Skip to main content

LensStudio:Ui.Rect

Class

Represents a rectangular area with x, y, width, height.

Example

// Rect represents a rectangular area with x, y, width, height.
// Constructor: new Rect(x, y, width, height)
const r1 = new Rect(10, 20, 200, 150);
console.log('Rect created: x=10, y=20, w=200, h=150');

const r2 = new Rect(100, 100, 50, 50);
console.log('Rect2: x=100, y=100, w=50, h=50');

// Rect is used by Pixmap.crop() and other UI geometry APIs

Constructors

Constructor

new Rect(x, y, width, height): Rect

Constructs a new Rect instance representing a rectangular region in UI space.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

Rect