ScreenFunctions
Index
Methods
Click
Parameters
event: MouseEvent | TouchEvent
The event that triggered this
Returns void
optionalDraw
Called each frame when the screen needs to be drawn.
Returns void
optionalExit
Called when user presses Esc
Returns void
optionalKeyDown
Called if the the user presses any key
Parameters
event: KeyboardEvent
The event that triggered this
Returns boolean
optionalKeyUp
Called if the user releases a pressed key
Parameters
event: KeyboardEvent
The event that triggered this
Returns void
optionalLoad
Called when screen is loaded using
CommonSetScreen
Returns void
optionalMouseDown
Called if the user presses the mouse button or touches the touchscreen on the canvas
Parameters
event: MouseEvent | TouchEvent
The event that triggered this
Returns void
optionalMouseMove
Called if the user moves the mouse cursor or the touch on the touchscreen over the canvas
Parameters
event: MouseEvent | TouchEvent
The event that triggered this
Returns void
optionalMouseUp
Called if the user releases the mouse button or the touchscreen on the canvas
Parameters
event: MouseEvent | TouchEvent
The event that triggered this
Returns void
optionalMouseWheel
Called if the user moves the mouse wheel on the canvas
Parameters
event: WheelEvent
The event that triggered this
Returns void
optionalResize
Called when screen size or position changes or after screen load
Parameters
load: boolean
If the reason for call was load (
true
) or window resize (false
)
Returns void
Run
Called each frame
Parameters
time: number
The current time for frame
Returns void
optionalUnload
Called when this screen is being replaced
Returns void
Called if the user clicks on the canvas