type
Rect
src
@Js
@Serializable { simple=true }
const class Rect : Obj
Represents the x,y coordinate and w,h size of a rectangle.
constructors
fromStr |
Parse from comma or space separated string. |
---|---|
make |
Construct with x, y, w, h. |
makeInt |
Construct with x, y, w, h as integers. |
makePosSize |
Construct from a Point and Size instance |
fields
methods
contains |
Return true if x,y is inside the bounds of this rectangle. |
---|---|
equals |
Return if obj is same Rect value. |
hash |
Return hash of x, y, w, and h. |
intersection |
Compute the intersection between this rectangle and that rectangle. |
intersects |
Return true if this rectangle intersects any portion of that rectangle |
pos |
Get the x, y coordinate of this rectangle. |
size |
Get the w, h size of this rectangle. |
toStr |
Return |
union |
Compute the union between this rectangle and that rectangle, which is the bounding box that exactly contains both rectangles. |