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)) → {}
| 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> |
See Layer#clearColor |
| boolean |
Enabling sorting objects within this group by zOrder. |
| number |
Groups with a non-zero sort priority are sorted first. |
| boolean |
|
| boolean |
|
| number |
Default zIndex value for layers that are created with this Group |
Methods from Group
| void |
Resolve a child PIXI.DisplayObject that is set to be in this group. |
| void |
Resolve the layer rendering this group of display objects. |
Events from Group
|
Fired for each DisplayObject in this group, right before they are sorted. |
Public Properties
sortPriority: number = 0
Groups with a non-zero sort priority are sorted first.
Unsure of the exact purpose yet :)
Public Methods
_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.
| Name | Type | Description |
|---|---|---|
| stage | Stage | |
| displayObject | PIXI.DisplayObject |
| Type | Description |
|---|---|
| void |
_resolveLayer(stage: Stage, layer: Layer) → {void}
Resolve the layer rendering this group of display objects.
This is an internal method.
| Type | Description |
|---|---|
| void |
Events
Fired for each DisplayObject in this group, right before they are sorted.
| Name | Type | Description |
|---|---|---|
| object | PIXI.DisplayObject |
The object that will be sorted. |