Clip

The Clip class represents a fundamental component in Rendley SDK, serving as the base class for various types of clips, including video, audio, image, and text clips.

Interacting with Clips

To interact with clips, you can directly access and modify their properties through the display. Here's how you can work with clips:

1. Retrieve the Clip at a Specific Position

const clip = engine.display.getClipIdByCursorPosition(x, y);

This method returns the clip with the highest zIndex at the given position, allowing you to interact with the topmost clip.

2. Modify the Clip's Properties

Once you have the clip, you can adjust its properties. For example, to change the clip's position:

clip.style.setPosition(200, 200);

3. Example

Here's an example of how to configure and interact with a clip:

// Get the clip at position (100, 150)
const clip = engine.display.getClipIdByCursorPosition(100, 150);
 
if (clip == null) {
  return;
}
 
// Modify the clip's position and other properties
clip.style.setPosition(200, 200);
clip.style.setRotation(2);

To learn more about the Clip, its properties, and functions, visit the API Reference.