跳转到内容

SpineRuntime

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

Defined in: spine/SpineRuntime.ts:98

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.

SpineVersion

SpineWasmModule

SpineRuntime

readonly version: SpineVersion

Defined in: spine/SpineRuntime.ts:112

get entityCount(): number

Defined in: spine/SpineRuntime.ts:116

number

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.

number

SkeletalBoneTree | null


clipBudget(entity): SpineClipBudget | null

Defined in: spine/SpineRuntime.ts:228

number

SpineClipBudget | null


collectAllEvents(isActive?): object[]

Defined in: spine/SpineRuntime.ts:342

(entity) => boolean

object[]


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.

void


enableEvents(entity): void

Defined in: spine/SpineRuntime.ts:337

number

void


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.

number

boolean


extractAndSubmitMeshes(core, registry, materialOf?, isActive?): void

Defined in: spine/SpineRuntime.ts:590

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.

CppRegistry

SkeletalMaterialOf

(entity) => boolean

void


getAnimations(entity): string[]

Defined in: spine/SpineRuntime.ts:234

number

string[]


getBounds(entity): { height: number; width: number; x: number; y: number; } | null

Defined in: spine/SpineRuntime.ts:222

number

{ height: number; width: number; x: number; y: number; } | null


getPathConstraintMix(entity, name): PathMixData | null

Defined in: spine/SpineRuntime.ts:316

number

string

PathMixData | null


getSkins(entity): string[]

Defined in: spine/SpineRuntime.ts:240

number

string[]


getTransformConstraintMix(entity, name): TransformMixData | null

Defined in: spine/SpineRuntime.ts:303

number

string

TransformMixData | null


listConstraints(entity): ConstraintList | null

Defined in: spine/SpineRuntime.ts:297

number

ConstraintList | null


loadEntity(entity, era): boolean

Defined in: spine/SpineRuntime.ts:120

number

SpineEraBinding

boolean


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.

number

boolean


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.

SpineFrameMetrics | null


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.

boolean

void


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.

number

number

SpineCullingEnvelope | null


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.

SpineEraBinding

SpinePreviewInstance | null


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.

number

{ culling: SpineCullingEnvelope; requiresContinuousWorldPose: boolean; } | null


removeEntity(entity): void

Defined in: spine/SpineRuntime.ts:650

number

void


residencies(): SpineResidencyFacts[]

Defined in: spine/SpineRuntime.ts:491

Every residency this runtime holds, for a scene-level diagnostic.

SpineResidencyFacts[]


setAnimation(entity, animation, loop): void

Defined in: spine/SpineRuntime.ts:210

number

string

boolean

void


setAttachment(entity, slotName, attachmentName): boolean

Defined in: spine/SpineRuntime.ts:277

number

string

string

boolean


setDefaultMix(entity, duration): void

Defined in: spine/SpineRuntime.ts:262

number

number

void


setEnabled(entity, enabled): void

Defined in: spine/SpineRuntime.ts:329

number

boolean

void


setEntityProps(entity, props): void

Defined in: spine/SpineRuntime.ts:193

number

{ a: number; b: number; g: number; r: number; }

number

number

number

number

boolean

boolean

number

boolean

number

number

void


setIKTarget(entity, constraintName, targetX, targetY, mix): boolean

Defined in: spine/SpineRuntime.ts:284

number

string

number

number

number

boolean


setMixDuration(entity, fromAnim, toAnim, duration): void

Defined in: spine/SpineRuntime.ts:267

number

string

string

number

void


setPathConstraintMix(entity, name, mix): boolean

Defined in: spine/SpineRuntime.ts:322

number

string

PathMixData

boolean


setSkin(entity, skin): void

Defined in: spine/SpineRuntime.ts:215

number

string

void


setSlotColor(entity, slotName, r, g, b, a): boolean

Defined in: spine/SpineRuntime.ts:291

number

string

number

number

number

number

boolean


setTrackAlpha(entity, track, alpha): void

Defined in: spine/SpineRuntime.ts:272

number

number

number

void


setTransformConstraintMix(entity, name, mix): boolean

Defined in: spine/SpineRuntime.ts:309

number

string

TransformMixData

boolean


updateAll(dt, isActive?): void

Defined in: spine/SpineRuntime.ts:548

number

(entity) => boolean

void


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.

object

pose: SpineTimeWindow

readback: SpineTimeWindow

total: SpineTimeWindow


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.

number