vidmake v0.2.1
Download

Docs/LayersPage 12 / 45

Shapes

The five built-in shapes — rect, ellipse, polygon, star and arc — their sizes, corner radius, sides, inner radius, angles and the progress-ring pattern.

View .md Ask Claude Ask ChatGPT

vidmake has five vector shapes. They are resolution independent, take any paint as fill or stroke, and accept every common field: position, anchor, rotation, scale, opacity, shadow, filters and presets.

typeextra fieldsdefault size
rectcornerRadiusthe full parent (when neither width nor height is set)
ellipse100×100
polygonsides100×100
starsides, innerRadius100×100
arcstartAngle, endAngle, closed100×100

For ellipse, polygon, star and arc, setting only width or only height makes the shape square, so "width": 80 is an 80 px circle. Set both for an oval or a stretched polygon.

#rect

A rectangle with optional rounded corners.

json
{ "id": "card", "type": "rect", "width": 480, "height": 280, "cornerRadius": 6, "fill": "#fbf9f4",  "stroke": "#161412", "strokeWidth": 2 }

With neither width nor height, a rect fills its parent, so { "type": "rect", "fill": "#f4f1ea" } as the first layer is a background (and as the first child of a group, the group's background). If you set only one of the two, the other defaults to 100, not to the parent size.

cornerRadius is in px, is animatable, and is clamped to half the shorter side; "50%" turns any rect into a pill (or a circle, if it is square). Rects are also the workhorse for bars and progress bars: anchor one end and animate width.

json
{ "id": "progress", "type": "rect", "anchor": "left", "x": 100, "y": 650, "height": 12, "cornerRadius": 6,  "width": { "from": 0, "to": 1080, "duration": "4s", "ease": "linear" }, "fill": "#c92a26" }

#ellipse

An ellipse inscribed in its box: width and height are the two diameters. Dots, avatars, glows and spotlights are all ellipses.

json
{ "id": "dot", "type": "ellipse", "width": 24, "fill": "#c92a26" }

#polygon

A regular polygon with sides corners (default 3, minimum 3), inscribed in the layer's box with its first corner pointing straight up. "sides": 6 is a hexagon, "sides": 4 a diamond (rotate it 45° for a square).

json
{ "id": "hex", "type": "polygon", "sides": 6, "width": 160, "fill": "#4a4640", "rotation": "=t * 30" }

sides is a plain number and cannot animate.

#star

A star with sides points (default 5) alternating between the outer edge of the box and an inner radius.

fielddefaultnotes
sides5number of points (minimum 3), not animatable
innerRadius0.5the inner corners' distance from the center, as a fraction of the outer radius. Animatable

A small innerRadius (0.2–0.4) makes spiky stars; values near 1 approach a polygon with 2 × sides corners, which is how you draw seals, badges and sunbursts.

00:00.0 · f 000
sides sets a star's points; innerRadius (animatable) sets how deep they cutDownload
shapes-star.jsonjson
{  "fonts": [{ "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }],  "compositions": [{    "id": "star", "description": "sides sets a star's points; innerRadius (animatable) sets how deep they cut",    "width": 1280, "height": 720, "fps": 30, "duration": "4s", "background": "#f4f1ea",    "layers": [      { "id": "star4", "type": "star", "sides": 4, "x": 320, "y": "45%", "width": 230, "fill": "#161412",        "innerRadius": [[0, 0.3], ["2s", 0.8, "easeInOutSine"], ["4s", 0.3, "easeInOutSine"]], "rotation": "=t * 22.5" },      { "id": "star5", "type": "star", "sides": 5, "x": 640, "y": "45%", "width": 230, "fill": "#161412",        "innerRadius": [[0, 0.3], ["2s", 0.8, "easeInOutSine"], ["4s", 0.3, "easeInOutSine"]], "rotation": "=t * 18" },      { "id": "star12", "type": "star", "sides": 12, "x": 960, "y": "45%", "width": 230, "fill": "#161412",        "innerRadius": [[0, 0.3], ["2s", 0.8, "easeInOutSine"], ["4s", 0.3, "easeInOutSine"]], "rotation": "=t * 7.5" },      { "id": "sides", "type": "text", "y": "72%", "font": "JetBrains Mono", "fontSize": 20, "letterSpacing": 2.4,        "uppercase": true, "fill": "#8a857a", "x": "=320 + i * 320", "repeat": 3, "text": "sides: ${pick(i, [4, 5, 12])}" },      { "id": "inner", "type": "text", "y": "86%", "font": "JetBrains Mono", "fontSize": 28, "fill": "#c92a26",        "text": "innerRadius: ${0.55 - 0.25 * cos(t * pi / 2):2}" }    ]  }]}

#arc

An elliptical arc inside the layer's box, drawn as a stroke.

fielddefaultnotes
startAngle0degrees, 0 = 12 o'clock, clockwise. Animatable
endAngle360degrees, animatable. The arc always runs from the smaller to the larger angle
closedfalsetrue draws a filled pie slice (center to the arc and back) instead of a stroke
strokeWidth8thicker than other shapes' default, since an open arc is only a stroke

An open arc draws its stroke; if you set only fill, that paint is used as the stroke. Ends are round (lineCap: "round"); use "lineCap": "butt" for flat ends. With closed: true the arc is a normal filled shape (white by default) that can also take a stroke.

json
{ "id": "spinner", "type": "arc", "width": 120, "stroke": "#1f5fb0", "strokeWidth": 12,  "startAngle": "=t * 360", "endAngle": "=t * 360 + 270" }{ "id": "slice", "type": "arc", "closed": true, "width": 300, "startAngle": 0, "endAngle": 72, "fill": "#c92a26" }

#Progress ring

Animate endAngle from 0 to 360 (or to the fraction you need) over a dimmer full-circle track. A ${...} text in the middle can count along with the same easing:

00:00.0 · f 000
A progress ring: an arc whose endAngle animates from 0 to 360Download
shapes-ring.jsonjson
{  "fonts": [    { "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" },    { "family": "JetBrains Mono", "path": "fonts/JetBrainsMono.ttf" }  ],  "compositions": [{    "id": "ring", "description": "A progress ring: an arc whose endAngle animates from 0 to 360",    "width": 1280, "height": 720, "fps": 30, "duration": "4s", "background": "#f4f1ea",    "layers": [      { "id": "track", "type": "arc", "y": "46%", "width": 320, "stroke": "#e9e4d8", "strokeWidth": 22 },      { "id": "ring", "type": "arc", "y": "46%", "width": 320, "strokeWidth": 22, "stroke": "#c92a26",        "endAngle": { "from": 0, "to": 302, "start": "0.3s", "duration": "2.2s", "ease": "easeInOutCubic" } },      { "id": "pct", "type": "text", "y": "46%", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 112,        "letterSpacing": -5, "fill": "#161412", "text": "${round(84 * easeInOutCubic(clamp((t - 0.3) / 2.2, 0, 1)))}%" },      { "id": "caption", "type": "text", "y": "82%", "font": "JetBrains Mono", "fontSize": 20, "letterSpacing": 2.4, "uppercase": true,        "fill": "#8a857a", "text": "Tasks complete", "start": "0.5s", "enter": "fadeUp" }    ]  }]}

The stroke is centered on the circle, so a ring with "width": 320 and "strokeWidth": 22 spans 342 px on screen. For a pie chart, stack closed arcs whose start angle is the previous one's end.

#Common patterns

  • Background: { "type": "rect", "fill": ... } as the first layer, or a gradient paint for depth.
  • Outline only: "fill": null, "stroke": "#161412". Add "dash": [12, 8] for a dashed border.
  • Badges and seals: a star with "innerRadius": 0.85 and many sides.
  • Many shapes from one: use repeat with i in expressions instead of copying a layer ten times.
  • Custom shapes: anything else is a path with SVG path data.

Tip

A shape's box is what inspect reports and what the anchor refers to. The stroke and the shadow are drawn outside it, so leave a margin when a shape sits near the edge of a clipped group.