Heres the other problem i mentioned with layertofront:
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
This code is otherwise same as before, except I am now using textout to create one textobject, and i add to Makebutton this "OnMouseOver" condition which goes to change text.
What ChangeText function does, is to change the text to tell on top of which numbered box the mouse curently is.
To notice the problem, you will first need to left click with mouse on top of boxes in such way that one of the boxes get covered by other boxes (this can be seen by having one vertically double sized big box).
If you now move the mouse over those boxes, you will notice that, I think, it is working wrong.
What I would expect to happen, is for that number to change only when I am moving on top of some new box graphics.
However, in practice when I move on top of that double sized box, it changes number twice.
If I have understood right, then Hollywood should work in such way that if Button A is completely covered by Button B, then there shouldnt be a way to push the A button, but it should be pushing B button instead.
However, in this case it seems to be working in such way that if Layertofront command would work as it should, then the buttonareas are aligned the exact way they should be.
This makes me suspect that this problem with layertofront behavior might be two different problems. That while graphics and graphics z-position go where ever they go, the button itself seems to go to right z-order anyway.