The Scene that this Display List belongs to.
The property key to sort by.
A callback that is invoked every time a child is added to this list.
The Scene's Event Emitter.
ReadonlyfirstThe first item in the List or null for an empty List.
ReadonlylastThe last item in the List, or null for an empty List.
ReadonlylengthThe number of items inside the List.
The objects that belong to this collection.
ReadonlynextThe next item in the List, or null if the entire List has been traversed.
This property can be read successively after reading #first or manually setting the #position to iterate the List.
The parent of this list.
The index of the current element.
This is used internally when iterating through the list with the #first, #last, #get, and #previous properties.
ReadonlypreviousThe previous item in the List, or null if the entire List has been traversed.
This property can be read successively after reading #last or manually setting the #position to iterate the List backwards.
A callback that is invoked every time a child is removed from this list.
The Scene that this Display List belongs to.
The flag the determines whether Game Objects should be sorted when depthSort() is called.
The Scene's Systems.
Adds the given item to the end of the list. Each item must be unique.
The item, or array of items, to add to the list.
OptionalskipCallback: booleanSkip calling the List.addCallback if this child is added successfully. Default false.
Adds an item to list, starting at a specified index. Each item must be unique within the list.
The item, or array of items, to add to the list.
Optionalindex: numberThe index in the list at which the element(s) will be inserted. Default 0.
OptionalskipCallback: booleanSkip calling the List.addCallback if this child is added successfully. Default false.
Brings the given child to the top of this List.
The item to bring to the top of the List.
Returns the total number of items in the List which have a property matching the given value.
The property to test on each item.
The value to test the property against.
Immediately sorts the display list if the flag is set.
Destroys this List.
Passes all children to the given callback.
The function to call.
Optionalcontext: anyValue to use as this when executing callback.
Additional arguments that will be passed to the callback, after the child.
Checks if an item exists within the List.
The item to check for the existence of.
Returns all children in this List.
You can optionally specify a matching criteria using the property and value arguments.
For example: getAll('parent') would return only children that have a property called parent.
You can also specify a value to compare the property to:
getAll('visible', true) would return only children that have their visible property set to true.
Optionally you can specify a start and end index. For example if this List had 100 children,
and you set startIndex to 0 and endIndex to 50, it would return matches from only
the first 50 children in the List.
Optionalproperty: stringAn optional property to test against the value argument.
Optionalvalue: anyIf property is set then Child.property must strictly equal this value to be included in the results.
OptionalstartIndex: numberThe first child index to start the search from.
OptionalendIndex: numberThe last child index to search up until.
Retrieves the item at a given position inside the List.
The index of the item.
Searches for the first instance of a child with its name
property matching the given argument. Should more than one child have
the same name only the first is returned.
The name to search for.
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 the first element in a given part of the List which matches a specific criterion.
The name of the property to test or a falsey value to have no criterion.
The value to test the property against, or undefined to allow any value and only check for existence.
OptionalstartIndex: numberThe position in the List to start the search at. Default 0.
OptionalendIndex: numberThe position in the List to optionally stop the search at. It won't be checked.
Locates an item within the List and returns its index.
The item to locate.
Returns a random child from the group.
OptionalstartIndex: numberOffset from the front of the group (lowest child). Default 0.
Optionallength: numberRestriction on the number of values you want to randomly select from. Default (to top).
Moves an item above another one in the List. If the given item is already above the other, it isn't moved. Above means toward the end of the List.
The element to move above base element.
The base element.
Moves an item below another one in the List. If the given item is already below the other, it isn't moved. Below means toward the start of the List.
The element to move below base element.
The base element.
Moves the given child down one place in this group unless it's already at the bottom.
The item to move down.
Moves an item in the List to a new position.
The item to move.
Moves an item in the List to a new position.
Moves the given child up one place in this group unless it's already at the top.
The item to move up.
Force a sort of the display list on the next call to depthSort.
Removes one or many items from the List.
The item, or array of items, to remove.
OptionalskipCallback: booleanSkip calling the List.removeCallback. Default false.
Removes all the items.
OptionalskipCallback: booleanSkip calling the List.removeCallback. Default false.
Removes the item at the given position in the List.
The position to remove the item from.
OptionalskipCallback: booleanSkip calling the List.removeCallback. Default false.
Removes the items within the given range in the List.
OptionalstartIndex: numberThe index to start removing from. Default 0.
OptionalendIndex: numberThe position to stop removing at. The item at this position won't be removed.
OptionalskipCallback: booleanSkip calling the List.removeCallback. Default false.
Replaces a child of this List with the given newChild. The newChild cannot be a member of this List.
The child in this List that will be replaced.
The child to be inserted into this List.
Reverses the order of all children in this List.
Sends the given child to the bottom of this List.
The item to send to the back of the list.
Sets the property key to the given value on all members of this List.
The name of the property to set.
The value to set the property to.
OptionalstartIndex: numberThe first child index to start the search from.
OptionalendIndex: numberThe last child index to search up until.
Shuffles the items in the list.
Clears the List and recreates its internal array.
Sort the contents of this List so the items are in order based on the given property.
For example, sort('alpha') would sort the List contents based on the value of their alpha property.
The property to lexically sort by.
Optionalhandler: FunctionProvide your own custom handler function. Will receive 2 children which it should compare and return a boolean.
Compare the depth of two Game Objects.
The first Game Object.
The second Game Object.
Swaps the positions of two items in the list.
The first item to swap.
The second item to swap.
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]Phaser.GameObjects.UpdateList, for updating.