genie

Genie Developer Hub

Welcome to the genie developer hub. You'll find comprehensive guides and documentation to help you start working with genie as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    API Reference

A Base canvas

Let's first build an empty canvas, then you can add the below objects into it. Paste the code below in your shot config -

{
  "duration": 1000,
  "objects": [
    {
      "type": "shape",
      "kind": "rectangle",
      "color": "#F2E880",
      "comment": "base canvas",
      "opacity": 1,
      "position": {
        "x": 0,
        "y": 0
      },
      "size": {
        "h": "700",
        "w": "700"
      }
}

A Circle

Let's start with a very basic shape - a simple filled circle with an outline.

{
        "comment": "circles",
        "kind": "circle",
        "stroke": {
          "color": "white",
          "width": 10
        },
        "fill": {
          "value": "#FC5185",
          "transform": [["alpha", 0.5]]
        },
        "shadow": ["white", 30, 3, 5],
        "position": {
          "y": 250,
          "x": 350
        },
        "type": "shape",
        "size": 70
      }
FieldDescription
typeshape
kindcircle
stroke - color, widthto set the color and width in pixels.
fill - value, transformhexcode, alpha with value
shadowhas the following format [color value, blur, xOffset, yOffset]
positionposition of this object
sizeradius of this object (circle)

A Polygon

{
        "comment": "polygon-shape",
        "type": "shape",
        "kind": "polygon",
        "stroke": {
          "color": "#7C74D4",
          "width": 10
        },
        "fill": "transparent",
        "shadow": ["#9388E3",2, 1, 10],
        "points": [
          {
          "y": 400,
          "x": 400
          },
          {
          "x": 450,
          "y": 450
          }, 
          {
          "x": 300,
          "y": 500
          }, 
          {
          "x": 350,
          "y": 550
          }
        ]
      }
FieldDescription
typeshape
kindpolygon
points (array)Defines the points of the polygon
Lines will first be drawn from point to point in the order mentioned in the points array. Finally a line will be drawn from the last point to the first point to close off the polygon.

Custom Rectangles

A simple rectangle

{
        "comment": "blue rectangle",
        "type": "shape",
        "kind": "rectangle",
        "color": "#3FC1C9",
        "opacity": 1,
        "position": {
          "x": 520,
          "y": 580
        },
        "size": {
          "h": 50,
          "w": 100
        }
      }
FieldDescription
typetype of object, here - shape.
kinddefine kind of shape here
colordefine a CSS color or a hex-value (black/ #000000)
opacitylevel of transparency of the object
positionThe coordinated of where the rectangle object starts
size (object)height and width of the object respectively

Rounded rectangle (uniform)

{
        "comment": "rounded rectangle",
        "type": "shape",
        "kind": "rectangle",
        "position": {
          "y": 420,
          "x": 520
        },
        "stroke": {
          "color": "#5DADEC",
          "width": 10,
          "join": "bevel"
        },
        "fill": "#87CEFA",
        "borderRadius": 30,
        "size": {
          "h": 100,
          "w": 100
        }
      }

📘

A variation to rounded rectangle

The borderRadius property also takes in array type, this can help make uneven rounded rectangular polygons. See borderRadius property below:

{
      "comment": "uneven rounded rectangle",
      "kind": "rectangle",
      "stroke": {
        "color": "#223B7D",
        "width": 10,
        "join": "bevel"
      },
      "fill": "#1D9ED9",
      "position": {
        "y": 280,
        "x": 520
      },
       "borderRadius": [10, 40, 60, 40],
      "type": "shape",
      "size": {
        "h": 100,
        "w": 100
      }
    }
FieldDescription
borderRadiusproperty that help round the corners of the rectangle.
Can be a single value (for uniform rounded rectangles),
Can be an array of 4 values (for different round-ness at each corner)

Updated about a year ago


What's Next

Color Gradients

Shapes


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.