Class: UpdateList

Phaser.GameObjects. UpdateList

The Update List plugin.

Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame.

Some or all of these Game Objects may also be part of the Scene's Display List, for Rendering.


new UpdateList(scene)

Parameters:
Name Type Description
scene Phaser.Scene

The Scene that the Update List belongs to.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 11)

Members


<readonly> length :integer

The length of the list.

Type:
  • integer
Since: 3.10.0
Source: src/gameobjects/UpdateList.js (Line 308)

scene :Phaser.Scene

The Scene that the Update List belongs to.

Type:
Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 32)

systems :Phaser.Scenes.Systems

The Scene's Systems.

Type:
Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 41)

Methods


add(child)

Add a Game Object to the Update List.

Parameters:
Name Type Description
child Phaser.GameObjects.GameObject

The Game Object to add.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 118)
Returns:

The added Game Object.

Type
Phaser.GameObjects.GameObject

destroy()

The Scene that owns this plugin is being destroyed. We need to shutdown and then kill off all external references.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 291)

preUpdate()

The pre-update step.

Handles Game Objects that are pending insertion to and removal from the list.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 140)

remove(child)

Remove a Game Object from the list.

Parameters:
Name Type Description
child Phaser.GameObjects.GameObject

The Game Object to remove from the list.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 210)
Returns:

The removed Game Object.

Type
Phaser.GameObjects.GameObject

removeAll()

Remove all Game Objects from the list.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 230)
Returns:

This UpdateList.

Type
Phaser.GameObjects.UpdateList

shutdown()

The Scene that owns this plugin is shutting down. We need to kill and reset all internal properties as well as stop listening to Scene events.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 250)

update(time, delta)

The update step.

Pre-updates every active Game Object in the list.

Parameters:
Name Type Description
time number

The current timestamp.

delta number

The delta time elapsed since the last frame.

Since: 3.0.0
Source: src/gameobjects/UpdateList.js (Line 183)