The canvas of the game.
The current game configuration, please be noticed any modification directly on this object after the game initialization won't take effect.
The container of game canvas.
The outer frame of the game canvas; parent of game container.
Callback when the scripts of engine have been load.
The renderer backend of the game.
Event triggered after engine inited, at this point you will be able to use all engine classes.
It was defined as EVENT_RENDERER_INITED in cocos creator v1.x and renamed in v2.0.
Since Cocos Creator v3.0, EVENT_RENDERER_INITED is a new event, look up define for details.
Event triggered after game inited, at this point all engine objects and game scripts are loaded
Event triggered when game hide to background.
Please note that this event is not 100% guaranteed to be fired on Web platform,
on native platforms, it corresponds to enter background event, os status bar or notification center may not trigger this event.
Event triggered when system in low memory status.
This event is only triggered on native iOS/Android platform.
Event triggered after renderer inited, at this point you will be able to use all gfx renderer feature.
Event triggered when game restart
Event triggered when game back to foreground
Please note that this event is not 100% guaranteed to be fired on Web platform,
on native platforms, it corresponds to enter foreground event.
Web Canvas 2d API as renderer backend.
OpenGL API as renderer backend.
WebGL API as renderer backend.
Indicates whether the engine and the renderer has been initialized
Add a persistent root node to the game, the persistent node won't be destroyed during scene transition.
The target node must be placed in the root level of hierarchy, otherwise this API won't have any effect.
The node to be made persistent
End game, it will close the game window
Get frame rate set for the game, it doesn't represent the real frame rate.
frame rate
Init game with configuration object.
Pass configuration object
Check whether the game is paused.
Check whether the node is a persistent root node.
The node to be checked
Register an callback of a specific event type on the game object.
This type of event should be triggered via emit
.
A string representing the event type to listen for.
The callback that will be invoked when the event is dispatched.
The callback is ignored if it is a duplicate (the callbacks are unique).
The target (this object) to invoke the callback, can be null
After the first invocation, whether the callback should be unregistered.
Register an callback of a specific event type on the game object,
the callback will remove itself after the first time it is triggered.
A string representing the event type to listen for.
The callback that will be invoked when the event is dispatched.
The callback is ignored if it is a duplicate (the callbacks are unique).
The target (this object) to invoke the callback, can be null
Pause the game main loop. This will pause:
game logic execution, rendering process, event manager, background music and all audio effects.
This is different with director.pause
which only pause the game logic execution.
Remove a persistent root node.
The node to be removed from persistent node list
Restart game.
Resume the game from pause. This will resume:
game logic execution, rendering process, event manager, background music and all audio effects.
Run game with configuration object and onStart function.
function to be executed after game initialized
Set frame rate of game.
Run the game frame by frame.
Generated using TypeDoc
An object to boot the game.