Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord

Phaser . GameObjects . DisplayList

This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord

Phaser . GameObjects . DisplayList

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.

Examples:
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.

Examples:
Since: 3.5.1
Focus
Focus
depthSort()
Focus
Focus

Description:

Immediately sorts the display list if the flag is set.

Examples:
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.

Examples:
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.

Examples:
Since: 3.12.0
Focus
Focus
queueDepthSort()
Focus
Focus

Description:

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

Examples:
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.

Examples:
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.

Examples:
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
Examples:
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.

Examples:
Since: 3.5.0
Focus
Focus