Kiwi.Input.InputManager Class
Handles the initialization and management of the various ways a user can interact with the device/game, whether this is through a Keyboard and Mouse or by a Touch. Also contains some of the general callbacks that are 'global' between both Desktop and Mobile based devices.
Constructor
Kiwi.Input.InputManager
-
game
Parameters:
-
game
Kiwi.GameThe game that this object belongs to.
Returns:
This object.
Item Index
Methods
Methods
_onDownEvent
-
x
-
y
-
timeDown
-
timeUp
-
duration
-
pointer
A private method that gets dispatched when either the mouse or touch manager dispatches a down event
Parameters:
-
x
NumberThe x coordinate of the pointer
-
y
NumberThe y coordinate of the pointer
-
timeDown
NumberThe time that the pointer has been down for.
-
timeUp
NumberThe Time that the pointer has been up form
-
duration
Number -
pointer
Kiwi.Input.PointerThe pointer that was used.
_onUpEvent
-
x
-
y
-
timeDown
-
timeUp
-
duration
-
pointer
A private method that gets dispatched when either the mouse or touch manager dispatches a up event
Parameters:
-
x
NumberThe x coordinate of the pointer
-
y
NumberThe y coordinate of the pointer
-
timeDown
NumberThe time that the pointer has been down for.
-
timeUp
NumberThe Time that the pointer has been up form
-
duration
Number -
pointer
Kiwi.Input.PointerThe pointer that was used.
boot
()
public
This method is executed when the DOM has loaded and the manager is ready to load.
objType
()
String
public
The type of object this is.
Returns:
"InputManager"
reset
()
Runs the reset method on the managers.
update
()
public
The update loop that gets executed every frame.
Properties
_pointers
Array
private
An array containing all of the pointers that are active on the stage.
game
Game
public
The game that this manager belongs to.
isDown
Boolean
public
If an input (either touch or the mouse cursor) is currently down. Not an accurate representation, should use the individual managers.
keyboard
Keyboard
public
The keyboard manager
mouse
Mouse
public
A reference to the mouse manager.
onDown
Signal
public
A Signal that dispatches a event when any Pointer is pressed from the game.
onReleased
Signal
public
An alias for the onRelease signal that goes straight to the onUp
onUp
Signal
public
A Signal that dispatches a event when any Pointer is released from the game.
pointers
Array
public
Returns all of the pointers that can be used on the Input Manager. This is READ only.
touch
Touch
public
The touch manager.
x
Number
public
Populated x coordinate based on the most recent click/touch event
y
Number
public
Populated y coordinate based on the most recent click/touch event