| FBA The Creator http://www.fbacreator.com/fbaforum/ |
|
| Is there a way of clearing the mousedown buffer? http://www.fbacreator.com/fbaforum/viewtopic.php?f=5&t=63 |
Page 1 of 1 |
| Author: | Boiled Sweets [ Thu Jun 26, 2008 12:16 pm ] |
| Post subject: | Is there a way of clearing the mousedown buffer? |
Hi, adding a menu to my game. On the main menu page I have amongst others an "options" & "quit" button. When they click "quit" the game closes. When they click "options" the options pages is displayed. On the options page in the same position as the quit button there a "done" button to return them to the main page. It all works lovely but if I don't 'stab' the "done" button then the "quit" button event is triggered. So is there a way to clear the mousedown buffer so that I can be sure they actually pressed the "quit" button deliberately? Code: function DoMenu() |
|
| Author: | evilmaio [ Thu Jun 26, 2008 12:37 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
Actually there isn't a way to do that, you could workaround this using the stylus events, instead of checking the mouse position inside your logic. |
|
| Author: | Boiled Sweets [ Thu Jun 26, 2008 12:51 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
Was just following the examples given with FBA.... |
|
| Author: | evilmaio [ Thu Jun 26, 2008 12:57 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
I know, but for your case, with alternate pages and several buttons on same position, it won't work well I thought a reset function for mousedown counter wouldn't be useful, but i'll add it if it will be necessary |
|
| Author: | Boiled Sweets [ Thu Jun 26, 2008 1:00 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
Hi, well more functionality would be nice But I have recoded... Code: function onstylusdown(x,y) and works perfectly - THANKS! Yeah I could use the x, y passed to in see if it's inside the button are but easier to call mousein I think... |
|
| Author: | phrebh [ Thu Jun 26, 2008 1:01 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
I use context-sensitive menus in the program I'm writing, and to make sure that my clicks are going to the write menu, I use some state variables. I got the idea from the Enlight code, where there are different states for the game, the help, and the about screen. Here's a snippet: Code: elseif mousein(49,96,166,111) then You can see that I check the state of the screen before I allow the click to change anything else. |
|
| Author: | Boiled Sweets [ Thu Jun 26, 2008 1:02 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
Don't take this the wrong way but I think that method is a little more 'clunky' - THANKS anyhow... |
|
| Author: | phrebh [ Thu Jun 26, 2008 1:13 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
Oh, I see. You took the same concept but switched around the order of the ifs. I like it. |
|
| Author: | Boiled Sweets [ Thu Jun 26, 2008 1:18 pm ] |
| Post subject: | Re: Is there a way of clearing the mousedown buffer? |
Also notice the const I'm using (the variables in uppercase). Makes it LOADS easier to rearrange the layout as it's all calculated based upon the certain set values - more flexible than hard coding... Yet to set the button size, i.e. the 32 etc but I'm working flat out |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |
|