class flixel.addons.plugin.FlxMouseControl extends FlxPlugin

Available on all platforms

FlxMouseControl * * @link http://www.photonstorm.com * @author Richard Davey / Photon Storm

Class Fields

static var ASCENDING:Int

Use with sort() to sort in ascending order.

static var DESCENDING:Int

Use with sort() to sort in descending order.

static var dragTarget:FlxExtendedSprite

The FlxExtendedSprite that is currently being dragged, if any.

static var isDragging:Bool

Is the mouse currently dragging a sprite? If you have just clicked but NOT yet moved the mouse then this might return false.

static var linkToDeadZone:Bool

Instead of using a mouseZone (which is calculated in world coordinates) you can limit the mouse to the FlxG.camera.deadzone area instead. * If set to true the mouse will use the camera deadzone. If false (or the deadzone is null) no check will take place. * Note that this takes priority over the mouseZone above. If the mouseZone and deadzone are set, the deadzone is used.

static var mouseZone:FlxRect

The mouse can be set to only be active within a specific FlxRect region of the game world. * If outside this FlxRect no clicks, drags or throws will be processed. * If the mouse leaves this region while still dragging then the sprite is automatically dropped and its release handler is called. * Set the FlxRect to null to disable the zone.

static var sortIndex:String

The value that the FlxExtendedSprites are sorted by before deciding which is "on-top" for click select

static var sortOrder:Int

The sorting order. If the sortIndex is "y" and the order is ASCENDING then a sprite with a Y value of 200 would be "on-top" of one with a Y value of 100.

static var speedX:Int

The speed the mouse is moving on the X axis in pixels per frame

static var speedY:Int

The speed the mouse is moving on the Y axis in pixels per frame

static function addToStack(Item:FlxExtendedSprite):Void

Adds the given FlxExtendedSprite to the stack of potential sprites that were clicked, the stack is then sorted and the final sprite is selected from that * *

Item

The FlxExtendedSprite that was clicked by the mouse

static function clear():Void

Removes all references to any click / drag targets and resets this class

Instance Fields

function new():Void

function destroy():Void

Runs when this plugin is destroyed

function update():Void

Main Update Loop - checks mouse status and updates FlxExtendedSprites accordingly