- x = rect:x()
- y = rect:y()
- y1 = rect:top()
- y2 = rect:bottom()
- x1 = rect:left()
- x2 = rect:right()
- x1, y1 = rect:topleft()
- x2, y2 = rect:bottomright()
SYNOPSIS
DESCRIPTION
A group of functions for querying the corner coordinates of a rectangle.
rect:x(), rect:left() | Returns the left x-coordinate of the rectangle. |
rect:right() | Returns the right x-coordinate of the rectangle. |
rect:y(), rect:top() | Returns the top y-coordinate of the rectangle. |
rect:bottom() | Returns the bottom y-coordinate of the rectangle. |
rect:topleft() | Returns the top-left x, y coordinate pair. |
rect:bottomright() | Returns the bottom-right x, y coordinate pair. |
ERRORS
Raises an error if rect is not a rectangle.
EXAMPLE
>
>
r = gfx.rect(10,20,30,40)
print(r.topleft())
10 20
>
print(r.bottomright())
39 59