I am currently planning on having bigger box with a small box in corner on top of the button.
Idea here is that by clicking on that bigger box I can load a picture to be displayed on it, but by pushing that small corner box, I can delete the image.
Easiest would be to make two #SIMPLEBUTTONs, but having the bigger for example 200x200, and then have smaller box of size 10x10 as example which is placed on the corner of the bigger Button.
However, how does Hollywoods buttons work. That is there a sure way to make sure that when I click on that Smaller button, it actually does activate the smaller button instead of the bigger button?
Like If I use MakeButton twice, is it so that the Button I created last would be the one that would be activated when two buttons are at same location? Or is it random behavior?
Would have tested, but even if it works as expected, that doesn't mean it would always work necessarily, if there is some randomness in it.
Is there a way to make sure that certain button activates when two buttons are in same place?
Re: Is there a way to make sure that certain button activates when two buttons are in same place?
acoring to manual of MakeButton() (check in Z-order ) the last created overlaps previous but this is guarandeed in layers
definitely works in way created thought even without layers, but will be guaranteed in future (?)
i know you dont use layers ...
definitely works in way created thought even without layers, but will be guaranteed in future (?)
i know you dont use layers ...
Christos
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Is there a way to make sure that certain button activates when two buttons are in same place?
It's not really random. All buttons are chained in a linked list to the current BGPic and then this list is checked against mouse events in the order of creation of the buttons so buttons created first should trigger first.
Re: Is there a way to make sure that certain button activates when two buttons are in same place?
i would say its the opposite order the last created is the first triggeredairsoftsoftwair wrote: ↑Mon Feb 19, 2024 9:32 pm It's not really random. All buttons are chained in a linked list to the current BGPic and then this list is checked against mouse events in the order of creation of the buttons so buttons created first should trigger first.
Code: Select all
Function p_MyFunc(msg)
Switch msg.action
Case "OnMouseUp":
DebugPrint("User left-clicked button", msg.id)
EndSwitch
EndFunction
evtmatch = {OnMouseUp = p_MyFunc}
MakeButton(1,#SIMPLEBUTTON,1,1,100,100,evtmatch)
MakeButton(2,#SIMPLEBUTTON,1,1,50,50,evtmatch)
Box(1,1,100,100,#RED)
Box(1,1,50,50,#BLUE)
Repeat
WaitEvent()
Forever
Christos
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact: