Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 13:22:43 +0100
Hi!
It seems to me that if there is some overlapping buttons, not all call the callback functions in HW3. What is the design consideration about overlapping buttons?
[19 Mar 2008] overlapping buttons
[19 Mar 2008] Re: overlapping buttons
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 13:49:40 -0000
Regards, Fabio.
Hello, I'd like to have some info about this behaviour too. I wasn't able to understand if there is some internal sort method with overlapping button because the last created button, over another previously created button sometimes miss calls to the callback functions, as you stated. It's difficult to test, but I've had the same feeling about overlapping buttons.Hi!
It seems to me that if there is some overlapping buttons, not all call the callback functions in HW3. What is the design consideration about overlapping buttons?
Regards, Fabio.
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
- airsoftsoftwair
- Posts: 5833
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[19 Mar 2008] Re: Re: overlapping buttons
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 17:29:09 +0100
Well, the behaviour of overlapping buttons is currently undefined. Which buttons are triggered will depend on their position in the list of buttons that Hollywood keeps.
I don't know a better way because Hollywood needs to decide which button to trigger when the user clicks on an overlapping region. It will usually trigger the first button in the list. Triggering all buttons that collide with the overlapping region doesn't make much sense IMHO.
Well, the behaviour of overlapping buttons is currently undefined. Which buttons are triggered will depend on their position in the list of buttons that Hollywood keeps.
I don't know a better way because Hollywood needs to decide which button to trigger when the user clicks on an overlapping region. It will usually trigger the first button in the list. Triggering all buttons that collide with the overlapping region doesn't make much sense IMHO.
[19 Mar 2008] Re: Re: overlapping buttons
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 10:00:25 -0700 (PDT)
A method that I have used to keep overlapping buttons sorted out is to make one button that spans the entire area and then do something like this in the function that is called:
If MouseX()>XVar1 AND MouseX()<XVar2 AND MouseY()>YVar1 AND MouseY()<YVar2
This method allows you to define behavior for overlapping buttons in a specified area (in a box shape). But you can also accomplish the same thing for other shapes using Hollywoods masking and collision detection functions.
A method that I have used to keep overlapping buttons sorted out is to make one button that spans the entire area and then do something like this in the function that is called:
If MouseX()>XVar1 AND MouseX()<XVar2 AND MouseY()>YVar1 AND MouseY()<YVar2
This method allows you to define behavior for overlapping buttons in a specified area (in a box shape). But you can also accomplish the same thing for other shapes using Hollywoods masking and collision detection functions.
[19 Mar 2008] Re: overlapping buttons
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 17:07:50 -0000
True, but if I've understood what you say, maybe is better to trigger the event of the last created button that should be in front of the previously created ones instead of the first in the list, assuming that the Hollywood list order reflect the button's creation order.
Regards Fabio
True, but if I've understood what you say, maybe is better to trigger the event of the last created button that should be in front of the previously created ones instead of the first in the list, assuming that the Hollywood list order reflect the button's creation order.
Regards Fabio
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | ☆★ All my links ★☆
[19 Mar 2008] Re: overlapping buttons
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 18:16:41 +0100
Hello Andreas
My problem is to capture right mouse click event on the whole screen beside buttons that react to left click. I made a button for the whole screen for the right click and the others to the desired places. That is how does not work properly.
I do not want to make a regular IsRightMouse() check and InstallEventHandler() cannot be used for it. By the way what is the reason that InstallEventHandler can not be used for all the global events, such as mouse click/wheel or joystick?
So can you suggest a proper way to call a function by the right mouse click?
Hello Andreas
Maybe the layerbuttons can produce some cases that would be handy if all overlapping buttons make a call.I don't know a better way because Hollywood needs to decide which button to trigger when the user clicks on an overlapping region. It will usually trigger the first button in the list. Triggering all buttons that collide with the overlapping region doesn't make much sense IMHO.
My problem is to capture right mouse click event on the whole screen beside buttons that react to left click. I made a button for the whole screen for the right click and the others to the desired places. That is how does not work properly.
I do not want to make a regular IsRightMouse() check and InstallEventHandler() cannot be used for it. By the way what is the reason that InstallEventHandler can not be used for all the global events, such as mouse click/wheel or joystick?
So can you suggest a proper way to call a function by the right mouse click?
- airsoftsoftwair
- Posts: 5833
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[19 Mar 2008] Re: Re: overlapping buttons
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 20:20:43 +0100
Hmm, actually, InstallEventHandler() should probably support handlers for MouseClick and RightMouseClick. I think I will add this feature for the next version. It really makes sense because otherwise there is no possibility to check for clicks unless you do a polling loop which is bad of course.Maybe the layerbuttons can produce some cases that would be handy if all overlapping buttons make a call.
My problem is to capture right mouse click event on the whole screen beside buttons that react to left click. I made a button for the whole screen for the right click and the others to the desired places. That is how does not work properly.
I do not want to make a regular IsRightMouse() check and InstallEventHandler() cannot be used for it. By the way what is the reason that InstallEventHandler can not be used for all the global events, such as mouse click/wheel or joystick?
So can you suggest a proper way to call a function by the right mouse click?
- airsoftsoftwair
- Posts: 5833
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[19 Mar 2008] Re: Re: overlapping buttons
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 19 Mar 2008 20:21:26 +0100
Yes, I could iterate over the list from the end to the beginning. Then it would work the other way round. I'll think about this.True, but if I've understood what you say, maybe is better to trigger the event of the last created button that should be in front of the previously created ones instead of the first in the list, assuming that the Hollywood list order reflect the button's creation order.