ia.Rectangle Class
Rectangle object.
Constructor
ia.Rectangle
(
-
[x=0]
-
[y=0]
-
[width=0]
-
[height=0]
Parameters:
-
[x=0]
Number optionalThe x coordinate of the origin.
-
[y=0]
Number optionalThe y coordinate of the origin.
-
[width=0]
Number optionalThe width.
-
[height=0]
Number optionalThe height.
Item Index
Methods
bottom
()
Number
The value of the bottom edge.
Returns:
Number:
intersects
(
Boolean
-
px
-
py
Tests whether a point intersects the rectangle.
Parameters:
-
px
NumberThe x coordinate.
-
py
NumberThe y coordinate.
Returns:
Boolean:
true if intercepts, otherwise false.
intersectsLine
(
Boolean
-
p1
-
p2
Tests whether a line segment intersects the rectangle.
Parameters:
-
p1
ObjectFirst point {x, y}.
-
p2
ObjectSecond point {x, y}.
Returns:
Boolean:
true if intercepts, otherwise false.
left
()
Number
The value of the left edge.
Returns:
Number:
lineIntersectsLine
(
Boolean
-
a1
-
a2
-
b1
-
b2
Tests whether a line segment intersects another line.
Parameters:
-
a1
ObjectFirst point of line one {x, y}.
-
a2
ObjectSecond point of line one {x, y}.
-
b1
ObjectFirst point of line two {x, y}.
-
b2
ObjectSecond point of line two {x, y}.
Returns:
Boolean:
true if intercepts, otherwise false.
right
()
Number
The value of the right edge.
Returns:
Number:
top
()
Number
The value of the top edge.
Returns:
Number:
toString
()
String
Get a simple text representation of this object.
Returns:
String:
A text String.
Properties
height
Number
The height.
Default: 0
width
Number
The width.
Default: 0
x
Number
The x coord.
Default: 0
y
Number
The y coord.
Default: 0