Multi Screen Menus
Hi guys, I have been searching and searching the forums to no avail, so sorry if this has been previously discussed. So I recently saw the video by TshirtBooth on youtube about mutliscreen menus. I loved the idea and easily implemented it into my game with two "menus" and it worked like a charm.
The problem came up when I tried for a third menu. For some reason, it doesn't want to go to the third menu. The first two work great. When trying to go to the third menu, the screen sort of bounces left to right on the second menu. To further understand what I am saying with these menus, check out his video title "Multiscreen Menus" on youtube. Part one explains the basics best.
Two more, much smaller and simpler questions if anyone knows the answer:
- How do I make it, so that when the player is swiping, they don't go to the scene that they are using to swipe. For instance, if I want to swipe to the second menu, and my stubby fat fingers just so happen to hit the "level 5" button, it won't even give me a chance to swipe, it just goes direction into that scene. I figured out that if I did "When actor receives event --> touch is released" that is helped a bit, but if I'm careful, and release on the same actor button that I pressed down on, the same problem persists. It helped at first only because a person (me in this case) usually swipes faster than the button can keep up. So when they release, they aren't actually on the button anymore, so no action takes place. I basically need button functionality to turn off when the player is swiping somehow.
I know that the part two of the mutliscreen menus videos prevents swiping when selecting a level, but that is not what I'm asking here, in fact, it is the opposite.
- I would also like the multiple screens to "stick". For example, I have one screen with 10 levels, the next 10 levels are a simple swipe to the left away (moving the screen to the right). How TshirtBooth has it set up in his videos, it is possible for me to see levels 5-10 and 11-15 on the same screen (levels 1-5 are off to the left of the viewer, and 16-20 are still to the right, requiring more swiping to see). I basically want the player to swipe to the left, and when the screen moves far enough to the right, it "sticks" to levels 11-20 and levels 1-10 are not in view anymore. This gives a grouping feel to the levels, as in levels 1-10 are basically mini levels within this one giant level. As I mentioned earlier, this is all much easier understood if you have watched the youtube video.
I tried to explain as best I can, maybe too much. But if you need any clarification please let me know! I will gladly help you help me! ;D Thanks guys!
Comments
I can't answer all of your questions but I'll help you with the smallest one:
The idea here is that you measure the distance the player has swiped (I'm not sure if that particular video included a technique for that but it shouldn't be too hard to add) and then you add a rule condition to the existing When Touch is Pressed or When Mouse is Down rule that says When game.swipeDistance > 30.
It could be any value really, I just chose 30 pixels as an example. You'll have to try it out to see what feels right.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Okay so I don't quite understand what your saying. So I need the rule that I already have, and within that rule (Actor receives event --> press is released --> change scene --> scene #) I need to add another rule saying that unless the player has swiped the screen a distance of less than 30 that rule doesn't apply? Meaning if the player swiped for 35 pixels, the button would no longer work? If that is what you mean, how would I add the attribute to the game so that it knew that by "30" i meant 30 pixels?
Also, in case anyone else is having this problem, the reason I couldn't view a third screen while previewing is because of the rule applied to the Cam actor as seen in the video I mentioned. Change the max portion of that rule to your new max. In the video, his max is double his screen size, adding two screens worth of width. A dumb mistake, but I never changed it to TRIPLE the screen width, meaning the Cam actor only moved far enough to view two screens. Hope that helps someone else, as that drove me crazy for a whole day straight trying to figure out.
If you each the video it says how to calculate for large areas. theres some attributes you have to set based on the full scene width and then subtracting half the screen size if i remember right. Once you understand how the expressions are built you can easily convert it over from hard numbers to just using the scene width attributes in place of the calculated numbers.
hope that clears things up.
I'll look for my demo project i made a while back using my updated method for ya. its based on that video but uses a better expression.
You'll see in this demo the constrains have a scene width-240 and scene.height-160
Thats because you need to make sure the cam actor stops at the center of the screen size
So in your version just replace the numbers you used that likely match your 2 scene width. with scene.width and it should know how far to let the actor swipe no matter how much you change the scene settings.
Thanks for the input guys, but I think I have that part figured out. The hitting a button while swiping is killing me though!
Well for that you need to setup your camera offset properly. Theres another video on gshelper for that if its not covered in the video your watching.
Edit: Sorry i think i may have misunderstood. you mean your buttons are being clicked when you swipe?
For that you need to add a condition to your buttons that says When the cam actor has a linear velocity of 0 or nearly 0. you'll have to play with the specific setting you want but that should help you out.