Home Contents | # gcx:size | Graphics | Core4 Lua Commands

## SYNOPSIS

1. w, h = gcx:size()
2. w = gcx:width()
3. h = gcx:height()
4. bpp = gcx:bpp()

## DESCRIPTION

Allows to query the size (in pixels) and bit depth of the specified graphics context gcx.

## RETURN VALUE

The function gcx:size() returns two numbers, the width and height of the hardware framebuffer. The functions gcx:width() and gcx:height() return the width and height of the framebuffer as a single value each. The function gcx:bpp() returns the number of bits used per pixel.

## ERRORS

Raises an error if gcx is not a graphics context.

## EXAMPLE

> >
fb = gfx.open() print (fb:width(), fb:height(), fb:size(), fb:bpp())
480 272 480 272 24

## SEE ALSO

gfx.size, gfx.height, gfx.width, gcx:resize