Text Clip
The Text Clip module enables displaying of text content. As an extension of the Clip class, the Text Clip provides access to shared properties, allowing you to leverage the same features and methods as other clip types.
The Text Clip has a more advanced styling system, which allows for greater customizations. It works with multiline text, as well as with custom fonts.
Example
1. To add a text clip directly to your composition, create a new layer and add the clip using:
const textLayer = engine.getTimeline().createLayer();
const textClip = textLayer.addClip({
text: "Hello World",
style: {
color: "#FF0000",
fontSize: 24,
fontFamily: "Arial",
},
startTime: 0,
});
Unlike other clip types, text clips do not need to be uploaded to the library first. You can directly add text content with styling options.
2. To change the text content of an existing text clip, use:
clip.setText("New Text Content");
3. To play the composition including your text clip, use:
engine.play();
To learn more about the TextClip, its properties, and functions, visit the API Reference.