Constructor
new Rectangle(x, y, width, height)
Parameters:
Name |
Type |
Description |
x |
Number
|
The position of left side of rectangle. |
y |
Number
|
The position of top side of rectangle. |
width |
Number
|
Amount of rectangle width. |
height |
Number
|
Amount of rectangle height. |
Properties:
Name |
Type |
Description |
x |
Number
|
The position of left side of rectangle. |
y |
Number
|
The position of top side of rectangle. |
width |
Number
|
Amount of rectangle width. |
height |
Number
|
Amount of rectangle height. |
- Source:
Methods
(static) this.set(x, y, width, height)
Sets Rectangle properties.
Parameters:
Name |
Type |
Description |
x |
Number
|
The position of left side of rectangle. |
y |
Number
|
The position of top side of rectangle. |
width |
Number
|
Amount of rectangle width. |
height |
Number
|
Amount of rectangle height. |
- Source:
(static) this.setFrom(r)
Sets Rectangle properties from rectangle r parameter.
Parameters:
Name |
Type |
Description |
r |
Tee.Rectangle
|
The Rectangle instance to copy values from. |
- Source:
contains(p) → {Boolean}
Parameters:
Name |
Type |
Description |
p |
Tee.Point
|
XY position to test. |
- Source:
Returns:
Returns if
Tee.Point p is inside the rectangle.
-
Type
-
Boolean
getBottom() → {Number}
- Source:
Returns:
Returns the position in pixels of the bottom side of the
rectangle.
-
Type
-
Number
getRight() → {Number}
- Source:
Returns:
Returns the position in pixels of the right side of the
rectangle.
-
Type
-
Number
offset(x, y)
Parameters:
Name |
Type |
Description |
x |
Number
|
Horizontal pixels. |
y |
Number
|
Vertical pixels. |
- Source:
setBottom(value)
Parameters:
Name |
Type |
Description |
value |
Number
|
Defines the position of bottom side of rectangle. |
- Source:
setLeft(value)
Parameters:
Name |
Type |
Description |
value |
Number
|
Defines the position of left side of rectangle. |
- Source:
setRight(value)
Parameters:
Name |
Type |
Description |
value |
Number
|
Defines the position of right side of rectangle. |
- Source:
setTop(value)
Parameters:
Name |
Type |
Description |
value |
Number
|
Defines the position of top side of rectangle. |
- Source: