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

## SYNOPSIS

1. gcx:blitMode(mode)
2. mode = gcx:blitMode()

## DESCRIPTION

If specified, selects mode as the new blitting mode for this graphics context.
With no arguments, returns the mode currently used by gcx.

The blitting mode indicates how raster copy operations (blitting) are done when this context is used as a source.

Values for mode are "blend", "mask" and "store".

In "blend" mode, full alpha blending is performed for any blitting operation.

In "mask" mode, the source alpha value is used only for transparency masking. Any alpha value which is less than 128 causes the source pixel to be written to the destination. Alpha values above 128 will leave the destination pixel as is. Faster than "blend" mode.

In "store" mode, the source pixels are copied verbatim to the destination. Neither alpha blending nor masking are performed. This is the fastest mode.

If this context does not have an alpha channel, the mode is fixed at "store" and cannot be changed.

## RETURN VALUE

A string indicating the blitting mode which is currently used by gcx.

## ERRORS

Raises an error if gcx is not a graphics context or if mode is not a valid value.

## EXAMPLE

> >
fb = gfx.open() print (fb:blitMode())
store

## SEE ALSO

gcx:pixmap, gcx:blit, gcx:blitframe, gcx:alphaMode