Name
SwapLayers -- swap two layers (V1.5)
Synopsis
SwapLayers(a, b)
Function
This function swaps the positions of the layer id's a and b. This can be very useful if you need to re-position your layers.

You need to enable layers before you can use this function. See Layers introduction for details.

Inputs
a
identifier or name of layer 1
b
identifier or name of layer 2
Example
EnableLayers()
SetFillStyle(#FILLCOLOR)
Box(0, 0, 150, 150, #RED)
Box(0, 0, 100, 100, #GREEN)
WaitLeftMouse
SwapLayers(1, 2)
The code above draws a red and a green filled box and then swaps layers which means that the smaller green box is suddenly not visible any more. Before the swapping, the red box was layer 1 and the green box layer 2. After the swapping, the green box is layer 1 and the red box is layer 2.

Show TOC