Package | org.flixel.data |
Class | public class FlxMouse |
Inheritance | FlxMouse Object |
Property | Defined By | ||
---|---|---|---|
cursor : FlxSprite
Graphical representation of the mouse pointer. | FlxMouse | ||
screenX : int
Current X position of the mouse pointer on the screen. | FlxMouse | ||
screenY : int
Current Y position of the mouse pointer on the screen. | FlxMouse | ||
x : int
Current X position of the mouse pointer in the game world. | FlxMouse | ||
y : int
Current Y position of the mouse pointer in the game world. | FlxMouse |
Property | Defined By | ||
---|---|---|---|
_current : int
Helper variable for tracking whether the mouse was just pressed or just released. | FlxMouse | ||
ImgDefaultCursor : Class | FlxMouse | ||
_last : int
Helper variable for tracking whether the mouse was just pressed or just released. | FlxMouse | ||
_out : Boolean
Helper for mouse visibility. | FlxMouse |
Method | Defined By | ||
---|---|---|---|
FlxMouse()
Constructor. | FlxMouse | ||
handleMouseDown(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse. | FlxMouse | ||
handleMouseOut(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse. | FlxMouse | ||
handleMouseOver(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse. | FlxMouse | ||
handleMouseUp(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse. | FlxMouse | ||
hide():void
Hides the mouse cursor
| FlxMouse | ||
justPressed():Boolean
Check to see if the mouse was just pressed. | FlxMouse | ||
justReleased():Boolean
Check to see if the mouse was just released. | FlxMouse | ||
load(Graphic:Class, XOffset:int = 0, YOffset:int = 0):void
Load a new mouse cursor graphic
| FlxMouse | ||
pressed():Boolean
Check to see if the mouse is pressed. | FlxMouse | ||
reset():void
Resets the just pressed/just released flags and sets mouse to not pressed. | FlxMouse | ||
show(Graphic:Class = null, XOffset:int = 0, YOffset:int = 0):void
Either show an existing cursor or load a new one. | FlxMouse | ||
unload():void
Unload the current cursor graphic. | FlxMouse | ||
update(X:int, Y:int, XScroll:Number, YScroll:Number):void
Called by the internal game loop to update the mouse pointer's position in the game world. | FlxMouse |
_current | property |
protected var _current:int
Helper variable for tracking whether the mouse was just pressed or just released.
_last | property |
protected var _last:int
Helper variable for tracking whether the mouse was just pressed or just released.
_out | property |
protected var _out:Boolean
Helper for mouse visibility.
cursor | property |
public var cursor:FlxSprite
Graphical representation of the mouse pointer.
ImgDefaultCursor | property |
protected var ImgDefaultCursor:Class
screenX | property |
public var screenX:int
Current X position of the mouse pointer on the screen.
screenY | property |
public var screenY:int
Current Y position of the mouse pointer on the screen.
x | property |
public var x:int
Current X position of the mouse pointer in the game world.
y | property |
public var y:int
Current Y position of the mouse pointer in the game world.
FlxMouse | () | Constructor |
public function FlxMouse()
Constructor.
handleMouseDown | () | method |
public function handleMouseDown(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse.
Parameters
event:MouseEvent — A MouseEvent object.
|
handleMouseOut | () | method |
public function handleMouseOut(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse.
Parameters
event:MouseEvent — A MouseEvent object.
|
handleMouseOver | () | method |
public function handleMouseOver(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse.
Parameters
event:MouseEvent — A MouseEvent object.
|
handleMouseUp | () | method |
public function handleMouseUp(event:MouseEvent):void
Event handler so FlxGame can toggle the mouse.
Parameters
event:MouseEvent — A MouseEvent object.
|
hide | () | method |
public function hide():void
Hides the mouse cursor
justPressed | () | method |
public function justPressed():Boolean
Check to see if the mouse was just pressed.
ReturnsBoolean — Whether the mouse was just pressed.
|
justReleased | () | method |
public function justReleased():Boolean
Check to see if the mouse was just released.
ReturnsBoolean — Whether the mouse was just released.
|
load | () | method |
public function load(Graphic:Class, XOffset:int = 0, YOffset:int = 0):void
Load a new mouse cursor graphic
Parameters
Graphic:Class — The image you want to use for the cursor.
| |
XOffset:int (default = 0 ) — The number of pixels between the mouse's screen position and the graphic's top left corner.
| |
YOffset:int (default = 0 ) — The number of pixels between the mouse's screen position and the graphic's top left corner.
|
pressed | () | method |
public function pressed():Boolean
Check to see if the mouse is pressed.
ReturnsBoolean — Whether the mouse is pressed.
|
reset | () | method |
public function reset():void
Resets the just pressed/just released flags and sets mouse to not pressed.
show | () | method |
public function show(Graphic:Class = null, XOffset:int = 0, YOffset:int = 0):void
Either show an existing cursor or load a new one.
Parameters
Graphic:Class (default = null ) — The image you want to use for the cursor.
| |
XOffset:int (default = 0 ) — The number of pixels between the mouse's screen position and the graphic's top left corner.
| |
YOffset:int (default = 0 ) — The number of pixels between the mouse's screen position and the graphic's top left corner.
|
unload | () | method |
public function 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.
update | () | method |
public function update(X:int, Y:int, XScroll:Number, YScroll:Number):void
Called by the internal game loop to update the mouse pointer's position in the game world. Also updates the just pressed/just released flags.
Parameters
X:int — The current X position of the mouse in the window.
| |
Y:int — The current Y position of the mouse in the window.
| |
XScroll:Number — The amount the game world has scrolled horizontally.
| |
YScroll:Number — The amount the game world has scrolled vertically.
|