DisplayList

DisplayList

Ready made methods that can be used by / mixed into objects owning a display list and inherit from DisplayObject

Methods

<static> addChild(child, index) → {this}

Adds a child or an array of children to the object.
Parameters:
Name Type Argument Default Description
child DisplayObject | Array The display object (or array of display objects) to add.
index Number <optional>
undefined A natural number at which index the child should be inserted.
Returns:
Type
this

<static> children(newChildren) → {this|Array}

Returns or sets the array of child display objects.
Parameters:
Name Type Argument Default Description
newChildren Array <optional>
undefined If passed, the display list is cleared and the new children are appended.
Returns:
Type
this | Array

<static> clear() → {this}

Removes all children from the object
Returns:
Type
this

<static> getBoundingBox(transform) → {Object}

Returns dimensions/location of the DisplayList, calculated from its children
Parameters:
Name Type Argument Default Description
transform Matrix <optional>
null A transform to apply to all points before computation.
Returns:
an object with all box properties
Type
Object