A list of rectangle coordinates forming an area.
- Inheritance
- Constructor
- Methods
- addRect() - Adds the rectangle coordinates to the area.
- clear() - Clears all rectangle coordinates.
- getRect() - Obtain coordinates of the i-th rectangle from the area.
- intersects() - Returns true if the given rectangle coordinates intersect the area.
- intersectsBorder()
- isWithin() - Returns true if the given rectangle coordinates are within the area.
- iteration() - Iterate through all rectangle coordinates.
- Inherited Methods
- / Object /
Area
-
Area()
Creates an empty area object.
-
Area:addRect(x, y, w, h)
Adds the rectangle coordinates to the area.
-
Area:clear()
Clears all rectangle coordinates. After this the area does not contain any rectangle, i.e. area.count == 0.
-
Area:getRect(i)
Obtain coordinates of the i-th rectangle from the area.
- i - index of the rectangle, 1 <= i <= area.count
Returns x, y, w, h rectangle coordinates
-
Area:intersects(x, y, w, h)
Returns true if the given rectangle coordinates intersect the area.
-
Area:intersectsBorder(x, y, w, h, borderWidth)
-
Area:isWithin(x, y, w, h)
Returns true if the given rectangle coordinates are within the area.
-
Area:iteration()
Iterate through all rectangle coordinates.
Returns an iterator function, self and 0, so that the construction
for i, x, y, w, h in area:iteration() do ... end
will iterate over all rectangle indices and coordinates.