A customized extension to FlxMouse that lets us add in accessibility stuff like using the keyboard to control mouse moving/clicking

Constructor

new(CursorContainer:Sprite)

Variables

@:value(true)updateGlobalScreenPosition:Bool = true

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

Deprecated: "deltaScreenX is deprecated, use deltaViewX, instead"

Distance in pixels the mouse has moved in screen space since the last frame in the X direction.

read onlydeltaScreenY:Int

Deprecated: "deltaScreenY is deprecated, use deltaViewY, instead"

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.

Available since

5.9.0

.

read onlydeltaViewY:Int

Distance in pixels the mouse has moved in view space since the last frame in the Y direction.

Available since

5.9.0

.

read onlydeltaX:Int

Distance in pixels the mouse has moved since the last frame in the X direction.

read onlydeltaY:Int

Distance in pixels the mouse has moved since the last frame in the Y direction.

@:value(true)enabled:Bool = true

Whether or not mouse input is currently enabled.

Available since

4.1.0

.

read onlyjustMoved:Bool

Check to see if the mouse has just been moved.

Available since

4.4.0

.

read onlyjustPressed:Bool

Check to see if the left mouse button has just been pressed.

read onlyjustPressedMiddle:Bool

Check to see if the middle mouse button has just been pressed.

read onlyjustPressedRight:Bool

Check to see if the right mouse button has just been pressed.

read onlyjustPressedTimeInTicks:Int

Time in ticks of last left mouse button press.

Available since

4.3.0

.

read onlyjustPressedTimeInTicksMiddle:Int

Time in ticks of last middle mouse button press.

Available since

4.3.0

.

read onlyjustPressedTimeInTicksRight:Int

Time in ticks of last right mouse button press.

Available since

4.3.0

.

read onlyjustReleased:Bool

Check to see if the left mouse button has just been released.

read onlyjustReleasedMiddle:Bool

Check to see if the middle mouse button has just been released.

read onlyjustReleasedRight:Bool

Check to see if the right mouse button has just been released.

read onlypressed:Bool

Check to see if the left mouse button is currently pressed.

read onlypressedMiddle:Bool

Check to see if the middle mouse button is currently pressed.

read onlypressedRight:Bool

Check to see if the right mouse button is currently pressed.

read onlyreleased:Bool

Check to see if the left mouse button is currently not pressed.

Available since

5.0.0

.

read onlyreleasedMiddle:Bool

Check to see if the middle mouse button is currently not pressed.

Available since

5.0.0

.

read onlyreleasedRight:Bool

Check to see if the right mouse button is currently not pressed.

Available since

5.0.0

.

@:value(false)useSystemCursor:Bool = false

Tells flixel to use the default system mouse cursor instead of custom Flixel mouse cursors.

@:value(true)visible:Bool = true

Used to toggle the visiblity of the mouse cursor - works on both the flixel and the system cursor, depending on which one is active.

@:value(0)read onlywheel:Int = 0

Current "delta" value of mouse wheel. If the wheel was just scrolled up, it will have a positive value and vice versa. Otherwise the value will be 0.

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

Available since

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

Available since

5.9.0

.

@:value(0)read onlyscreenX:Int = 0

Deprecated: "screenX is deprecated, use viewX, instead"

The world position relative to the main camera's scroll position

@:value(0)read onlyscreenY:Int = 0

Deprecated: "screenY is deprecated, use viewY, instead"

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

Available since

5.9.0

.

@:value(0)read onlyviewY:Int = 0

The world position relative to the main camera's scroll position, cam.viewMarginY or cam.viewMarginTop is the top edge of the camera and cam.viewMarginBottom is the bottom

Available since

5.9.0

.

@:value(0)read onlyx:Int = 0

The position in the world

@:value(0)read onlyy:Int = 0

The position in the world

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

Available since

4.2.0

.

reset():Void

Resets the just pressed/just released flags and sets mouse to not pressed.

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

unload():Void

Unload the current cursor graphic. If the current cursor is visible, then the default system cursor is loaded up to replace the old one.

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

Available since

5.9.0

.

getPosition(?result:FlxPoint):FlxPoint

Returns a FlxPoint with this input's x and y.

getPositionInCameraView(?camera:FlxCamera, ?result:FlxPoint):FlxPoint

Deprecated: "getPositionInCameraView is deprecated, use getViewPosition, instead"

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, FlxG.camera is used, instead.

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

Deprecated: "getScreenPosition is deprecated, use getViewPosition, instead"

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, FlxG.camera is used, instead

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, FlxG.camera is used, instead

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, FlxG.camera is used, instead

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, FlxG.camera is used

inlinesetGlobalScreenPositionUnsafe(newX:Float, newY:Float):Void

Deprecated: "setGlobalScreenPositionUnsafe is deprecated, use setRawPositionUnsafe, instead"

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.

Available since

5.9.0

.