Skip to content

Event

type: "event" · Effector: acts per element (letters, copies, pieces…), usually through nested effects. · Editor menu: Effect.

Applies the effects nested in it to an element when something happens to it, for Decay seconds. Trigger Impact: a body of the Gravity or Physics before it in the same stack hits something (another body, the floor, a Solid, a wall) at Threshold px/s or more; hits closer than 0.06 s are one. Trigger Appear, Disappear or Color: the element becomes visible, stops being visible or changes its fill colour (its stroke, for a line with no fill), as the effects before it leave it (a dot a tide reaches, a cell a wave lights up); event.strength is 1. The nested effects read event.strength (0–1: the speed over Full), event.age (seconds since) and event.speed, besides element.*: a Color that flashes, a Transform that squashes, a Sound that plays. An element with no event is left as it is.

Takes nested effects (children): applies them to an element for Decay seconds after its event (an Impact of the Gravity or Physics before it, or its appearing, disappearing or changing colour), evaluating their formulas with event.* (strength, age, speed) and element.*. A sound (Sound) child plays a note per event. Nested effectors are not allowed.

Param Type Default Range Notes
trigger enum "impact" impact, appear, disappear, color not animatable
threshold number 120 min 0, max 5000, step 10 unit: px/s; only when trigger is impact
full number 1200 min 10, max 10000, step 10 unit: px/s; only when trigger is impact
decay number 0.5 min 0, max 10, step 0.05 unit: s
time number 0 min 0, step 0.01 unit: s; left out, it follows scene.time
seed seed 1 integer label: Random seed

Missing parameters take their default. Numbers and angles (and points and colours) can be animated with a track { on: "modifier", modifier: "<id>", param: "<name>" } unless noted.

Inside a node’s stack (effects run top to bottom):

{
"id": "event-1",
"type": "event",
"params": {
"trigger": "impact",
"threshold": 120,
"full": 1200,
"decay": 0.5,
"time": {
"$expr": "scene.time",
"fallback": 0
},
"seed": 1
},
"children": [
{
"id": "sound-1",
"type": "sound",
"params": {
"preset": "wood",
"patch": "{\n instrument: 'MembraneSynth',\n options: { pitchDecay: 0.008, octaves: 2, envelope: { attack: 0.001, decay: 0.12, sustain: 0, release: 0.05 } },\n note: 'G4',\n duration: 0.08,\n effects: [{ effect: 'Filter', frequency: 2400, type: 'lowpass' }],\n}",
"volume": 0.8,
"pitch": 0,
"sizePitch": 0.5,
"pan": 0.6
}
},
{
"id": "opacity-1",
"type": "opacity",
"params": {
"opacity": {
"$expr": "1 - 0.5 * event.strength",
"fallback": 1
}
}
}
]
}

Generated from the schema of @svertik/engine. See the index.