---
title: "Style Text and Shapes in Video | Rendley SDK Docs"
description: "Control the visual style of text and shape clips. Position, scale, rotation, opacity, color, stroke and drop shadow. Through the Rendley SDK ClipStyle API."
url: https://docs.rendley.com/sdk/getting-started/styling/
---

# Styling

Any clip with visuals (`clip.hasSprite()`) exposes a `style` property, an instance of [ClipStyle](https://docs.rendley.com/sdk/api-reference/classes/ClipStyle.html). This page covers the controls every clip shares. Text and shape clips add their own fields on top: see [TextStyle](https://docs.rendley.com/sdk/api-reference/classes/TextStyle.html) and [ShapeStyle](https://docs.rendley.com/sdk/api-reference/classes/ShapeStyle.html).

You can apply style on creation or update it later on an existing clip.

## Position

`setPosition(x, y)` moves a clip on the canvas. Coordinates are in pixels, with the origin at the top-left of the display (the default 1920×1080 canvas centers at `(960, 540)`).

Runnable exampleShow full code

Run

```
const clip = await layer.addClip({
  type: "shape",
  shape: "rectangle",
  startTime: 0,
  duration: 5,
  style: { fillColor: "#6d6ff2", width: 300, height: 300 },
});

clip.style.setPosition(960, 540); // center of a 1920x1080 canvas
```

## Scale

`setScale(scaleX, scaleY)` multiplies the clip’s size. `1` is natural size; `2` doubles it. X and Y scale independently, so you can stretch a clip asymmetrically.

Runnable exampleShow full code

Run

```
const clip = await layer.addClip({
  type: "shape",
  shape: "circle",
  startTime: 0,
  duration: 5,
  style: { fillColor: "#FF4D6D", width: 200, height: 200 },
});
clip.style.setPosition(960, 540);

clip.style.setScale(2, 1); // stretch horizontally
```

## Rotation

`setRotation(radians)` rotates the clip around its center. Positive values rotate clockwise.

Runnable exampleShow full code

Run

```
const clip = await layer.addClip({
  type: "text",
  text: "Tilted",
  startTime: 0,
  duration: 5,
  style: { fontSize: 160, color: "#FFFFFF" },
});
clip.style.setPosition(960, 540);

clip.style.setRotation(Math.PI / 8); // 22.5 degrees
```

## Alpha (opacity)

`setAlpha(value)` sets the opacity. `1` is fully opaque, `0` is invisible.

Runnable exampleShow full code

Run

```
const clip = await layer.addClip({
  type: "shape",
  shape: "rectangle",
  startTime: 0,
  duration: 5,
  style: { fillColor: "#6d6ff2", width: 600, height: 300 },
});
clip.style.setPosition(960, 540);

clip.style.setAlpha(0.4);
```

## Corner radius

`setCornerRadius([tl, tr, br, bl])` rounds the corners of a clip (media clips and shapes). The tuple order goes clockwise from the top-left corner.

Runnable exampleShow full code

Run

```
const clip = await layer.addClip({
  type: "shape",
  shape: "rectangle",
  startTime: 0,
  duration: 5,
  style: { fillColor: "#6d6ff2", width: 600, height: 300 },
});
clip.style.setPosition(960, 540);

clip.style.setCornerRadius([60, 60, 60, 60]);
```

Pass a single number to round all four corners equally:

```
clip.style.setCornerRadius(60);
```

## Relative corner radius

By default, the corner radius is in absolute pixels. Pass `true` as the second argument to make the radius scale with the clip:

```
clip.style.setCornerRadius([0.5, 0.5, 0.5, 0.5], true); // fully circular
```

## Size

Clip size is determined by the source `width` and `height` and the clip’s `scale`. Use `setSize` to set an absolute size; the `scale` is computed automatically.

```
clip.style.setSize(400, 200);
const [w, h] = clip.style.getSize();
```

## Setting style at creation

Every controller has a corresponding option on `addClip` so you can configure a clip in one call:

```
const clip = await layer.addClip({
  type: "text",
  text: "Hello",
  startTime: 0,
  duration: 3,
  style: {
    fontSize: 120,
    color: "#FF4D6D",
    position: [960, 540],
    rotation: 0.1,
    alpha: 0.9,
  },
});
```

## Animating style

Most of the proeprties documented above are animatable through the [Property Animator](https://docs.rendley.com/sdk/getting-started/property-animator/). The track keys match the method names without `set`: `positionX`, `positionY`, `scaleX`, `scaleY`, `rotation`, `alpha`, `cornerRadius`.

Use `getRegisteredProperties` method to get a description of the properties that can be animated.

Runnable exampleShow full code

Run

```
const clip = await layer.addClip({
  type: "shape",
  shape: "circle",
  startTime: 0,
  duration: 3,
  style: { fillColor: "#FF4D6D", width: 200, height: 200 },
});
clip.style.setPosition(960, 540);

clip.propertyAnimator.addKeyframe("rotation", 0, 0);
clip.propertyAnimator.addKeyframe("rotation", 3, Math.PI * 2);
```

## What to read next

- **[Keyframe animator](https://docs.rendley.com/sdk/getting-started/property-animator/)** animates any property with keyframes and bezier easing.
- **[Text clips](https://docs.rendley.com/sdk/getting-started/clips/text/)** add and style text overlays.
- **[Shape clips](https://docs.rendley.com/sdk/getting-started/clips/shape/)** draw rectangles, circles and lines without an asset.
- API reference: [`ClipStyle`](https://docs.rendley.com/sdk/api-reference/classes/ClipStyle.html).

[Previous pageCustom clips](https://docs.rendley.com/sdk/getting-started/clips/custom/) [Next pageFonts](https://docs.rendley.com/sdk/getting-started/fonts/)
