Skip to content

format

typescript
new Rect ((x, y, w, h))

description

Create a new Rect object.

parameter

param_nametypedescription
xnumber?The x coordinate of the top-left corner of the Rect.
ynumber?The y coordinate of the top-left corner of the Rect.
wnumber?The width of the Rect.
hnumber?The height of the Rect.

code example

javascript
let rect:Rect = new Rect(0, 0, 100, 100);