EffectsHost
Defined in: renderer/src/effects/EffectsHost.ts:24
Per-attachment-site holder for an EffectStack. Every scope (component,
layer, scene, screen) carries its own EffectsHost exposed as .fx, so
the user-facing API for adding / finding / fading effects is identical
regardless of where the effect lives.
The underlying EffectStack is built lazily on first addEffect (or
restore) so sites that never use effects pay zero cost.
getContainer is a thunk because some sites (component scope) wire the
host at construction time but the underlying display object may itself be
created in the same constructor — the thunk removes “is this stable yet?”
thinking. makeQueue is optional because some test setups omit a
ProcessSystem; calling addEffect then throws a clear error.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new EffectsHost(
getContainer,scope,makeQueue):EffectsHost
Defined in: renderer/src/effects/EffectsHost.ts:27
Parameters
Section titled “Parameters”getContainer
Section titled “getContainer”() => Container
makeQueue
Section titled “makeQueue”(() => ScopedProcessQueue) | undefined
Returns
Section titled “Returns”EffectsHost
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Defined in: renderer/src/effects/EffectsHost.ts:54
Number of attached effects on this host.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”addEffect()
Section titled “addEffect()”addEffect<
H>(factory):H
Defined in: renderer/src/effects/EffectsHost.ts:37
Attach a visual effect. Returns a typed handle for fading, removal, intensity, and any per-effect extras the factory exposes.
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/EffectsHost.ts:75
Internal
— torn down by the owning site (component/layer/scene/screen) before its container is destroyed, so user-assigned external filters survive the EffectStack teardown.
Returns
Section titled “Returns”void
findEffect()
Section titled “findEffect()”findEffect<
H,O>(definition):H|null
Defined in: renderer/src/effects/EffectsHost.ts:47
Recover the handle for the first effect attached here whose underlying
definition is definition. Returns null if no match exists. Useful
after save/load to re-acquire a handle whose caller-side reference
went stale during restoration.
Type Parameters
Section titled “Type Parameters”H extends EffectHandle
O
Parameters
Section titled “Parameters”definition
Section titled “definition”EffectDefinition<H, O>
Returns
Section titled “Returns”H | null
restore()
Section titled “restore()”restore(
snap):void
Defined in: renderer/src/effects/EffectsHost.ts:66
Internal
— used by the renderer’s snapshot contributor.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
serialize()
Section titled “serialize()”serialize():
EffectStackSnapshot|undefined
Defined in: renderer/src/effects/EffectsHost.ts:59
Internal
— used by the renderer’s snapshot contributor.
Returns
Section titled “Returns”EffectStackSnapshot | undefined