跳转到内容

DragonBonesModuleController

此内容尚不支持你的语言。

Defined in: dragonbones/DragonBonesController.ts:35

  • SkeletalController

new DragonBonesModuleController(raw, api): DragonBonesModuleController

Defined in: dragonbones/DragonBonesController.ts:39

DragonBonesWasmModule

DragonBonesWrappedAPI

DragonBonesModuleController

createInstance(skeletonHandle, armatureName): number

Defined in: dragonbones/DragonBonesController.ts:95

-1 when the file holds no armature by that name (see getArmatures).

number

string

number


destroyInstance(instanceId): void

Defined in: dragonbones/DragonBonesController.ts:101

number

void

SkeletalController.destroyInstance


fadeIn(instanceId, animation, fadeSeconds, loop?): boolean

Defined in: dragonbones/DragonBonesController.ts:113

Crossfade into animation over fadeSeconds — Spine’s mix table, per play.

number

string

number

boolean = true

boolean


forEachMeshBatch(instanceId, cb): void

Defined in: dragonbones/DragonBonesController.ts:153

Visit the posed geometry; views live only for the duration of each call.

number

MeshBatchVisitor

void

SkeletalController.forEachMeshBatch


getAnimations(instanceId): string[]

Defined in: dragonbones/DragonBonesController.ts:134

Animation names this instance can play.

number

string[]

SkeletalController.getAnimations


getArmatures(handle): string[]

Defined in: dragonbones/DragonBonesController.ts:75

The armatures this file holds — DragonBones-only; a Spine file has one skeleton.

number

string[]


getAtlasImageName(handle): string

Defined in: dragonbones/DragonBonesController.ts:80

The image the atlas expects, so the caller knows what to upload.

number

string


getBounds(instanceId): SkeletalBounds

Defined in: dragonbones/DragonBonesController.ts:140

Where the posed skeleton currently is, in its own units.

number

SkeletalBounds

SkeletalController.getBounds


getLastError(): string

Defined in: dragonbones/DragonBonesController.ts:66

Why the last call that could fail did. Empty when it did not.

string

SkeletalController.getLastError


loadSkeleton(skeletonData, atlasJson): number

Defined in: dragonbones/DragonBonesController.ts:51

Parse a skeleton and its atlas together; -1 on failure, with the reason in getLastError. Both are copied into the module’s heap because the parsers want a terminated string and the caller’s bytes are not one.

string | Uint8Array<ArrayBufferLike>

string

number


play(instanceId, animation, loop?): boolean

Defined in: dragonbones/DragonBonesController.ts:108

loop false plays once; DragonBones counts plays, where 0 means forever.

number

string

boolean = true

boolean


runtimeVersion(): number

Defined in: dragonbones/DragonBonesController.ts:158

The DragonBones data format this module reads.

number


setAtlasTexture(handle, textureId): void

Defined in: dragonbones/DragonBonesController.ts:88

Bind the uploaded page. Safe to call after instances exist — the module invalidates them, because uploading last is the normal order.

number

number

void


setColor(instanceId, r, g, b, a): void

Defined in: dragonbones/DragonBonesController.ts:126

Tint, multiplied onto each slot’s authored colour — opaque white is “as drawn”.

number

number

number

number

number

void


setTimeScale(instanceId, scale): void

Defined in: dragonbones/DragonBonesController.ts:121

number

number

void


stop(instanceId, animation?): void

Defined in: dragonbones/DragonBonesController.ts:117

number

string = ''

void


unloadSkeleton(handle): void

Defined in: dragonbones/DragonBonesController.ts:70

Drop a loaded file and every instance built from it.

number

void

SkeletalController.unloadSkeleton


update(instanceId, dt): void

Defined in: dragonbones/DragonBonesController.ts:130

Advance by dt seconds and re-pose. Geometry is read back after this.

number

number

void

SkeletalController.update