Name
Cls -- clear screen (V2.0)
Synopsis
Cls([color])
Function
This function quickly clears the current output device. Its behaviour depends on what is currently selected as the output device.

If the output device is the display, the current background picture will be restored and all layers and sprites will be removed. The color argument is not used in this case.

If the output device is a brush, it will be cleared with the specified color.

If the output device is a background picture, i.e. SelectBGPic() with mode set to #SELMODE_LAYERS is active, all layers of that picture will be removed. The color argument is not used in this case.

If the output device is a mask, Cls() will clear the pixels using the mode that was installed by SetMaskMode(). The color argument is not used in this case.

If the output device is an alpha channel, Cls() will fill the pixels with the intensity specified using SetAlphaIntensity(). The color argument is not used in this case.

Note that when the current draw target is palette-based and the palette mode is set to #PALETTEMODE_PEN, this function will clear the screen using the pen set via SetDrawPen() instead of the color passed to the function.

Inputs
color
optional: RGB color (defaults to #BLACK); only required when used while SelectBrush() is active

Show TOC