Class Fz2D.Rect
| Defined in: | src/scene/rect.coffee |
Overview
Public: Rectangle
Instance Method Summary
- ::constructor(x = 0, y = 0, w = 0, h = 0) Constructor
- ::contains(p) Determines if a point is inside the rectangle.
- ::equals(r) Compares the rectangle to another rectangle.
- ::isNull() Returns true if the rectangle is null, otherwise false.
- ::overlaps(r) Determines if the rectangle overlaps another rectangle.
- ::set(x, y, w, h) Sets the position and size.
- ::setPos(x, y) Sets the position of the rectangle.
- ::setSize(w, h) Sets the size of the rectangle.
Constructor Details
::constructor(x = 0, y = 0, w = 0, h = 0) Source
Public: Constructor
x - position on the X axis
y - position on the Y axis
w - width
h - height
Instance Method Details
::contains(p) Source
Public: Determines if a point is inside the rectangle.
p - Fz2D.Vec2
Returns true or false.
::equals(r) Source
Public: Compares the rectangle to another rectangle.
r - Fz2D.Rect
Returns the result of the comparison.
::isNull() Source
Public: Returns true if the rectangle is null, otherwise false.
::overlaps(r) Source
Public: Determines if the rectangle overlaps another rectangle.
r - Fz2D.Rect
Returns true or false.
::set(x, y, w, h) Source
Public: Sets the position and size.
x - position on the X axis
y - position on the Y axis
w - width
h - height
::setPos(x, y) Source
Public: Sets the position of the rectangle.
x - position on the X axis
y - position on the Y axis
::setSize(w, h) Source
Public: Sets the size of the rectangle.
w - width
h - height