| Package | org.flixel.data |
| Class | public class FlxMouse |
| 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 | ||
| wheel : int
Current "delta" value of mouse wheel.
| 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 update the mouse.
| FlxMouse | ||
|
handleMouseOut(event:MouseEvent):void
Event handler so FlxGame can update the mouse.
| FlxMouse | ||
|
handleMouseOver(event:MouseEvent):void
Event handler so FlxGame can update the mouse.
| FlxMouse | ||
|
handleMouseUp(event:MouseEvent):void
Event handler so FlxGame can update the mouse.
| FlxMouse | ||
|
handleMouseWheel(event:MouseEvent):void
Event handler so FlxGame can update 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:intHelper variable for tracking whether the mouse was just pressed or just released.
| cursor | property |
public var cursor:FlxSpriteGraphical representation of the mouse pointer.
| ImgDefaultCursor | property |
protected var ImgDefaultCursor:Class
| _last | property |
protected var _last:intHelper variable for tracking whether the mouse was just pressed or just released.
| _out | property |
protected var _out:BooleanHelper for mouse visibility.
| screenX | property |
public var screenX:intCurrent X position of the mouse pointer on the screen.
| screenY | property |
public var screenY:intCurrent Y position of the mouse pointer on the screen.
| wheel | property |
public var wheel:intCurrent "delta" value of mouse wheel. If the wheel was just scrolled up, it will have a positive value. If it was just scrolled down, it will have a negative value. If it wasn't just scroll this frame, it will be 0.
| x | property |
public var x:intCurrent X position of the mouse pointer in the game world.
| y | property |
public var y:intCurrent Y position of the mouse pointer in the game world.
| FlxMouse | () | constructor |
public function FlxMouse()Constructor.
| handleMouseDown | () | method |
public function handleMouseDown(event:MouseEvent):voidEvent handler so FlxGame can update the mouse.
Parametersevent:MouseEvent — A MouseEvent object.
|
| handleMouseOut | () | method |
public function handleMouseOut(event:MouseEvent):voidEvent handler so FlxGame can update the mouse.
Parametersevent:MouseEvent — A MouseEvent object.
|
| handleMouseOver | () | method |
public function handleMouseOver(event:MouseEvent):voidEvent handler so FlxGame can update the mouse.
Parametersevent:MouseEvent — A MouseEvent object.
|
| handleMouseUp | () | method |
public function handleMouseUp(event:MouseEvent):voidEvent handler so FlxGame can update the mouse.
Parametersevent:MouseEvent — A MouseEvent object.
|
| handleMouseWheel | () | method |
public function handleMouseWheel(event:MouseEvent):voidEvent handler so FlxGame can update the mouse.
Parametersevent:MouseEvent — A MouseEvent object.
|
| hide | () | method |
public function hide():voidHides the mouse cursor
| justPressed | () | method |
public function justPressed():BooleanCheck to see if the mouse was just pressed.
ReturnsBoolean — Whether the mouse was just pressed.
|
| justReleased | () | method |
public function justReleased():BooleanCheck 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):voidLoad a new mouse cursor graphic
ParametersGraphic: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():BooleanCheck to see if the mouse is pressed.
ReturnsBoolean — Whether the mouse is pressed.
|
| reset | () | method |
public function reset():voidResets 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):voidEither show an existing cursor or load a new one.
ParametersGraphic: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():voidUnload 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):voidCalled by the internal game loop to update the mouse pointer's position in the game world. Also updates the just pressed/just released flags.
ParametersX: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.
|