Phaser API Documentation

  Version: 
Filter

The Display List plugin.

Display Lists belong to a Scene and maintain the list of Game Objects to render every frame.

Some of these Game Objects may also be part of the Scene's Update List, for updating.

Constructor:

new DisplayList(scene)

Parameters:

name type description
scene Phaser.Scene

The Scene that this Display List belongs to.

Since: 3.0.0

Extends


Members

Description:

The Scene's Event Emitter.

Type:
Since: 3.50.0
Focus
Focus
scene: Phaser.Scene
Focus
Focus

Description:

The Scene that this Display List belongs to.

Type:
Since: 3.0.0
Focus
Focus
sortChildrenFlag: boolean
Focus
Focus

Description:

The flag the determines whether Game Objects should be sorted when depthSort() is called.

Type:
boolean
Default: false
Since: 3.0.0
Focus
Focus

Description:

The Scene's Systems.

Type:
Since: 3.0.0
Focus
Focus

Methods

<private> addChildCallback(gameObject)
Focus
Focus

Description:

Internal method called from List.addCallback.

Parameters:

name type description
gameObject Phaser.GameObjects.GameObject

The Game Object that was added to the list.

Since: 3.50.0
Focus
Focus
<private> boot()
Focus
Focus

Description:

This method is called automatically, only once, when the Scene is first created. Do not invoke it directly.

Since: 3.5.1
Focus
Focus
depthSort()
Focus
Focus

Description:

Immediately sorts the display list if the flag is set.

Since: 3.0.0
Focus
Focus
<private> destroy()
Focus
Focus

Description:

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

Since: 3.0.0
Focus
Focus
getChildren()
Focus
Focus

Description:

Returns an array which contains all objects currently on the Display List. This is a reference to the main list array, not a copy of it, so be careful not to modify it.

Returns:
Description:

The group members.

Since: 3.12.0
Focus
Focus
queueDepthSort()
Focus
Focus

Description:

Force a sort of the display list on the next call to depthSort.

Since: 3.0.0
Focus
Focus
<private> removeChildCallback(gameObject)
Focus
Focus

Description:

Internal method called from List.removeCallback.

Parameters:

name type description
gameObject Phaser.GameObjects.GameObject

The Game Object that was removed from the list.

Since: 3.50.0
Focus
Focus
<private> shutdown()
Focus
Focus

Description:

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
Focus
Focus
sortByDepth(childA, childB)
Focus
Focus

Description:

Compare the depth of two Game Objects.

Parameters:

name type description
childA Phaser.GameObjects.GameObject

The first Game Object.

childB Phaser.GameObjects.GameObject

The second Game Object.

Returns:
Description:

The difference between the depths of each Game Object.

Type:
  • number
Since: 3.0.0
Focus
Focus
<private> start()
Focus
Focus

Description:

This method is called automatically by the Scene when it is starting up. It is responsible for creating local systems, properties and listening for Scene events. Do not invoke it directly.

Since: 3.5.0
Focus
Focus