<Mask>
Shows only a shape of its clip, with a feathered edge or inverted.
tsx
import { Clip, Composition, Mask, Track } from "@cutcraft/kit";
export default function Video() {
return (
<Composition fps={30} width={960} height={540} background={{ mode: "color", color: "#f3ead6" }}>
<Track id="main">
<Clip id="shot" src="asset:spiral" in={0} out={3} fit="cover">
<Mask id="oval" shape={{ ellipse: { cx: 0.5, cy: 0.5, rx: 0.3, ry: 0.4 } }} feather={20} />
</Clip>
</Track>
</Composition>
);
}Props
| prop | type | default | required | description |
|---|---|---|---|---|
id | string | yes | The mask's name. | |
type | "shape" | "drawn" | "shape" | shape for a rectangle, ellipse or polygon; drawn for a bezier path. | |
shape | { rect } | { ellipse } | | The region it shows: { rect }, { ellipse } or { polygon }, in the clip's pixels. | ||
path | A drawn mask's outline: bezier points with handles, closed or open. | |||
feather | number (0..100) | 0 | Softens the mask's edge, in pixels. | |
inverted | boolean | false | Shows everything outside the region instead of inside. | |
expansion | number (-100..100) | 0 | Grows the region outwards, or shrinks it when negative, in pixels. | |
opacity | number (0..1) | 1 | How much the mask hides: 1 hides fully outside the region, 0 not at all. | |
easing | "linear" | "ease-in" | "ease-out" | "ease-in-out" | "linear" | How the mask moves between its keyframes. |
Children: keyframe. All elements