Home Contents | # Rectangle Sizes | Graphics | Core4 Lua Commands

## SYNOPSIS

1. w, h = rect:size()
2. w = rect:width()
3. h = rect:height()

## DESCRIPTION

A rectangle is a simple data structure containing a coordinate pair and a size pair. These functions allow to query the size of the specified rectangle rect.

## RETURN VALUE

The function rect:size() returns two numbers, the width and height of the rectangle. The functions rect:width() and rect:height() return the width and height of the rectangle as a single value each.

## ERRORS

Raises an error if rect is not a rectangle.

## EXAMPLE

> >
r = gfx.rect(10,20,30,40) print (r:width(), r:height(), r:size())
30 40 30 40

## SEE ALSO

gfx.rect, rect(), rect:bottom, rect:bottomright, rect:left, rect:right, rect:top, rect:topleft, rect:x, rect:y, rect:contains, tostring(rect)