So close... menu overlay with popup, touch pressed/released causing issues
Hi Guys. I've been killing myself, but I'm so close. I have attached examples.
When my game starts I have a menu overlay with a "popup toggle" button. While the menu is active, it should not be possible to click the actor under the menu, that part is working fine. If the menu is clicked, the menu should disappear as well as the "popup toggle" button, that part also works.
If the "popup toggle" button is clicked, a popup box should pop up and when the close button (x) is clicked on the popup box, the pop-up box should close and basically everything should be as it was before the "popup toggle" button was pressed, this part also works.
The problem is the touch rule on the menu overlay actor. If I use "touch is pressed" the entire thing works perfectly, but the touch/click is very buggy. It's almost as if I have to touch the menu overlay actor longer than just a quick tap, but not too long, if I hold it too long, the actor underneath the menu gets clicked. I'm making an app for toddlers so ideally it should still work if they hold their finger down for a while.
So I changed to "touch is released" on the menu overlay actor and it resolved the buggy click issue and longer touches but now what happens is when I click the close button (x) on the popup, the menu overlay disappears, instead of just the popup and close button.
Also the rules following the touch rule on the menu overlay actor was a bit of trial and error and a lot of forum reading. I would appreciate if someone could let me know if that's the most efficient way of doing things.
Thanks!
Comments
You need a lockout so when the pop up is active the actors below lockout from touch. You can use a game level Boolean and add it to the conditions of the touch rules of the actors below.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I already have a game level Boolean called is "ispopupactive" which fires when the popup is spawned and the actors below the popup have "ispopupactive false" as part of their touch rule. It's working fine if the menu actors uses touch pressed, but as I said the touch is then buggy. Using touch released on the menu actor fixes the buggyness of the touch/click, but then "ispopupactive" doesn't seem to fire. Any chance of having a look at my attached templates?
Edit: Made the issue more clear, I swear it wasn't a bump
@revoltandreverb, I had a look at your setup.
For simple things you are on the right track, setting game level states and using timers to counteract the latency of the pressed and released conditions. You will however also need to pay attention to the scene layers and the order in which actors get processed.
As your project grows it is going to cause you frustrations though.
Consider a different approach:
Either
a) make each popup a separate pause scene (most control)
or
b) make the underlying menu options scroll out of the way while the popup is active (most fancy)
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Thanks! Yea I started to realize that if I do a bigger project things will get crazy, it's already hard to keep track. When you say "separate pause scene" are you referring to a separate scene for each "popup layer"?
Thanks
@revoltandreverb, exactly, gives you complete control over each layer. Like a modal dialog box.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
I just always thought that new scenes load a long time and it's always better to try and do menu's and pause screens in the same scene, obviously not?
In general you are correct, it is a tradeoff in this special case. A simple scene with a few menu options loads almost instantly.
Give it a try.
Usually I try to avoid overlapping menus like this.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Awesome!
Just want to say thanks again I've redone the game with scenes and it took my 5 seconds. I guess I was trying to reinvent the wheel but at the same time it wasn't allowed to be round