Automotion docs

Text element

Draws styled text on the canvas. Fonts come from the bundled Google Fonts set; every visual field (position, size, animation) applies.

Draws styled text on the canvas. Fonts come from the bundled Google Fonts set; every visual field (position, size, animation) applies.

Properties

PropertyTypeDefaultDescription
id *string (non-empty)Stable identifier, unique across the whole movie. Used by editor selection sync and error paths.
startnumber (≥ 0)0When the element appears, in seconds relative to its scene (or to the movie for movie-level elements).
durationnumber (> 0)How long the element is active, in seconds. Defaults to the remainder of its scene.
positionobject | "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right""center"Where to place the element: absolute {x, y} pixels or a named anchor.
widthnumber (> 0)Element box width in output pixels. Defaults to an element-specific intrinsic size.
heightnumber (> 0)Element box height in output pixels. Defaults to an element-specific intrinsic size.
opacitynumber (0–1)1Element opacity from 0 (invisible) to 1 (fully opaque).
rotationnumber0Rotation around the element's center, in degrees (clockwise).
animationobjectEntrance animation applied when the element appears.
type *"text"A styled text overlay.
text *string (non-empty)The text to display. May contain {{variable}} placeholders.
font"Inter" | "Roboto" | "Open Sans" | "Montserrat" | "Poppins" | "Lato" | "Oswald" | "Raleway" | "Nunito" | "Work Sans" | "DM Sans" | "Space Grotesk" | "Source Sans 3" | "Merriweather" | "Playfair Display" | "Lora" | "Bebas Neue" | "Anton" | "Pacifico" | "Caveat""Inter"Font family from the curated Google Fonts set bundled with the renderer.
fontSizenumber (> 0)64Font size in output pixels.
fontWeightinteger (100–900, multiple of 100)400Font weight from 100 (thin) to 900 (black), in steps of 100.
colorstring (non-empty)"#ffffff"Text color as a CSS color value, e.g. "#ffffff". May contain {{variable}} placeholders.
backgroundstring (non-empty)Background color drawn behind the text block. Omit for no background.
align"left" | "center" | "right""center"Horizontal text alignment within the text box.
paddingnumber (≥ 0)0Padding around the text in output pixels (visible with a background color).
lineHeightnumber (> 0)1.2Line height as a multiplier of the font size.

position object

Absolute pixel position of the element's center.

PropertyTypeDefaultDescription
x *numberHorizontal position of the element's center, in output pixels from the left edge.
y *numberVertical position of the element's center, in output pixels from the top edge.

animation object

Entrance animation applied when the element appears.

PropertyTypeDefaultDescription
preset *"none" | "fade" | "slide-in-left" | "slide-in-right" | "slide-in-up" | "slide-in-down" | "zoom-in" | "zoom-out"Entrance animation preset applied when the element appears.
easing"linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out""ease"Easing curve applied to the animation.
durationnumber (> 0)0.5Animation duration in seconds.

Example

Text: styled, positioned and animated:

movie.json
{
  "schema": "v1",
  "preset": "9:16",
  "scenes": [
    {
      "id": "headline",
      "duration": 4,
      "background": "#0f172a",
      "elements": [
        {
          "id": "headline-main",
          "type": "text",
          "text": "Big news, {{name}}!",
          "font": "Montserrat",
          "fontSize": 88,
          "fontWeight": 800,
          "color": "#facc15",
          "background": "#00000088",
          "align": "center",
          "padding": 24,
          "lineHeight": 1.1,
          "position": {
            "x": 540,
            "y": 640
          },
          "animation": {
            "preset": "slide-in-up",
            "easing": "ease-out",
            "duration": 0.5
          }
        },
        {
          "id": "headline-sub",
          "type": "text",
          "text": "Rendered by the Automotion API",
          "fontSize": 40,
          "color": "#e2e8f0",
          "position": "bottom-center",
          "start": 0.5
        }
      ]
    }
  ],
  "variables": {
    "name": {
      "type": "string",
      "default": "world",
      "description": "Name shown in the headline."
    }
  }
}

▶ Try it in the playground

On this page