Class: Spine
Defined in: src/components/Spine.ts:57
Spine component for Pixi.js, used to display Spine components.
Example
import { Assets, canvas } from "@drincs/pixi-vn";
import { Spine } from "@drincs/pixi-vn-spine";
await Assets.load([
{
alias: "spineSkeleton",
src: "https://raw.githubusercontent.com/pixijs/spine-v8/main/examples/assets/spineboy-pro.skel",
},
{
alias: "spineAtlas",
src: "https://raw.githubusercontent.com/pixijs/spine-v8/main/examples/assets/spineboy-pma.atlas",
},
]);
const spine = new Spine({ atlas: "spineAtlas", skeleton: "spineSkeleton" });
spine.x = canvas.width / 2;
spine.y = canvas.height;
canvas.add("spine", spine);Extends
Spine
Implements
CanvasBaseItem<SpineMemory>AnchorExtensionListenerExtensionAdditionalPositionsExtension
Constructors
Constructor
> new Spine(options): Spine
Defined in: src/components/Spine.ts:69
Parameters
options
Options used to configure the Spine skeleton (skeleton/atlas aliases, scale, dark tint, auto update, initial skin, initial animation) plus the standard CanvasBaseItem container options (anchor, align, percentagePosition, etc.).
Returns
Spine
Overrides
CoreSpine.constructor
Properties
__devtoolIgnore?
> optional __devtoolIgnore?: boolean
Defined in: node_modules/@pixi/devtools/global.d.ts:35
Inherited from
CoreSpine.__devtoolIgnore
__devtoolIgnoreChildren?
> optional __devtoolIgnoreChildren?: string
Defined in: node_modules/@pixi/devtools/global.d.ts:36
Inherited from
CoreSpine.__devtoolIgnoreChildren
__devtoolLocked?
> optional __devtoolLocked?: boolean
Defined in: node_modules/@pixi/devtools/global.d.ts:37
Inherited from
CoreSpine.__devtoolLocked
_bounds
> protected _bounds: Bounds
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:59
Inherited from
CoreSpine._bounds
_boundsDirty
> protected _boundsDirty: boolean
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:60
Inherited from
CoreSpine._boundsDirty
_cx
> _cx: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:751
Internal
The X-coordinate value of the normalized local X axis, the first column of the local transformation matrix without a scale.
Inherited from
CoreSpine._cx
_cy
> _cy: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:763
Internal
The X-coordinate value of the normalized local Y axis, the second column of the local transformation matrix without a scale.
Inherited from
CoreSpine._cy
_didSpineUpdate
> _didSpineUpdate: boolean
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:174
Inherited from
CoreSpine._didSpineUpdate
_gcData?
> optional _gcData?: GCData
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:54
Internal
Inherited from
CoreSpine._gcData
_gcLastUsed
> _gcLastUsed: number
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:58
Internal
Inherited from
CoreSpine._gcLastUsed
_gpuData
> _gpuData: Record<number, GPU_DATA>
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:52
Internal
Inherited from
CoreSpine._gpuData
_lastUsed
> _lastUsed: number
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:50
Internal
Inherited from
CoreSpine._lastUsed
_pivot
> _pivot: ObservablePoint
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:734
Internal
The pivot point of the container that it rotates around.
Inherited from
CoreSpine._pivot
_position
> _position: ObservablePoint
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:724
Internal
The coordinate of the object relative to the local coordinates of the parent.
Inherited from
CoreSpine._position
_roundPixels
> _roundPixels: 0 | 1
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:48
Internal
Inherited from
CoreSpine._roundPixels
_scale
> _scale: ObservablePoint
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:729
Internal
The scale factor of the object.
Inherited from
CoreSpine._scale
_skew
> _skew: ObservablePoint
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:745
Internal
The skew amount, on the x and y axis.
Inherited from
CoreSpine._skew
_slotsObject
> readonly _slotsObject: Record<string, SpineSlotObject | null>
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:184
Inherited from
CoreSpine._slotsObject
_sx
> _sx: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:757
Internal
The Y-coordinate value of the normalized local X axis, the first column of the local transformation matrix without a scale.
Inherited from
CoreSpine._sx
_sy
> _sy: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:769
Internal
The Y-coordinate value of the normalized local Y axis, the second column of the local transformation matrix without a scale.
Inherited from
CoreSpine._sy
_zIndex
> _zIndex: number
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts:60
Internal
Inherited from
CoreSpine._zIndex
accessible?
> optional accessible?: boolean
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:31
Flag for if the object is accessible. If true AccessibilityManager will overlay a shadow div with attributes set
Default
falseExample
const container = new Container();
container.accessible = true;Inherited from
CoreSpine.accessible
accessibleChildren?
> optional accessibleChildren?: boolean
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:126
Setting to false will prevent any children inside this container to be accessible. Defaults to true.
Default
trueExample
const container = new Container();
container.accessible = true;
container.accessibleChildren = false; // This will prevent any children from being accessible
const sprite = new Sprite(texture);
sprite.accessible = true; // This will not work since accessibleChildren is falseInherited from
CoreSpine.accessibleChildren
accessibleHint?
> optional accessibleHint?: string | null
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:56
Sets the aria-label attribute of the shadow div
Default
nullAdvanced
Example
const container = new Container();
container.accessible = true;
container.accessibleHint = 'This is a container';Inherited from
CoreSpine.accessibleHint
accessiblePointerEvents?
> optional accessiblePointerEvents?: PointerEvents
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:100
Specify the pointer-events the accessible div will use Defaults to auto.
Default
'auto'Advanced
Example
const container = new Container();
container.accessible = true;
container.accessiblePointerEvents = 'none'; // or 'auto', 'visiblePainted', etc.Inherited from
CoreSpine.accessiblePointerEvents
accessibleText?
> optional accessibleText?: string | null
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:111
Sets the text content of the shadow
Default
nullExample
const container = new Container();
container.accessible = true;
container.accessibleText = 'This is a container';Inherited from
CoreSpine.accessibleText
accessibleTitle?
> optional accessibleTitle?: string | null
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:44
Sets the title attribute of the shadow div If accessibleTitle AND accessibleHint has not been this will default to 'container [tabIndex]'
Default
nullExample
const container = new Container();
container.accessible = true;
container.accessibleTitle = 'My Container';Inherited from
CoreSpine.accessibleTitle
accessibleType?
> optional accessibleType?: keyof HTMLElementTagNameMap
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:86
Specify the type of div the accessible layer is. Screen readers treat the element differently depending on this type. Defaults to button.
Default
'button'Advanced
Example
const container = new Container();
container.accessible = true;
container.accessibleType = 'button'; // or 'link', 'checkbox', etc.Inherited from
CoreSpine.accessibleType
afterUpdateWorldTransforms
> afterUpdateWorldTransforms: (object) => void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:176
Parameters
object
Spine
Returns
void
Inherited from
CoreSpine.afterUpdateWorldTransforms
allowChildren
> allowChildren: boolean
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:46
Internal
Inherited from
CoreSpine.allowChildren
atlasAlias
> readonly atlasAlias: string
Defined in: src/components/Spine.ts:118
The asset alias of the atlas this component was created with.
autoGarbageCollect
> autoGarbageCollect: boolean
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:56
If set to true, the resource will be garbage collected automatically when it is not used.
Inherited from
CoreSpine.autoGarbageCollect
beforeUpdateWorldTransforms
> beforeUpdateWorldTransforms: (object) => void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:175
Parameters
object
Spine
Returns
void
Inherited from
CoreSpine.beforeUpdateWorldTransforms
boundsArea
> boundsArea: Rectangle
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:815
An optional bounds area for this container. Setting this rectangle will stop the renderer from recursively measuring the bounds of each children and instead use this single boundArea.
> [!IMPORTANT] This is great for optimisation! If for example you have a > 1000 spinning particles and you know they all sit within a specific bounds, > then setting it will mean the renderer will not need to measure the > 1000 children to find the bounds. Instead it will just use the bounds you set.
Example
const container = new Container();
container.boundsArea = new Rectangle(0, 0, 500, 500);Inherited from
CoreSpine.boundsArea
buildId
> buildId: number
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:172
Inherited from
CoreSpine.buildId
cacheAsBitmap
> cacheAsBitmap: boolean
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/cacheAsTextureMixin.d.ts:61
Legacy property for backwards compatibility with PixiJS v7 and below.
Use cacheAsTexture instead.
Deprecated
since 8.0.0
Inherited from
CoreSpine.cacheAsBitmap
cacheAsTexture
> cacheAsTexture: (val) => void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/cacheAsTextureMixin.d.ts:45
Caches this container as a texture. This allows the container to be rendered as a single texture, which can improve performance for complex static containers.
Parameters
val
boolean | CacheAsTextureOptions
If true, enables caching with default options. If false, disables caching. Can also pass options object to configure caching behavior.
Returns
void
Example
// Basic caching
container.cacheAsTexture(true);
// With custom options
container.cacheAsTexture({
resolution: 2,
antialias: true,
});
// Disable caching
container.cacheAsTexture(false);
// Cache a complex UI
const ui = new Container();
// Add multiple children...
ui.cacheAsTexture(true);
ui.updateCacheTexture(); // Update if contents changeSee
- Container#updateCacheTexture For updating cached content
- Container#isCachedAsTexture For checking cache state
Inherited from
CoreSpine.cacheAsTexture
canBundle
> readonly canBundle: true = true
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:44
Internal
Inherited from
CoreSpine.canBundle
children
> readonly children: ContainerChild[]
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:639
The array of children of this container. Each child must be a Container or extend from it.
The array is read-only, but its contents can be modified using Container methods.
Example
// Access children
const firstChild = container.children[0];
const lastChild = container.children[container.children.length - 1];See
- Container#addChild For adding children
- Container#removeChild For removing children
Inherited from
CoreSpine.children
cullable?
> optional cullable?: boolean
Defined in: node_modules/pixi.js/lib/culling/cullingMixin.d.ts:69
Controls whether this object should be culled when out of view. When true, the object will not be rendered if its bounds are outside the visible area.
Example
const sprite = new Sprite(texture);
// Enable culling
sprite.cullable = true;
// Force object to always render
sprite.cullable = false;Remarks
- Does not affect transform updates
- Applies to this object only
- Children follow their own cullable setting
Default
falseInherited from
CoreSpine.cullable
cullableChildren?
> optional cullableChildren?: boolean
Defined in: node_modules/pixi.js/lib/culling/cullingMixin.d.ts:92
Controls whether children of this container can be culled. When false, skips recursive culling checks for better performance.
Example
const container = new Container();
// Enable container culling
container.cullable = true;
// Disable child culling for performance
container.cullableChildren = false;
// Children will always render if container is visible
container.addChild(sprite1, sprite2, sprite3);Remarks
- Improves performance for static scenes
- Useful when children are always within container bounds
- Parent culling still applies
Default
trueInherited from
CoreSpine.cullableChildren
cullArea?
> optional cullArea?: Rectangle
Defined in: node_modules/pixi.js/lib/culling/cullingMixin.d.ts:49
Custom shape used for culling calculations instead of object bounds. Defined in local space coordinates relative to the object. > [!NOTE] > Setting this to a custom Rectangle allows you to define a specific area for culling, > which can improve performance by avoiding expensive bounds calculations.
Example
const container = new Container();
// Define custom culling boundary
container.cullArea = new Rectangle(0, 0, 800, 600);
// Reset to use object bounds
container.cullArea = null;Remarks
- Improves performance by avoiding bounds calculations
- Useful for containers with many children
- Set to null to use object bounds
Default
nullInherited from
CoreSpine.cullArea
cursor?
> optional cursor?: Cursor | string & object
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:187
The cursor style to display when the mouse pointer is hovering over the object. Accepts any valid CSS cursor value or custom cursor URL.
Example
// Common cursor types
sprite.cursor = 'pointer'; // Hand cursor for clickable elements
sprite.cursor = 'grab'; // Grab cursor for draggable elements
sprite.cursor = 'crosshair'; // Precise cursor for selection
sprite.cursor = 'not-allowed'; // Indicate disabled state
// Direction cursors
sprite.cursor = 'n-resize'; // North resize
sprite.cursor = 'ew-resize'; // East-west resize
sprite.cursor = 'nesw-resize'; // Northeast-southwest resize
// Custom cursor with fallback
sprite.cursor = 'url("custom.png"), auto';
sprite.cursor = 'url("cursor.cur") 2 2, pointer'; // With hotspot offsetDefault
undefinedSee
- EventSystem.cursorStyles For setting global cursor styles
- https://developer.mozilla.org/en-US/docs/Web/CSS/cursor MDN Cursor Documentation
Inherited from
CoreSpine.cursor
darkTintCore
> readonly darkTintCore: boolean | undefined
Defined in: src/components/Spine.ts:124
Whether the dark tint renderer is used for this skeleton. If true, uses the dark tint renderer; if
false, uses the default pixi renderer; if undefined, the dark tint renderer is used only when at
least one slot has tint black.
depthOfChildModified
> depthOfChildModified: () => void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts:74
Internal
Returns
void
Inherited from
CoreSpine.depthOfChildModified
destroyed
> destroyed: boolean
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:719
Whether this object has been destroyed. If true, the object should no longer be used. After an object is destroyed, all of its functionality is disabled and references are removed.
Example
// Cleanup with destroy
sprite.destroy();
console.log(sprite.destroyed); // trueDefault
falseSee
Container#destroy For destroying objects
Inherited from
CoreSpine.destroyed
effects?
> optional effects?: Effect[]
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:183
todo Needs docs
Advanced
Inherited from
CoreSpine.effects
eventMode?
> optional eventMode?: EventMode
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:225
Enable interaction events for the Container. Touch, pointer and mouse events are supported.
Example
const sprite = new Sprite(texture);
// Enable standard interaction (like buttons)
sprite.eventMode = 'static';
sprite.on('pointerdown', () => console.log('clicked!'));
// Enable for moving objects
sprite.eventMode = 'dynamic';
sprite.on('pointermove', () => updatePosition());
// Disable all interaction
sprite.eventMode = 'none';
// Only allow child interactions
sprite.eventMode = 'passive';Available modes:
'none': Ignores all interaction events, even on its children. Best for pure visuals.'passive': (default) Does not emit events and ignores hit testing on itself and non-interactive children. Interactive children will still emit events.'auto': Does not emit events but is hit tested if parent is interactive. Same asinteractive = falsein v7.'static': Emit events and is hit tested. Same asinteractive = truein v7. Best for buttons/UI.'dynamic': Like static but also receives synthetic events when pointer is idle. Best for moving objects.
Performance tips:
- Use
'none'for pure visual elements - Use
'passive'for containers with some interactive children - Use
'static'for standard UI elements - Use
'dynamic'only when needed for moving/animated elements
Since
7.2.0
Inherited from
CoreSpine.eventMode
filterArea?
> optional filterArea?: Rectangle
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:178
The area the filter is applied to. This is used as an optimization to define a specific region for filter effects instead of calculating the display object bounds each frame.
> [!NOTE] > Setting this to a custom Rectangle allows you to define a specific area for filter effects, > which can improve performance by avoiding expensive bounds calculations.
Example
// Set specific filter area
container.filterArea = new Rectangle(0, 0, 100, 100);
// Optimize filter region
const screen = app.screen;
container.filterArea = new Rectangle(
screen.x,
screen.y,
screen.width,
screen.height
);See
- Container#filters For applying filters
- Rectangle For area definition
Inherited from
CoreSpine.filterArea
globalDisplayStatus
> globalDisplayStatus: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:798
Internal
Inherited from
CoreSpine.globalDisplayStatus
groupAlpha
> groupAlpha: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:780
Internal
Inherited from
CoreSpine.groupAlpha
groupBlendMode
> groupBlendMode: BLEND_MODES
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:788
Internal
Inherited from
CoreSpine.groupBlendMode
groupColor
> groupColor: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:782
Internal
Inherited from
CoreSpine.groupColor
groupColorAlpha
> groupColorAlpha: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:784
Internal
Inherited from
CoreSpine.groupColorAlpha
groupTransform
> readonly groupTransform: Matrix
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:705
The group transform is a transform relative to the render group it belongs too. If this container is render group then this will be an identity matrix. other wise it will be the same as the relativeGroupTransform. Use this value when actually rendering things to the screen
Advanced
Inherited from
CoreSpine.groupTransform
hitArea?
> optional hitArea?: IHitArea | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:297
Defines a custom hit area for pointer interaction testing. When set, this shape will be used for hit testing instead of the container's standard bounds.
Example
import { Rectangle, Circle, Sprite } from 'pixi.js';
// Rectangular hit area
const button = new Sprite(texture);
button.eventMode = 'static';
button.hitArea = new Rectangle(0, 0, 100, 50);
// Circular hit area
const icon = new Sprite(texture);
icon.eventMode = 'static';
icon.hitArea = new Circle(32, 32, 32);
// Custom hit area with polygon
const custom = new Sprite(texture);
custom.eventMode = 'static';
custom.hitArea = new Polygon([0,0, 100,0, 100,100, 0,100]);
// Custom hit testing logic
sprite.hitArea = {
contains(x: number, y: number) {
// Custom collision detection
return x >= 0 && x <= width && y >= 0 && y <= height;
}
};Remarks
- Takes precedence over the container's bounds for hit testing
- Can improve performance by simplifying collision checks
- Useful for irregular shapes or precise click areas
Inherited from
CoreSpine.hitArea
interactive?
> optional interactive?: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:238
Whether this object should fire UI events. This is an alias for eventMode set to 'static' or 'passive'.
Setting this to true will enable interaction events like pointerdown, click, etc.
Setting it to false will disable all interaction events on this object.
See
Example
// Enable interaction events
sprite.interactive = true; // Sets eventMode = 'static'
sprite.interactive = false; // Sets eventMode = 'passive'Inherited from
CoreSpine.interactive
interactiveChildren?
> optional interactiveChildren?: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:261
Controls whether children of this container can receive pointer events.
Setting this to false allows PixiJS to skip hit testing on all children, improving performance for containers with many non-interactive children.
Default
trueExample
// Container with many visual-only children
const container = new Container();
container.interactiveChildren = false; // Skip hit testing children
// Menu with interactive buttons
const menu = new Container();
menu.interactiveChildren = true; // Test all children
menu.addChild(button1, button2, button3);
// Performance optimization
background.interactiveChildren = false;
foreground.interactiveChildren = true;Inherited from
CoreSpine.interactiveChildren
isCachedAsTexture
> readonly isCachedAsTexture: boolean
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/cacheAsTextureMixin.d.ts:75
Whether this container is currently cached as a texture.
Example
// Check cache state
if (container.isCachedAsTexture) {
console.log('Container is cached');
}See
- Container#cacheAsTexture For enabling caching
- Container#updateCacheTexture For updating cache
Inherited from
CoreSpine.isCachedAsTexture
isInteractive
> isInteractive: () => boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:1040
Determines if the container is interactive or not
Returns
boolean
Whether the container is interactive or not
Since
7.2.0
Example
import { Sprite } from 'pixi.js';
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
sprite.isInteractive(); // true
sprite.eventMode = 'dynamic';
sprite.isInteractive(); // true
sprite.eventMode = 'none';
sprite.isInteractive(); // false
sprite.eventMode = 'passive';
sprite.isInteractive(); // false
sprite.eventMode = 'auto';
sprite.isInteractive(); // falseInherited from
CoreSpine.isInteractive
label
> label: string
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.d.ts:8
The instance label of the object.
Default
nullInherited from
CoreSpine.label
layerParentId
> layerParentId: string
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:829
Internal
Inherited from
CoreSpine.layerParentId
localAlpha
> localAlpha: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:778
Internal
Inherited from
CoreSpine.localAlpha
localBlendMode
> localBlendMode: BLEND_MODES
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:786
Internal
Inherited from
CoreSpine.localBlendMode
localColor
> localColor: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:776
Internal
Inherited from
CoreSpine.localColor
localDisplayStatus
> localDisplayStatus: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:796
Internal
This property holds three bits: culled, visible, renderable the third bit represents culling (0 = culled, 1 = not culled) 0b100 the second bit represents visibility (0 = not visible, 1 = visible) 0b010 the first bit represents renderable (0 = not renderable, 1 = renderable) 0b001
Inherited from
CoreSpine.localDisplayStatus
localTransform
> readonly localTransform: Matrix
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:688
Current transform of the object based on local factors: position, scale, other stuff. This matrix represents the local transformation without any parent influence.
Example
// Basic transform access
const localMatrix = sprite.localTransform;
console.log(localMatrix.toString());See
- Container#worldTransform For global transform
- Container#groupTransform For render group transform
Inherited from
CoreSpine.localTransform
mask
> mask: Mask
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:254
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.
> [!IMPORTANT] In PixiJS a regular mask must be a Graphics or a Sprite object.
> This allows for much faster masking in canvas as it uses shape clipping.
> 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.
Sprite masks read the red channel by default. Use Container#setMask with channel: 'alpha'
to read the alpha channel instead. See MaskOptions#channel for details.
Example
// Apply mask to sprite
const sprite = new Sprite(texture);
sprite.mask = graphics;
// Remove mask
sprite.mask = null;See
- Graphics For creating mask shapes
- Sprite For texture-based masks
- Container#setMask For advanced mask options including channel selection
Inherited from
CoreSpine.mask
name
> name: string
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.d.ts:24
The instance name of the object.
Deprecated
since 8.0.0
See
Container#label
Default
nullInherited from
CoreSpine.name
onclick?
> optional onclick?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:317
Property-based event handler for the click event.
Fired when a pointer device (mouse, touch, etc.) completes a click action.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('click', (event) => {
console.log('Sprite clicked at:', event.global.x, event.global.y);
});
// Using property-based handler
sprite.onclick = (event) => {
console.log('Clicked at:', event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.onclick
onEventsHandlers
> readonly onEventsHandlers: OnEventsHandlers = {}
Defined in: src/components/Spine.ts:459
The registered event handlers for this component, used by setMemory/memory to persist and restore listeners added via on.
Implementation of
ListenerExtension.onEventsHandlers
onglobalmousemove?
> optional onglobalmousemove?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:430
Property-based event handler for the globalmousemove event.
Fired when the mouse moves anywhere, regardless of whether the pointer is over this object.
The object must have eventMode set to 'static' or 'dynamic' to receive this event.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('globalmousemove', (event) => {
// Move sprite to mouse position
sprite.position.copyFrom(event.global);
});
// Using property-based handler
sprite.onglobalmousemove = (event) => {
// Move sprite to mouse position
sprite.position.copyFrom(event.global);
};Default
nullRemarks
- Fires even when the mouse is outside the object's bounds
- Useful for drag operations or global mouse tracking
- Must have
eventModeset appropriately to receive events - Part of the global move events family along with
globalpointermoveandglobaltouchmove
Inherited from
CoreSpine.onglobalmousemove
onglobalpointermove?
> optional onglobalpointermove?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:637
Property-based event handler for the globalpointermove event.
Fired when the pointer moves anywhere, regardless of whether the pointer is over this object.
The object must have eventMode set to 'static' or 'dynamic' to receive this event.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('globalpointermove', (event) => {
sprite.position.set(event.global.x, event.global.y);
});
// Using property-based handler
sprite.onglobalpointermove = (event) => {
sprite.position.set(event.global.x, event.global.y);
};Default
nullRemarks
- Fires even when the mouse is outside the object's bounds
- Useful for drag operations or global mouse tracking
- Must have
eventModeset appropriately to receive events - Part of the global move events family along with
globalpointermoveandglobaltouchmove
Inherited from
CoreSpine.onglobalpointermove
onglobaltouchmove?
> optional onglobaltouchmove?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:947
Property-based event handler for the globaltouchmove event.
Fired when a touch interaction moves anywhere, regardless of whether the pointer is over this object.
The object must have eventMode set to 'static' or 'dynamic' to receive this event.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('globaltouchmove', (event) => {
sprite.position.set(event.global.x, event.global.y);
});
// Using property-based handler
sprite.onglobaltouchmove = (event) => {
sprite.position.set(event.global.x, event.global.y);
};Default
nullRemarks
- Fires even when the touch is outside the object's bounds
- Useful for drag operations or global touch tracking
- Must have
eventModeset appropriately to receive events - Part of the global move events family along with
globalpointermoveandglobalmousemove
Inherited from
CoreSpine.onglobaltouchmove
onmousedown?
> optional onmousedown?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:339
Property-based event handler for the mousedown event.
Fired when a mouse button is pressed while the pointer is over the object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mousedown', (event) => {
sprite.alpha = 0.5; // Visual feedback
console.log('Mouse button:', event.button);
});
// Using property-based handler
sprite.onmousedown = (event) => {
sprite.alpha = 0.5; // Visual feedback
console.log('Mouse button:', event.button);
};Default
nullInherited from
CoreSpine.onmousedown
onmouseenter?
> optional onmouseenter?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:359
Property-based event handler for the mouseenter event.
Fired when the mouse pointer enters the bounds of the object. Does not bubble.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mouseenter', (event) => {
sprite.scale.set(1.1);
});
// Using property-based handler
sprite.onmouseenter = (event) => {
sprite.scale.set(1.1);
};Default
nullInherited from
CoreSpine.onmouseenter
onmouseleave?
> optional onmouseleave?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:379
Property-based event handler for the mouseleave event.
Fired when the pointer leaves the bounds of the display object. Does not bubble.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mouseleave', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onmouseleave = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onmouseleave
onmousemove?
> optional onmousemove?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:401
Property-based event handler for the mousemove event.
Fired when the pointer moves while over the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mousemove', (event) => {
// Get coordinates relative to the sprite
console.log('Local:', event.getLocalPosition(sprite));
});
// Using property-based handler
sprite.onmousemove = (event) => {
// Get coordinates relative to the sprite
console.log('Local:', event.getLocalPosition(sprite));
};Default
nullInherited from
CoreSpine.onmousemove
onmouseout?
> optional onmouseout?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:450
Property-based event handler for the mouseout event.
Fired when the pointer moves out of the bounds of the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mouseout', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onmouseout = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onmouseout
onmouseover?
> optional onmouseover?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:470
Property-based event handler for the mouseover event.
Fired when the pointer moves onto the bounds of the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mouseover', (event) => {
sprite.scale.set(1.1);
});
// Using property-based handler
sprite.onmouseover = (event) => {
sprite.scale.set(1.1);
};Default
nullInherited from
CoreSpine.onmouseover
onmouseup?
> optional onmouseup?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:490
Property-based event handler for the mouseup event.
Fired when a mouse button is released over the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mouseup', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onmouseup = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onmouseup
onmouseupoutside?
> optional onmouseupoutside?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:511
Property-based event handler for the mouseupoutside event.
Fired when a mouse button is released outside the display object that initially
registered a mousedown.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('mouseupoutside', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onmouseupoutside = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onmouseupoutside
onpointercancel?
> optional onpointercancel?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:531
Property-based event handler for the pointercancel event.
Fired when a pointer device interaction is canceled or lost.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointercancel', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onpointercancel = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onpointercancel
onpointerdown?
> optional onpointerdown?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:551
Property-based event handler for the pointerdown event.
Fired when a pointer device button (mouse, touch, pen, etc.) is pressed.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointerdown', (event) => {
sprite.position.set(event.global.x, event.global.y);
});
// Using property-based handler
sprite.onpointerdown = (event) => {
sprite.position.set(event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.onpointerdown
onpointerenter?
> optional onpointerenter?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:571
Property-based event handler for the pointerenter event.
Fired when a pointer device enters the bounds of the display object. Does not bubble.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointerenter', (event) => {
sprite.scale.set(1.2);
});
// Using property-based handler
sprite.onpointerenter = (event) => {
sprite.scale.set(1.2);
};Default
nullInherited from
CoreSpine.onpointerenter
onpointerleave?
> optional onpointerleave?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:590
Property-based event handler for the pointerleave event.
Fired when a pointer device leaves the bounds of the display object. Does not bubble.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointerleave', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onpointerleave = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onpointerleave
onpointermove?
> optional onpointermove?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:610
Property-based event handler for the pointermove event.
Fired when a pointer device moves while over the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointermove', (event) => {
sprite.position.set(event.global.x, event.global.y);
});
// Using property-based handler
sprite.onpointermove = (event) => {
sprite.position.set(event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.onpointermove
onpointerout?
> optional onpointerout?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:657
Property-based event handler for the pointerout event.
Fired when the pointer moves out of the bounds of the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointerout', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onpointerout = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onpointerout
onpointerover?
> optional onpointerover?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:677
Property-based event handler for the pointerover event.
Fired when the pointer moves over the bounds of the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointerover', (event) => {
sprite.scale.set(1.2);
});
// Using property-based handler
sprite.onpointerover = (event) => {
sprite.scale.set(1.2);
};Default
nullInherited from
CoreSpine.onpointerover
onpointertap?
> optional onpointertap?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:697
Property-based event handler for the pointertap event.
Fired when a pointer device completes a tap action (e.g., touch or mouse click).
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointertap', (event) => {
console.log('Sprite tapped at:', event.global.x, event.global.y);
});
// Using property-based handler
sprite.onpointertap = (event) => {
console.log('Sprite tapped at:', event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.onpointertap
onpointerup?
> optional onpointerup?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:717
Property-based event handler for the pointerup event.
Fired when a pointer device button (mouse, touch, pen, etc.) is released.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointerup', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onpointerup = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onpointerup
onpointerupoutside?
> optional onpointerupoutside?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:738
Property-based event handler for the pointerupoutside event.
Fired when a pointer device button is released outside the bounds of the display object
that initially registered a pointerdown.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('pointerupoutside', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onpointerupoutside = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onpointerupoutside
onRender
> onRender: ((renderer) => void) | null
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.d.ts:25
This callback is used when the container is rendered. It runs every frame during the render process, making it ideal for per-frame updates and animations.
> [!NOTE] In v7 many users used updateTransform for this, however the way v8 renders objects is different
> and "updateTransform" is no longer called every frame
Example
// Basic rotation animation
const container = new Container();
container.onRender = () => {
container.rotation += 0.01;
};
// Cleanup when done
container.onRender = null; // Removes callbackParam
renderer
The renderer instance
See
Renderer For renderer capabilities
Inherited from
CoreSpine.onRender
onrightclick?
> optional onrightclick?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:758
Property-based event handler for the rightclick event.
Fired when a right-click (context menu) action is performed on the object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('rightclick', (event) => {
console.log('Right-clicked at:', event.global.x, event.global.y);
});
// Using property-based handler
sprite.onrightclick = (event) => {
console.log('Right-clicked at:', event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.onrightclick
onrightdown?
> optional onrightdown?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:778
Property-based event handler for the rightdown event.
Fired when a right mouse button is pressed down over the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('rightdown', (event) => {
sprite.scale.set(0.9);
});
// Using property-based handler
sprite.onrightdown = (event) => {
sprite.scale.set(0.9);
};Default
nullInherited from
CoreSpine.onrightdown
onrightup?
> optional onrightup?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:798
Property-based event handler for the rightup event.
Fired when a right mouse button is released over the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('rightup', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onrightup = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onrightup
onrightupoutside?
> optional onrightupoutside?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:819
Property-based event handler for the rightupoutside event.
Fired when a right mouse button is released outside the bounds of the display object
that initially registered a rightdown.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('rightupoutside', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.onrightupoutside = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.onrightupoutside
ontap?
> optional ontap?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:839
Property-based event handler for the tap event.
Fired when a tap action (touch) is completed on the object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('tap', (event) => {
console.log('Sprite tapped at:', event.global.x, event.global.y);
});
// Using property-based handler
sprite.ontap = (event) => {
console.log('Sprite tapped at:', event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.ontap
ontouchcancel?
> optional ontouchcancel?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:859
Property-based event handler for the touchcancel event.
Fired when a touch interaction is canceled, such as when the touch is interrupted.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('touchcancel', (event) => {
console.log('Touch canceled at:', event.global.x, event.global.y);
});
// Using property-based handler
sprite.ontouchcancel = (event) => {
console.log('Touch canceled at:', event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.ontouchcancel
ontouchend?
> optional ontouchend?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:879
Property-based event handler for the touchend event.
Fired when a touch interaction ends, such as when the finger is lifted from the screen.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('touchend', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.ontouchend = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.ontouchend
ontouchendoutside?
> optional ontouchendoutside?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:900
Property-based event handler for the touchendoutside event.
Fired when a touch interaction ends outside the bounds of the display object
that initially registered a touchstart.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('touchendoutside', (event) => {
sprite.scale.set(1.0);
});
// Using property-based handler
sprite.ontouchendoutside = (event) => {
sprite.scale.set(1.0);
};Default
nullInherited from
CoreSpine.ontouchendoutside
ontouchmove?
> optional ontouchmove?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:920
Property-based event handler for the touchmove event.
Fired when a touch interaction moves while over the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('touchmove', (event) => {
sprite.position.set(event.global.x, event.global.y);
});
// Using property-based handler
sprite.ontouchmove = (event) => {
sprite.position.set(event.global.x, event.global.y);
};Default
nullInherited from
CoreSpine.ontouchmove
ontouchstart?
> optional ontouchstart?: FederatedEventHandler<FederatedPointerEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:967
Property-based event handler for the touchstart event.
Fired when a touch interaction starts, such as when a finger touches the screen.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('touchstart', (event) => {
sprite.scale.set(0.9);
});
// Using property-based handler
sprite.ontouchstart = (event) => {
sprite.scale.set(0.9);
};Default
nullInherited from
CoreSpine.ontouchstart
onwheel?
> optional onwheel?: FederatedEventHandler<FederatedWheelEvent> | null
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:989
Property-based event handler for the wheel event.
Fired when the mouse wheel is scrolled while over the display object.
Example
const sprite = new Sprite(texture);
sprite.eventMode = 'static';
// Using emitter handler
sprite.on('wheel', (event) => {
sprite.scale.x += event.deltaY * 0.01; // Zoom in/out
sprite.scale.y += event.deltaY * 0.01; // Zoom in/out
});
// Using property-based handler
sprite.onwheel = (event) => {
sprite.scale.x += event.deltaY * 0.01; // Zoom in/out
sprite.scale.y += event.deltaY * 0.01; // Zoom in/out
};Default
nullInherited from
CoreSpine.onwheel
parent
> readonly parent: Container<ContainerChild> | null
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:659
The display object container that contains this display object. This represents the parent-child relationship in the display tree.
Example
// Basic parent access
const parent = sprite.parent;
// Walk up the tree
let current = sprite;
while (current.parent) {
console.log('Level up:', current.parent.constructor.name);
current = current.parent;
}See
- Container#addChild For adding to a parent
- Container#removeChild For removing from parent
Inherited from
CoreSpine.parent
parentRenderLayer
> readonly parentRenderLayer: RenderLayer | null
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:672
The RenderLayer this container belongs to, if any. If it belongs to a RenderLayer, it will be rendered from the RenderLayer's position in the scene.
Advanced
Inherited from
CoreSpine.parentRenderLayer
pixivnId
> readonly pixivnId: string = CANVAS_SPINE_ID
Defined in: src/components/Spine.ts:114
Get the id of the canvas element. This variable is used in the system to get the canvas element by id
Implementation of
CanvasBaseItem.pixivnId
relativeGroupTransform
> readonly relativeGroupTransform: Matrix
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:696
The relative group transform is a transform relative to the render group it belongs too. It will include all parent transforms and up to the render group (think of it as kind of like a stage - but the stage can be nested). If this container is is self a render group matrix will be relative to its parent render group
Advanced
Inherited from
CoreSpine.relativeGroupTransform
renderPipeId
> readonly renderPipeId: "spine" = "spine"
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:173
Internal
Inherited from
CoreSpine.renderPipeId
skeleton
> skeleton: Skeleton
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:178
The skeleton for this Spine game object.
Inherited from
CoreSpine.skeleton
skeletonAlias
> readonly skeletonAlias: string
Defined in: src/components/Spine.ts:116
The asset alias of the skeleton this component was created with.
skeletonBounds?
> optional skeletonBounds?: SkeletonBounds
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:181
Inherited from
CoreSpine.skeletonBounds
sortableChildren
> sortableChildren: boolean
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts:48
If set to true, the container will sort its children by zIndex value
when the next render is called, or manually if sortChildren() is called.
This actually changes the order of elements in the array of children, so it will affect the rendering order.
> [!NOTE] 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.
Example
container.sortableChildren = true;Default
falseInherited from
CoreSpine.sortableChildren
sortChildren
> sortChildren: () => void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts:72
Sorts children by zIndex value. Only sorts if container is marked as dirty.
Returns
void
Example
// Basic sorting
particles.zIndex = 2; // Will mark as dirty
container.sortChildren();See
- Container#sortableChildren For enabling automatic sorting
- Container#zIndex For setting child order
Inherited from
CoreSpine.sortChildren
sortDirty
> sortDirty: boolean
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts:32
Internal
Should children be sorted by zIndex at the next render call.
Will get automatically set to true if a new child is added, or if a child's zIndex changes.
Default
false
@internalInherited from
CoreSpine.sortDirty
spineAttachmentsDirty
> spineAttachmentsDirty: boolean
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:187
Inherited from
CoreSpine.spineAttachmentsDirty
spineTexturesDirty
> spineTexturesDirty: boolean
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:188
Inherited from
CoreSpine.spineTexturesDirty
state
> state: AnimationState
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:180
The animation state for this Spine game object.
Inherited from
CoreSpine.state
tabIndex?
> optional tabIndex?: number
Defined in: node_modules/pixi.js/lib/accessibility/accessibilityTarget.d.ts:72
Sets the tabIndex of the shadow div. You can use this to set the order of the elements when using the tab key to navigate.
Default
0Example
const container = new Container();
container.accessible = true;
container.tabIndex = 0;
const sprite = new Sprite(texture);
sprite.accessible = true;
sprite.tabIndex = 1;Inherited from
CoreSpine.tabIndex
uid
> readonly uid: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:610
Internal
unique id for this container
Inherited from
CoreSpine.uid
updateCacheTexture
> updateCacheTexture: () => void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/cacheAsTextureMixin.d.ts:55
Updates the cached texture of this container. This will flag the container's cached texture to be redrawn on the next render.
Returns
void
Example
// Basic update after changes
container.updateCacheTexture();Inherited from
CoreSpine.updateCacheTexture
updateTick
> updateTick: number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:674
Internal
Inherited from
CoreSpine.updateTick
zIndex
> zIndex: number
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.d.ts:24
The zIndex of the container.
Controls the rendering order of children within their parent container.
A higher value will mean it will be moved towards the front of the rendering order.
Example
// Add in any order
container.addChild(character, background, foreground);
// Adjust rendering order
background.zIndex = 0;
character.zIndex = 1;
foreground.zIndex = 2;See
- Container#sortableChildren For enabling sorting
- Container#sortChildren For manual sorting
Default
0Inherited from
CoreSpine.zIndex
prefixed
> static prefixed: string | boolean
Defined in: node_modules/eventemitter3/index.d.ts:9
Inherited from
CoreSpine.prefixed
Accessors
align
Get Signature
> get align(): number | Partial<PointData>
Defined in: src/components/Spine.ts:527
is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas. For example:
- if you set align to 0.5, the element will be in the center of the canvas.
- if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
- if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does not affect the alignment.
Returns
number | Partial<PointData>
Set Signature
> set align(value): void
Defined in: src/components/Spine.ts:515
is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas. For example:
- if you set align to 0.5, the element will be in the center of the canvas.
- if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
- if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does not affect the alignment.
Parameters
value
number | Partial<PointData>
Returns
void
Implementation of
AdditionalPositionsExtension.align
alpha
Get Signature
> get alpha(): number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1246
The opacity of the object relative to its parent's opacity. Value ranges from 0 (fully transparent) to 1 (fully opaque).
Example
// Basic transparency
sprite.alpha = 0.5; // 50% opacity
// Inherited opacity
container.alpha = 0.5;
const child = new Sprite(texture);
child.alpha = 0.5;
container.addChild(child);
// child's effective opacity is 0.25 (0.5 * 0.5)Default
1See
- Container#visible For toggling visibility
- Container#renderable For render control
Returns
number
Set Signature
> set alpha(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1226
Parameters
value
number
Returns
void
Inherited from
CoreSpine.alpha
anchor
Get Signature
> get anchor(): PointData
Defined in: src/components/Spine.ts:487
The anchor sets the origin point of the imageContainer. The default value is taken from the Texture and passed to the constructor.
The default is (0,0), this means the imageContainer's origin is the top left.
Setting the anchor to (0.5,0.5) means the imageContainer's origin is centered.
Setting the anchor to (1,1) would mean the imageContainer's origin point will be the bottom right corner.
If you pass only single parameter, it will set both x and y to the same value as shown in the example below.
Example
import { ImageContainer } from '@drincs/pixi-vn';
const imageContainer = new ImageContainer();
imageContainer.anchor = 0.5;Returns
PointData
Set Signature
> set anchor(value): void
Defined in: src/components/Spine.ts:492
The anchor sets the origin point of the imageContainer. The default value is taken from the Texture and passed to the constructor.
The default is (0,0), this means the imageContainer's origin is the top left.
Setting the anchor to (0.5,0.5) means the imageContainer's origin is centered.
Setting the anchor to (1,1) would mean the imageContainer's origin point will be the bottom right corner.
If you pass only single parameter, it will set both x and y to the same value as shown in the example below.
Example
import { ImageContainer } from '@drincs/pixi-vn';
const imageContainer = new ImageContainer();
imageContainer.anchor = 0.5;Parameters
value
number | PointData
Returns
void
Implementation of
AnchorExtension.anchor
angle
Get Signature
> get angle(): number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1008
The angle of the object in degrees.
> [!NOTE] 'rotation' and 'angle' have the same effect on a display object; > rotation is in radians, angle is in degrees.
Example
// Basic angle rotation
sprite.angle = 45; // 45 degrees
// Rotate around center
sprite.pivot.set(sprite.width / 2, sprite.height / 2);
sprite.angle = 180; // Half rotation
// Rotate around center with origin
sprite.origin.set(sprite.width / 2, sprite.height / 2);
sprite.angle = 180; // Half rotation
// Reset rotation
sprite.angle = 0;Returns
number
Set Signature
> set angle(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1009
Parameters
value
number
Returns
void
Inherited from
CoreSpine.angle
autoUpdate
Get Signature
> get autoUpdate(): boolean
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:201
Returns
boolean
Set Signature
> set autoUpdate(value): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:203
When true, the Spine AnimationState and the Skeleton will be automatically updated using the ticker.
Parameters
value
boolean
Returns
void
Inherited from
CoreSpine.autoUpdate
blendMode
Get Signature
> get blendMode(): BLEND_MODES
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1289
The blend mode to be applied to the sprite. Controls how pixels are blended when rendering.
Setting to 'normal' will reset to default blending.
> [!NOTE] More blend modes are available after importing the pixi.js/advanced-blend-modes sub-export.
Example
// Basic blend modes
sprite.blendMode = 'add'; // Additive blending
sprite.blendMode = 'multiply'; // Multiply colors
sprite.blendMode = 'screen'; // Screen blend
// Reset blend mode
sprite.blendMode = 'normal'; // Normal blendingDefault
'normal'See
- Container#alpha For transparency
- Container#tint For color adjustments
Returns
BLEND_MODES
Set Signature
> set blendMode(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1269
Parameters
value
BLEND_MODES
Returns
void
Inherited from
CoreSpine.blendMode
bounds
Get Signature
> get bounds(): Bounds
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:255
The local bounds of the view in its own coordinate space. Bounds are automatically updated when the view's content changes.
Example
// Get bounds dimensions
const bounds = view.bounds;
console.log(`Width: ${bounds.maxX - bounds.minX}`);
console.log(`Height: ${bounds.maxY - bounds.minY}`);See
Bounds For bounds operations
Returns
Bounds
The rectangular bounds of the view
Inherited from
CoreSpine.bounds
boundsProvider
Get Signature
> get boundsProvider(): SpineBoundsProvider | undefined
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:210
The bounds provider to use. If undefined the bounds will be dynamic, calculated when requested and based on the current frame.
Returns
SpineBoundsProvider | undefined
Set Signature
> set boundsProvider(value): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:211
Parameters
value
SpineBoundsProvider | undefined
Returns
void
Inherited from
CoreSpine.boundsProvider
debug
Get Signature
> get debug(): ISpineDebugRenderer | undefined
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:194
Returns
ISpineDebugRenderer | undefined
Set Signature
> set debug(value): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:198
Pass a SpineDebugRenderer or create your own ISpineDebugRenderer to render bones, meshes, ...
Example
spineGO.debug = new SpineDebugRenderer();Parameters
value
ISpineDebugRenderer | undefined
Returns
void
Inherited from
CoreSpine.debug
filters
Get Signature
> get filters(): readonly Filter[]
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:277
Sets the filters for the displayObject. Filters are visual effects that can be applied to any display object and its children.
> [!IMPORTANT] This is a WebGL/WebGPU only feature and will be ignored by the canvas renderer.
Example
new Container({
filters: [new BlurFilter(2), new ColorMatrixFilter()],
});See
Filter For filter base class
Returns
readonly Filter[]
Set Signature
> set filters(value): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:276
Sets the filters for the displayObject. Filters are visual effects that can be applied to any display object and its children.
> [!IMPORTANT] This is a WebGL/WebGPU only feature and will be ignored by the canvas renderer.
Example
// Add a single filter
sprite.filters = new BlurFilter(2);
// Apply multiple filters
container.filters = [
new BlurFilter(2),
new ColorMatrixFilter(),
];
// Remove filters
sprite.filters = null;See
Filter For filter base class
Parameters
value
Filter | Filter[] | null | undefined
Returns
void
Inherited from
CoreSpine.filters
height
Get Signature
> get height(): number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1117
The height of the Container, > [!NOTE] Changing the height will adjust the scale.y property of the container while maintaining its aspect ratio. > [!NOTE] If you want to set both width and height at the same time, use Container#setSize as it is more optimized by not recalculating the local bounds twice.
Example
// Basic height setting
container.height = 200;
// Optimized height setting
container.setSize(100, 200);Returns
number
Set Signature
> set height(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1118
Parameters
value
number
Returns
void
Inherited from
CoreSpine.height
isRenderable
Get Signature
> get isRenderable(): boolean
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1329
Whether or not the object should be rendered.
Advanced
Returns
boolean
Inherited from
CoreSpine.isRenderable
isRenderGroup
Get Signature
> get isRenderGroup(): boolean
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:894
Returns true if this container is a render group. This means that it will be rendered as a separate pass, with its own set of instructions
Advanced
Returns
boolean
Set Signature
> set isRenderGroup(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:888
Parameters
value
boolean
Returns
void
Inherited from
CoreSpine.isRenderGroup
memory
Get Signature
> get memory(): SpineMemory
Defined in: src/components/Spine.ts:136
This method return the memory of the canvas element.
Throws
when the method is not overridden in the subclass.
Returns
Implementation of
CanvasBaseItem.memory
origin
Get Signature
> get origin(): ObservablePoint
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1087
Experimental
The origin point around which the container rotates and scales without affecting its position. Unlike pivot, changing the origin will not move the container's position.
Example
// Rotate around center point
container.origin.set(container.width / 2, container.height / 2);
container.rotation = Math.PI; // Rotates around center
// Reset origin
container.origin.set(0, 0);Returns
ObservablePoint
Set Signature
> set origin(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1088
Parameters
value
number | PointData
Returns
void
Inherited from
CoreSpine.origin
percentagePosition
Get Signature
> get percentagePosition(): number | Partial<PointData>
Defined in: src/components/Spine.ts:602
is a way to set the position of the element in the canvas calculated in percentage. For example, if you set the PixiContainer.pivot to 0.5, and:
- if you set percentagePosition to 0.5, the element will be in the center of the canvas.
- If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
- If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does affect the percentagePosition.
Returns
number | Partial<PointData>
Set Signature
> set percentagePosition(value): void
Defined in: src/components/Spine.ts:590
is a way to set the position of the element in the canvas calculated in percentage. For example, if you set the PixiContainer.pivot to 0.5, and:
- if you set percentagePosition to 0.5, the element will be in the center of the canvas.
- If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
- If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does affect the percentagePosition.
Parameters
value
number | Partial<PointData>
Returns
void
Implementation of
AdditionalPositionsExtension.percentagePosition
percentageX
Get Signature
> get percentageX(): number
Defined in: src/components/Spine.ts:616
is a way to set the position of the element in the canvas calculated in percentage. For example, if you set the PixiContainer.pivot to 0.5, and:
- if you set percentagePosition to 0.5, the element will be in the center of the canvas.
- If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
- If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does affect the percentagePosition.
Returns
number
Set Signature
> set percentageX(_value): void
Defined in: src/components/Spine.ts:608
is a way to set the position of the element in the canvas calculated in percentage. For example, if you set the PixiContainer.pivot to 0.5, and:
- if you set percentagePosition to 0.5, the element will be in the center of the canvas.
- If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
- If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does affect the percentagePosition.
Parameters
_value
number
Returns
void
Implementation of
AdditionalPositionsExtension.percentageX
percentageY
Get Signature
> get percentageY(): number
Defined in: src/components/Spine.ts:627
is a way to set the position of the element in the canvas calculated in percentage. For example, if you set the PixiContainer.pivot to 0.5, and:
- if you set percentagePosition to 0.5, the element will be in the center of the canvas.
- If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
- If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does affect the percentagePosition.
Returns
number
Set Signature
> set percentageY(_value): void
Defined in: src/components/Spine.ts:619
is a way to set the position of the element in the canvas calculated in percentage. For example, if you set the PixiContainer.pivot to 0.5, and:
- if you set percentagePosition to 0.5, the element will be in the center of the canvas.
- If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
- If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does affect the percentagePosition.
Parameters
_value
number
Returns
void
Implementation of
AdditionalPositionsExtension.percentageY
physicsPositionInheritanceFactorX
Get Signature
> get physicsPositionInheritanceFactorX(): number
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:223
Scales how much horizontal translation of this Pixi container is inherited by skeleton physics constraints.
Returns
number
Inherited from
CoreSpine.physicsPositionInheritanceFactorX
physicsPositionInheritanceFactorY
Get Signature
> get physicsPositionInheritanceFactorY(): number
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:225
Scales how much vertical translation of this Pixi container is inherited by skeleton physics constraints.
Returns
number
Inherited from
CoreSpine.physicsPositionInheritanceFactorY
physicsRotationInheritanceFactor
Get Signature
> get physicsRotationInheritanceFactor(): number
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:237
Scales how much rotation of this Pixi container is inherited by skeleton physics constraints.
The default is 1, which applies container rotation normally. Use 0 to prevent container
rotation from affecting physics constraints.
Returns
number
Set Signature
> set physicsRotationInheritanceFactor(value): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:238
Parameters
value
number
Returns
void
Inherited from
CoreSpine.physicsRotationInheritanceFactor
pivot
Get Signature
> get pivot(): ObservablePoint
Defined in: src/components/Spine.ts:505
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).
Example
// Rotate around center
container.pivot.set(container.width / 2, container.height / 2);
container.rotation = Math.PI; // Rotates around centerSince
4.0.0
Returns
ObservablePoint
Set Signature
> set pivot(value): void
Defined in: src/components/Spine.ts:508
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).
Example
// Rotate around center
container.pivot.set(container.width / 2, container.height / 2);
container.rotation = Math.PI; // Rotates around centerSince
4.0.0
Parameters
value
ObservablePoint
Returns
void
Overrides
CoreSpine.pivot
position
Get Signature
> get position(): ObservablePoint
Defined in: src/components/Spine.ts:701
The coordinate of the object relative to the local coordinates of the parent.
Example
// Basic position setting
container.position.set(100, 200);
container.position.set(100); // Sets both x and y to 100
// Using point data
container.position = { x: 50, y: 75 };Since
4.0.0
Returns
ObservablePoint
Set Signature
> set position(value): void
Defined in: src/components/Spine.ts:704
The coordinate of the object relative to the local coordinates of the parent.
Example
// Basic position setting
container.position.set(100, 200);
container.position.set(100); // Sets both x and y to 100
// Using point data
container.position = { x: 50, y: 75 };Since
4.0.0
Parameters
value
ObservablePoint
Returns
void
Overrides
CoreSpine.position
positionInfo
Get Signature
> get positionInfo(): object
Defined in: src/components/Spine.ts:638
Returns
object
type
> type: "align" | "pixel" | "percentage"
x
> x: number
y
> y: number
Set Signature
> set positionInfo(value): void
Defined in: src/components/Spine.ts:650
Parameters
value
type?
"align" | "pixel" | "percentage"
x
number
y
number
Returns
void
Implementation of
AdditionalPositionsExtension.positionInfo
positionType
Get Signature
> get positionType(): "align" | "pixel" | "percentage"
Defined in: src/components/Spine.ts:630
Returns
"align" | "pixel" | "percentage"
Implementation of
AdditionalPositionsExtension.positionType
renderable
Get Signature
> get renderable(): boolean
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1323
Controls whether this object can be rendered. If false the object will not be drawn, but the transform will still be updated. This is different from visible, which skips transform updates.
Example
// Basic render control
sprite.renderable = false; // Skip rendering
sprite.renderable = true; // Enable renderingDefault
trueSee
- Container#visible For skipping transform updates
- Container#alpha For transparency
Returns
boolean
Set Signature
> set renderable(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1324
Parameters
value
boolean
Returns
void
Inherited from
CoreSpine.renderable
rotation
Get Signature
> get rotation(): number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:984
The rotation of the object in radians.
> [!NOTE] 'rotation' and 'angle' have the same effect on a display object; > rotation is in radians, angle is in degrees.
Example
// Basic rotation
container.rotation = Math.PI / 4; // 45 degrees
// Convert from degrees
const degrees = 45;
container.rotation = degrees * Math.PI / 180;
// Rotate around center
container.pivot.set(container.width / 2, container.height / 2);
container.rotation = Math.PI; // 180 degrees
// Rotate around center with origin
container.origin.set(container.width / 2, container.height / 2);
container.rotation = Math.PI; // 180 degreesReturns
number
Set Signature
> set rotation(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:985
Parameters
value
number
Returns
void
Inherited from
CoreSpine.rotation
roundPixels
Get Signature
> get roundPixels(): boolean
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:86
Whether or not to round the x/y position of the sprite.
Example
// Enable pixel rounding for crisp rendering
view.roundPixels = true;Default
falseReturns
boolean
Set Signature
> set roundPixels(value): void
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:87
Whether or not to round the x/y position of the object.
Parameters
value
boolean
Returns
void
Inherited from
CoreSpine.roundPixels
scale
Get Signature
> get scale(): ObservablePoint
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1071
The scale factors of this object along the local coordinate axes.
The default scale is (1, 1).
Example
// Basic scaling
container.scale.set(2, 2); // Scales to double size
container.scale.set(2); // Scales uniformly to double size
container.scale = 2; // Scales uniformly to double size
// Scale to a specific width and height
container.setSize(200, 100); // Sets width to 200 and height to 100Since
4.0.0
Returns
ObservablePoint
Set Signature
> set scale(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1072
Parameters
value
string | number | PointData
Returns
void
Inherited from
CoreSpine.scale
skew
Get Signature
> get skew(): ObservablePoint
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1054
The skew factor for the object in radians. Skewing is a transformation that distorts the object by rotating it differently at each point, creating a non-uniform shape.
Example
// Basic skewing
container.skew.set(0.5, 0); // Skew horizontally
container.skew.set(0, 0.5); // Skew vertically
// Skew with point data
container.skew = { x: 0.3, y: 0.3 }; // Diagonal skew
// Reset skew
container.skew.set(0, 0);
// Animate skew
app.ticker.add(() => {
// Create wave effect
container.skew.x = Math.sin(Date.now() / 1000) * 0.3;
});
// Combine with rotation
container.rotation = Math.PI / 4; // 45 degrees
container.skew.set(0.2, 0.2); // Skew the rotated objectSince
4.0.0
Default
{x: 0, y: 0}Returns
ObservablePoint
Set Signature
> set skew(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1055
Parameters
value
PointData
Returns
void
Inherited from
CoreSpine.skew
ticker
Get Signature
> get ticker(): Ticker
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:205
The ticker to use when autoUpdate is true. Defaults to Ticker.shared.
Returns
Ticker
Set Signature
> set ticker(value): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:207
Sets the ticker to use when autoUpdate is true. If autoUpdate is already true, the update callback will be moved from the old ticker to the new one.
Parameters
value
Ticker
Returns
void
Inherited from
CoreSpine.ticker
tint
Get Signature
> get tint(): number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1268
The tint applied to the sprite.
This can be any valid ColorSource.
Example
// Basic color tinting
container.tint = 0xff0000; // Red tint
container.tint = 'red'; // Same as above
container.tint = '#00ff00'; // Green
container.tint = 'rgb(0,0,255)'; // Blue
// Remove tint
container.tint = 0xffffff; // White = no tint
container.tint = null; // Also removes tintDefault
0xFFFFFFSee
- Container#alpha For transparency
- Container#visible For visibility control
Returns
number
Set Signature
> set tint(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1247
Parameters
value
ColorSource
Returns
void
Inherited from
CoreSpine.tint
visible
Get Signature
> get visible(): boolean
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1303
The visibility of the object. If false the object will not be drawn, and the transform will not be updated.
Example
// Basic visibility toggle
sprite.visible = false; // Hide sprite
sprite.visible = true; // Show spriteDefault
trueSee
- Container#renderable For render-only control
- Container#alpha For transparency
Returns
boolean
Set Signature
> set visible(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1304
Parameters
value
boolean
Returns
void
Inherited from
CoreSpine.visible
width
Get Signature
> get width(): number
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1102
The width of the Container, setting this will actually modify the scale to achieve the value set. > [!NOTE] Changing the width will adjust the scale.x property of the container while maintaining its aspect ratio. > [!NOTE] If you want to set both width and height at the same time, use Container#setSize as it is more optimized by not recalculating the local bounds twice.
Example
// Basic width setting
container.width = 100;
// Optimized width setting
container.setSize(100, 100);Returns
number
Set Signature
> set width(value): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1103
Parameters
value
number
Returns
void
Inherited from
CoreSpine.width
worldTransform
Get Signature
> get worldTransform(): Matrix
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:922
Current transform of the object based on world (parent) factors.
This matrix represents the absolute transformation in the scene graph.
Example
// Get world position
const worldPos = container.worldTransform;
console.log(`World position: (${worldPos.tx}, ${worldPos.ty})`);See
Container#localTransform For local space transform
Returns
Matrix
Inherited from
CoreSpine.worldTransform
x
Get Signature
> get x(): number
Defined in: src/components/Spine.ts:709
The position of the container on the x axis relative to the local coordinates of the parent.
An alias to position.x
Example
// Basic position
container.x = 100;Returns
number
Set Signature
> set x(value): void
Defined in: src/components/Spine.ts:712
The position of the container on the x axis relative to the local coordinates of the parent.
An alias to position.x
Example
// Basic position
container.x = 100;Parameters
value
number
Returns
void
Overrides
CoreSpine.x
xAlign
Get Signature
> get xAlign(): number
Defined in: src/components/Spine.ts:557
is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas. For example:
- if you set align to 0.5, the element will be in the center of the canvas.
- if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
- if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does not affect the alignment.
Returns
number
Set Signature
> set xAlign(value): void
Defined in: src/components/Spine.ts:549
is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas. For example:
- if you set align to 0.5, the element will be in the center of the canvas.
- if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
- if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does not affect the alignment.
Parameters
value
number
Returns
void
Implementation of
AdditionalPositionsExtension.xAlign
y
Get Signature
> get y(): number
Defined in: src/components/Spine.ts:717
The position of the container on the y axis relative to the local coordinates of the parent.
An alias to position.y
Example
// Basic position
container.y = 200;Returns
number
Set Signature
> set y(value): void
Defined in: src/components/Spine.ts:720
The position of the container on the y axis relative to the local coordinates of the parent.
An alias to position.y
Example
// Basic position
container.y = 200;Parameters
value
number
Returns
void
Overrides
CoreSpine.y
yAlign
Get Signature
> get yAlign(): number
Defined in: src/components/Spine.ts:577
is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas. For example:
- if you set align to 0.5, the element will be in the center of the canvas.
- if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
- if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does not affect the alignment.
Returns
number
Set Signature
> set yAlign(value): void
Defined in: src/components/Spine.ts:569
is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas. For example:
- if you set align to 0.5, the element will be in the center of the canvas.
- if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
- if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
Important: The PixiContainer.pivot field does not affect the alignment.
Parameters
value
number
Returns
void
Implementation of
AdditionalPositionsExtension.yAlign
Methods
_getCachedData()
> _getCachedData(slot, attachment): AttachmentCacheData
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:301
Internal
Parameters
slot
Slot
attachment
RegionAttachment | MeshAttachment
Returns
AttachmentCacheData
Inherited from
CoreSpine._getCachedData
_getGlobalBoundsRecursive()
> _getGlobalBoundsRecursive(factorRenderLayers, bounds, currentLayer): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getFastGlobalBoundsMixin.d.ts:32
Internal
Recursively calculates the global bounds for the container and its children. This method is used internally by getFastGlobalBounds to traverse the scene graph.
Parameters
factorRenderLayers
boolean
A flag indicating whether to consider render layers in the calculation.
bounds
Bounds
The bounds object to update with the calculated values.
currentLayer
RenderLayer
The current render layer being processed.
Returns
void
Inherited from
CoreSpine._getGlobalBoundsRecursive
_onTouch()?
> optional _onTouch(now): void
Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/GCSystem.d.ts:31
An optional callback for when an item is touched
Parameters
now
number
Returns
void
Inherited from
CoreSpine._onTouch
_validateAndTransformAttachments()
> _validateAndTransformAttachments(): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:282
Internal
- validates the attachments - to flag if the attachments have changed this state
- transforms the attachments - to update the vertices of the attachments based on the new positions
Returns
void
Inherited from
CoreSpine._validateAndTransformAttachments
addAnimation()
> addAnimation(animationName, options?): TrackEntry
Defined in: src/components/Spine.ts:277
Queues an animation to play on a track after the current animation (if any) completes. Use setAnimation instead to replace the track's current animation immediately.
Parameters
animationName
string
The name of the animation to queue.
options?
Additional options for playing the track.
completeOnContinue?
boolean
If true, the animation will be completed before the next step.
Default
truedelay?
number
Delay in seconds before the animation starts. If not provided, the animation will start immediately after the previous animation on the track, or after the mix duration if there is a previous animation.
If > 0, sets TrackEntry#delay. If <= 0, the delay set is the duration of the previous track entry
minus any mix duration (from the AnimationStateData) plus the specified delay (ie the mix
ends at (delay = 0) or before (delay < 0) the previous track entry duration). If the
previous entry is looping, its next loop completion is used instead of its duration.
loop?
boolean
Whether the animation should loop. If true, the animation will loop indefinitely until changed.
trackIndex?
number
The track index to play the animation on.
Returns
TrackEntry
The TrackEntry for the queued animation, or null if the animation could not be found.
addBounds()
> addBounds(bounds): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:338
Internal
Parameters
bounds
Bounds
Returns
void
Inherited from
CoreSpine.addBounds
addChild()
> addChild<U>(...children): U[0]
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:864
Adds one or more children to the container. The children will be rendered as part of this container's display list.
Type Parameters
U
U extends ContainerChild[]
Parameters
children
...U
The Container(s) to add to the container
Returns
U[0]
The first child that was added
Example
// Add a single child
container.addChild(sprite);
// Add multiple children
container.addChild(background, player, foreground);
// Add with type checking
const sprite = container.addChild<Sprite>(new Sprite(texture));
sprite.tint = 'red';See
- Container#removeChild For removing children
- Container#addChildAt For adding at specific index
Inherited from
CoreSpine.addChild
addChildAt()
> addChildAt<U>(child, index): U
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:161
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.
When moving a child within the same container, childAdded and added events are
not emitted because the parent-child relationship hasn't changed. Events only fire when
a child is added from a different parent (or from no parent).
Type Parameters
U
U extends ContainerChild
Parameters
child
U
The child to add
index
number
The index where the child will be placed
Returns
U
The child that was added
Example
// Add at specific index
container.addChildAt(sprite, 0); // Add to front
// Move existing child (no events emitted)
const index = container.children.length - 1;
container.addChildAt(existingChild, index); // Move to back
// With error handling
try {
container.addChildAt(sprite, 1000);
} catch (e) {
console.warn('Index out of bounds');
}Throws
If index is out of bounds
See
- Container#addChild For adding to the end
- Container#setChildIndex For moving existing children
Inherited from
CoreSpine.addChildAt
addEventListener()
Call Signature
> addEventListener<K>(type, listener, options?): void
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:1072
Unlike on or addListener which are methods from EventEmitter, addEventListener
seeks to be compatible with the DOM's addEventListener with support for options.
Type Parameters
K
K extends keyof FederatedEventMap | keyof GlobalFederatedEventMap
Parameters
type
K
The type of event to listen to.
listener
(e) => any
The listener callback or object.
options?
AddListenerOptions
Listener options, used for capture phase.
Returns
void
Example
// Tell the user whether they did a single, double, triple, or nth click.
button.addEventListener('click', {
handleEvent(e): {
let prefix;
switch (e.detail) {
case 1: prefix = 'single'; break;
case 2: prefix = 'double'; break;
case 3: prefix = 'triple'; break;
default: prefix = e.detail + 'th'; break;
}
console.log('That was a ' + prefix + 'click');
}
});
// But skip the first click!
button.parent.addEventListener('click', function blockClickOnce(e) {
e.stopImmediatePropagation();
button.parent.removeEventListener('click', blockClickOnce, true);
}, {
capture: true,
});Inherited from
CoreSpine.addEventListener
Call Signature
> addEventListener(type, listener, options?): void
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:1073
Parameters
type
string
listener
EventListenerOrEventListenerObject
options?
AddListenerOptions
Returns
void
Inherited from
CoreSpine.addEventListener
addListener()
> addListener<T>(event, fn, context?): this
Defined in: node_modules/eventemitter3/index.d.ts:45
Type Parameters
T
T extends keyof ContainerEvents | keyof AnyEvent
Parameters
event
T
fn
(...args) => void
context?
any
Returns
this
Inherited from
CoreSpine.addListener
addSlotObject()
> addSlotObject(slot, container, options?): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:314
Attaches a PixiJS container to a specified slot. This will map the world transform of the slots bone to the attached container. A container can only be attached to one slot at a time.
Parameters
slot
string | number | Slot
container
Container
The container to attach to the slot
options?
Optional settings for the attachment.
followAttachmentTimeline?
boolean
If true, the attachment will follow the slot's attachment timeline.
followSlotColor?
boolean
If true, the container tint will follow the skeleton and slot colors.
Returns
void
Inherited from
CoreSpine.addSlotObject
clearTrack()
> clearTrack(trackIndex): void
Defined in: src/components/Spine.ts:435
Removes all animations from a single track, stopping its running playSequence timeline (if any), and leaving the skeleton in its current pose.
Parameters
trackIndex
number
The track index to clear.
Returns
void
clearTracks()
> clearTracks(): void
Defined in: src/components/Spine.ts:423
Removes all animations from all tracks, stopping any running playSequence timelines, and leaving the skeleton in its current pose.
Returns
void
collectRenderables()
> collectRenderables(instructionSet, renderer, currentLayer): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/collectRenderablesMixin.d.ts:21
Internal
Collects all renderables from the container and its children, adding them to the instruction set. This method decides whether to use a simple or advanced collection method based on the container's properties.
Parameters
instructionSet
InstructionSet
The set of instructions to which the renderables will be added.
renderer
Renderer
The renderer responsible for rendering the scene.
currentLayer
RenderLayer
The current render layer being processed.
Returns
void
Inherited from
CoreSpine.collectRenderables
collectRenderablesSimple()
> collectRenderablesSimple(instructionSet, renderer, currentLayer): void
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:119
Internal
Collects renderables for the view container.
Parameters
instructionSet
InstructionSet
The instruction set to collect renderables for.
renderer
Renderer
The renderer to collect renderables for.
currentLayer
RenderLayer
The current render layer.
Returns
void
Inherited from
CoreSpine.collectRenderablesSimple
collectRenderablesWithEffects()
> collectRenderablesWithEffects(instructionSet, renderer, currentLayer): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/collectRenderablesMixin.d.ts:39
Internal
Collects renderables using an advanced method, suitable for containers with complex processing needs. This method handles additional effects and transformations that may be applied to the renderables.
Parameters
instructionSet
InstructionSet
The set of instructions to which the renderables will be added.
renderer
Renderer
The renderer responsible for rendering the scene.
currentLayer
RenderLayer
The current render layer being processed.
Returns
void
Inherited from
CoreSpine.collectRenderablesWithEffects
containsPoint()
> containsPoint(point): boolean
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:104
Checks if the object contains the given point in local coordinates. Uses the view's bounds for hit testing.
Parameters
point
PointData
The point to check in local coordinates
Returns
boolean
True if the point is within the view's bounds
Example
// Basic point check
const localPoint = { x: 50, y: 25 };
const contains = view.containsPoint(localPoint);
console.log('Point is inside:', contains);See
- ViewContainer#bounds For the bounds used in hit testing
- Container#toLocal For converting global coordinates to local
Inherited from
CoreSpine.containsPoint
destroy()
> destroy(options?): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:346
Destroys this sprite renderable and optionally its texture.
Parameters
options?
DestroyOptions
Options parameter. A boolean will act as if all options have been set to that value
Returns
void
Inherited from
CoreSpine.destroy
disableRenderGroup()
> disableRenderGroup(): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:906
This will disable the render group for this container.
Returns
void
Advanced
Inherited from
CoreSpine.disableRenderGroup
dispatchEvent()
> dispatchEvent(e): boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:1094
Dispatch the event on this Container using the event's EventBoundary.
The target of the event is set to this and the defaultPrevented flag is cleared before dispatch.
Parameters
e
FederatedEvent
The event to dispatch.
Returns
boolean
Whether the FederatedEvent.preventDefault preventDefault() method was not invoked.
Example
// Reuse a click event!
button.dispatchEvent(clickEvent);Inherited from
CoreSpine.dispatchEvent
emit()
> emit<T>(event, ...args): boolean
Defined in: node_modules/eventemitter3/index.d.ts:32
Calls each of the listeners registered for a given event.
Type Parameters
T
T extends keyof ContainerEvents | keyof AnyEvent
Parameters
event
T
args
...ArgumentMap<ContainerEvents<ContainerChild> & AnyEvent>[Extract<T, keyof ContainerEvents | keyof AnyEvent>]
Returns
boolean
Inherited from
CoreSpine.emit
enableRenderGroup()
> enableRenderGroup(): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:901
Calling this enables a render group for this container. This means it will be rendered as a separate set of instructions. The transform of the container will also be handled on the GPU rather than the CPU.
Returns
void
Advanced
Inherited from
CoreSpine.enableRenderGroup
eventNames()
> eventNames(): (keyof ContainerEvents | keyof AnyEvent)[]
Defined in: node_modules/eventemitter3/index.d.ts:15
Return an array listing the events for which the emitter has registered listeners.
Returns
(keyof ContainerEvents | keyof AnyEvent)[]
Inherited from
CoreSpine.eventNames
getBonePosition()
> getBonePosition(bone, outPos?): PointData | undefined
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:269
Return the position of the bone given in input into an IPointData.
Parameters
bone
string | Bone
outPos?
PointData
Returns
PointData | undefined
: the position of the bone, or undefined if no matching bone is found in the skeleton
Inherited from
CoreSpine.getBonePosition
getBounds()
> getBounds(skipUpdate?, bounds?): Bounds
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.d.ts:88
Calculates and returns the (world) bounds of the display object as a Rectangle. Takes into account transforms and child bounds.
Parameters
skipUpdate?
boolean
Setting 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.
bounds?
Bounds
Optional bounds to store the result of the bounds calculation
Returns
Bounds
The minimum axis-aligned rectangle in world space that fits around this object
Example
// Basic bounds calculation
const bounds = sprite.getBounds();
console.log(`World bounds: ${bounds.x}, ${bounds.y}, ${bounds.width}, ${bounds.height}`);
// Reuse bounds object for performance
const recycleBounds = new Bounds();
sprite.getBounds(false, recycleBounds);
// Skip update for performance
const fastBounds = sprite.getBounds(true);Remarks
- Includes transform calculations
- Updates scene graph by default
- Can reuse bounds objects
- Common in hit testing
See
- Container#getLocalBounds For untransformed bounds
- Bounds For bounds properties
Inherited from
CoreSpine.getBounds
getChildAt()
> getChildAt<U>(index): U
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:85
Returns the child at the specified index.
Type Parameters
U
U extends ContainerChild
Parameters
index
number
The index to get the child from
Returns
U
The child at the given index
Example
// Get first child
const first = container.getChildAt(0);
// Type-safe access
const sprite = container.getChildAt<Sprite>(1);
// With error handling
try {
const child = container.getChildAt(10);
} catch (e) {
console.warn('Index out of bounds');
}Throws
If index is out of bounds
See
- Container#children For direct array access
- Container#getChildByLabel For name-based lookup
Inherited from
CoreSpine.getChildAt
getChildByLabel()
> getChildByLabel(label, deep?): Container<ContainerChild> | null
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.d.ts:53
Returns the first child in the container with the specified label. Recursive searches are done in a pre-order traversal.
Parameters
label
string | RegExp
Instance label to search for
deep?
boolean
Whether to search recursively through children
Returns
Container<ContainerChild> | null
The first child with the specified label, or null if none found
Example
// Basic label search
const child = container.getChildByLabel('player');
// Search with regular expression
const enemy = container.getChildByLabel(/enemy-\d+/);
// Deep search through children
const deepChild = container.getChildByLabel('powerup', true);See
- Container#getChildrenByLabel For finding all matches
- Container#label For setting labels
Inherited from
CoreSpine.getChildByLabel
getChildByName()
> getChildByName(label, deep?): Container<ContainerChild> | null
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.d.ts:32
Parameters
label
string | RegExp
Instance name.
deep?
boolean
Whether to search recursively
Returns
Container<ContainerChild> | null
The child with the specified name.
Deprecated
since 8.0.0
See
Container#getChildByLabel
Inherited from
CoreSpine.getChildByName
getChildIndex()
> getChildIndex(child): number
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:130
Returns the index position of a child Container instance.
Parameters
child
ContainerChild
The Container instance to identify
Returns
number
The index position of the child container
Example
// Basic index lookup
const index = container.getChildIndex(sprite);
console.log(`Sprite is at index ${index}`);
// With error handling
try {
const index = container.getChildIndex(sprite);
} catch (e) {
console.warn('Child not found in container');
}Throws
If child is not in this container
See
- Container#setChildIndex For changing index
- Container#children For direct array access
Inherited from
CoreSpine.getChildIndex
getChildrenByLabel()
> getChildrenByLabel(label, deep?, out?): Container<ContainerChild>[]
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.d.ts:74
Returns all children in the container with the specified label. Recursive searches are done in a pre-order traversal.
Parameters
label
string | RegExp
Instance label to search for
deep?
boolean
Whether to search recursively through children
out?
Container<ContainerChild>[]
Optional array to store matching children in
Returns
Container<ContainerChild>[]
An array of children with the specified label
Example
// Basic label search
const enemies = container.getChildrenByLabel('enemy');
// Search with regular expression
const powerups = container.getChildrenByLabel(/powerup-\d+/);
// Deep search with collection
const buttons = [];
container.getChildrenByLabel('button', true, buttons);See
- Container#getChildByLabel For finding first match
- Container#label For setting labels
Inherited from
CoreSpine.getChildrenByLabel
getFastGlobalBounds()
> getFastGlobalBounds(factorRenderLayers?, bounds?): Bounds
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getFastGlobalBoundsMixin.d.ts:23
Computes an approximate global bounding box for the container and its children. This method is optimized for speed by using axis-aligned bounding boxes (AABBs), and uses the last render results from when it updated the transforms. This function does not update them. which may result in slightly larger bounds but never smaller than the actual bounds.
for accurate (but less performant) results use container.getGlobalBounds
Parameters
factorRenderLayers?
boolean
A flag indicating whether to consider render layers in the calculation.
bounds?
Bounds
The output bounds object to store the result. If not provided, a new one is created.
Returns
Bounds
The computed bounds.
Advanced
Inherited from
CoreSpine.getFastGlobalBounds
getGlobalAlpha()
> getGlobalAlpha(skipUpdate?): number
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.d.ts:35
Returns the global (compound) alpha of the container within the scene.
Parameters
skipUpdate?
boolean
Performance optimization flag:
- If false (default): Recalculates the entire alpha chain through parents for accuracy
- If true: Uses cached worldAlpha from the last render pass for better performance
Returns
number
The resulting alpha value (between 0 and 1)
Example
// Accurate but slower - recalculates entire alpha chain
const preciseAlpha = container.getGlobalAlpha();
// Faster but may be outdated - uses cached alpha
const cachedAlpha = container.getGlobalAlpha(true);Inherited from
CoreSpine.getGlobalAlpha
getGlobalPosition()
> getGlobalPosition(point?, skipUpdate?): Point
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.d.ts:36
Returns the global position of the container, taking into account the container hierarchy.
Parameters
point?
Point
The optional point to write the global value to
skipUpdate?
boolean
Should we skip the update transform
Returns
Point
The updated point
Example
// Basic position check
const globalPos = sprite.getGlobalPosition();
console.log(`Global: (${globalPos.x}, ${globalPos.y})`);
// Reuse point object
const point = new Point();
sprite.getGlobalPosition(point);
// Skip transform update for performance
const fastPos = container.getGlobalPosition(undefined, true);See
- Container#toGlobal For converting specific points
- Container#toLocal For converting to local space
Inherited from
CoreSpine.getGlobalPosition
getGlobalTint()
> getGlobalTint(skipUpdate?): number
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.d.ts:72
Returns the global (compound) tint color of the container within the scene.
Parameters
skipUpdate?
boolean
Performance optimization flag:
- If false (default): Recalculates the entire tint chain through parents for accuracy
- If true: Uses cached worldColor from the last render pass for better performance
Returns
number
The resulting tint color as a 24-bit RGB number (0xRRGGBB)
Example
// Accurate but slower - recalculates entire tint chain
const preciseTint = container.getGlobalTint();
// Faster but may be outdated - uses cached tint
const cachedTint = container.getGlobalTint(true);Inherited from
CoreSpine.getGlobalTint
getGlobalTransform()
> getGlobalTransform(matrix?, skipUpdate?): Matrix
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.d.ts:56
Returns the global transform matrix of the container within the scene.
Parameters
matrix?
Matrix
Optional matrix to store the result. If not provided, a new Matrix will be created.
skipUpdate?
boolean
Performance optimization flag:
- If false (default): Recalculates the entire transform chain for accuracy
- If true: Uses cached worldTransform from the last render pass for better performance
Returns
Matrix
The resulting transformation matrix (either the input matrix or a new one)
Example
// Accurate but slower - recalculates entire transform chain
const preciseTransform = container.getGlobalTransform();
// Faster but may be outdated - uses cached transform
const cachedTransform = container.getGlobalTransform(undefined, true);
// Reuse existing matrix
const existingMatrix = new Matrix();
container.getGlobalTransform(existingMatrix);Inherited from
CoreSpine.getGlobalTransform
getLocalBounds()
> getLocalBounds(): Bounds
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.d.ts:58
Retrieves the local bounds of the container as a Bounds object. Uses cached values when possible for better performance.
Returns
Bounds
The bounding area
Example
// Basic bounds check
const bounds = container.getLocalBounds();
console.log(`Width: ${bounds.width}, Height: ${bounds.height}`);
// subsequent calls will reuse the cached bounds
const cachedBounds = container.getLocalBounds();
console.log(bounds === cachedBounds); // trueSee
- Container#getBounds For world space bounds
- Bounds For bounds properties
Inherited from
CoreSpine.getLocalBounds
getSize()
> getSize(out?): Size
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1136
Retrieves the size of the container as a [Size]Size object.
This is faster than get the width and height separately.
Parameters
out?
Size
Optional object to store the size in.
Returns
Size
The size of the container.
Example
// Basic size retrieval
const size = container.getSize();
console.log(`Size: ${size.width}x${size.height}`);
// Reuse existing size object
const reuseSize = { width: 0, height: 0 };
container.getSize(reuseSize);Inherited from
CoreSpine.getSize
getSlotObject()
> getSlotObject(slot): Container<ContainerChild> | undefined
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:335
Returns a container attached to a slot, or undefined if no container is attached.
Parameters
slot
string | number | Slot
Returns
Container<ContainerChild> | undefined
- The container attached to the slot
Inherited from
CoreSpine.getSlotObject
internalUpdate()
> protected internalUpdate(ticker?, deltaSeconds?): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:242
Parameters
ticker?
Ticker
deltaSeconds?
number
Returns
void
Inherited from
CoreSpine.internalUpdate
listenerCount()
> listenerCount(event): number
Defined in: node_modules/eventemitter3/index.d.ts:27
Return the number of listeners listening to a given event.
Parameters
event
keyof ContainerEvents | keyof AnyEvent
Returns
number
Inherited from
CoreSpine.listenerCount
listeners()
> listeners<T>(event): (...args) => void[]
Defined in: node_modules/eventemitter3/index.d.ts:20
Return the listeners registered for a given event.
Type Parameters
T
T extends keyof ContainerEvents | keyof AnyEvent
Parameters
event
T
Returns
(...args) => void[]
Inherited from
CoreSpine.listeners
off()
> off<T>(event, fn?, context?, once?): this
Defined in: node_modules/eventemitter3/index.d.ts:69
Type Parameters
T
T extends keyof ContainerEvents | keyof AnyEvent
Parameters
event
T
fn?
(...args) => void
context?
any
once?
boolean
Returns
this
Inherited from
CoreSpine.off
on()
> on<T>(event, fn, context?): this
Defined in: src/components/Spine.ts:460
Add a listener for a given event.
Type Parameters
T
T extends symbol | object & string | keyof ContainerEvents
Parameters
event
T
fn
(...args) => void
context?
any
Returns
this
Implementation of
ListenerExtension.on
Overrides
CoreSpine.on
once()
> once<T>(event, fn, context?): this
Defined in: node_modules/eventemitter3/index.d.ts:54
Add a one-time listener for a given event.
Type Parameters
T
T extends keyof ContainerEvents | keyof AnyEvent
Parameters
event
T
fn
(...args) => void
context?
any
Returns
this
Inherited from
CoreSpine.once
pixiWorldCoordinatesToBone()
> pixiWorldCoordinatesToBone(point, bone): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:366
Converts a point from the Pixi world coordinate system to the bone's local coordinate system.
Parameters
point
x
number
y
number
bone
Bone
Returns
void
Inherited from
CoreSpine.pixiWorldCoordinatesToBone
pixiWorldCoordinatesToSkeleton()
> pixiWorldCoordinatesToSkeleton(point): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:361
Converts a point from the Pixi world coordinate system to the skeleton coordinate system.
Parameters
point
x
number
y
number
Returns
void
Inherited from
CoreSpine.pixiWorldCoordinatesToSkeleton
playSequence()
> playSequence(sequence, options?): Omit<AnimationPlaybackControlsWithThen, "pause">
Defined in: src/components/Spine.ts:333
Plays a sequence of animations on a track, one after another, driven by a motion timeline. Any
animation currently playing on the track is cleared first. The sequence is tracked in
sequenceTimelines (and thus included in memory) until it completes, at which point
the track is cleared automatically.
Parameters
sequence
(string | [string, SpineSequenceOptions])[]
The sequence of animations to play, with their respective options. Corresponds to the motion sequence settings: https://motion.dev/docs/animate#timeline-sequences
options?
SequenceOptions & object = {}
Additional options for playing the track.
Returns
Omit<AnimationPlaybackControlsWithThen, "pause">
The motion timeline controls for the sequence (without pause, since pausing is not supported).
Example
spine.playSequence([
["walk", { loop: true, duration: 2 }],
["jump", { delay: 0.5 }],
], { loop: true, completeOnContinue: true });reloadAnchor()
> protected reloadAnchor(): void
Defined in: src/components/Spine.ts:500
Returns
void
reloadPosition()
> protected reloadPosition(): void
Defined in: src/components/Spine.ts:664
Re-applies whichever positioning mode is active (align or percentagePosition) onto the underlying pixel x/y, e.g. after the skeleton's size, scale or angle changes. No-op when neither mode is set (plain pixel positioning).
Returns
void
removeAllListeners()
> removeAllListeners(event?): this
Defined in: node_modules/eventemitter3/index.d.ts:79
Remove all listeners, or those of the specified event.
Parameters
event?
keyof ContainerEvents | keyof AnyEvent
Returns
this
Inherited from
CoreSpine.removeAllListeners
removeChild()
> removeChild<U>(...children): U[0]
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:885
Removes one or more children from the container. When removing multiple children, events will be triggered for each child in sequence.
Type Parameters
U
U extends ContainerChild[]
Parameters
children
...U
The Container(s) to remove
Returns
U[0]
The first child that was removed
Example
// Remove a single child
const removed = container.removeChild(sprite);
// Remove multiple children
const bg = container.removeChild(background, player, userInterface);
// Remove with type checking
const sprite = container.removeChild<Sprite>(childSprite);
sprite.texture = newTexture;See
- Container#addChild For adding children
- Container#removeChildren For removing multiple children
Inherited from
CoreSpine.removeChild
removeChildAt()
> removeChildAt<U>(index): U
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:61
Removes a child from the specified index position.
Type Parameters
U
U extends ContainerChild
Parameters
index
number
The index to remove the child from
Returns
U
The child that was removed
Example
// Remove first child
const removed = container.removeChildAt(0);
// type safe access
const sprite = container.removeChildAt<Sprite>(1);
// With error handling
try {
const child = container.removeChildAt(10);
} catch (e) {
console.warn('Index out of bounds');
}Throws
If index is out of bounds
See
- Container#removeChild For removing specific children
- Container#removeChildren For removing multiple children
Inherited from
CoreSpine.removeChildAt
removeChildren()
> removeChildren(beginIndex?, endIndex?): ContainerChild[]
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:37
Removes all children from this container that are within the begin and end indexes.
Parameters
beginIndex?
number
The beginning position
endIndex?
number
The ending position. Default is container size
Returns
ContainerChild[]
List of removed children
Example
// Remove all children
container.removeChildren();
// Remove first 3 children
const removed = container.removeChildren(0, 3);
console.log('Removed:', removed.length); // 3
// Remove children from index 2 onwards
container.removeChildren(2);
// Remove specific range
const middle = container.removeChildren(1, 4);Throws
If begin/end indexes are invalid
See
- Container#addChild For adding children
- Container#removeChild For removing specific children
Inherited from
CoreSpine.removeChildren
removeEventListener()
Call Signature
> removeEventListener<K>(type, listener, options?): void
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:1082
Unlike off or removeListener which are methods from EventEmitter, removeEventListener
seeks to be compatible with the DOM's removeEventListener with support for options.
Type Parameters
K
K extends keyof FederatedEventMap | keyof GlobalFederatedEventMap
Parameters
type
K
The type of event the listener is bound to.
listener
(e) => any
The listener callback or object.
options?
RemoveListenerOptions
The original listener options. This is required to deregister a capture phase listener.
Returns
void
Inherited from
CoreSpine.removeEventListener
Call Signature
> removeEventListener(type, listener, options?): void
Defined in: node_modules/pixi.js/lib/events/FederatedEventTarget.d.ts:1083
Parameters
type
string
listener
EventListenerOrEventListenerObject
options?
RemoveListenerOptions
Returns
void
Inherited from
CoreSpine.removeEventListener
removeFromParent()
> removeFromParent(): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:203
Remove the Container from its parent Container. If the Container has no parent, do nothing.
Returns
void
Example
// Basic removal
sprite.removeFromParent();
// With validation
if (sprite.parent) {
sprite.removeFromParent();
}See
- Container#addChild For adding to a new parent
- Container#removeChild For parent removing children
Inherited from
CoreSpine.removeFromParent
removeListener()
> removeListener<T>(event, fn?, context?, once?): this
Defined in: node_modules/eventemitter3/index.d.ts:63
Remove the listeners of a given event.
Type Parameters
T
T extends keyof ContainerEvents | keyof AnyEvent
Parameters
event
T
fn?
(...args) => void
context?
any
once?
boolean
Returns
this
Inherited from
CoreSpine.removeListener
removeSlotObject()
> removeSlotObject(slotOrContainer): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:324
Removes a PixiJS container from the slot it is attached to.
Parameters
slotOrContainer
string | number | Container<ContainerChild> | Slot
The container, slot id or slot to detach from
Returns
void
Inherited from
CoreSpine.removeSlotObject
removeSlotObjects()
> removeSlotObjects(): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:328
Removes all PixiJS containers attached to any slot.
Returns
void
Inherited from
CoreSpine.removeSlotObjects
reparentChild()
> reparentChild<U>(...child): U[0]
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:224
Reparent a child or multiple children to this container while preserving their world transform. This ensures that the visual position and rotation of the children remain the same even when changing parents.
Type Parameters
U
U extends ContainerChild[]
Parameters
child
...U
The child or children to reparent
Returns
U[0]
The first child that was reparented
Example
// Basic reparenting
const sprite = new Sprite(texture);
oldContainer.addChild(sprite);
// Move to new parent, keeping visual position
newContainer.reparentChild(sprite);
// Reparent multiple children
const batch = [sprite1, sprite2, sprite3];
newContainer.reparentChild(...batch);See
- Container#reparentChildAt For index-specific reparenting
- Container#addChild For simple parenting
Inherited from
CoreSpine.reparentChild
reparentChildAt()
> reparentChildAt<U>(child, index): U
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:243
Reparent the child to this container at the specified index while preserving its world transform. This ensures that the visual position and rotation of the child remain the same even when changing parents.
Type Parameters
U
U extends ContainerChild
Parameters
child
U
The child to reparent
index
number
The index to reparent the child to
Returns
U
The reparented child
Example
// Basic index-specific reparenting
const sprite = new Sprite(texture);
oldContainer.addChild(sprite);
// Move to new parent at index 0 (front)
newContainer.reparentChildAt(sprite, 0);Throws
If index is out of bounds
See
- Container#reparentChild For appending reparented children
- Container#addChildAt For simple indexed parenting
Inherited from
CoreSpine.reparentChildAt
replaceChild()
> replaceChild<U, T>(oldChild, newChild): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:249
Replace a child in the container with a new child. Copying the local transform from the old child to the new one.
Type Parameters
U
U extends ContainerChild
T
T extends ContainerChild
Parameters
oldChild
U
The child to replace.
newChild
T
The new child to add.
Returns
void
Inherited from
CoreSpine.replaceChild
resetPhysicsPosition()
> resetPhysicsPosition(): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:244
Resets the position used for calculating inherited physics translation.
Returns
void
Inherited from
CoreSpine.resetPhysicsPosition
resetPhysicsRotation()
> resetPhysicsRotation(): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:246
Resets the rotation used for calculating inherited physics rotation.
Returns
void
Inherited from
CoreSpine.resetPhysicsRotation
resetPhysicsTransform()
> resetPhysicsTransform(): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:248
Resets the transform used for calculating inherited physics translation and rotation.
Returns
void
Inherited from
CoreSpine.resetPhysicsTransform
setAnimation()
> setAnimation(animationName, options): TrackEntry
Defined in: src/components/Spine.ts:239
Sets the current animation on a track, replacing whatever is currently playing on it. Use addAnimation instead to queue an animation after the current one.
Parameters
animationName
string
The name of the animation to set.
options
Additional options for setting the animation.
completeOnContinue?
boolean
If true, the animation will be completed before the next step.
Default
trueloop?
boolean
Whether the animation should loop. If true, the animation will loop indefinitely until changed.
trackIndex
number
The track index to play the animation on.
Returns
TrackEntry
The TrackEntry for the animation, or null if the animation could not be found.
setBonePosition()
> setBonePosition(bone, position): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:262
Set the position of the bone given in input through a IPointData.
Parameters
bone
string | Bone
position
PointData
Returns
void
Throws
: if the given bone is not found in the skeleton, an error is thrown
Inherited from
CoreSpine.setBonePosition
setChildIndex()
> setChildIndex(child, index): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:108
Changes the position of an existing child in the container.
Parameters
child
ContainerChild
The child Container instance to reposition
index
number
The resulting index number for the child
Returns
void
Example
// Basic index change
container.setChildIndex(sprite, 0); // Move to front
container.setChildIndex(sprite, container.children.length - 1); // Move to back
// With error handling
try {
container.setChildIndex(sprite, 5);
} catch (e) {
console.warn('Invalid index or child not found');
}Throws
If index is out of bounds
Throws
If child is not in container
See
- Container#getChildIndex For getting current index
- Container#swapChildren For swapping positions
Inherited from
CoreSpine.setChildIndex
setFromMatrix()
> setFromMatrix(matrix): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1223
Updates the local transform properties by decomposing the given matrix. Extracts position, scale, rotation, and skew from a transformation matrix.
Parameters
matrix
Matrix
The matrix to use for updating the transform
Returns
void
Example
// Basic matrix transform
const matrix = new Matrix()
.translate(100, 100)
.rotate(Math.PI / 4)
.scale(2, 2);
container.setFromMatrix(matrix);
// Copy transform from another container
const source = new Container();
source.position.set(100, 100);
source.rotation = Math.PI / 2;
target.setFromMatrix(source.localTransform);
// Reset transform
container.setFromMatrix(Matrix.IDENTITY);See
- Container#updateTransform For property-based updates
- Matrix#decompose For matrix decomposition details
Inherited from
CoreSpine.setFromMatrix
setMask()
> setMask(options): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.d.ts:229
Used to set mask and control mask options on a display object. Allows for more detailed control over masking behavior compared to the mask property.
Parameters
options
Partial<MaskOptionsAndMask>
Configuration options for the mask
Returns
void
Example
import { Graphics, Sprite } from 'pixi.js';
// Create a circular mask
const graphics = new Graphics()
.beginFill(0xFF3300)
.drawCircle(100, 100, 50)
.endFill();
// Apply mask with options
sprite.setMask({
mask: graphics,
inverse: true, // Create a hole effect
});
// Use the alpha channel for masking (useful for sprites with transparency)
sprite.setMask({
mask: maskSprite,
channel: 'alpha',
});
// Clear existing mask
sprite.setMask({ mask: null });See
- Container#mask For simple masking
- MaskOptionsAndMask For full options API
- MaskOptions#channel For channel selection
Inherited from
CoreSpine.setMask
setMemory()
> setMemory(memory): Promise<void>
Defined in: src/components/Spine.ts:227
This method set the memory of the canvas element.
Parameters
memory
Returns
Promise<void>
Throws
when the method is not overridden in the subclass.
Implementation of
CanvasBaseItem.setMemory
setPhysicsPositionInheritanceFactor()
> setPhysicsPositionInheritanceFactor(x, y): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:231
Sets how much translation of this Pixi container is inherited by skeleton physics constraints. The default is (1, 1), which applies container translation normally. Use (0, 0) to prevent container translation from affecting physics constraints.
Parameters
x
number
y
number
Returns
void
Inherited from
CoreSpine.setPhysicsPositionInheritanceFactor
setSize()
> setSize(value, height?): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1151
Sets the size of the container to the specified width and height. This is more efficient than setting width and height separately as it only recalculates bounds once.
Parameters
value
number | Optional<Size, "height">
This can be either a number or a [Size]Size object.
height?
number
The height to set. Defaults to the value of width if not provided.
Returns
void
Example
// Basic size setting
container.setSize(100, 200);
// Set uniform size
container.setSize(100); // Sets both width and height to 100Inherited from
CoreSpine.setSize
setSkin()
> setSkin(skinName): void
Defined in: src/components/Spine.ts:445
Sets the active skin on the skeleton and refreshes its pose slots accordingly. Failures (e.g. an unknown skin name) are logged via logger.error rather than thrown.
Parameters
skinName
string
The name of the skin to set.
Returns
void
skeletonToPixiWorldCoordinates()
> skeletonToPixiWorldCoordinates(point): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:356
Converts a point from the skeleton coordinate system to the Pixi world coordinate system.
Parameters
point
x
number
y
number
Returns
void
Inherited from
CoreSpine.skeletonToPixiWorldCoordinates
swapChildren()
> swapChildren<U>(child, child2): void
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.d.ts:187
Swaps the position of 2 Containers within this container.
Type Parameters
U
U extends ContainerChild
Parameters
child
U
First container to swap
child2
U
Second container to swap
Returns
void
Example
// Basic swap
container.swapChildren(sprite1, sprite2);
// With error handling
try {
container.swapChildren(sprite1, sprite2);
} catch (e) {
console.warn('One or both children not found in container');
}Remarks
- Updates render groups
- No effect if same child
- Triggers container changes
- Common in z-ordering
Throws
If either child is not in container
See
- Container#setChildIndex For direct index placement
- Container#getChildIndex For getting current positions
Inherited from
CoreSpine.swapChildren
toGlobal()
> toGlobal<P>(position, point?, skipUpdate?): P
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.d.ts:64
Calculates the global position of a point relative to this container. Takes into account the container hierarchy and transforms.
Type Parameters
P
P extends PointData = Point
Parameters
position
PointData
The local point to convert
point?
P
Optional point to store the result
skipUpdate?
boolean
Whether to skip transform updates
Returns
P
The global position
Example
// Basic point conversion
const localPoint = { x: 10, y: 20 };
const globalPoint = container.toGlobal(localPoint);
// With point reuse
const reusePoint = new Point();
container.toGlobal(localPoint, reusePoint);
// Performance optimization
const fastPoint = container.toGlobal(
{ x: 50, y: 50 },
undefined,
true // Skip transform update
);See
- Container#toLocal For reverse conversion
- Container#getGlobalPosition For container position
Inherited from
CoreSpine.toGlobal
toLocal()
> toLocal<P>(position, from?, point?, skipUpdate?): P
Defined in: node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.d.ts:100
Calculates the local position of the container relative to another point. Converts coordinates from any coordinate space to this container's local coordinate space.
Type Parameters
P
P extends PointData = Point
Parameters
position
PointData
The world origin to calculate from
from?
Container<ContainerChild>
The Container to calculate the global position from
point?
P
A Point object in which to store the value
skipUpdate?
boolean
Should we skip the update transform
Returns
P
A point object representing the position in local space
Example
// Basic coordinate conversion
const worldPoint = { x: 100, y: 100 };
const localPos = container.toLocal(worldPoint);
// Convert from another container
const fromSprite = new Sprite(texture);
fromSprite.position.set(50, 50);
const pointInSprite = { x: 10, y: 10 };
const localPoint = container.toLocal(pointInSprite, fromSprite);
// With point reuse for performance
const reusePoint = new Point();
container.toLocal(worldPoint, undefined, reusePoint);
// Skip transform update for static objects
const fastLocal = container.toLocal(
worldPoint,
undefined,
undefined,
true
);See
- Container#toGlobal For reverse conversion
- Container#getGlobalPosition For container position
Inherited from
CoreSpine.toLocal
unload()
> unload(): void
Defined in: node_modules/pixi.js/lib/scene/view/ViewContainer.d.ts:110
Unloads the GPU data from the view.
Returns
void
Inherited from
CoreSpine.unload
unloadFromCache()
> unloadFromCache(): boolean
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:354
Unloads this Spine object's cached SkeletonData.
Existing Spine objects that use this SkeletonData continue to work. Future Spine objects created with the same skeleton, atlas, and scale will parse a new SkeletonData.
Returns
boolean
true if the cached SkeletonData was removed, otherwise false.
Inherited from
CoreSpine.unloadFromCache
update()
> update(dt): void
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:241
If Spine.autoUpdate is false, this method allows to update the AnimationState and the Skeleton with the given delta.
Parameters
dt
number
Returns
void
Inherited from
CoreSpine.update
updateLocalTransform()
> updateLocalTransform(): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1225
Updates the local transform.
Returns
void
Inherited from
CoreSpine.updateLocalTransform
updateTransform()
> updateTransform(opts): this
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1195
Updates the transform properties of the container. Allows partial updates of transform properties for optimized manipulation.
Parameters
opts
Partial<UpdateTransformOptions>
Transform options to update
Returns
this
This container, for chaining
Example
// Basic transform update
container.updateTransform({
x: 100,
y: 200,
rotation: Math.PI / 4
});
// Scale and rotate around center
sprite.updateTransform({
pivotX: sprite.width / 2,
pivotY: sprite.height / 2,
scaleX: 2,
scaleY: 2,
rotation: Math.PI
});
// Update position only
button.updateTransform({
x: button.x + 10, // Move right
y: button.y // Keep same y
});See
- Container#setFromMatrix For matrix-based transforms
- Container#position For direct position access
Inherited from
CoreSpine.updateTransform
createOptions()
> static createOptions(options): SpineOptions
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:384
Get a convenient initialization configuration for your Spine game object.
Before instantiating a Spine game object, the skeleton (.skel or .json) and the atlas text files must be loaded into the Assets. For example:
PIXI.Assets.add("sackData", "/assets/sack-pro.skel");
PIXI.Assets.add("sackAtlas", "/assets/sack-pma.atlas");
await PIXI.Assets.load(["sackData", "sackAtlas"]);Once a Spine game object is created, its skeleton data is cached into Cache using the key:
${skeletonAssetName}-${atlasAssetName}-${options?.scale ?? 1}
Parameters
options
SpineFromOptions
Options to configure the Spine game object. See SpineFromOptions
Returns
SpineOptions
The configuration ready to be passed to the Spine constructor
Inherited from
CoreSpine.createOptions
from()
> static from(options): Spine
Defined in: node_modules/@esotericsoftware/spine-pixi-v8/dist/Spine.d.ts:402
Parameters
options
SpineFromOptions
Options to configure the Spine game object. See SpineFromOptions
Returns
Spine
The Spine game object instantiated
Deprecated
Use directly the Spine constructor or createOptions to make options and customize it to pass to the constructor
Use this method to instantiate a Spine game object.
Before instantiating a Spine game object, the skeleton (.skel or .json) and the atlas text files must be loaded into the Assets. For example:
PIXI.Assets.add("sackData", "/assets/sack-pro.skel");
PIXI.Assets.add("sackAtlas", "/assets/sack-pma.atlas");
await PIXI.Assets.load(["sackData", "sackAtlas"]);Once a Spine game object is created, its skeleton data is cached into Cache using the key:
${skeletonAssetName}-${atlasAssetName}-${options?.scale ?? 1}
Inherited from
CoreSpine.from
mixin()
> static mixin(source): void
Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:605
Mixes all enumerable properties and methods from a source object to Container.
Parameters
source
Dict<any>
The source of properties and methods to mix in.
Returns
void
Deprecated
since 8.8.0
Inherited from
CoreSpine.mixin