Skip to content

API / TransformObject

Class: abstract TransformObject

Defined in: armature/TransformObject.ts:36

The base class of the transform object.

Extends

Extended by

Constructors

Constructor

ts
new TransformObject(): TransformObject;

Returns

TransformObject

Inherited from

BaseObject.constructor

Properties

_alpha

ts
_alpha: number;

Defined in: armature/TransformObject.ts:78

Internal


_armature

ts
_armature: Armature;

Defined in: armature/TransformObject.ts:86

Internal


_globalAlpha

ts
_globalAlpha: number;

Defined in: armature/TransformObject.ts:82

Internal


global

ts
readonly global: Transform;

Defined in: armature/TransformObject.ts:56

A transform relative to the armature coordinate system.


globalTransformMatrix

ts
readonly globalTransformMatrix: Matrix;

Defined in: armature/TransformObject.ts:47

A matrix relative to the armature coordinate system.


hashCode

ts
readonly hashCode: number;

Defined in: core/BaseObject.ts:156

A unique identification number assigned to the object.

Inherited from

BaseObject.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.

Accessors

armature

Get Signature

ts
get armature(): Armature;

Defined in: armature/TransformObject.ts:129

The armature to which it belongs.

Returns

Armature

Methods

returnToPool()

ts
returnToPool(): void;

Defined in: core/BaseObject.ts:167

Clear the object and return it back to object pool。

Returns

void

Inherited from

BaseObject.returnToPool


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;

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

BaseObject.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

BaseObject.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

BaseObject.setMaxCount


toString()

ts
static toString(): string;

Defined in: core/BaseObject.ts:56

Returns

string

Inherited from

BaseObject.toString

Released under the MIT License.