Skip to content

API 参考 / NatsumeRuntime

Class: NatsumeRuntime ​

Defined in: packages/natsume/src/runtime/runtime.ts:1070

Binds a Pixi WebGL2 renderer. Owns shared textures and Script Bridge registrations.

Constructors ​

Constructor ​

new NatsumeRuntime(renderer, options?): NatsumeRuntime

Defined in: packages/natsume/src/runtime/runtime.ts:1079

Parameters ​

renderer ​

WebGLRenderer

options? ​
scriptErrors? ​

"isolate" | "throw"

Returns ​

NatsumeRuntime

Properties ​

renderer ​

readonly renderer: WebGLRenderer

Defined in: packages/natsume/src/runtime/runtime.ts:1080


scriptErrors ​

readonly scriptErrors: "isolate" | "throw"

Defined in: packages/natsume/src/runtime/runtime.ts:1077

How errors thrown by host and Bridge callbacks are handled.

Methods ​

checkCompatibility() ​

checkCompatibility(pack, options?): CompatibilityReport

Defined in: packages/natsume/src/runtime/runtime.ts:1131

Checks the selected entry and host inputs without creating an instance or decoding textures. Includes blocking issues and approximation warnings; does not run script factories.

Parameters ​

pack ​

EffectPack

options? ​

InstanceOptions = {}

Returns ​

CompatibilityReport


destroy() ​

destroy(): void

Defined in: packages/natsume/src/runtime/runtime.ts:1509

Destroys every live instance and clears registered scripts.

Returns ​

void


instantiate() ​

instantiate(pack, options?): Promise<EffectInstance>

Defined in: packages/natsume/src/runtime/runtime.ts:1148

Creates an independent effect after compatibility checks pass.

Parameters ​

pack ​

EffectPack

options? ​

InstanceOptions = {}

Returns ​

Promise<EffectInstance>

Throws ​

NatsumeCompatibilityError with all preflight issues when configuration is blocked.


registerScript() ​

registerScript(identity, factory, declaration?): void

Defined in: packages/natsume/src/runtime/runtime.ts:1092

Registers host behavior and the exact scalar fields writable by source animation.

Parameters ​

identity ​

ScriptIdentity

factory ​

ScriptFactory

declaration? ​

ScriptDeclaration = {}

Returns ​

void

基于 Apache License 2.0 发布