These affect the calling scene only.
Example:
this.scene.start()
| method | calling scene | notes |
|---|---|---|
| pause | pause | |
| remove | destroy | Queued during scene processing |
| restart | shutdown?, start | Shutdown first only if RUNNING or PAUSED. |
| resume | resume | |
| sleep | sleep | |
| start | shutdown?, start | Shutdown first only if RUNNING or PAUSED. |
| stop | shutdown | |
| wake | wake |
remove() is queued while the Scene Manager is updating or rendering, or run immediately otherwise.
All other operations are queued always.
start() and restart() are identical when called without a key argument.
These affect the target scene and may affect the calling scene.
Example:
this.scene.start('target')
| method | calling scene | target scene | notes |
|---|---|---|---|
| launch | shutdown?, start | Target scene is shutdown first only if RUNNING or PAUSED. If the calling scene is also the target, nothing happens | |
| pause | pause | ||
| remove | destroy | Queued during scene processing | |
| resume | resume | ||
| run | shutdown?, start / wake / resume | Target scene is shutdown first only if RUNNING | |
| sleep | sleep | ||
| start | shutdown | shutdown?, start | Target scene is shutdown first only if RUNNING or PAUSED |
| stop | shutdown | ||
| switch | sleep | shutdown?, start / wake | Target scene is shutdown first only if RUNNING or PAUSED |
| wake | wake |
remove() is queued while the Scene Manager is updating or rendering, or run immediately otherwise.
All other operations are queued always.
restart() never takes a key argument. Use launch('target') instead.
Scene operations change a scene's state and trigger certain events.
Within a scene, you can listen to these events from this.events.
active means a scene is updating its objects and plugins.
visible means a scene is rendering its objects and plugins.
| method | status | identity | active | visible | events |
|---|---|---|---|---|---|
| init | INIT | boot |
|||
| start | START | yes | yes | start, ready |
|
| pause | PAUSED | isPaused() | no | pause |
|
| resume | RUNNING | isActive() | yes | resume |
|
| sleep | SLEEPING | isSleeping() | no | no | sleep |
| wake | RUNNING | isActive() | yes | yes | wake |
| shutdown | SHUTDOWN | no | no | shutdown |
|
| destroy | DESTROYED | no | no | destroy |
Table shows: SCENE STATUS, scene events, scene methods
| INIT | START | LOADING | CREATING | RUNNING | PAUSED | SLEEPING | SHUTDOWN | DESTROYED |
|---|---|---|---|---|---|---|---|---|
boot |
||||||||
start |
(resume/wake) |
pause |
sleep |
shutdown |
destroy |
|||
ready |
||||||||
| init | ||||||||
| create | ||||||||
preupdate |
preupdate |
|||||||
update |
update |
|||||||
| update | ||||||||
postupdate |
postupdate |
|||||||
prerender |
prerender |
prerender |
||||||
render |
render |
render |
resumeis emitted only for PAUSED → RUNNING.wakeis emitted only for SLEEPING → RUNNING.
Moved to https://github.com/samme/phaser3-faq/wiki/Scenes.