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.filtersassignments. 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/fadeOutare implemented viaTween.custom, scheduled on the suppliedScopedProcessQueue. Per-effect processes are tracked sohandle.remove()cancels in-flight fades for that effect rather than letting them keep firingsetIntensityafter detach.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new EffectStack(
displayObject,queue,scope):EffectStack
Defined in: renderer/src/effects/EffectStack.ts:66
Parameters
Section titled “Parameters”displayObject
Section titled “displayObject”Container
ScopedProcessQueue
Returns
Section titled “Returns”EffectStack
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Defined in: renderer/src/effects/EffectStack.ts:165
Number of attached effects.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”add<
H>(factory):H
Defined in: renderer/src/effects/EffectStack.ts:73
Build and attach an effect, returning its handle.
Type Parameters
Section titled “Type Parameters”H extends EffectHandle
Parameters
Section titled “Parameters”factory
Section titled “factory”Returns
Section titled “Returns”H
destroy()
Section titled “destroy()”destroy():
void
Defined in: renderer/src/effects/EffectStack.ts:272
Tear down every attached effect and cancel any in-flight tweens.
Returns
Section titled “Returns”void
findHandle()
Section titled “findHandle()”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.
Parameters
Section titled “Parameters”definitionName
Section titled “definitionName”string
Returns
Section titled “Returns”EffectHandle | undefined
restoreFrom()
Section titled “restoreFrom()”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.
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Returns
Section titled “Returns”void
serialize()
Section titled “serialize()”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.