OptionalactionpressedMapped action triggered. See input.Input for action mapping.
OptionalactionreleasedMapped action released.
OptionalblurCanvas or tab lost focus. Game may pause audio/updates.
OptionaldrawRender frame. Clear the screen and draw your game here.
OptionalfocusCanvas or tab gained focus. Game may resume audio/updates.
OptionalgamepadconnectedFires when a gamepad is connected.
OptionalgamepaddisconnectedFires when a gamepad is disconnected.
OptionalgamepadpressedGamepad button pressed. source is controller index, name is derived from a mapping on the raw num
OptionalgamepadreleasedGamepad button released. source is controller index, name is derived from a mapping on the raw num
OptionalhandleLIKE's runtime is concentrated into handleEvent.
This function recieves all events. callOwnHandlers is the default behavior.
Otherwise, a custom handler will totally override
event handler callbacks like like.draw,
replacing it with a system of your choice.
For example, the scene architecture is built around setting this function. Setting to a custom function will disable the scene system.
Setting handleEvent to undefined will revert
to default behavior.
OptionalkeypressedPhysical key pressed. scancode is the physical key, keycode is the character.
OptionalkeyreleasedPhysical key released.
OptionalloadGame initialization. Called once before the first frame.
OptionalmousemovedMouse moved event. pos is absolute, delta is relative.
OptionalmousepressedMouse button pressed. pos in canvas pixels. Button: 1=left, 2=middle, 3=right.
OptionalmousereleasedMouse button released.
OptionalquitGame deinit. Called when like is disposed.
Use case: you're using native event handlers or global resource allocations that need to be cleared out to avoid memory leaks, regardless of what called like.dispose().
OptionalresizeCanvas was resized. Used mostly in native mode, though setMode may send it too.
OptionalupdateFrame update. dt is delta time in seconds (time since last frame).
Every possible event handler callback is in this interface.
The engine will call these functions when the corresponding events fire unless handleEvent is customized, for example when the scene system is in use.