DragonBonesModuleController
此内容尚不支持你的语言。
Defined in: dragonbones/DragonBonesController.ts:35
Implements
Section titled “Implements”SkeletalController
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DragonBonesModuleController(
raw,api):DragonBonesModuleController
Defined in: dragonbones/DragonBonesController.ts:39
Parameters
Section titled “Parameters”Returns
Section titled “Returns”DragonBonesModuleController
Methods
Section titled “Methods”createInstance()
Section titled “createInstance()”createInstance(
skeletonHandle,armatureName):number
Defined in: dragonbones/DragonBonesController.ts:95
-1 when the file holds no armature by that name (see getArmatures).
Parameters
Section titled “Parameters”skeletonHandle
Section titled “skeletonHandle”number
armatureName
Section titled “armatureName”string
Returns
Section titled “Returns”number
destroyInstance()
Section titled “destroyInstance()”destroyInstance(
instanceId):void
Defined in: dragonbones/DragonBonesController.ts:101
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”SkeletalController.destroyInstance
fadeIn()
Section titled “fadeIn()”fadeIn(
instanceId,animation,fadeSeconds,loop?):boolean
Defined in: dragonbones/DragonBonesController.ts:113
Crossfade into animation over fadeSeconds — Spine’s mix table, per play.
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
animation
Section titled “animation”string
fadeSeconds
Section titled “fadeSeconds”number
boolean = true
Returns
Section titled “Returns”boolean
forEachMeshBatch()
Section titled “forEachMeshBatch()”forEachMeshBatch(
instanceId,cb):void
Defined in: dragonbones/DragonBonesController.ts:153
Visit the posed geometry; views live only for the duration of each call.
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
MeshBatchVisitor
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”SkeletalController.forEachMeshBatch
getAnimations()
Section titled “getAnimations()”getAnimations(
instanceId):string[]
Defined in: dragonbones/DragonBonesController.ts:134
Animation names this instance can play.
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
Returns
Section titled “Returns”string[]
Implementation of
Section titled “Implementation of”SkeletalController.getAnimations
getArmatures()
Section titled “getArmatures()”getArmatures(
handle):string[]
Defined in: dragonbones/DragonBonesController.ts:75
The armatures this file holds — DragonBones-only; a Spine file has one skeleton.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
Returns
Section titled “Returns”string[]
getAtlasImageName()
Section titled “getAtlasImageName()”getAtlasImageName(
handle):string
Defined in: dragonbones/DragonBonesController.ts:80
The image the atlas expects, so the caller knows what to upload.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
Returns
Section titled “Returns”string
getBounds()
Section titled “getBounds()”getBounds(
instanceId):SkeletalBounds
Defined in: dragonbones/DragonBonesController.ts:140
Where the posed skeleton currently is, in its own units.
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
Returns
Section titled “Returns”SkeletalBounds
Implementation of
Section titled “Implementation of”SkeletalController.getBounds
getLastError()
Section titled “getLastError()”getLastError():
string
Defined in: dragonbones/DragonBonesController.ts:66
Why the last call that could fail did. Empty when it did not.
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”SkeletalController.getLastError
loadSkeleton()
Section titled “loadSkeleton()”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.
Parameters
Section titled “Parameters”skeletonData
Section titled “skeletonData”string | Uint8Array<ArrayBufferLike>
atlasJson
Section titled “atlasJson”string
Returns
Section titled “Returns”number
play()
Section titled “play()”play(
instanceId,animation,loop?):boolean
Defined in: dragonbones/DragonBonesController.ts:108
loop false plays once; DragonBones counts plays, where 0 means forever.
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
animation
Section titled “animation”string
boolean = true
Returns
Section titled “Returns”boolean
runtimeVersion()
Section titled “runtimeVersion()”runtimeVersion():
number
Defined in: dragonbones/DragonBonesController.ts:158
The DragonBones data format this module reads.
Returns
Section titled “Returns”number
setAtlasTexture()
Section titled “setAtlasTexture()”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.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
textureId
Section titled “textureId”number
Returns
Section titled “Returns”void
setColor()
Section titled “setColor()”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”.
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
number
number
number
number
Returns
Section titled “Returns”void
setTimeScale()
Section titled “setTimeScale()”setTimeScale(
instanceId,scale):void
Defined in: dragonbones/DragonBonesController.ts:121
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
number
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop(
instanceId,animation?):void
Defined in: dragonbones/DragonBonesController.ts:117
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
animation?
Section titled “animation?”string = ''
Returns
Section titled “Returns”void
unloadSkeleton()
Section titled “unloadSkeleton()”unloadSkeleton(
handle):void
Defined in: dragonbones/DragonBonesController.ts:70
Drop a loaded file and every instance built from it.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”SkeletalController.unloadSkeleton
update()
Section titled “update()”update(
instanceId,dt):void
Defined in: dragonbones/DragonBonesController.ts:130
Advance by dt seconds and re-pose. Geometry is read back after this.
Parameters
Section titled “Parameters”instanceId
Section titled “instanceId”number
number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”SkeletalController.update