A customized extension to FlxMouse that lets us add in accessibility stuff like using the keyboard to control mouse moving/clicking
Constructor
Variables
Inherited Variables
Defined by FlxMouse
read onlycursor:Null<Bitmap>
The current cursor bitmap, if there is one. To set, use the load
function.
read onlycursorContainer:Sprite
A display container for the mouse cursor. It is a child of FlxGame and sits at the right "height". Not used on flash with the native cursor API.
read onlydeltaScreenX:Int
Distance in pixels the mouse has moved in screen space since the last frame in the X direction.
read onlydeltaScreenY:Int
Distance in pixels the mouse has moved in screen space since the last frame in the Y direction.
@:value(true)enabled:Bool = true
Whether or not mouse input is currently enabled.
4.1.0
.read onlyjustPressedTimeInTicks:Int
Time in ticks of last left mouse button press.
4.3.0
.read onlyjustPressedTimeInTicksMiddle:Int
Time in ticks of last middle mouse button press.
4.3.0
.read onlyjustPressedTimeInTicksRight:Int
Time in ticks of last right mouse button press.
4.3.0
.read onlyreleased:Bool
Check to see if the left mouse button is currently not pressed.
5.0.0
.read onlyreleasedMiddle:Bool
Check to see if the middle mouse button is currently not pressed.
5.0.0
.read onlyreleasedRight:Bool
Check to see if the right mouse button is currently not pressed.
5.0.0
.@:value(false)useSystemCursor:Bool = false
Tells flixel to use the default system mouse cursor instead of custom Flixel mouse cursors.
Defined by FlxPointer
Inherited Methods
Defined by FlxMouse
@:value({ YOffset : 0, XOffset : 0, Scale : 1 })load(?Graphic:Dynamic, Scale:Float = 1, XOffset:Int = 0, YOffset:Int = 0):Void
Load a new mouse cursor graphic - if you're using native cursors on flash, check registerNativeCursor() for more control.
Parameters:
Graphic | The image you want to use for the cursor. |
---|---|
Scale | Change the size of the cursor. |
XOffset | The number of pixels between the mouse's screen position and the graphic's top left corner. Has to be positive when using native cursors. |
YOffset | The number of pixels between the mouse's screen position and the graphic's top left corner. Has to be positive when using native cursors. |
@:has_untypedinlineregisterNativeCursor(name:String, cursorData:MouseCursorData):Void
Shortcut to register a native cursor in flash
Parameters:
name | The ID name used for the cursor |
---|---|
cursorData | MouseCursorData contains the bitmap, hotspot etc |
registerSimpleNativeCursorData(name:String, cursorBitmap:BitmapData):MouseCursorData
Shortcut to register a simple MouseCursorData
Parameters:
name | The ID name used for the cursor |
---|---|
cursorData | MouseCursorData contains the bitmap, hotspot etc |
4.2.0
.setNativeCursor(name:String):Void
Set a Native cursor that has been registered by name Warning, you need to use registerNativeCursor() before you use it here
Parameters:
name | The name ID used when registered |
---|
setSimpleNativeCursorData(name:String, cursorBitmap:BitmapData):MouseCursorData
Shortcut to create and set a simple MouseCursorData
Parameters:
name | The ID name used for the cursor |
---|---|
cursorData | MouseCursorData contains the bitmap, hotspot etc |
Defined by FlxPointer
@:access(flixel.FlxCamera)getPositionInCameraView(?Camera:FlxCamera, ?point:FlxPoint):FlxPoint
Fetch the screen position of the pointer relative to given camera's viewport.
Parameters:
Camera | If unspecified, first/main global camera is used instead. |
---|---|
point | An existing point object to store the results (if you don't want a new one created). |
Returns:
The touch point's location relative to camera's viewport.
getScreenPosition(?Camera:FlxCamera, ?point:FlxPoint):FlxPoint
Fetch the screen position of the pointer on any given camera. NOTE: screenX and screenY also store the screen position of the pointer on the main camera.
Parameters:
Camera | If unspecified, first/main global camera is used instead. |
---|---|
point | An existing point object to store the results (if you don't want a new one created). |
Returns:
The touch point's location in screen space.
getWorldPosition(?Camera:FlxCamera, ?point:FlxPoint):FlxPoint
Fetch the world position of the pointer on any given camera. NOTE: x and y also store the world position of the pointer on the main camera.
Parameters:
Camera | If unspecified, first/main global camera is used instead. |
---|---|
point | An existing point object to store the results (if you don't want a new one created). |
Returns:
The touch point's location in world space.
@:access(flixel.group.FlxTypedGroup.resolveGroup)overlaps(ObjectOrGroup:FlxBasic, ?Camera:FlxCamera):Bool
Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. If the group has a LOT of things in it, it might be faster to use FlxG.overlaps(). WARNING: Currently tilemaps do NOT support screen space overlap checks!
Parameters:
ObjectOrGroup | The object or group being tested. |
---|---|
Camera | Specify which game camera you want. If null getScreenPosition() will just grab the first global camera. |
Returns:
Whether or not the two objects overlap.
inlinesetGlobalScreenPositionUnsafe(newX:Float, newY:Float):Void
Directly set the underyling screen position variable. WARNING! You should never use this unless you are trying to manually dispatch low-level mouse / touch events to the stage.