Skip to content

EffectStack

Defined in: renderer/src/effects/EffectStack.ts:58

Internal

Internal: a list of attached effects bound to one pixi Container.

  • Coexists with external displayObject.filters assignments. The stack tracks the filter instances it owns; any other filter present on the target at sync time is treated as external and preserved (placed before the stack’s owned filters in the chain, so user filters render first and stack effects composite on top).
  • fadeIn / fadeOut are implemented via Tween.custom, scheduled on the supplied ScopedProcessQueue. Per-effect processes are tracked so handle.remove() cancels in-flight fades for that effect rather than letting them keep firing setIntensity after detach.

new EffectStack(displayObject, queue, scope): EffectStack

Defined in: renderer/src/effects/EffectStack.ts:66

Container

ScopedProcessQueue

EffectScope

EffectStack

get size(): number

Defined in: renderer/src/effects/EffectStack.ts:165

Number of attached effects.

number

add<H>(factory): H

Defined in: renderer/src/effects/EffectStack.ts:73

Build and attach an effect, returning its handle.

H extends EffectHandle

EffectFactory<H>

H


destroy(): void

Defined in: renderer/src/effects/EffectStack.ts:272

Tear down every attached effect and cancel any in-flight tweens.

void


findHandle(definitionName): EffectHandle | undefined

Defined in: renderer/src/effects/EffectStack.ts:179

Find the handle for the first effect in the stack built from a defineEffect-registered definition with the given name. Useful after restoreFrom to recover a handle to a saved effect (e.g. a hitFlash whose trigger() button needs to keep working).

Returns undefined if no matching entry exists. If the stack holds multiple entries with the same definition name, the first one encountered (insertion order) is returned.

string

EffectHandle | undefined


restoreFrom(snapshot): void

Defined in: renderer/src/effects/EffectStack.ts:228

Replace the stack’s contents with effects rebuilt from snapshot. Cancels in-flight fades on existing entries and detaches them, then re-adds each entry via its registered definition. Unknown definition names are skipped with a warning.

EffectStackSnapshot

void


serialize(): EffectStackSnapshot

Defined in: renderer/src/effects/EffectStack.ts:196

Capture the steady-state of every effect in the stack. Effects built from defineEffect-registered factories are included; entries without registry metadata (e.g. rawFilter, hand-built Effects) are skipped with a one-shot warning. In-flight fadeIn / fadeOut tweens are NOT preserved — only the values getIntensity() reads at call time.

EffectStackSnapshot