BB.Pointer
A module for funneling in and standardizing basic pointer-like interfaces like mouse and touch.
Constructor
BB.Pointer
(
-
controllerModule
)
-
controllerModule
Parameters:
-
controllerModule
ObjectThe input module you would like to control this pointer with.
Properties
hasSelectionInterface
Boolean
default:false
Does the selection interface controlling this pointer have a selection interface (like a button)?
isDown
Boolean
default:false
A variable holding wether or not the selection interface (i.e. mouse button, etc...) controlling this pointer object (via BB.Pointer.update(...)) is active.
isMoving
Boolean
default:false
A variable holding wether or not the event module controlling this pointer object (via BB.Pointer.update(...)) is moving
x
Number
default:undefined
The pointer's current x position as supplied by the eventModule in BB.Pointer.update(...).
y
Number
default:undefined
The pointer's current y position as supplied by the eventModule in BB.Pointer.update(...).
Methods
on
(
-
eventName
-
callback
)
-
eventName
-
callback
A method used to register "activestart", "activestop", "movestart", "movestop", and "move" events.
Parameters:
-
eventName
StringThe event to register callback to. "activestart", "activestop", "movestart", and "movestop" are all valid events.
-
callback
FunctionThe callback to execute once the registered event has fired.
update
(
-
controllerModule
)
-
controllerModule
Update the pointer using the controllerModule. Usually called once per animation frame.
Parameters:
-
controllerModule
Object