API & Integration -> RenderScript

Element properties in RenderScript

These properties are shared by RenderScript elements and control their fundamental behavior, appearance, and positioning. A few apply to certain element types only, as their descriptions say.

Some properties may behave differently or include additional options based on element type; see the dedicated Image, Video, Audio, Text, Shape, and Composition element pages for specifics.

How position, size and auto layout work together is explained in Layout in RenderScript.

Element type

The kind of element: 'text', 'image', 'video', 'audio', 'shape' or 'composition'. Required on every element.

Example

"type": "text",

Default

(none, required)

Name and ID

The name is the handle automations use: a modification key starts with it, and a subtitle's transcript_source names the media element by it. Names are matched without regard to case. The editor replaces spaces with dashes and removes dots when you name an element; a dot can't appear in a name, because it separates the name from the property in a modification key. The id is assigned when the template is loaded: leave it out when writing RenderScript, and a duplicate is replaced by a new one.

Example

"name": "Main-Title",

Defaults

"name": null, "id": "(assigned)",

Layer ordering

The track number on which this element is placed.

Example

"track": 2,

Default

"track": null,

Element timing

When the element appears in its composition, and for how long. time is in seconds from the start of the composition, null to start right after the previous element on its track, or 'end' to finish when the composition ends. duration is in seconds, null to fill the available time, 'media' for the full length of a video or audio file, or a share such as '1 fr', which divides the composition's length among the shares on its track.

Example

"time": 5.5, "duration": 10,

Defaults

"time": null, "duration": null,

Element positioning

The position of the element's anchor in its composition, measured from the left and top edges. Set x or y to null to have an auto layout place the element.

Example

"x": 250, "y": 500,

Defaults

"x": "50%", "y": "50%",

Depth

The element's position on the z axis, for 3D transforms with perspective. Same units as x and y.

Example

"z": "-10 vmin",

Default

"z": "0%",

Element dimensions

The width and height of the element. A percentage is relative to its composition. Set to null to make the element as big as its content. Text and shape elements default to null.

Example

"width": 300, "height": 200,

Defaults

"width": "100%", "height": "100%",

Size limits

The smallest and largest size the element may take, whatever its width and height work out to. Meant for sizes that follow the content or the available space.

Example

"min_width": "20 vw", "max_width": "80 vw", "min_height": "10 vh", "max_height": "50 vh",

Defaults

"min_width": null, "max_width": null, "min_height": null, "max_height": null,

Aspect ratio

Keeps the element in a fixed shape (width divided by height) inside its width and height. A value of 1 is square, a value of 1.6 is 16:10. Both the width and the height need a value.

Example

"aspect_ratio": 1.6,

Default

"aspect_ratio": null,

Padding

The room between the element's edges and its content, set per axis or per side. A side that is set takes the place of its axis on that side.

Example

"x_padding": "2 vmin", "y_padding": "1 vmin", "top_padding": "4 vmin",

Defaults

"x_padding": "0 vw", "y_padding": "0 vh", "top_padding": null, "bottom_padding": null, "left_padding": null, "right_padding": null,

Fill in an auto layout

Makes the element take a share of the space that the other elements of an auto layout leave, along the direction of the layout. The width or height in that direction must be null. When several elements fill, the space is divided by their shares.

Example

"flow_stretch": "1 fr",

Default

"flow_stretch": null,

Render order

The order in which the elements are drawn. Elements without a z_index are drawn first, in track order. Every element with a z_index is drawn on top of those, lowest value first, so even a negative z_index puts an element above all elements without one.

Example

"z_index": 10,

Default

"z_index": null,

Transform origin

The element's origin from which its position, scale, rotate, and skew transformations are applied.

Example

"x_anchor": "0%", "y_anchor": "100%",

Defaults

"x_anchor": "50%", "y_anchor": "50%",

Content alignment

Where the content sits inside the element's box, from 0% (left or top) to 100% (right or bottom). For an image or video with fit set to cover, this is the part of the picture that stays when it is cropped. Text elements have their own default of 0%, which is why new text is left-aligned.

Example

"x_alignment": "50%", "y_alignment": "0%",

Defaults

"x_alignment": "50%", "y_alignment": "50%",

Element scaling

The horizontal and vertical scale transformation in percent.

Example

"x_scale": "150%", "y_scale": "80%",

Defaults

"x_scale": "100%", "y_scale": "100%",

Element skewing

The horizontal and vertical skew transformation in degrees.

Example

"x_skew": 15, "y_skew": -10,

Defaults

"x_skew": "0°", "y_skew": "0°",

Element rotation

Rotates the element in 3D space along the x, y, and z axes. The perspective controls the 3D depth effect, and backface_visible determines whether to show the element's back side when rotated.

Example

"x_rotation": "45°", "y_rotation": "30°", "z_rotation": "90°", "perspective": 1000, "backface_visible": false,

Defaults

"x_rotation": "0°", "y_rotation": "0°", "z_rotation": "0°", "perspective": null, "backface_visible": true,

Element fill styling

The fill color of the element. It may be a string or an array of color stops if fill_mode is set to linear or radial. Use the template editor to see how color stops are formatted. There are 3 fill modes: solid, linear, and radial. Available on text, shape, and composition elements.

Example

"fill_color": "#3B82F6", "fill_mode": "linear", "fill_x0": "0%", "fill_y0": "0%", "fill_x1": "100%", "fill_y1": "100%", "fill_radius": "75%",

Defaults

"fill_color": null, "fill_mode": "solid", "fill_x0": "50%", "fill_y0": "0%", "fill_x1": "50%", "fill_y1": "100%", "fill_radius": "50%",

Element stroke styling

The stroke color, width, and styling of the element. There are 3 stroke cap options: butt, square, and round. There are 3 stroke join options: miter, bevel, and round. Available on all elements except audio.

Example

"stroke_color": "#1F2937", "stroke_width": "2vmin", "stroke_cap": "square", "stroke_join": "miter", "stroke_start": "10%", "stroke_end": "90%", "stroke_offset": "5%",

Defaults

"stroke_color": null, "stroke_width": "0.1vmin", "stroke_cap": "round", "stroke_join": "round", "stroke_start": "0%", "stroke_end": "100%", "stroke_offset": "0%",

Border radius

The border radius of the element. Available on image, video, shape, and composition elements.

Example

"border_radius": "1vmin",

Default

"border_radius": "0vmin",

Element shadow

The shadow color, blur, and offset of the element. Set shadow_color to null to disable the shadow.

Example

"shadow_color": "#000000", "shadow_blur": "5vmin", "shadow_x": "2vmin", "shadow_y": "2vmin",

Defaults

"shadow_color": null, "shadow_blur": "3vmin", "shadow_x": "0vmin", "shadow_y": "0vmin",

Content clipping

When set to true, the element's content is clipped to its borders.

Example

"clip": true,

Default

"clip": false,

Element transparency

The opacity of the element.

Example

"opacity": "75%",

Default

"opacity": "100%",

Layer blending

The blend mode of the element. These options are available: none, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, lighter, difference, exclusion, hue, saturation, color, luminosity.

Example

"blend_mode": "multiply",

Default

"blend_mode": "none",

Color filtering

The color filter that is applied to the element and its intensity. These options are currently available: none, brighten, contrast, hue, invert, grayscale, and sepia.

Example

"color_filter": "grayscale", "color_filter_value": 50,

Defaults

"color_filter": "none", "color_filter_value": 0,

Color overlay

A color that is applied on top the element.

Example

"color_overlay": "#ff0000",

Default

"color_overlay": null,

Chroma key

Makes one color transparent, the green-screen effect. chroma_key_color is the color to remove and chroma_key_sensitivity, from 1% to 100%, how far a color may differ from it and still be removed.

Example

"chroma_key_color": "#00ff00", "chroma_key_sensitivity": "10%",

Defaults

"chroma_key_color": null, "chroma_key_sensitivity": "1%",

Element blur effect

A gaussian blur that is applied to the element. The amount is the blur's standard deviation, the same as CSS filter: blur(), and can be specified in px, vw, vh, vmin, or vmax. A vmin value keeps the blur in proportion when the template is rendered at a different size.

Example

"blur": "2 vmin",

Default

"blur": 0,

Legacy blur effect

The blur from before the blur property, kept so that existing templates render exactly as they always have: the radius of the blur and the algorithm used (stack, box, or box-2). Use the aforementioned 'blur' property for anything new. When both are set, 'blur' is applied and these two are ignored.

Example

"blur_radius": 5, "blur_mode": "box",

Defaults

"blur_radius": 0, "blur_mode": "stack",

Element masking

By setting the mask mode, the element is used as a mask for the element one track below it. The options alpha and alpha-inverted use the alpha channel of this element, and luma and luma-inverted use the luminance.

Example

"mask_mode": "alpha",

Default

"mask_mode": null,

Pattern repeat

When set to true, the element is repeated in its composition, acting as a fill pattern.

Example

"repeat": true,

Default

"repeat": false,

Element visibility and interaction

Controls whether the element is rendered and if users can interact with it in the template designer. When visible is set to false, the element is not rendered. When locked is set to true, the element can't be moved or resized on the canvas of the template editor.

Example

"visible": false, "locked": true,

Defaults

"visible": true, "locked": false,

Dynamic

Marks what an automation fills in. true exposes the element's main property (the text of a text element, the source of an image, video or audio element) as a field in Zapier, Make, n8n, feeds and shareable forms; an array of property names exposes each of those properties as its own field. A modification can change any property, dynamic or not.

Example

"dynamic": ["text", "fill_color"],

Default

"dynamic": false,

Element warping

Distorts the element's shape using a grid of control points. Use 'default' mode for flexible grid-based warping, or 'perspective' mode for four-corner distortion similar to perspective correction.

Example

"warp_mode": "perspective", "warp_matrix": [   [     { "x": "32", "y": "4%" },     { "x": "84%", "y": "19%" }   ],   [     { "x": "26%", "y": "90%" },     { "x": "100%", "y": "83%" }   ] ],

Defaults

"warp_mode": "default", "warp_matrix": null

Animation keyframes

An array of animation presets. Each entry names a 'type' and takes 'time' (seconds from the element's start, or 'start' or 'end'), 'duration' (seconds), 'easing', 'reversed' (true turns an entrance into an exit) and 'transition' (true on the second of two elements on a track makes a transition between them); a preset's own settings are extra keys, as the template editor writes them. Presets: fade, scale, slide, rotate-slide, pan, wipe, color-wipe, circular-wipe, film-roll, squash, spin, stripe, flip, shake, bounce, wiggle, shift, and for text elements text-appear, text-scale, text-slide, text-reveal, text-fly, text-spin, text-wave, text-counter and text-typewriter. An unknown type is an error that lists the valid ones.

Example

"animations": [   {     "time": 0,     "duration": 1,     "easing": "linear",     "type": "fade"   } ],

Default

"animations": null,

Keyframes

Any property that is not structural accepts an array of keyframes instead of a single value. Structural, and so never keyframed, are the timing and track properties, source, provider, the trims, loop, speed, volume, the audio fades, fit, the subtitle settings other than transcript_source and transcript_color, dynamic and the top-level output settings.

{
  "x_rotation": [
    {
      "time": 0,
      "value": "0°"
    },
    {
      "time": 2,
      "value": "360°",
      "easing": "cubic-in-out"
    }
  ]
}

time is in seconds from the element's start, or "start" or "end" to stay attached to that edge of the element however long it becomes. Before the first keyframe the property holds that keyframe's value, after the last it holds the last, and between two keyframes the value moves from one to the other over the whole gap: a value that must wait needs the same value repeated at the moment its move begins. easing belongs to the keyframe being approached and shapes the movement towards it; the default is quadratic-in-out. Numbers, sizes, colors and shape paths interpolate; strings and booleans switch at the keyframe. A duration on a keyframe is ignored, except on animations, where it is the length of the animation, and on transcript_source, where it is how long a word is spoken. A keyframe with a name and "dynamic": true can be changed per render with a modification.

Easings: linear; sinusoid, quadratic, cubic, quartic, quintic, exponential, circular, back, elastic and bounce, each with -in, -out or -in-out; steps(n); cubic-bezier(x1, y1, x2, y2). A misspelled easing is not an error: the keyframe then moves linearly.