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.
read onlydeltaViewX:Int
Distance in pixels the mouse has moved in view space since the last frame in the X direction.
5.9.0
.read onlydeltaViewY:Int
Distance in pixels the mouse has moved in view space since the last frame in the Y direction.
5.9.0
.@: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
@:value(0)read onlygameX:Int = 0
The position relative to the FlxGame
's position in the window,
where 0
is the left edge of the game and FlxG.width
is the right
5.9.0
.@:value(0)read onlygameY:Int = 0
The position relative to the FlxGame
's position in the window,
where 0
is the top edge of the game and FlxG.height
is the bottom
5.9.0
.@:value(0)read onlyscreenX:Int = 0
The world position relative to the main camera's scroll position
@:value(0)read onlyscreenY:Int = 0
The world position relative to the main camera's scroll position
@:value(0)read onlyviewX:Int = 0
The world position relative to the main camera's scroll position, cam.viewMarginX
or
cam.viewMarginLeft
is the left edge of the camera and cam.viewMarginRight
is the right
5.9.0
.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
getGamePosition(?result:FlxPoint):FlxPoint
The position relative to the game's position in the window, where (0, 0)
is the
top-left edge of the game and (FlxG.width, FlxG.height)
is the bottom-right
Note: Fields gameX
and gameY
also store this result
Parameters:
result | An existing point to store the results, if unspecified, one is created |
---|
5.9.0
.getPositionInCameraView(?camera:FlxCamera, ?result:FlxPoint):FlxPoint
Fetch the position of the pointer relative to given camera's scroll
position, where
(cam.viewMarginLeft, cam.viewMarginTop)
is the top-left of the camera and
(cam.viewMarginRight, cam.viewMarginBottom)
is the bottom right of the camera
Note: Fields viewX
and viewY
also store this result for FlxG.camera
Parameters:
camera | If unspecified, |
---|---|
result | An existing point to store the results, if unspecified, one is created |
Returns:
The pointer's location relative to camera's viewport.
getScreenPosition(?camera:FlxCamera, ?result:FlxPoint):FlxPoint
Fetch the position of the pointer relative to given camera's scroll
position, where
(cam.viewMarginLeft, cam.viewMarginTop)
is the top-left of the camera and
(cam.viewMarginRight, cam.viewMarginBottom)
is the bottom right of the camera
Note: Fields viewX
and viewY
also store this result for FlxG.camera
Parameters:
camera | If unspecified, |
---|---|
result | An existing point to store the results, if unspecified, one is created |
getViewPosition(?camera:FlxCamera, ?result:FlxPoint):FlxPoint
Fetch the world position relative to the main camera's scroll
position, where
(cam.viewMarginLeft, cam.viewMarginTop)
is the top-left of the camera and
(cam.viewMarginRight, cam.viewMarginBottom)
is the bottom right
Note: Fields viewX
and viewY
also store this result
Parameters:
camera | If unspecified, |
---|---|
result | An existing point to store the results, if unspecified, one is created |
getWorldPosition(?camera:FlxCamera, ?result:FlxPoint):FlxPoint
Fetch the world position of the pointer on any given camera
Note: Fields x
and y
also store this result
Parameters:
camera | If unspecified, |
---|---|
result | An existing point to store the results, if unspecified, one is created |
@:access(flixel.group.FlxTypedGroup.resolveGroup)overlaps(objectOrGroup:FlxBasic, ?camera:FlxCamera):Bool
Checks to see if this pointer overlaps some FlxObject
or FlxGroup
.
Parameters:
objectOrGroup | The object or group being tested |
---|---|
camera | Helps determine the world position. If unspecified, |
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.
@:haxe.warning("-WDeprecated")setRawPositionUnsafe(x:Float, y:Float):Void
Directly set the underyling position variable. WARNING! You should never use this unless you are trying to manually dispatch low-level mouse / touch events to the stage.
5.9.0
.