WorldController

WorldController

Template for a World Controller ES5 Module

Methods

onMouseEvent(event, button, x, y) → {boolean}

On Mouse Event handler
Parameters:
Name Type Description
event number (0 - Up | 1 - Down | 2 - Dragging)
button number current button index
x number pixel position
y number pixel position
Returns:
false will block event propagation (default true)
Type
boolean

onRender() → {boolean}

On Render handler
Returns:
false will block event propagation (default true)
Type
boolean

onScroll(y) → {boolean}

On Scroll Event handler
Parameters:
Name Type Description
y number scroll amount
Returns:
false will block event propagation (default true)
Type
boolean

onSurfaceChanged(rotation, width, height)

On Surface Changed handler
Parameters:
Name Type Description
rotation number
width number
height number

onTouchEvent(event, touches, pointer, x, y) → {boolean}

On Touch Event handler
Parameters:
Name Type Description
event number (0 - Up | 1 - Down | 2 - Dragging)
touches number total touches
pointer number current touch index
x number pixel position
y number pixel position
Returns:
false will block event propagation (default true)
Type
boolean