Skip to content

API / Surface

类: Surface ​

定义于: armature/Surface.ts:33

Internal

继承 ​

构造函数 ​

构造函数 ​

ts
new Surface(): Surface;

返回 ​

Surface

继承自 ​

Bone.constructor

属性 ​

_alpha ​

ts
_alpha: number;

定义于: armature/TransformObject.ts:78

Internal

继承自 ​

Bone._alpha


_armature ​

ts
_armature: Armature;

定义于: armature/TransformObject.ts:86

Internal

继承自 ​

Bone._armature


_bone ​

ts
_bone: Bone;

定义于: armature/Surface.ts:55


_boneData ​

ts
_boneData: BoneData;

定义于: armature/Bone.ts:79

Internal

继承自 ​

Bone._boneData


_cachedFrameIndices ​

ts
_cachedFrameIndices: number[];

定义于: armature/Bone.ts:87

Internal

继承自 ​

Bone._cachedFrameIndices


_childrenTransformDirty ​

ts
_childrenTransformDirty: boolean;

定义于: armature/Bone.ts:68

Internal

继承自 ​

Bone._childrenTransformDirty


_deformVertices ​

ts
readonly _deformVertices: number[] = [];

定义于: armature/Surface.ts:45


_globalAlpha ​

ts
_globalAlpha: number;

定义于: armature/TransformObject.ts:82

Internal

继承自 ​

Bone._globalAlpha


_hasConstraint ​

ts
_hasConstraint: boolean;

定义于: armature/Bone.ts:73

Internal

继承自 ​

Bone._hasConstraint


_transformDirty ​

ts
_transformDirty: boolean;

定义于: armature/Bone.ts:64

Internal

继承自 ​

Bone._transformDirty


_vertices ​

ts
readonly _vertices: number[] = [];

定义于: armature/Surface.ts:44


animationPose ​

ts
readonly animationPose: Transform;

定义于: armature/Bone.ts:60

Internal

继承自 ​

Bone.animationPose


global ​

ts
readonly global: Transform;

定义于: armature/TransformObject.ts:56

相对于骨架坐标系的变换。

继承自 ​

Bone.global


globalTransformMatrix ​

ts
readonly globalTransformMatrix: Matrix;

定义于: armature/TransformObject.ts:47

相对于骨架坐标系的矩阵。

继承自 ​

Bone.globalTransformMatrix


hashCode ​

ts
readonly hashCode: number;

定义于: core/BaseObject.ts:156

分配给此实例的唯一标识号。

继承自 ​

Bone.hashCode


offset ​

ts
readonly offset: Transform;

定义于: armature/TransformObject.ts:65

相对于骨架或父骨骼坐标系的偏移变换。

继承自 ​

Bone.offset


offsetMode ​

ts
offsetMode: OffsetMode;

定义于: armature/Bone.ts:56

偏移模式。

继承自 ​

Bone.offsetMode

访问器 ​

armature ​

Getter 签名 ​

ts
get armature(): Armature;

定义于: armature/TransformObject.ts:129

所属的骨架。

返回 ​

Armature

继承自 ​

Bone.armature


boneData ​

Getter 签名 ​

ts
get boneData(): BoneData;

定义于: armature/Bone.ts:499

骨骼数据。

返回 ​

BoneData

继承自 ​

Bone.boneData


name ​

Getter 签名 ​

ts
get name(): string;

定义于: armature/Bone.ts:534

骨骼名称。

返回 ​

string

继承自 ​

Bone.name


parent ​

Getter 签名 ​

ts
get parent(): Bone;

定义于: armature/Bone.ts:544

所属的父骨骼。

返回 ​

Bone

继承自 ​

Bone.parent


visible ​

Getter 签名 ​

ts
get visible(): boolean;

定义于: armature/Bone.ts:511

此骨骼所有插槽的可见。

默认值 ​
ts
true
返回 ​

boolean

Setter 签名 ​

ts
set visible(value: boolean): void;

定义于: armature/Bone.ts:514

参数 ​
参数类型
valueboolean
返回 ​

void

继承自 ​

Bone.visible

方法 ​

_getGlobalTransformMatrix() ​

ts
_getGlobalTransformMatrix(x: number, y: number): Matrix;

定义于: armature/Surface.ts:171

参数 ​

参数类型
xnumber
ynumber

返回 ​

Matrix


_updateAlpha() ​

ts
_updateAlpha(): void;

定义于: armature/Bone.ts:331

Internal

返回 ​

void

继承自 ​

Bone._updateAlpha


contains() ​

ts
contains(value: Bone): boolean;

定义于: armature/Bone.ts:480

检查该骨骼是否包含特定的骨骼。

参数 ​

参数类型
valueBone

返回 ​

boolean

继承自 ​

Bone.contains


invalidUpdate() ​

ts
invalidUpdate(): void;

定义于: armature/Bone.ts:469

强制骨骼在下一帧更新变换。 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。

返回 ​

void

示例 ​

ts
    let bone = armature.getBone("arm");
    bone.offset.scaleX = 2.0;
    bone.invalidUpdate();

继承自 ​

Bone.invalidUpdate


returnToPool() ​

ts
returnToPool(): void;

定义于: core/BaseObject.ts:167

清除该实例的所有数据并将其返还对象池。

返回 ​

void

继承自 ​

Bone.returnToPool


update() ​

ts
update(cacheFrameIndex: number): void;

定义于: armature/Surface.ts:487

Internal

参数 ​

参数类型
cacheFrameIndexnumber

返回 ​

void

重写了 ​

Bone.update


updateByConstraint() ​

ts
updateByConstraint(): void;

定义于: armature/Bone.ts:442

Internal

返回 ​

void

继承自 ​

Bone.updateByConstraint


updateGlobalTransform() ​

ts
updateGlobalTransform(): void;

定义于: armature/TransformObject.ts:116

出于性能的考虑,骨骼或插槽的 #global 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 使用此方法可以保证访问到 #global 属性中正确的旋转或缩放。

返回 ​

void

示例 ​

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

继承自 ​

Bone.updateGlobalTransform


borrowObject() ​

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

定义于: core/BaseObject.ts:136

从对象池中获取特定类的实例。

类型参数 ​

类型参数
T extends BaseObject

参数 ​

参数类型描述
objectConstructor() => T特定的类。

返回 ​

T

继承自 ​

Bone.borrowObject


clearPool() ​

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

定义于: core/BaseObject.ts:111

清除特定对象池的缓存实例。

参数 ​

参数类型默认值描述
objectConstructortypeof BaseObjectnull特定的类。 (不设置则清除所有缓存的实例)

返回 ​

void

继承自 ​

Bone.clearPool


setMaxCount() ​

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

定义于: core/BaseObject.ts:72

设置特定对象池的最大缓存数量。

参数 ​

参数类型描述
objectConstructortypeof BaseObject特定的类。 (不设置则设置所有对象池的最大缓存数量)
maxCountnumber最大缓存数量。

返回 ​

void

继承自 ​

Bone.setMaxCount


toString() ​

ts
static toString(): string;

定义于: armature/Surface.ts:34

返回 ​

string

重写了 ​

Bone.toString

Released under the MIT License.