Skip to content

API / PixiSlot

Class: PixiSlot ​

Defined in: pixi/PixiSlot.ts:38

The PixiJS slot.

Extends ​

Constructors ​

Constructor ​

ts
new PixiSlot(): PixiSlot;

Returns ​

PixiSlot

Inherited from ​

Slot.constructor

Properties ​

_alpha ​

ts
_alpha: number;

Defined in: armature/TransformObject.ts:78

Internal

Inherited from ​

Slot._alpha


_armature ​

ts
_armature: Armature;

Defined in: armature/TransformObject.ts:86

Internal

Inherited from ​

Slot._armature


_cachedFrameIndices ​

ts
_cachedFrameIndices: number[];

Defined in: armature/Slot.ts:255

Internal

Inherited from ​

Slot._cachedFrameIndices


_colorDirty ​

ts
_colorDirty: boolean;

Defined in: armature/Slot.ts:190

Internal

Inherited from ​

Slot._colorDirty


_colorTransform ​

ts
readonly _colorTransform: ColorTransform;

Defined in: armature/Slot.ts:221

Internal

Inherited from ​

Slot._colorTransform


_displayFrame ​

ts
_displayFrame: DisplayFrame;

Defined in: armature/Slot.ts:237

Internal

Inherited from ​

Slot._displayFrame


_displayFrames ​

ts
readonly _displayFrames: DisplayFrame[] = [];

Defined in: armature/Slot.ts:225

Internal

Inherited from ​

Slot._displayFrames


_geometryBones ​

ts
readonly _geometryBones: Bone[] = [];

Defined in: armature/Slot.ts:229

Internal

Inherited from ​

Slot._geometryBones


_geometryData ​

ts
_geometryData: GeometryData;

Defined in: armature/Slot.ts:241

Internal

Inherited from ​

Slot._geometryData


_globalAlpha ​

ts
_globalAlpha: number;

Defined in: armature/TransformObject.ts:82

Internal

Inherited from ​

Slot._globalAlpha


_pivotX ​

ts
_pivotX: number;

Defined in: armature/Slot.ts:212

Internal

Inherited from ​

Slot._pivotX


_pivotY ​

ts
_pivotY: number;

Defined in: armature/Slot.ts:216

Internal

Inherited from ​

Slot._pivotY


_slotData ​

ts
_slotData: SlotData;

Defined in: armature/Slot.ts:233

Internal

Inherited from ​

Slot._slotData


_verticesDirty ​

ts
_verticesDirty: boolean;

Defined in: armature/Slot.ts:194

Internal

Inherited from ​

Slot._verticesDirty


_zIndex ​

ts
_zIndex: number;

Defined in: armature/Slot.ts:208

Internal

Inherited from ​

Slot._zIndex


_zOrder ​

ts
_zOrder: number;

Defined in: armature/Slot.ts:204

Internal

Inherited from ​

Slot._zOrder


displayController ​

ts
displayController: string;

Defined in: armature/Slot.ts:179

Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states.

Default ​

ts
null

Inherited from ​

Slot.displayController


global ​

ts
readonly global: Transform;

Defined in: armature/TransformObject.ts:56

A transform relative to the armature coordinate system.

Inherited from ​

Slot.global


globalTransformMatrix ​

ts
readonly globalTransformMatrix: Matrix;

Defined in: armature/TransformObject.ts:47

A matrix relative to the armature coordinate system.

Inherited from ​

Slot.globalTransformMatrix


hashCode ​

ts
readonly hashCode: number;

Defined in: core/BaseObject.ts:156

A unique identification number assigned to the object.

Inherited from ​

Slot.hashCode


offset ​

ts
readonly offset: Transform;

Defined in: armature/TransformObject.ts:65

The offset transform relative to the armature or the parent bone coordinate system.

Inherited from ​

Slot.offset

Accessors ​

armature ​

Get Signature ​

ts
get armature(): Armature;

Defined in: armature/TransformObject.ts:129

The armature to which it belongs.

Returns ​

Armature

Inherited from ​

Slot.armature


boundingBoxData ​

Get Signature ​

ts
get boundingBoxData(): BoundingBoxData;

Defined in: armature/Slot.ts:1156

The custom bounding box data for the slot at current time.

Returns ​

BoundingBoxData

Inherited from ​

Slot.boundingBoxData


childArmature ​

Get Signature ​

ts
get childArmature(): Armature;

Defined in: armature/Slot.ts:1215

The child armature that the slot displayed at current time.

Example ​
ts
    let slot = armature.getSlot("weapon");
    let prevChildArmature = slot.childArmature;
    if (prevChildArmature) {
        prevChildArmature.dispose();
    }
    slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
Returns ​

Armature

Set Signature ​

ts
set childArmature(value: Armature): void;

Defined in: armature/Slot.ts:1218

Parameters ​
ParameterType
valueArmature
Returns ​

void

Inherited from ​

Slot.childArmature


display ​

Get Signature ​

ts
get display(): any;

Defined in: armature/Slot.ts:1183

The display object that the slot displays at this time.

Example ​
ts
    let slot = armature.getSlot("text");
    slot.display = new yourEngine.TextField();
Returns ​

any

Set Signature ​

ts
set display(value: any): void;

Defined in: armature/Slot.ts:1186

Parameters ​
ParameterType
valueany
Returns ​

void

Inherited from ​

Slot.display


displayFrameCount ​

Set Signature ​

ts
set displayFrameCount(value: number): void;

Defined in: armature/Slot.ts:1067

Parameters ​
ParameterType
valuenumber
Returns ​

void

Inherited from ​

Slot.displayFrameCount


displayIndex ​

Get Signature ​

ts
get displayIndex(): number;

Defined in: armature/Slot.ts:1098

The index of the display object displayed in the display list.

Example ​
ts
    let slot = armature.getSlot("weapon");
    slot.displayIndex = 3;
    slot.displayController = "none";
Returns ​

number

Set Signature ​

ts
set displayIndex(value: number): void;

Defined in: armature/Slot.ts:1101

Parameters ​
ParameterType
valuenumber
Returns ​

void

Inherited from ​

Slot.displayIndex


displayList ​

Get Signature ​

ts
get displayList(): any[];

Defined in: armature/Slot.ts:1123

Contains a display list of display objects or child armatures.

Returns ​

any[]

Set Signature ​

ts
set displayList(value: any[]): void;

Defined in: armature/Slot.ts:1131

Parameters ​
ParameterType
valueany[]
Returns ​

void

Inherited from ​

Slot.displayList


name ​

Get Signature ​

ts
get name(): string;

Defined in: armature/Slot.ts:1113

The slot name.

Returns ​

string

Inherited from ​

Slot.name


parent ​

Get Signature ​

ts
get parent(): Bone;

Defined in: armature/Slot.ts:1232

The parent bone to which it belongs.

Returns ​

Bone

Inherited from ​

Slot.parent


slotData ​

Get Signature ​

ts
get slotData(): SlotData;

Defined in: armature/Slot.ts:1146

The slot data.

Returns ​

SlotData

Inherited from ​

Slot.slotData


visible ​

Get Signature ​

ts
get visible(): boolean;

Defined in: armature/Slot.ts:1050

The visible of slot's display object.

Default ​
ts
true
Returns ​

boolean

Set Signature ​

ts
set visible(value: boolean): void;

Defined in: armature/Slot.ts:1053

Parameters ​
ParameterType
valueboolean
Returns ​

void

Inherited from ​

Slot.visible

Methods ​

_isBonesUpdate() ​

ts
_isBonesUpdate(): boolean;

Defined in: armature/Slot.ts:358

Internal

Returns ​

boolean

Inherited from ​

Slot._isBonesUpdate


_setColor() ​

ts
_setColor(value: ColorTransform): boolean;

Defined in: armature/Slot.ts:627

Internal

Parameters ​

ParameterType
valueColorTransform

Returns ​

boolean

Inherited from ​

Slot._setColor


_setDisplayIndex() ​

ts
_setDisplayIndex(value: number, isAnimation: boolean): void;

Defined in: armature/Slot.ts:594

Internal

Parameters ​

ParameterTypeDefault value
valuenumberundefined
isAnimationbooleanfalse

Returns ​

void

Inherited from ​

Slot._setDisplayIndex


_setZOrder() ​

ts
_setZOrder(value: number): boolean;

Defined in: armature/Slot.ts:614

Internal

Parameters ​

ParameterType
valuenumber

Returns ​

boolean

Inherited from ​

Slot._setZOrder


_updateAlpha() ​

ts
_updateAlpha(): void;

Defined in: armature/Slot.ts:370

Internal

Returns ​

void

Inherited from ​

Slot._updateAlpha


_updateVisible() ​

ts
_updateVisible(): void;

Defined in: pixi/PixiSlot.ts:97

Internal

Returns ​

void

Overrides ​

Slot._updateVisible


containsPoint() ​

ts
containsPoint(x: number, y: number): boolean;

Defined in: armature/Slot.ts:933

Check whether a specific point is inside a custom bounding box in the slot. The coordinate system of the point is the inner coordinate system of the armature. Custom bounding boxes need to be customized in Dragonbones Pro.

Parameters ​

ParameterTypeDescription
xnumberThe horizontal coordinate of the point.
ynumberThe vertical coordinate of the point.

Returns ​

boolean

Inherited from ​

Slot.containsPoint


getDisplay() ​

ts
getDisplay(): any;

Defined in: armature/Slot.ts:1243

Deprecated, please refer to #display.

Returns ​

any

Deprecated ​

Inherited from ​

Slot.getDisplay


init() ​

ts
init(
   slotData: SlotData, 
   armatureValue: Armature, 
   rawDisplay: any, 
   meshDisplay: any): void;

Defined in: armature/Slot.ts:635

Internal

Parameters ​

ParameterType
slotDataSlotData
armatureValueArmature
rawDisplayany
meshDisplayany

Returns ​

void

Inherited from ​

Slot.init


intersectsSegment() ​

ts
intersectsSegment(
   xA: number, 
   yA: number, 
   xB: number, 
   yB: number, 
   intersectionPointA: object, 
   intersectionPointB: object, 
   normalRadians: object): number;

Defined in: armature/Slot.ts:981

Check whether a specific segment intersects a custom bounding box for the slot. The coordinate system of the segment and intersection is the inner coordinate system of the armature. Custom bounding boxes need to be customized in Dragonbones Pro.

Parameters ​

ParameterTypeDefault valueDescription
xAnumberundefinedThe horizontal coordinate of the beginning of the segment.
yAnumberundefinedThe vertical coordinate of the beginning of the segment.
xBnumberundefinedThe horizontal coordinate of the end point of the segment.
yBnumberundefinedThe vertical coordinate of the end point of the segment.
intersectionPointA{ x: number; y: number; }nullThe first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated)
intersectionPointA.xnumberundefined-
intersectionPointA.ynumberundefined-
intersectionPointB{ x: number; y: number; }nullThe first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated)
intersectionPointB.xnumberundefined-
intersectionPointB.ynumberundefined-
normalRadians{ x: number; y: number; }nullThe normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated)
normalRadians.xnumberundefined-
normalRadians.ynumberundefined-

Returns ​

number

Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections]

Inherited from ​

Slot.intersectsSegment


invalidUpdate() ​

ts
invalidUpdate(): void;

Defined in: armature/Slot.ts:788

Forces the slot to update the state of the display object in the next frame.

Returns ​

void

Inherited from ​

Slot.invalidUpdate


returnToPool() ​

ts
returnToPool(): void;

Defined in: core/BaseObject.ts:167

Clear the object and return it back to object pool。

Returns ​

void

Inherited from ​

Slot.returnToPool


setDisplay() ​

ts
setDisplay(value: any): void;

Defined in: armature/Slot.ts:1253

Deprecated, please refer to #display.

Parameters ​

ParameterType
valueany

Returns ​

void

Deprecated ​

Inherited from ​

Slot.setDisplay


update() ​

ts
update(cacheFrameIndex: number): void;

Defined in: armature/Slot.ts:674

Internal

Parameters ​

ParameterType
cacheFrameIndexnumber

Returns ​

void

Inherited from ​

Slot.update


updateGlobalTransform() ​

ts
updateGlobalTransform(): void;

Defined in: armature/TransformObject.ts:116

For performance considerations, rotation or scale in the #global attribute of the bone or slot is not always properly accessible, some engines do not rely on these attributes to update rendering, such as Egret. The use of this method ensures that the access to the #global property is correctly rotation or scale.

Returns ​

void

Example ​

ts
    bone.updateGlobalTransform();
    let rotation = bone.global.rotation;

Inherited from ​

Slot.updateGlobalTransform


borrowObject() ​

ts
static borrowObject<T>(objectConstructor: () => T): T;

Defined in: core/BaseObject.ts:136

Get an instance of the specify class from object pool.

Type Parameters ​

Type Parameter
T extends BaseObject

Parameters ​

ParameterTypeDescription
objectConstructor() => TThe specify class.

Returns ​

T

Inherited from ​

Slot.borrowObject


clearPool() ​

ts
static clearPool(objectConstructor: typeof BaseObject): void;

Defined in: core/BaseObject.ts:111

Clear the cached instances of a specify object pool.

Parameters ​

ParameterTypeDefault valueDescription
objectConstructortypeof BaseObjectnullSpecify class. (Clear all cached instances if not set)

Returns ​

void

Inherited from ​

Slot.clearPool


setMaxCount() ​

ts
static setMaxCount(objectConstructor: typeof BaseObject, maxCount: number): void;

Defined in: core/BaseObject.ts:72

Set the maximum cache count of the specify object pool.

Parameters ​

ParameterTypeDescription
objectConstructortypeof BaseObjectThe specify class. (Set all object pools max cache count if not set)
maxCountnumberMax count.

Returns ​

void

Inherited from ​

Slot.setMaxCount


toString() ​

ts
static toString(): string;

Defined in: pixi/PixiSlot.ts:39

Returns ​

string

Overrides ​

Slot.toString

Released under the MIT License.