Skip to content

Class: SSRuntimeEffectSlot ​

Defined in: wasm/ssruntime.d.ts:278

JS-friendly wrapper of EffectSlot. Same conceptual flow as the C FFI:

  1. construct via create, 2) call step per frame with the resolved active event and timing, 3) read get_draw_plan_buf/get_draw_plan_len only when step returned true and only before the next call.

Indexable ​

[key: number]: () => void

Methods ​

free() ​

free(): void

Defined in: wasm/ssruntime.d.ts:280

Returns ​

void


get_draw_plan_buf() ​

get_draw_plan_buf(): number

Defined in: wasm/ssruntime.d.ts:283

Returns ​

number


get_draw_plan_len() ​

get_draw_plan_len(): number

Defined in: wasm/ssruntime.d.ts:284

Returns ​

number


get_seed() ​

get_seed(): number

Defined in: wasm/ssruntime.d.ts:285

Returns ​

number


is_independent() ​

is_independent(): boolean

Defined in: wasm/ssruntime.d.ts:286

Returns ​

boolean


reset() ​

reset(): void

Defined in: wasm/ssruntime.d.ts:294

Reset the slot's playback / "last started key" memory to its just-created state without destroying it. Call on an explicit head-out (replay) so a re-played animation re-fires its effect from scratch instead of debouncing the first key as the same one the slot last started. Mirrors the C-API ss_effect_slot_reset.

Returns ​

void


step() ​

step(ev, parent_frame, delta_seconds, fps, parent_looped, y_flip, vert_stride, draw): boolean

Defined in: wasm/ssruntime.d.ts:309

Advance one frame. ev is the event info returned by SSRuntimeContext::get_active_effect_event (or built manually via WebEffectEventInfo).

y_flip = true for Y-down rendering (pixi.js), mirroring each particle's Y position, rotation sign and quad; vert_stride = 2 packs (x,y) verts, 3 packs (x,y,0) for engines requiring 3-component verts. draw is whether the part is in this frame's draw_order: a hidden part steps with false, which moves its clock and builds no plan. Pass true when stepping before this frame's draw_order is known. Returns true if visible; on true callers read the plan via get_draw_plan_buf / get_draw_plan_len before the next step.

Parameters ​

ev ​

WebEffectEventInfo

parent_frame ​

number

delta_seconds ​

number

fps ​

number

parent_looped ​

boolean

y_flip ​

boolean

vert_stride ​

number

draw ​

boolean

Returns ​

boolean


create() ​

static create(resource, effect_name_hash, seed): SSRuntimeEffectSlot

Defined in: wasm/ssruntime.d.ts:282

Parameters ​

resource ​

SSRuntimeResource

effect_name_hash ​

number

seed ​

number

Returns ​

SSRuntimeEffectSlot