Class: Group

PIXI.layers.Group

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

new PIXI.layers.Group (zIndex, sorting)

Name Type Default Description
zIndex number 0

The z-index for the entire group.

sorting boolean | ((displayObject: 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.

Extends

  • utils.EventEmitter

Members

clearColor ArrayLike<number>

See Layer#clearColor

enableSort boolean

Enabling sorting objects within this group by zOrder.

sortPriority number

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

Unsure of the exact purpose yet :)

Default Value:
  • 0

useDoubleBuffer boolean

See Layer#useDoubleBuffer

Default Value:
  • false

useRenderTexture boolean

See Layer#useRenderTexture

Default Value:
  • false

zIndex number

Default zIndex value for layers that are created with this Group

Events

sort

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

Name Type Description
object PIXI.DisplayObject

The object that will be sorted.