defineEffect
defineEffect<
H,O>(spec):EffectDefinition<H,O>
Defined in: renderer/src/effects/defineEffect.ts:50
Register an effect preset under a stable string name so its EffectStack
entries survive save/load. The returned callable accepts the preset’s
options and yields an EffectFactory whose built Effect is tagged with
{ name, options } for serialization.
Names are conventionally prefixed (yage:hitFlash, yage:bloom, …); the
@yagejs/effects package uses yage: for its hero presets.
Re-registering an existing name overwrites the previous entry and emits a dev warning — typically only happens during HMR.
Type Parameters
Section titled “Type Parameters”H extends EffectHandle
O
Parameters
Section titled “Parameters”factory
Section titled “factory”(options) => Effect<H>
string
Returns
Section titled “Returns”EffectDefinition<H, O>