Motion SDK

Text

3D text from bundled fonts, with depth, wrapping and entrance animations.

A node with text draws a string from one of the bundled OFL fonts. Text is lit like any mesh, so give it a material, or leave it out for plain white.

A display title that pops in, and a monospaced subtitle.
{
  "camera": { "position": [0, 0, 6], "target": [0, 0, 0], "fov": 40 },
  "lighting": { "rig": "neon_rim" },
  "environment": {
    "background": {
      "linear_gradient": { "from": "#140a2a", "to": "#05030a", "angle": 0 }
    }
  },
  "post": { "bloom": 0.8 },
  "materials": {
    "title": {
      "preset": "glossy_plastic",
      "color": "#ffffff",
      "emissive": "#ff2ec4",
      "emissive_intensity": 0.6
    }
  },
  "nodes": {
    "title": {
      "text": {
        "content": "Made by\nan agent",
        "font": "display_black",
        "size": 0.9,
        "depth": 0.15,
        "material": "title",
        "animate_in": { "preset": "pop_in" }
      }
    },
    "sub": {
      "transform": { "position": [0, -1.6, 0] },
      "text": {
        "content": "motion-sdk render scene.json",
        "font": "jetbrains_mono",
        "size": 0.22
      }
    }
  },
  "timeline": { "duration": 3, "loop": "once" }
}
A display title that pops in, and a monospaced subtitle. apps/docs/examples/text.json · render it with motion-sdk render apps/docs/examples/text.json -t 1 -o text.png

Fonts

inter, inter_bold, space_grotesk, jetbrains_mono, playfair_display and display_black. In the browser, fonts load on demand from fontBase.

Layout

  • size is the cap height in world units.
  • max_width wraps lines to a width. \n breaks a line.
  • align is left, center or right.
  • depth extrudes the glyphs into solid 3D letters (world units, e.g. 0.2 for a 1-unit title). They take the material's lighting, cast shadows and keep animate_in. In the browser this loads the authoring bundle; 0 stays flat text on the lean player. Dynamic text (counters, scrambles, swaps) always draws flat.
  • letter_spacing adds space between letters, in ems.

Entrances

animate_in plays typewriter, fade_up, pop_in, blur_in or split_flip from start seconds. Four more are made for extruded text: flip_in (letters tip up from lying flat), drop_in (they fall and bounce), spin_in (half a turn as they grow) and tumble_in (a seeded scatter that settles). On flat text they fall back to a squash or a drop. They need the authoring bundle in the browser, which the loader fetches for you. In a seamless loop, keep the hook on screen from frame 0 with no animate_in, or it will pop in again every loop. The validator warns about this.

Strokes

stroke draws a solid outline behind flat text, which is the classic look for short-form captions. width is in world units, around 0.05 to 0.15 of size, and color defaults to black. The letters always sit on top of their own stroke. It needs the authoring bundle in the browser, which the loader fetches for you. Extruded text ignores it.

{ "text": { "content": "One mistake", "font": "display_black", "size": 0.8, "material": "caption", "stroke": { "color": "#170b08", "width": 0.07 } } }
Coming soon:Text along paths and per-letter tracks are on the roadmap. See 2D Motion Graphics.

API Reference

Text

Extrudable 3D (or flat) text using bundled fonts.

PropertyTypeDefaultDescription
alignTextAlign"center"Line alignment.
animate_inTextAnimation—Built-in entrance animation.
content*stringrequiredThe text. \n breaks lines.
depthnumber0Extrusion depth in world units: the letters become solid, lit glyphs that cast shadows and keep their entrance animation. 0 renders flat text. In the browser this needs the authoring bundle (the lean player draws it flat).
dynamicTextDynamic—Content that changes over time: a counter, a scramble reveal or word swaps (authoring builds).
fontFont"inter_bold"One of the bundled fonts.
letter_spacingnumber0Extra letter spacing in em.
materialstring—Material id, or preset:<name>.
max_widthnumber0Wrap width in world units (0 = no wrapping).
sizenumber1Cap height in world units.
strokeTextStroke—A solid stroke drawn behind flat text, e.g. dark-edged captions (authoring builds; extruded text ignores it).

Font

Bundled, license-clean fonts (deterministic glyph output).

ValueDescription
"inter"
"inter_bold"
"space_grotesk"
"jetbrains_mono"
"playfair_display"
"display_black"Heavy display face for hooks and titles.

TextAlign

ValueDescription
"left"
"center"
"right"

TextAnimation

Per-glyph entrance animations.

PropertyTypeDefaultDescription
preset*TextAnimationPresetrequiredThe entrance animation.
staggernumber0.04Seconds between consecutive glyphs.
startnumber0Seconds when the entrance starts.

TextAnimationPreset

ValueDescription
"typewriter"
"fade_up"
"pop_in"
"blur_in"
"split_flip"
"flip_in"Each letter tips up from lying flat, overshooting a little (best on extruded text).
"drop_in"Each letter drops in from above and bounces to rest.
"spin_in"Each letter spins half a turn about its upright axis as it grows in.
"tumble_in"Each letter tumbles in from a scattered, tilted start towards the camera (seeded, so every render matches).

TextStroke

A solid stroke around flat text.

PropertyTypeDefaultDescription
colorColor"#000000"Stroke colour (black by default).
width*numberrequiredThickness in world units, about 0.05-0.15 of the text size.