Container
Creates a Container
A Container is the base component for all components that render to the screen. It can be used on its own, but components such as Sprite or Graphics will be composed of Containers
When child components are rendered inside, their coordinates become local to the parent Container.
API
Container Attributes
Name | Type | Default | Description |
---|---|---|---|
width | number | The width of the Container | |
height | number | The height of the Container | |
position |
| 0 | The position of the Container |
x | number | 0 | The x coordinate of the Container |
y | number | 0 | The y coordinate of the Container |
pivot |
| 0 | The pivot point of the Container that it rotates around. |
pivot-x | number | 0 | The x pivot point of the Container that it rotates around. |
pivot-y | number | 0 | The y pivot point of the Container that it rotates around. |
scale |
| 1 | The scale of the Container |
scale-x | number | 1 | The x scale of the Container |
scale-y | number | 1 | The y scale of the Container |
skew |
| 0 | The skew of the Container |
skew-x | number | 0 | The x skew of the Container |
skew-y | number | 0 | The y skew of the Container |
rotation | number | 0 | The rotation of the Container |
event-mode | enum | 'auto' | The event mode of the Container |
alpha | number | 1 | The opacity of the Container |
mask | object | undefined | The mask of the Container |
hit-area | object | undefined | The hit area of the Container |
more attributes in PIXI.Container
Container Events
Name | Type | Description |
---|---|---|
added | function | when the Container is added to the stage |
child-added | function | when a child is added to the Container |
child-removed | function | when a child is removed from the Container |
removed | function | when the Container is removed from the stage |
render | function | custom rendering listener |
click | function | when the Container is clicked |
mousedown | function | when the mouse button is pressed down on the Container |
mouseup | function | when the mouse button is released over the Container |
mouseover | function | when the mouse cursor moves over the Container |
mouseout | function | when the mouse cursor moves out of the Container |
mousemove | function | when the mouse cursor moves while over the Container |
mouseupoutside | function | when the mouse button is released outside the Container |
pointercancel | function | when a pointer event is canceled |
pointerdown | function | when a pointer down event is detected |
pointermove | function | when a pointer move event is detected |
pointerout | function | when a pointer leaves event is detected |
pointerover | function | when a pointer over event is detected |
pointertap | function | when a pointer tap event is detected |
pointerup | function | when a pointer up event is detected |
pointerupoutside | function | when a pointer up outside event is detected |
tab | function | when a tab event is detected |
touchcancel | function | when a touch cancel event is detected |
touchend | function | when a touch end event is detected |
touchendoutside | function | when a touch end outside event is detected |
touchmove | function | when a touch move event is detected |
touchstart | function | when a touch start event is detected |
more events in PIXI.Container
Graphics Slots
Name | Description |
---|---|
default | The default slot is used to render the children of the Container element. |