Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

animations/presets.json — file map

Named animation presets. Reference with "preset": "nudge" on an animate command. Built-ins (shake, pulse, …) work without this file. Locale overlay: presets_<locale>.json.

The whole file

Keys with { … } open below. Linked names jump to that section. Grey notes say what each key does. Under each section, Keys lists type, If omitted, allowed values, and a short note.

{
  "nudge": { … },  // example preset id — any name you choose
  "…": { … }       // more preset ids — same fields as animate
}

nudge

Example preset id — any name you choose.

{
  "nudge": {                   // example preset id — any name you choose
    "property": "position_y",  // what to tween
    "from": 1.0,               // start
    "to": -8,                  // end
    "duration": 0.12,          // length
    "ease": "in_out",          // ease
    "trans": "sine",           // transition curve
    "loop": "ping_pong",       // repeat
    "count": 2,                // repeat count
    "relative": true,          // relative to
    "keyframes": [],           // keyframe list
    "frames": [],              // frame list
    "fps": 12,                 // frame rate
    "intensity": 1.0,          // shake strength
    "distance": 8,             // travel distance
    "start_frame": 0,          // first frame
    "color": "#ffffff",        // tint end
    "opacity": 1.0,            // alpha end
    "scale_from": 1.0,         // scale start
    "scale_to": 1.05,          // scale end
    "decay": true              // shake decay
  }
}

Keys

property string
If omitted required for tween
e.g. position_x, position_y, scale, opacity, modulate.
from number
If omitted current value
Start value (or current if omitted).
to number
If omitted required for tween
End value.
duration number
If omitted 0
Values seconds
Seconds.
ease enum
If omitted out
Values in · out · in_out · out_in
Ease curve.
trans enum
If omitted cubic
Values linear · sine · cubic · quad · quint · expo · elastic · back · bounce
Tween transition.
loop enum
If omitted false
Values true · false · ping_pong
true, false, or ping_pong.
count number
If omitted forever if loop
How many loops (0 = forever when looping).
relative bool
If omitted false
Treat to / from as deltas.
keyframes array
If omitted none
For keyframe mode.
frames array
If omitted none
For frames mode.
fps number
If omitted mode default
For frames mode.
intensity number
If omitted preset default
Built-in / preset knobs.
distance number
If omitted preset default
For some presets.
start_frame number
If omitted 0
Start index for frames mode.
color color
If omitted unchanged
For modulate / color tweens.
opacity number
If omitted unchanged
For opacity tweens.
scale_from number
If omitted from
Alternate scale start knob.
scale_to number
If omitted to
Alternate scale end knob.
decay bool
If omitted false
Whether shake intensity falls off.

Learn more: nudge