Skip to content
On this page

kagurajs - v0.2.7 / Exports / Sprite

Class: Sprite

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Sprite()

Inherited from

ObjectContainer.constructor

Defined in

src/object/object-container/index.ts:17

Properties

_accessibleActive

Optional _accessibleActive: boolean

Inherited from

ObjectContainer._accessibleActive

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:8


_accessibleDiv

Optional _accessibleDiv: IAccessibleHTMLElement

Inherited from

ObjectContainer._accessibleDiv

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:9


_bounds

_bounds: Bounds

The bounds object, this is used to calculate and store the bounds of the displayObject.

Inherited from

ObjectContainer._bounds

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:273


_boundsID

Protected _boundsID: number

Flags the cached bounds as dirty.

Inherited from

ObjectContainer._boundsID

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:288


_boundsRect

Protected _boundsRect: Rectangle

Cache of this display-object's bounds-rectangle.

Inherited from

ObjectContainer._boundsRect

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:290


_cacheAsBitmap

_cacheAsBitmap: boolean

Inherited from

ObjectContainer._cacheAsBitmap

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:10


_cacheAsBitmapMultisample

_cacheAsBitmapMultisample: MSAA_QUALITY

Inherited from

ObjectContainer._cacheAsBitmapMultisample

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:9


_cacheAsBitmapResolution

_cacheAsBitmapResolution: number

Inherited from

ObjectContainer._cacheAsBitmapResolution

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:8


_cacheData

_cacheData: CacheData

Inherited from

ObjectContainer._cacheData

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:11


_destroyed

Protected _destroyed: boolean

If the object has been destroyed via destroy(). If true, it should not be used.

Inherited from

ObjectContainer._destroyed

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:294


_enabledFilters

Protected _enabledFilters: Filter[]

Currently enabled filters.

Inherited from

ObjectContainer._enabledFilters

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:286


_height

Protected _height: number

Inherited from

ObjectContainer._height

Defined in

node_modules/@pixi/display/lib/Container.d.ts:77


_internalEventMode

_internalEventMode: EventMode

Inherited from

ObjectContainer._internalEventMode

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:37


_internalInteractive

_internalInteractive: boolean

Inherited from

ObjectContainer._internalInteractive

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:34


_lastSortedIndex

Protected _lastSortedIndex: number

Which index in the children array the display component was before the previous zIndex sort. Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.

Inherited from

ObjectContainer._lastSortedIndex

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:266


_localBounds

_localBounds: Bounds

Local bounds object, swapped with _bounds when using getLocalBounds().

Inherited from

ObjectContainer._localBounds

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:275


_localBoundsRect

Protected _localBoundsRect: Rectangle

Cache of this display-object's local-bounds rectangle.

Inherited from

ObjectContainer._localBoundsRect

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:292


_mask

Protected _mask: Container<DisplayObject> | MaskData

The original, cached mask of the object.

Inherited from

ObjectContainer._mask

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:271


_width

Protected _width: number

Inherited from

ObjectContainer._width

Defined in

node_modules/@pixi/display/lib/Container.d.ts:76


_zIndex

Protected _zIndex: number

The zIndex of the displayObject. A higher value will mean it will be rendered on top of other displayObjects within the same container.

Inherited from

ObjectContainer._zIndex

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:281


accessible

Optional accessible: boolean

Inherited from

ObjectContainer.accessible

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:4


accessibleChildren

Optional accessibleChildren: boolean

Inherited from

ObjectContainer.accessibleChildren

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:12


accessibleHint

Optional accessibleHint: string

Inherited from

ObjectContainer.accessibleHint

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:6


accessiblePointerEvents

Optional accessiblePointerEvents: PointerEvents

Inherited from

ObjectContainer.accessiblePointerEvents

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:11


accessibleTitle

Optional accessibleTitle: string

Inherited from

ObjectContainer.accessibleTitle

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:5


accessibleType

Optional accessibleType: string

Inherited from

ObjectContainer.accessibleType

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:10


alpha

alpha: number

The opacity of the object.

Inherited from

ObjectContainer.alpha

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:217


cacheAsBitmap

cacheAsBitmap: boolean

Inherited from

ObjectContainer.cacheAsBitmap

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:5


cacheAsBitmapMultisample

cacheAsBitmapMultisample: MSAA_QUALITY

Inherited from

ObjectContainer.cacheAsBitmapMultisample

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:7


cacheAsBitmapResolution

cacheAsBitmapResolution: number

Inherited from

ObjectContainer.cacheAsBitmapResolution

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:6


childContainer

Optional childContainer: {} | Container<DisplayObject>

Inherited from

ObjectContainer.childContainer

Defined in

src/object/object-container/index.ts:16


children

Readonly children: DisplayObject[]

The array of children of this container.

Inherited from

ObjectContainer.children

Defined in

node_modules/@pixi/display/lib/Container.d.ts:54


containerUpdateTransform

containerUpdateTransform: () => void

Type declaration

▸ (): void

Returns

void

Inherited from

ObjectContainer.containerUpdateTransform

Defined in

node_modules/@pixi/display/lib/Container.d.ts:75


cullArea

cullArea: Rectangle

If set, this shape is used for culling instead of the bounds of this object. It can improve the culling performance of objects with many children. The culling area is defined in local space.

Inherited from

ObjectContainer.cullArea

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:243


cullable

cullable: boolean

Should this object be rendered if the bounds of this object are out of frame?

Culling has no effect on whether updateTransform is called.

Inherited from

ObjectContainer.cullable

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:237


cursor

cursor: string

The cursor preferred when the mouse pointer is hovering over.

Inherited from

ObjectContainer.cursor

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:27


displayObjectUpdateTransform

displayObjectUpdateTransform: () => void

Type declaration

▸ (): void

Returns

void

Inherited from

ObjectContainer.displayObjectUpdateTransform

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:298


eventMode

eventMode: EventMode

The mode of interaction for this object

Inherited from

ObjectContainer.eventMode

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:36


filterArea

filterArea: Rectangle

The area the filter is applied to. This is used as more of an optimization rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.

Also works as an interaction mask.

Inherited from

ObjectContainer.filterArea

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:250


filters

filters: null | Filter[]

Sets the filters for the displayObject. IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. To remove filters simply set this property to 'null'.

Inherited from

ObjectContainer.filters

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:256


hitArea

hitArea: null | IHitArea

The hit-area specifies the area for which pointer events should be captured by this event target.

Inherited from

ObjectContainer.hitArea

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:43


interactive

interactive: boolean

Whether this event target should fire UI events.

Inherited from

ObjectContainer.interactive

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:33


interactiveChildren

interactiveChildren: boolean

Whether this event target has any children that need UI events. This can be used optimize event propagation.

Inherited from

ObjectContainer.interactiveChildren

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:41


isInteractive

isInteractive: () => boolean

Type declaration

▸ (): boolean

Returns true if the DisplayObject has interactive 'static' or 'dynamic'

Returns

boolean

Inherited from

ObjectContainer.isInteractive

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:39


isMask

isMask: boolean

Does any other displayObject use this object as a mask?

Inherited from

ObjectContainer.isMask

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:260


isSprite

isSprite: boolean

Used to fast check if a sprite is.. a sprite!

Inherited from

ObjectContainer.isSprite

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:258


name

name: null | string

Inherited from

ObjectContainer.name

Defined in

node_modules/@pixi/mixin-get-child-by-name/global.d.ts:5


onclick

onclick: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'click' event

Inherited from

ObjectContainer.onclick

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:47


onglobalmousemove

onglobalmousemove: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'globalmousemove' event

Inherited from

ObjectContainer.onglobalmousemove

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:57


onglobalpointermove

onglobalpointermove: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'globalpointermove' event

Inherited from

ObjectContainer.onglobalpointermove

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:77


onglobaltouchmove

onglobaltouchmove: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'globaltouchmove' event

Inherited from

ObjectContainer.onglobaltouchmove

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:107


onmousedown

onmousedown: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mousedown' event

Inherited from

ObjectContainer.onmousedown

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:49


onmouseenter

onmouseenter: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mouseenter' event

Inherited from

ObjectContainer.onmouseenter

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:51


onmouseleave

onmouseleave: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mouseleave' event

Inherited from

ObjectContainer.onmouseleave

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:53


onmousemove

onmousemove: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mousemove' event

Inherited from

ObjectContainer.onmousemove

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:55


onmouseout

onmouseout: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mouseout' event

Inherited from

ObjectContainer.onmouseout

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:59


onmouseover

onmouseover: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mouseover' event

Inherited from

ObjectContainer.onmouseover

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:61


onmouseup

onmouseup: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mouseup' event

Inherited from

ObjectContainer.onmouseup

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:63


onmouseupoutside

onmouseupoutside: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'mouseupoutside' event

Inherited from

ObjectContainer.onmouseupoutside

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:65


onpointercancel

onpointercancel: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointercancel' event

Inherited from

ObjectContainer.onpointercancel

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:67


onpointerdown

onpointerdown: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointerdown' event

Inherited from

ObjectContainer.onpointerdown

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:69


onpointerenter

onpointerenter: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointerenter' event

Inherited from

ObjectContainer.onpointerenter

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:71


onpointerleave

onpointerleave: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointerleave' event

Inherited from

ObjectContainer.onpointerleave

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:73


onpointermove

onpointermove: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointermove' event

Inherited from

ObjectContainer.onpointermove

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:75


onpointerout

onpointerout: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointerout' event

Inherited from

ObjectContainer.onpointerout

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:79


onpointerover

onpointerover: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointerover' event

Inherited from

ObjectContainer.onpointerover

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:81


onpointertap

onpointertap: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointertap' event

Inherited from

ObjectContainer.onpointertap

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:83


onpointerup

onpointerup: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointerup' event

Inherited from

ObjectContainer.onpointerup

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:85


onpointerupoutside

onpointerupoutside: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'pointerupoutside' event

Inherited from

ObjectContainer.onpointerupoutside

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:87


onrightclick

onrightclick: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'rightclick' event

Inherited from

ObjectContainer.onrightclick

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:89


onrightdown

onrightdown: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'rightdown' event

Inherited from

ObjectContainer.onrightdown

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:91


onrightup

onrightup: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'rightup' event

Inherited from

ObjectContainer.onrightup

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:93


onrightupoutside

onrightupoutside: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'rightupoutside' event

Inherited from

ObjectContainer.onrightupoutside

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:95


ontap

ontap: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'tap' event

Inherited from

ObjectContainer.ontap

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:97


ontouchcancel

ontouchcancel: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'touchcancel' event

Inherited from

ObjectContainer.ontouchcancel

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:99


ontouchend

ontouchend: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'touchend' event

Inherited from

ObjectContainer.ontouchend

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:101


ontouchendoutside

ontouchendoutside: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'touchendoutside' event

Inherited from

ObjectContainer.ontouchendoutside

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:103


ontouchmove

ontouchmove: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'touchmove' event

Inherited from

ObjectContainer.ontouchmove

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:105


ontouchstart

ontouchstart: null | FederatedEventHandler<FederatedPointerEvent>

Handler for 'touchstart' event

Inherited from

ObjectContainer.ontouchstart

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:109


onwheel

onwheel: null | FederatedEventHandler<FederatedWheelEvent>

Handler for 'wheel' event

Inherited from

ObjectContainer.onwheel

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:111


parent

parent: Container<DisplayObject>

Inherited from

ObjectContainer.parent

Defined in

node_modules/@pixi/display/lib/Container.d.ts:74


renderId

Optional renderId: number

Inherited from

ObjectContainer.renderId

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:13


renderable

renderable: boolean

Can this object be rendered, if false the object will not be drawn but the updateTransform methods will still be called.

Only affects recursive calls from parent. You can ask for bounds manually.

Inherited from

ObjectContainer.renderable

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:231


sortDirty

sortDirty: boolean

Should children be sorted by zIndex at the next updateTransform call.

Will get automatically set to true if a new child is added, or if a child's zIndex changes.

Inherited from

ObjectContainer.sortDirty

Defined in

node_modules/@pixi/display/lib/Container.d.ts:73


sortableChildren

sortableChildren: boolean

If set to true, the container will sort its children by zIndex value when updateTransform() is called, or manually if sortChildren() is called.

This actually changes the order of elements in the array, so should be treated as a basic solution that is not performant compared to other solutions, such as PixiJS Layers

Also be aware of that this may not work nicely with the addChildAt() function, as the zIndex sorting may cause the child to automatically sorted to another position.

See

PIXI.Container.defaultSortableChildren

Inherited from

ObjectContainer.sortableChildren

Defined in

node_modules/@pixi/display/lib/Container.d.ts:67


tabIndex

Optional tabIndex: number

Inherited from

ObjectContainer.tabIndex

Defined in

node_modules/@pixi/accessibility/lib/accessibleTarget.d.ts:7


transform

transform: Transform

World transform and local transform of this object. This will become read-only later, please do not assign anything there unless you know what are you doing.

Inherited from

ObjectContainer.transform

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:215


visible

visible: boolean

The visibility of the object. If false the object will not be drawn, and the updateTransform function will not be called.

Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.

Inherited from

ObjectContainer.visible

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:224


worldAlpha

Readonly worldAlpha: number

The multiplied alpha of the displayObject.

Inherited from

ObjectContainer.worldAlpha

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:210


defaultSortableChildren

Static defaultSortableChildren: boolean

Sets the default value for the container property sortableChildren. If set to true, the container will sort its children by zIndex value when updateTransform() is called, or manually if sortChildren() is called.

This actually changes the order of elements in the array, so should be treated as a basic solution that is not performant compared to other solutions, such as PixiJS Layers.

Also be aware of that this may not work nicely with the addChildAt() function, as the zIndex sorting may cause the child to automatically sorted to another position.

Static

Inherited from

ObjectContainer.defaultSortableChildren

Defined in

node_modules/@pixi/display/lib/Container.d.ts:49


prefixed

Static prefixed: string | boolean

Inherited from

ObjectContainer.prefixed

Defined in

node_modules/eventemitter3/index.d.ts:9

Accessors

_tempDisplayObjectParent

get _tempDisplayObjectParent(): TemporaryDisplayObject

Returns

TemporaryDisplayObject

Member

Inherited from

ObjectContainer._tempDisplayObjectParent

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:431


angle

get angle(): number

The angle of the object in degrees. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.

Returns

number

Inherited from

ObjectContainer.angle

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:509

set angle(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

ObjectContainer.angle

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:510


destroyed

get destroyed(): boolean

Readonly flag for destroyed display objects.

Returns

boolean

Inherited from

ObjectContainer.destroyed

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:324


height

get height(): number

The height of the Container, setting this will actually modify the scale to achieve the value set.

Returns

number

Inherited from

ObjectContainer.height

Defined in

node_modules/@pixi/display/lib/Container.d.ts:229

set height(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

ObjectContainer.height

Defined in

node_modules/@pixi/display/lib/Container.d.ts:230


localTransform

get localTransform(): Matrix

Current transform of the object based on local factors: position, scale, other stuff.

Returns

Matrix

Inherited from

ObjectContainer.localTransform

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:469


mask

get mask(): null | Container<DisplayObject> | MaskData

Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. In PixiJS a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilities shape clipping. Furthermore, a mask of an object must be in the subtree of its parent. Otherwise, getLocalBounds may calculate incorrect bounds, which makes the container's width and height wrong. To remove a mask, set this property to null.

For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.

Returns

null | Container<DisplayObject> | MaskData

Example

ts
import { Graphics, Sprite } from 'pixi.js';

const graphics = new Graphics();
graphics.beginFill(0xFF3300);
graphics.drawRect(50, 250, 100, 100);
graphics.endFill();

const sprite = new Sprite(texture);
sprite.mask = graphics;

Todo

At the moment, CanvasRenderer doesn't support Sprite as mask.

Inherited from

ObjectContainer.mask

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:547

set mask(value): void

Parameters

NameType
valuenull | Container<DisplayObject> | MaskData

Returns

void

Inherited from

ObjectContainer.mask

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:548


pivot

get pivot(): ObservablePoint<any>

The center of rotation, scaling, and skewing for this display object in its local space. The position is the projection of pivot in the parent's local space.

By default, the pivot is the origin (0, 0).

Returns

ObservablePoint<any>

Since

4.0.0

Inherited from

ObjectContainer.pivot

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:491

set pivot(value): void

Parameters

NameType
valueIPointData

Returns

void

Inherited from

ObjectContainer.pivot

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:492


position

get position(): ObservablePoint<any>

The coordinate of the object relative to the local coordinates of the parent.

Returns

ObservablePoint<any>

Since

4.0.0

Inherited from

ObjectContainer.position

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:474

set position(value): void

Parameters

NameType
valueIPointData

Returns

void

Inherited from

ObjectContainer.position

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:475


rotation

get rotation(): number

The rotation of the object in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.

Returns

number

Inherited from

ObjectContainer.rotation

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:503

set rotation(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

ObjectContainer.rotation

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:504


scale

get scale(): ObservablePoint<any>

The scale factors of this object along the local coordinate axes.

The default scale is (1, 1).

Returns

ObservablePoint<any>

Since

4.0.0

Inherited from

ObjectContainer.scale

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:482

set scale(value): void

Parameters

NameType
valueIPointData

Returns

void

Inherited from

ObjectContainer.scale

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:483


skew

get skew(): ObservablePoint<any>

The skew factor for the object in radians.

Returns

ObservablePoint<any>

Since

4.0.0

Inherited from

ObjectContainer.skew

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:497

set skew(value): void

Parameters

NameType
valueIPointData

Returns

void

Inherited from

ObjectContainer.skew

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:498


width

get width(): number

The width of the Container, setting this will actually modify the scale to achieve the value set.

Returns

number

Inherited from

ObjectContainer.width

Defined in

node_modules/@pixi/display/lib/Container.d.ts:226

set width(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

ObjectContainer.width

Defined in

node_modules/@pixi/display/lib/Container.d.ts:227


worldTransform

get worldTransform(): Matrix

Current transform of the object based on world (parent) factors.

Returns

Matrix

Inherited from

ObjectContainer.worldTransform

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:464


worldVisible

get worldVisible(): boolean

Indicates if the object is globally visible.

Returns

boolean

Inherited from

ObjectContainer.worldVisible

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:525


x

get x(): number

The position of the displayObject on the x axis relative to the local coordinates of the parent. An alias to position.x

Returns

number

Inherited from

ObjectContainer.x

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:452

set x(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

ObjectContainer.x

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:453


y

get y(): number

The position of the displayObject on the y axis relative to the local coordinates of the parent. An alias to position.y

Returns

number

Inherited from

ObjectContainer.y

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:458

set y(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

ObjectContainer.y

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:459


zIndex

get zIndex(): number

The zIndex of the displayObject.

If a container has the sortableChildren property set to true, children will be automatically sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, and thus rendered on top of other display objects within the same container.

Returns

number

See

PIXI.Container#sortableChildren

Inherited from

ObjectContainer.zIndex

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:519

set zIndex(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

ObjectContainer.zIndex

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:520

Methods

_cacheAsBitmapDestroy

_cacheAsBitmapDestroy(options?): void

Parameters

NameType
options?boolean | IDestroyOptions

Returns

void

Inherited from

ObjectContainer._cacheAsBitmapDestroy

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:19


_calculateBounds

Protected _calculateBounds(): void

Recalculates the content bounds of this object. This should be overriden to calculate the bounds of this specific object (not including children).

Returns

void

Inherited from

ObjectContainer._calculateBounds

Defined in

node_modules/@pixi/display/lib/Container.d.ts:170


_calculateCachedBounds

_calculateCachedBounds(): void

Returns

void

Inherited from

ObjectContainer._calculateCachedBounds

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:14


_destroyCachedDisplayObject

_destroyCachedDisplayObject(): void

Returns

void

Inherited from

ObjectContainer._destroyCachedDisplayObject

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:18


_getCachedLocalBounds

_getCachedLocalBounds(): Rectangle

Returns

Rectangle

Inherited from

ObjectContainer._getCachedLocalBounds

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:15


_initCachedDisplayObject

_initCachedDisplayObject(renderer): void

Parameters

NameType
rendererRenderer

Returns

void

Inherited from

ObjectContainer._initCachedDisplayObject

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:13


_initCachedDisplayObjectCanvas

_initCachedDisplayObjectCanvas(renderer): void

Parameters

NameType
rendererIRenderer<ICanvas>

Returns

void

Inherited from

ObjectContainer._initCachedDisplayObjectCanvas

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:17


_recursivePostUpdateTransform

Protected _recursivePostUpdateTransform(): void

Recursively updates transform of all objects from the root to this one internal function for toLocal()

Returns

void

Inherited from

ObjectContainer._recursivePostUpdateTransform

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:334


_render

Protected _render(_renderer): void

To be overridden by the subclasses.

Parameters

NameTypeDescription
_rendererRendererThe renderer

Returns

void

Inherited from

ObjectContainer._render

Defined in

node_modules/@pixi/display/lib/Container.d.ts:211


_renderCached

_renderCached(renderer): void

Parameters

NameType
rendererRenderer

Returns

void

Inherited from

ObjectContainer._renderCached

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:12


_renderCachedCanvas

_renderCachedCanvas(renderer): void

Parameters

NameType
rendererIRenderer<ICanvas>

Returns

void

Inherited from

ObjectContainer._renderCachedCanvas

Defined in

node_modules/@pixi/mixin-cache-as-bitmap/global.d.ts:16


_renderWithCulling

Protected _renderWithCulling(renderer): void

Renders this object and its children with culling.

Parameters

NameTypeDescription
rendererRendererThe renderer

Returns

void

Inherited from

ObjectContainer._renderWithCulling

Defined in

node_modules/@pixi/display/lib/Container.d.ts:176


addChild

addChild<U>(...children): U[0]

Adds one or more children to the container.

Multiple items can be added like so: myContainer.addChild(thingOne, thingTwo, thingThree)

Type parameters

NameType
Uextends DisplayObject[]

Parameters

NameTypeDescription
...childrenUThe DisplayObject(s) to add to the container

Returns

U[0]

  • The first child that was added.

Inherited from

ObjectContainer.addChild

Defined in

node_modules/@pixi/display/lib/Container.d.ts:91


addChildAt

addChildAt<U>(child, index): U

Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown. If the child is already in this container, it will be moved to the specified index.

Type parameters

NameType
Uextends DisplayObject<U>

Parameters

NameTypeDescription
childUThe child to add.
indexnumberThe absolute index where the child will be positioned at the end of the operation.

Returns

U

The child that was added.

Inherited from

ObjectContainer.addChildAt

Defined in

node_modules/@pixi/display/lib/Container.d.ts:99


addEventListener

addEventListener<K>(type, listener, options?): void

Type parameters

NameType
Kextends keyof FederatedEventMap | keyof GlobalFederatedEventMap

Parameters

NameType
typeK
listener(e: AllFederatedEventMap[K]) => any
options?AddListenerOptions

Returns

void

Inherited from

ObjectContainer.addEventListener

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:116

addEventListener(type, listener, options?): void

Parameters

NameType
typestring
listenerEventListenerOrEventListenerObject
options?AddListenerOptions

Returns

void

Inherited from

ObjectContainer.addEventListener

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:117


addListener

addListener<T>(event, fn, context?): Sprite

Type parameters

NameType
Textends keyof DisplayObjectEvents

Parameters

NameType
eventT
fn(...args: ArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]) => void
context?any

Returns

Sprite

Inherited from

ObjectContainer.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


calculateBounds

calculateBounds(): void

Recalculates the bounds of the container.

This implementation will automatically fit the children's bounds into the calculation. Each child's bounds is limited to its mask's bounds or filterArea, if any is applied.

Returns

void

Inherited from

ObjectContainer.calculateBounds

Defined in

node_modules/@pixi/display/lib/Container.d.ts:153


destroy

destroy(options?): void

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

Parameters

NameTypeDescription
options?boolean | IDestroyOptionsOptions parameter. A boolean will act as if all options have been set to that value

Returns

void

Inherited from

ObjectContainer.destroy

Defined in

node_modules/@pixi/display/lib/Container.d.ts:224


disableTempParent

disableTempParent(cacheParent): void

Pair method for enableTempParent

Parameters

NameTypeDescription
cacheParentContainer<DisplayObject>Actual parent of element

Returns

void

Inherited from

ObjectContainer.disableTempParent

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:447


dispatchEvent

dispatchEvent(event): boolean

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

Parameters

NameType
eventEvent

Returns

boolean

Inherited from

ObjectContainer.dispatchEvent

Defined in

node_modules/typescript/lib/lib.dom.d.ts:5309


emit

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

NameType
Textends keyof DisplayObjectEvents

Parameters

NameType
eventT
...argsArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]

Returns

boolean

Inherited from

ObjectContainer.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


enableTempParent

enableTempParent(): Container<DisplayObject>

Used in Renderer, cacheAsBitmap and other places where you call an updateTransform on root.

js
const cacheParent = elem.enableTempParent();
elem.updateTransform();
elem.disableTempParent(cacheParent);

Returns

Container<DisplayObject>

  • Current parent

Inherited from

ObjectContainer.enableTempParent

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:442


eventNames

eventNames(): keyof DisplayObjectEvents[]

Return an array listing the events for which the emitter has registered listeners.

Returns

keyof DisplayObjectEvents[]

Inherited from

ObjectContainer.eventNames

Defined in

node_modules/eventemitter3/index.d.ts:15


from

from(childContainer): void

Parameters

NameType
childContainerContainer<DisplayObject>

Returns

void

Inherited from

ObjectContainer.from

Defined in

src/object/object-container/index.ts:23


getBounds

getBounds(skipUpdate?, rect?): Rectangle

Calculates and returns the (world) bounds of the display object as a [Rectangle]PIXI.Rectangle.

This method is expensive on containers with a large subtree (like the stage). This is because the bounds of a container depend on its children's bounds, which recursively causes all bounds in the subtree to be recalculated. The upside, however, is that calling getBounds once on a container will indeed update the bounds of all children (the whole subtree, in fact). This side effect should be exploited by using displayObject._bounds.getRectangle() when traversing through all the bounds in a scene graph. Otherwise, calling getBounds on each object in a subtree will cause the total cost to increase quadratically as its height increases.

The transforms of all objects in a container's subtree and of all ancestors are updated. The world bounds of all display objects in a container's subtree will also be recalculated.

The _bounds object stores the last calculation of the bounds. You can use to entirely skip bounds calculation if needed.

js
const lastCalculatedBounds = displayObject._bounds.getRectangle(optionalRect);

Do know that usage of getLocalBounds can corrupt the _bounds of children (the whole subtree, actually). This is a known issue that has not been solved. See [getLocalBounds]PIXI.DisplayObject#getLocalBounds for more details.

getBounds should be called with skipUpdate equal to true in a render() call. This is because the transforms are guaranteed to be update-to-date. In fact, recalculating inside a render() call may cause corruption in certain cases.

Parameters

NameTypeDescription
skipUpdate?booleanSetting to true will stop the transforms of the scene graph from being updated. This means the calculation returned MAY be out of date BUT will give you a nice performance boost.
rect?RectangleOptional rectangle to store the result of the bounds calculation.

Returns

Rectangle

  • The minimum axis-aligned rectangle in world space that fits around this object.

Inherited from

ObjectContainer.getBounds

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:371


getChildAt

getChildAt(index): DisplayObject

Returns the child at the specified index

Parameters

NameTypeDescription
indexnumberThe index to get the child at

Returns

DisplayObject

  • The child at the given index, if any.

Inherited from

ObjectContainer.getChildAt

Defined in

node_modules/@pixi/display/lib/Container.d.ts:123


getChildByName

getChildByName<T>(name, deep?): null | T

Type parameters

NameType
Textends DisplayObject<T> = DisplayObject

Parameters

NameType
namestring
deep?boolean

Returns

null | T

Inherited from

ObjectContainer.getChildByName

Defined in

node_modules/@pixi/mixin-get-child-by-name/global.d.ts:10


getChildIndex

getChildIndex(child): number

Returns the index position of a child DisplayObject instance

Parameters

NameTypeDescription
childDisplayObjectThe DisplayObject instance to identify

Returns

number

  • The index position of the child display object to identify

Inherited from

ObjectContainer.getChildIndex

Defined in

node_modules/@pixi/display/lib/Container.d.ts:111


getGlobalPosition

getGlobalPosition(point?, skipUpdate?): Point

Parameters

NameType
point?Point
skipUpdate?boolean

Returns

Point

Inherited from

ObjectContainer.getGlobalPosition

Defined in

node_modules/@pixi/mixin-get-global-position/global.d.ts:5


getLocalBounds

getLocalBounds(rect?, skipChildrenUpdate?): Rectangle

Retrieves the local bounds of the displayObject as a rectangle object.

Calling getLocalBounds may invalidate the _bounds of the whole subtree below. If using it inside a render() call, it is advised to call getBounds() immediately after to recalculate the world bounds of the subtree.

Parameters

NameTypeDescription
rect?RectangleOptional rectangle to store the result of the bounds calculation.
skipChildrenUpdate?booleanSetting to true will stop re-calculation of children transforms, it was default behaviour of pixi 4.0-5.2 and caused many problems to users.

Returns

Rectangle

  • The rectangular bounding area.

Inherited from

ObjectContainer.getLocalBounds

Defined in

node_modules/@pixi/display/lib/Container.d.ts:164


init

init(options): Promise<Sprite>

Parameters

NameType
optionsSpriteInitOptions

Returns

Promise<Sprite>

Defined in

src/object/sprite/index.ts:10


listenerCount

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

NameType
eventkeyof DisplayObjectEvents

Returns

number

Inherited from

ObjectContainer.listenerCount

Defined in

node_modules/eventemitter3/index.d.ts:27


listeners

listeners<T>(event): (...args: ArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]) => void[]

Return the listeners registered for a given event.

Type parameters

NameType
Textends keyof DisplayObjectEvents

Parameters

NameType
eventT

Returns

(...args: ArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]) => void[]

Inherited from

ObjectContainer.listeners

Defined in

node_modules/eventemitter3/index.d.ts:20


off

off<T>(event, fn?, context?, once?): Sprite

Type parameters

NameType
Textends keyof DisplayObjectEvents

Parameters

NameType
eventT
fn?(...args: ArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]) => void
context?any
once?boolean

Returns

Sprite

Inherited from

ObjectContainer.off

Defined in

node_modules/eventemitter3/index.d.ts:69


on

on<T>(event, fn, context?): Sprite

Add a listener for a given event.

Type parameters

NameType
Textends keyof DisplayObjectEvents

Parameters

NameType
eventT
fn(...args: ArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]) => void
context?any

Returns

Sprite

Inherited from

ObjectContainer.on

Defined in

node_modules/eventemitter3/index.d.ts:40


onChildrenChange

Protected onChildrenChange(_length?): void

Overridable method that can be used by Container subclasses whenever the children array is modified.

Parameters

NameType
_length?number

Returns

void

Inherited from

ObjectContainer.onChildrenChange

Defined in

node_modules/@pixi/display/lib/Container.d.ts:83


once

once<T>(event, fn, context?): Sprite

Add a one-time listener for a given event.

Type parameters

NameType
Textends keyof DisplayObjectEvents

Parameters

NameType
eventT
fn(...args: ArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]) => void
context?any

Returns

Sprite

Inherited from

ObjectContainer.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeAllListeners

removeAllListeners(event?): Sprite

Remove all listeners, or those of the specified event.

Parameters

NameType
event?keyof DisplayObjectEvents

Returns

Sprite

Inherited from

ObjectContainer.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


removeChild

removeChild<U>(...children): U[0]

Removes one or more children from the container.

Type parameters

NameType
Uextends DisplayObject[]

Parameters

NameTypeDescription
...childrenUThe DisplayObject(s) to remove

Returns

U[0]

The first child that was removed.

Inherited from

ObjectContainer.removeChild

Defined in

node_modules/@pixi/display/lib/Container.d.ts:129


removeChildAt

removeChildAt(index): DisplayObject

Removes a child from the specified index position.

Parameters

NameTypeDescription
indexnumberThe index to get the child from

Returns

DisplayObject

The child that was removed.

Inherited from

ObjectContainer.removeChildAt

Defined in

node_modules/@pixi/display/lib/Container.d.ts:135


removeChildren

removeChildren(beginIndex?, endIndex?): DisplayObject[]

Removes all children from this container that are within the begin and end indexes.

Parameters

NameTypeDescription
beginIndex?numberThe beginning position.
endIndex?numberThe ending position. Default value is size of the container.

Returns

DisplayObject[]

  • List of removed children

Inherited from

ObjectContainer.removeChildren

Defined in

node_modules/@pixi/display/lib/Container.d.ts:142


removeEventListener

removeEventListener<K>(type, listener, options?): void

Type parameters

NameType
Kextends keyof FederatedEventMap | keyof GlobalFederatedEventMap

Parameters

NameType
typeK
listener(e: AllFederatedEventMap[K]) => any
options?RemoveListenerOptions

Returns

void

Inherited from

ObjectContainer.removeEventListener

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:118

removeEventListener(type, listener, options?): void

Parameters

NameType
typestring
listenerEventListenerOrEventListenerObject
options?RemoveListenerOptions

Returns

void

Inherited from

ObjectContainer.removeEventListener

Defined in

node_modules/@pixi/events/lib/FederatedEventTarget.d.ts:119


removeFromParent

removeFromParent(): void

Remove the DisplayObject from its parent Container. If the DisplayObject has no parent, do nothing.

Returns

void

Inherited from

ObjectContainer.removeFromParent

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:404


removeListener

removeListener<T>(event, fn?, context?, once?): Sprite

Remove the listeners of a given event.

Type parameters

NameType
Textends keyof DisplayObjectEvents

Parameters

NameType
eventT
fn?(...args: ArgumentMap<DisplayObjectEvents>[Extract<T, keyof DisplayObjectEvents>]) => void
context?any
once?boolean

Returns

Sprite

Inherited from

ObjectContainer.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


render

render(renderer): void

Renders the object using the WebGL renderer.

The [_render]PIXI.Container#_render method is be overriden for rendering the contents of the container itself. This render method will invoke it, and also invoke the render methods of all children afterward.

If renderable or visible is false or if worldAlpha is not positive or if cullable is true and the bounds of this object are out of frame, this implementation will entirely skip rendering. See PIXI.DisplayObject for choosing between renderable or visible. Generally, setting alpha to zero is not recommended for purely skipping rendering.

When your scene becomes large (especially when it is larger than can be viewed in a single screen), it is advised to employ culling to automatically skip rendering objects outside of the current screen. See [cullable]PIXI.DisplayObject#cullable and [cullArea]PIXI.DisplayObject#cullArea. Other culling methods might be better suited for a large number static objects; see [@pixi-essentials/cull]https://www.npmjs.com/package/@pixi-essentials/cull and [pixi-cull]https://www.npmjs.com/package/pixi-cull.

The [renderAdvanced]PIXI.Container#renderAdvanced method is internally used when when masking or filtering is applied on a container. This does, however, break batching and can affect performance when masking and filtering is applied extensively throughout the scene graph.

Parameters

NameTypeDescription
rendererRendererThe renderer

Returns

void

Inherited from

ObjectContainer.render

Defined in

node_modules/@pixi/display/lib/Container.d.ts:201


renderAdvanced

Protected renderAdvanced(renderer): void

Render the object using the WebGL renderer and advanced features.

Parameters

NameTypeDescription
rendererRendererThe renderer

Returns

void

Inherited from

ObjectContainer.renderAdvanced

Defined in

node_modules/@pixi/display/lib/Container.d.ts:206


setChildIndex

setChildIndex(child, index): void

Changes the position of an existing child in the display object container

Parameters

NameTypeDescription
childDisplayObjectThe child DisplayObject instance for which you want to change the index number
indexnumberThe resulting index number for the child display object

Returns

void

Inherited from

ObjectContainer.setChildIndex

Defined in

node_modules/@pixi/display/lib/Container.d.ts:117


setParent

setParent(container): Container<DisplayObject>

Set the parent Container of this DisplayObject.

Parameters

NameTypeDescription
containerContainer<DisplayObject>The Container to add this DisplayObject to.

Returns

Container<DisplayObject>

  • The Container that this DisplayObject was added to.

Inherited from

ObjectContainer.setParent

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:402


setTransform

setTransform(x?, y?, scaleX?, scaleY?, rotation?, skewX?, skewY?, pivotX?, pivotY?): Sprite

Convenience function to set the position, scale, skew and pivot at once.

Parameters

NameTypeDescription
x?numberThe X position
y?numberThe Y position
scaleX?numberThe X scale value
scaleY?numberThe Y scale value
rotation?numberThe rotation
skewX?numberThe X skew value
skewY?numberThe Y skew value
pivotX?numberThe X pivot value
pivotY?numberThe Y pivot value

Returns

Sprite

  • The DisplayObject instance

Inherited from

ObjectContainer.setTransform

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:418


sortChildren

sortChildren(): void

Sorts children by zIndex. Previous order is maintained for 2 children with the same zIndex.

Returns

void

Inherited from

ObjectContainer.sortChildren

Defined in

node_modules/@pixi/display/lib/Container.d.ts:144


swapChildren

swapChildren(child, child2): void

Swaps the position of 2 Display Objects within this container.

Parameters

NameTypeDescription
childDisplayObjectFirst display object to swap
child2DisplayObjectSecond display object to swap

Returns

void

Inherited from

ObjectContainer.swapChildren

Defined in

node_modules/@pixi/display/lib/Container.d.ts:105


toGlobal

toGlobal<P>(position, point?, skipUpdate?): P

Calculates the global position of the display object.

Type parameters

NameType
Pextends IPointData = Point

Parameters

NameTypeDescription
positionIPointDataThe world origin to calculate from.
point?PA Point object in which to store the value, optional (otherwise will create a new Point).
skipUpdate?booleanShould we skip the update transform.

Returns

P

  • A point object representing the position of this object.

Inherited from

ObjectContainer.toGlobal

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:386


toLocal

toLocal<P>(position, from?, point?, skipUpdate?): P

Calculates the local position of the display object relative to another point.

Type parameters

NameType
Pextends IPointData = Point

Parameters

NameTypeDescription
positionIPointDataThe world origin to calculate from.
from?DisplayObjectThe DisplayObject to calculate the global position from.
point?PA Point object in which to store the value, optional (otherwise will create a new Point).
skipUpdate?booleanShould we skip the update transform

Returns

P

  • A point object representing the position of this object

Inherited from

ObjectContainer.toLocal

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:396


updateTransform

updateTransform(): void

Updates the transform on all children of this container for rendering.

Returns

void

Inherited from

ObjectContainer.updateTransform

Defined in

node_modules/@pixi/display/lib/Container.d.ts:146


mixin

Static mixin(source): void

Mixes all enumerable properties and methods from a source object to DisplayObject.

Parameters

NameTypeDescription
sourceDict<any>The source of properties and methods to mix in.

Returns

void

Inherited from

ObjectContainer.mixin

Defined in

node_modules/@pixi/display/lib/DisplayObject.d.ts:303