Code: Select all
Function MultipleLayerToFront()
If IsLeftMouse() = False Then ClearInterval(1)
For n = 1 To 5
SetLayerZPos("layer"..n,0)
Next
EndFunction
Code: Select all
Function MultipleLayerToFront()
If IsLeftMouse() = False Then ClearInterval(1)
For n = 1 To 5
SetLayerZPos("layer"..n,0)
Next
EndFunction
Code: Select all
Function StartLayerToFront()
SetInterval(1, MultipleLayerToFront, 1)
EndFunction
Function MultipleLayerToFront()
If IsLeftMouse() = False Then ClearInterval(1)
For n = 1 To 5
LayerToFront("layer"..n)
Next
EndFunction
Function ChangeText(msg)
n=msg.userdata
SetLayerStyle("text", {text=n})
EndFunction
EnableLayers
CreateLayer(100, 100, 200, 300, {Color = #RED, name="layer1"})
CreateLayer(200, 100, 200, 300, {Color = #GREEN, name="layer2"})
CreateLayer(300, 100, 200, 300, {Color = #BLUE, name="layer3"})
CreateLayer(400, 100, 200, 300, {Color = #YELLOW, name="layer4"})
CreateLayer(500, 100, 200, 300, {Color = #WHITE, name="layer5"})
TextOut(10, 10, "text", {name="text"})
For n = 1 To 5
MakeButton(Nil, #LAYERBUTTON, "layer"..n, True, False, {OnMouseDown = StartLayerToFront, OnMouseOver = ChangeText}, n)
Next
Repeat
WaitEvent()
Until quit = True
Code: Select all
- New: LayerToFront() and LayerToBack() accept an optional argument now; if this is set to FALSE, the
layer isn't brought to front or back by swapping layers but by simply moving the specified layer
to the front or the back; this is a much more logical behaviour but by default LayerToFront() and
LayerToBack() will use the old behaviour for compatibility reasons