SpineRuntime
此内容尚不支持你的语言。
Defined in: spine/SpineRuntime.ts:98
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SpineRuntime(
version,module):SpineRuntime
Defined in: spine/SpineRuntime.ts:112
One runtime per loaded module: the ABI adapter is made here rather than handed in, because nothing else has a reason to hold one.
Parameters
Section titled “Parameters”version
Section titled “version”module
Section titled “module”SpineWasmModule
Returns
Section titled “Returns”SpineRuntime
Properties
Section titled “Properties”version
Section titled “version”
readonlyversion:SpineVersion
Defined in: spine/SpineRuntime.ts:112
Accessors
Section titled “Accessors”entityCount
Section titled “entityCount”Get Signature
Section titled “Get Signature”get entityCount():
number
Defined in: spine/SpineRuntime.ts:116
Returns
Section titled “Returns”number
Methods
Section titled “Methods”boneTree()
Section titled “boneTree()”boneTree(
entity):SkeletalBoneTree|null
Defined in: spine/SpineRuntime.ts:251
The skeleton’s bones as drawn this frame, with how the entity places them: the skeleton’s own scale and flips, which the draw applies and a point in skeleton space has to as well. Null when nothing is loaded or the module predates the call.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”SkeletalBoneTree | null
clipBudget()
Section titled “clipBudget()”clipBudget(
entity):SpineClipBudget|null
Defined in: spine/SpineRuntime.ts:228
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”SpineClipBudget | null
collectAllEvents()
Section titled “collectAllEvents()”collectAllEvents(
isActive?):object[]
Defined in: spine/SpineRuntime.ts:342
Parameters
Section titled “Parameters”isActive?
Section titled “isActive?”(entity) => boolean
Returns
Section titled “Returns”object[]
dispose()
Section titled “dispose()”dispose():
void
Defined in: spine/SpineRuntime.ts:673
Give back everything this runtime holds, in the order it holds it: instances, then the native skeletons, then the eras they came from.
Returns
Section titled “Returns”void
enableEvents()
Section titled “enableEvents()”enableEvents(
entity):void
Defined in: spine/SpineRuntime.ts:337
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
ensurePose()
Section titled “ensurePose()”ensurePose(
entity):boolean
Defined in: spine/SpineRuntime.ts:525
Resolve this entity’s world transforms if they do not already reflect its local pose; returns whether it had to. The REVISION is the authority, not the frame — a frame that resolves and then moves an IK target owes another one, and a frame key would hand the next asker the pose from before it.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”boolean
extractAndSubmitMeshes()
Section titled “extractAndSubmitMeshes()”extractAndSubmitMeshes(
core,registry,materialOf?,isActive?):void
Defined in: spine/SpineRuntime.ts:590
Parameters
Section titled “Parameters”NonNullable<EngineApi>
whichever engine core is present (see ecs/engineApi.ts) — the batches cross through its heap, which is wasm linear memory on the web and the host arena on a device.
registry
Section titled “registry”CppRegistry
materialOf?
Section titled “materialOf?”SkeletalMaterialOf
isActive?
Section titled “isActive?”(entity) => boolean
Returns
Section titled “Returns”void
getAnimations()
Section titled “getAnimations()”getAnimations(
entity):string[]
Defined in: spine/SpineRuntime.ts:234
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”string[]
getBounds()
Section titled “getBounds()”getBounds(
entity): {height:number;width:number;x:number;y:number; } |null
Defined in: spine/SpineRuntime.ts:222
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”{ height: number; width: number; x: number; y: number; } | null
getPathConstraintMix()
Section titled “getPathConstraintMix()”getPathConstraintMix(
entity,name):PathMixData|null
Defined in: spine/SpineRuntime.ts:316
Parameters
Section titled “Parameters”entity
Section titled “entity”number
string
Returns
Section titled “Returns”PathMixData | null
getSkins()
Section titled “getSkins()”getSkins(
entity):string[]
Defined in: spine/SpineRuntime.ts:240
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”string[]
getTransformConstraintMix()
Section titled “getTransformConstraintMix()”getTransformConstraintMix(
entity,name):TransformMixData|null
Defined in: spine/SpineRuntime.ts:303
Parameters
Section titled “Parameters”entity
Section titled “entity”number
string
Returns
Section titled “Returns”TransformMixData | null
listConstraints()
Section titled “listConstraints()”listConstraints(
entity):ConstraintList|null
Defined in: spine/SpineRuntime.ts:297
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”ConstraintList | null
loadEntity()
Section titled “loadEntity()”loadEntity(
entity,era):boolean
Defined in: spine/SpineRuntime.ts:120
Parameters
Section titled “Parameters”entity
Section titled “entity”number
SpineEraBinding
Returns
Section titled “Returns”boolean
mayDefer()
Section titled “mayDefer()”mayDefer(
entity):boolean
Defined in: spine/SpineRuntime.ts:391
Whether this entity’s world pose may be left owed when nothing wants it — both proofs, settled when its residency was made. The scheduler that will use it does not exist yet; a diagnostic asking why can already read the two facts off the residency.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”boolean
metrics()
Section titled “metrics()”metrics():
SpineFrameMetrics|null
Defined in: spine/SpineRuntime.ts:639
The LIVE frame record — the same object every frame, so reading it costs nothing and holding it shows the next frame. Null when not observing.
Returns
Section titled “Returns”SpineFrameMetrics | null
observe()
Section titled “observe()”observe(
on):void
Defined in: spine/SpineRuntime.ts:633
Start or stop reporting what each frame costs. Off by default and off is free: every counter and both clock reads are behind this one field, so a runtime nobody is watching pays a branch per entity and nothing else.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
observedBounds()
Section titled “observedBounds()”observedBounds(
entity,sampleStep?):SpineCullingEnvelope|null
Defined in: spine/SpineRuntime.ts:403
Scan this entity’s SKELETON — every animation over its whole duration, in every skin — on a scratch instance, so the entity asking keeps its pose. An OBSERVATION whatever it finds: authoring proposes contracts from it and the runtime may never act on it. See spineBounds.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
sampleStep?
Section titled “sampleStep?”number
Returns
Section titled “Returns”SpineCullingEnvelope | null
openPreview()
Section titled “openPreview()”openPreview(
era):SpinePreviewInstance|null
Defined in: spine/SpineRuntime.ts:431
A skeleton posed by nobody but its caller.
Outside entities_ on purpose — the map updateAll and the submit both
walk — so a preview is never advanced or drawn by the frame. What it gives
back is the same instance and the same batch walk a scene entity gets.
Parameters
Section titled “Parameters”SpineEraBinding
Returns
Section titled “Returns”SpinePreviewInstance | null
poseEligibility()
Section titled “poseEligibility()”poseEligibility(
entity): {culling:SpineCullingEnvelope;requiresContinuousWorldPose:boolean; } |null
Defined in: spine/SpineRuntime.ts:412
Why, for a diagnostic: the promise, and what the runtime says of itself.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”{ culling: SpineCullingEnvelope; requiresContinuousWorldPose: boolean; } | null
removeEntity()
Section titled “removeEntity()”removeEntity(
entity):void
Defined in: spine/SpineRuntime.ts:650
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
residencies()
Section titled “residencies()”residencies():
SpineResidencyFacts[]
Defined in: spine/SpineRuntime.ts:491
Every residency this runtime holds, for a scene-level diagnostic.
Returns
Section titled “Returns”setAnimation()
Section titled “setAnimation()”setAnimation(
entity,animation,loop):void
Defined in: spine/SpineRuntime.ts:210
Parameters
Section titled “Parameters”entity
Section titled “entity”number
animation
Section titled “animation”string
boolean
Returns
Section titled “Returns”void
setAttachment()
Section titled “setAttachment()”setAttachment(
entity,slotName,attachmentName):boolean
Defined in: spine/SpineRuntime.ts:277
Parameters
Section titled “Parameters”entity
Section titled “entity”number
slotName
Section titled “slotName”string
attachmentName
Section titled “attachmentName”string
Returns
Section titled “Returns”boolean
setDefaultMix()
Section titled “setDefaultMix()”setDefaultMix(
entity,duration):void
Defined in: spine/SpineRuntime.ts:262
Parameters
Section titled “Parameters”entity
Section titled “entity”number
duration
Section titled “duration”number
Returns
Section titled “Returns”void
setEnabled()
Section titled “setEnabled()”setEnabled(
entity,enabled):void
Defined in: spine/SpineRuntime.ts:329
Parameters
Section titled “Parameters”entity
Section titled “entity”number
enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
setEntityProps()
Section titled “setEntityProps()”setEntityProps(
entity,props):void
Defined in: spine/SpineRuntime.ts:193
Parameters
Section titled “Parameters”entity
Section titled “entity”number
color?
Section titled “color?”{ a: number; b: number; g: number; r: number; }
color.a
Section titled “color.a”number
color.b
Section titled “color.b”number
color.g
Section titled “color.g”number
color.r
Section titled “color.r”number
flipX?
Section titled “flipX?”boolean
flipY?
Section titled “flipY?”boolean
layer?
Section titled “layer?”number
playing?
Section titled “playing?”boolean
skeletonScale?
Section titled “skeletonScale?”number
timeScale?
Section titled “timeScale?”number
Returns
Section titled “Returns”void
setIKTarget()
Section titled “setIKTarget()”setIKTarget(
entity,constraintName,targetX,targetY,mix):boolean
Defined in: spine/SpineRuntime.ts:284
Parameters
Section titled “Parameters”entity
Section titled “entity”number
constraintName
Section titled “constraintName”string
targetX
Section titled “targetX”number
targetY
Section titled “targetY”number
number
Returns
Section titled “Returns”boolean
setMixDuration()
Section titled “setMixDuration()”setMixDuration(
entity,fromAnim,toAnim,duration):void
Defined in: spine/SpineRuntime.ts:267
Parameters
Section titled “Parameters”entity
Section titled “entity”number
fromAnim
Section titled “fromAnim”string
toAnim
Section titled “toAnim”string
duration
Section titled “duration”number
Returns
Section titled “Returns”void
setPathConstraintMix()
Section titled “setPathConstraintMix()”setPathConstraintMix(
entity,name,mix):boolean
Defined in: spine/SpineRuntime.ts:322
Parameters
Section titled “Parameters”entity
Section titled “entity”number
string
Returns
Section titled “Returns”boolean
setSkin()
Section titled “setSkin()”setSkin(
entity,skin):void
Defined in: spine/SpineRuntime.ts:215
Parameters
Section titled “Parameters”entity
Section titled “entity”number
string
Returns
Section titled “Returns”void
setSlotColor()
Section titled “setSlotColor()”setSlotColor(
entity,slotName,r,g,b,a):boolean
Defined in: spine/SpineRuntime.ts:291
Parameters
Section titled “Parameters”entity
Section titled “entity”number
slotName
Section titled “slotName”string
number
number
number
number
Returns
Section titled “Returns”boolean
setTrackAlpha()
Section titled “setTrackAlpha()”setTrackAlpha(
entity,track,alpha):void
Defined in: spine/SpineRuntime.ts:272
Parameters
Section titled “Parameters”entity
Section titled “entity”number
number
number
Returns
Section titled “Returns”void
setTransformConstraintMix()
Section titled “setTransformConstraintMix()”setTransformConstraintMix(
entity,name,mix):boolean
Defined in: spine/SpineRuntime.ts:309
Parameters
Section titled “Parameters”entity
Section titled “entity”number
string
Returns
Section titled “Returns”boolean
updateAll()
Section titled “updateAll()”updateAll(
dt,isActive?):void
Defined in: spine/SpineRuntime.ts:548
Parameters
Section titled “Parameters”number
isActive?
Section titled “isActive?”(entity) => boolean
Returns
Section titled “Returns”void
windows()
Section titled “windows()”windows():
object
Defined in: spine/SpineRuntime.ts:646
The last 120 COMPLETED frames of each timed phase — all three fed at the same boundary, so they always describe the same frames. A mean hides the frame that missed; these say whether one did.
Returns
Section titled “Returns”object
pose:
SpineTimeWindow
readback
Section titled “readback”readback:
SpineTimeWindow
total:
SpineTimeWindow
worldPoseDebt()
Section titled “worldPoseDebt()”worldPoseDebt():
number
Defined in: spine/SpineRuntime.ts:510
Entities owing a world pose, disabled ones aside — those are out of the frame, so posing every frame would not have resolved them either.
A STATE and not a tally, which is what makes it exact: read after a frame’s submit it is the world-transform resolves that frame did not do.
Returns
Section titled “Returns”number