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

## SYNOPSIS

x, y = gcx:origin([x [, y]])

## DESCRIPTION

If a hardware framebuffer has been resized to be bigger than the actual hardware, this function can be used to select the actual section of the larger area that is being displayed.

If any of the arguments is absent or nil, the respective value is not changed.

## RETURN VALUE

On success, returns the origin of the visible section. On failure, returns four values: nil, nil, a string describing the error (The result of the C library call strerror() on the errno code) and the errno number from the standard C library.

## ERRORS

Raises an error if gcx is not a graphics context.

## NOTES

Setting the origin works only for the hardware framebuffer.

Actual hardware may be restricted in what values it can accept for the origin coordinates. Often the x coordinate can only be set in steps of four or eight. Check the return value to see where the origin ended up.

## SEE ALSO

gcx:resize