Skip to content

1681-engine / index / Group

Class: Group ​

Defined in: src/core/Group.ts:5

A container of world objects, drawn in list order (children do not sort by depth).

Extends ​

  • Container<ContainerChild, this> & GameObjectMembers<this>

Constructors ​

Constructor ​

ts
new Group(options?): Group;

Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:843

Parameters ​

ParameterType
options?ContainerOptions<ContainerChild>

Returns ​

Group

Inherited from ​

ts
GameObject(Container).constructor

Properties ​

active ​

ts
readonly active: boolean;

Defined in: src/core/gameObject.ts:42

False once destroyed.

Inherited from ​

ts
GameObject(Container).active

depth ​

ts
depth: number;

Defined in: src/core/gameObject.ts:44

The draw order in the world layer (zIndex): bigger is in front.

Inherited from ​

ts
GameObject(Container).depth

flipX ​

ts
flipX: boolean;

Defined in: src/core/gameObject.ts:48

Inherited from ​

ts
GameObject(Container).flipX

flipY ​

ts
flipY: boolean;

Defined in: src/core/gameObject.ts:49

Inherited from ​

ts
GameObject(Container).flipY

scaleX ​

ts
scaleX: number;

Defined in: src/core/gameObject.ts:46

Scale without the flip: stays positive on a mirrored sprite.

Inherited from ​

ts
GameObject(Container).scaleX

scaleY ​

ts
scaleY: number;

Defined in: src/core/gameObject.ts:47

Inherited from ​

ts
GameObject(Container).scaleY

scene ​

ts
scene: Stage;

Defined in: src/core/gameObject.ts:40

Inherited from ​

ts
GameObject(Container).scene

Accessors ​

list ​

Get Signature ​

ts
get list(): Container<ContainerChild>[];

Defined in: src/core/Group.ts:6

Returns ​

Container<ContainerChild>[]

Methods ​

add() ​

ts
add(child): this;

Defined in: src/core/Group.ts:10

Parameters ​

ParameterType
childContainer<ContainerChild> | Container<ContainerChild>[]

Returns ​

this


addAt() ​

ts
addAt(child, index): this;

Defined in: src/core/Group.ts:15

Parameters ​

ParameterType
childContainer
indexnumber

Returns ​

this


clearTint() ​

ts
clearTint(): this;

Defined in: src/core/gameObject.ts:64

Returns ​

this

Inherited from ​

ts
GameObject(Container).clearTint

destroy() ​

Call Signature ​

ts
destroy(options?): void;

Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1343

Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.

Parameters ​
ParameterTypeDescription
options?DestroyOptionsOptions parameter. A boolean will act as if all options have been set to that value
Returns ​

void

Example ​
ts
container.destroy();
container.destroy(true);
container.destroy({ children: true });
container.destroy({ children: true, texture: true, textureSource: true });
Inherited from ​
ts
GameObject(Container).destroy

Call Signature ​

ts
destroy(): void;

Defined in: src/core/gameObject.ts:67

Returns ​

void

Inherited from ​
ts
GameObject(Container).destroy

keepAbove() ​

ts
keepAbove(child, other): this;

Defined in: src/core/Group.ts:44

Keeps child drawn above other, anywhere above it: moved (directly above) only when it is below. What a weapon held over its body asks for. moveAbove from two pieces each wanting to sit directly above the same body (two blades, a fist on a hilt, a load) pushed the other out every frame, and every push rebuilt Pixi's instructions.

Parameters ​

ParameterType
childContainer
otherContainer

Returns ​

this


keepBelow() ​

ts
keepBelow(child, other): this;

Defined in: src/core/Group.ts:51

Keeps child drawn below other, anywhere below it: moved (directly below) only when it is above (keepAbove).

Parameters ​

ParameterType
childContainer
otherContainer

Returns ​

this


moveAbove() ​

ts
moveAbove(child, other): this;

Defined in: src/core/Group.ts:58

Puts child directly above other in the draw order; already there, it does nothing (see moveBelow).

Parameters ​

ParameterType
childContainer
otherContainer

Returns ​

this


moveBelow() ​

ts
moveBelow(child, other): this;

Defined in: src/core/Group.ts:31

Puts child directly below other in the draw order. Already there, it does nothing: taking a child out and putting it back marks the render group's structure changed, and Pixi rebuilds its draw instructions for that frame — a held weapon ordered against its body every frame did it every frame.

Parameters ​

ParameterType
childContainer
otherContainer

Returns ​

this


remove() ​

ts
remove(child, destroy?): this;

Defined in: src/core/Group.ts:20

Parameters ​

ParameterTypeDefault value
childContainerundefined
destroybooleanfalse

Returns ​

this


setAlpha() ​

ts
setAlpha(a?): this;

Defined in: src/core/gameObject.ts:55

Parameters ​

ParameterType
a?number

Returns ​

this

Inherited from ​

ts
GameObject(Container).setAlpha

setAngle() ​

ts
setAngle(a?): this;

Defined in: src/core/gameObject.ts:59

Parameters ​

ParameterType
a?number

Returns ​

this

Inherited from ​

ts
GameObject(Container).setAngle

setBlendMode() ​

ts
setBlendMode(mode): this;

Defined in: src/core/gameObject.ts:60

Parameters ​

ParameterType
modeBLEND_MODES

Returns ​

this

Inherited from ​

ts
GameObject(Container).setBlendMode

setDepth() ​

ts
setDepth(d): this;

Defined in: src/core/gameObject.ts:54

Parameters ​

ParameterType
dnumber

Returns ​

this

Inherited from ​

ts
GameObject(Container).setDepth

setFlip() ​

ts
setFlip(x, y): this;

Defined in: src/core/gameObject.ts:53

Parameters ​

ParameterType
xboolean
yboolean

Returns ​

this

Inherited from ​

ts
GameObject(Container).setFlip

setFlipX() ​

ts
setFlipX(v): this;

Defined in: src/core/gameObject.ts:51

Parameters ​

ParameterType
vboolean

Returns ​

this

Inherited from ​

ts
GameObject(Container).setFlipX

setFlipY() ​

ts
setFlipY(v): this;

Defined in: src/core/gameObject.ts:52

Parameters ​

ParameterType
vboolean

Returns ​

this

Inherited from ​

ts
GameObject(Container).setFlipY

setPosition() ​

ts
setPosition(x?, y?): this;

Defined in: src/core/gameObject.ts:57

Parameters ​

ParameterType
x?number
y?number

Returns ​

this

Inherited from ​

ts
GameObject(Container).setPosition

setRotation() ​

ts
setRotation(r?): this;

Defined in: src/core/gameObject.ts:58

Parameters ​

ParameterType
r?number

Returns ​

this

Inherited from ​

ts
GameObject(Container).setRotation

setScale() ​

ts
setScale(x, y?): this;

Defined in: src/core/gameObject.ts:50

Parameters ​

ParameterType
xnumber
y?number

Returns ​

this

Inherited from ​

ts
GameObject(Container).setScale

setScrollFactor() ​

ts
setScrollFactor(f): this;

Defined in: src/core/gameObject.ts:66

0 pins the object to the screen instead of the world.

Parameters ​

ParameterType
fnumber

Returns ​

this

Inherited from ​

ts
GameObject(Container).setScrollFactor

setTint() ​

ts
setTint(color?): this;

Defined in: src/core/gameObject.ts:61

Parameters ​

ParameterType
color?number

Returns ​

this

Inherited from ​

ts
GameObject(Container).setTint

setTintFill() ​

ts
setTintFill(color): this;

Defined in: src/core/gameObject.ts:63

Paints every opaque pixel in one solid colour (hit flash, silhouettes).

Parameters ​

ParameterType
colornumber

Returns ​

this

Inherited from ​

ts
GameObject(Container).setTintFill

setVisible() ​

ts
setVisible(v): this;

Defined in: src/core/gameObject.ts:56

Parameters ​

ParameterType
vboolean

Returns ​

this

Inherited from ​

ts
GameObject(Container).setVisible

Released under the MIT License.