You need to enable layers before you can use this function. See Layers introduction for details.
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.