Group

class Group extends utils.EventEmitter

A context for z-ordering PIXI.DisplayObjects within the same Layer.

Constructor


new Group(zIndex: number, sorting: boolean | ((displayObject: PIXI.DisplayObject) => void)) → {}
Parameters:
Name Type Default Description
zIndex number 0

The z-index for the entire group.

sorting boolean | ((displayObject: PIXI.DisplayObject) => void) false

This will enable sorting by z-order. You can also pass a callback that will assign the z-index before sorting. This is useful, for example, when you want to sort by "y" - the callback can then set the zOrder to the y-coordinate. This callback is invoked as an event-listener to the Group#sort event.

Summary


Properties from Group

ArrayLike<number>
clearColor

See Layer#clearColor

boolean
enableSort

Enabling sorting objects within this group by zOrder.

number
sortPriority = 0

Groups with a non-zero sort priority are sorted first.

boolean
useDoubleBuffer = false

See Layer#useDoubleBuffer

boolean
useRenderTexture = false

See Layer#useRenderTexture

number
zIndex

Default zIndex value for layers that are created with this Group

Methods from Group

void
_resolveChildDisplayObject(stage: Stage, displayObject: PIXI.DisplayObject)

Resolve a child PIXI.DisplayObject that is set to be in this group.

void
_resolveLayer(stage: Stage, layer: Layer)

Resolve the layer rendering this group of display objects.

Events from Group

sort

Fired for each DisplayObject in this group, right before they are sorted.

Public Properties


clearColor Group.ts:27
clearColor: ArrayLike<number>
enableSort Group.ts:38
enableSort: boolean

Enabling sorting objects within this group by zOrder.

sortPriority Group.ts:20
sortPriority: number = 0

Groups with a non-zero sort priority are sorted first.

Unsure of the exact purpose yet :)

useDoubleBuffer Group.ts:17
useDoubleBuffer: boolean = false
useRenderTexture Group.ts:14
useRenderTexture: boolean = false
zIndex Group.ts:35
zIndex: number

Default zIndex value for layers that are created with this Group

Public Methods


_resolveChildDisplayObject Group.ts:104
_resolveChildDisplayObject(stage: Stage, displayObject: PIXI.DisplayObject) → {void}

Resolve a child PIXI.DisplayObject that is set to be in this group.

This is an internal method.

Parameters:
Name Type Description
stage Stage
displayObject PIXI.DisplayObject
Returns:
Type Description
void
See: Stage#updateStage
_resolveLayer Group.ts:126
_resolveLayer(stage: Stage, layer: Layer) → {void}

Resolve the layer rendering this group of display objects.

This is an internal method.

Parameters:
Name Type Description
stage Stage
layer Layer
Returns:
Type Description
void
See: Layer#_onBeginLayerSubtreeTraversal

Events


sort Group.ts:183

Fired for each DisplayObject in this group, right before they are sorted.

Parameters:
Name Type Description
object PIXI.DisplayObject

The object that will be sorted.


Powered by webdoc!