how to make a simple menu that hides when not needed?

xyloFUNxyloFUN Member Posts: 1,593
edited November -1 in Working with GS (Mac)
Hey,
i've been watching some of the game demos posted on here and many have a really cool menu with buttons that slide out.
Did someone ever make a tutorial on how to do this?
Nothing fancy, just say a side strip that has 4 buttons on it and the menu comes out when needed?

I'd love to read a tut or if someone feels up to it, please just describe how to add the main strip on the side and one button that sticks to it.

thanks :)

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Well, the strip will still obviously need buttons!

    I would set them all offsceen and use interpolate to get them into position when needed, then move offscreen again when not needed.

    You'll need some sort of button somewhere to call them in/tart them off.

    In the interpolate command, just say 'Change selfpositionx' and apply the time - if you use ease in/out, you'll get a nice soft entry/disembark.

    hope that helps!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • xyloFUNxyloFUN Member Posts: 1,593
    thank quantumsheep,
    that is great! I can't wait to experiment with that! .... actually, I don't have to wait .... i'm off to experiment now!!!
  • simo103simo103 Member, PRO Posts: 1,331
    xyloFUN .. I downloaded a template a long time ago and don't know where on GS so I have zipped it here for you:

    http://www.resqwest.com/TEST/popup_selector.gameproj.zip

    hope it helps a bit
  • xyloFUNxyloFUN Member Posts: 1,593
    hey thanks!

    I will dissect it like the frog in grade ....
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    This is what i do for hiddable menus. You set the menu actor offscreen, and have whatever you want trigger a interpolate to the position you want. That will raise it when needed. Then if you have a x at the top of the menu of whatver to exit it have it interpolate back to original posion when pressed.That gets it sliding up and down. Then for the buttons, create invisble actors for them.i create 2 global attributes menu x and menu y. Then constrain menu x and menu y to the actual menu actors x and y. Then for the button have rule constrain attribute x to menu x +( then you put whatever number you want here, can also be negative if you want it to be opposite direction more. Then do same for y. Then any other buttons do the same constrain x to menu x + whatever and same for y. That way it slides up and down when exited, and your buttons stay in the same place on the menu no matter where the menu is on the screen. Because you cant just place actors on the buttons because they wil respond to touch even when the menus not there. And if you spawn the buttons with the menu it slows down fps alot. Hope i helped!
  • xyloFUNxyloFUN Member Posts: 1,593
    A W E W O M E !

    I am soooo excited to fiddle with this tonight because that is EXACTLY what I need!

    That phone screen is soooo tiny!

    John, while I have your attention, here is what i did:

    I've build resolution independent for iphone but now i can not set my graphics to "fixed" anymore or i'm afraid that it will mess up the iphone 4 or 3 version. Especially, since i have no way of doing early testing which is not good.
    So thanks for now .... I'll be back!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Let me know how it works! And im sorry resolution independece is the one thing i dont really know alot about, ive never really messed with it yet.
  • xyloFUNxyloFUN Member Posts: 1,593
    resolution independence is probably a good thing but when you need pixel perfect accurate placement, it might not be ideal. I can not say yet because I have not tested but i recall that my ipad game worked perfect in the simulator and downloading the build into the ipad hand one of the trumpet valves move one pixel when pressed.
    I can not imagine that two resolutions could function without messing one or the other up?

    Will see ... i try to test on the weekend.

    Now back to that menu ....
  • SingleSparqSingleSparq Member Posts: 1,339
    I have an iPhone 4 and 3GS and on the sliding menus I have in the game I'm working and I don't have any issues with placement. (least none that is noticeable)
  • xyloFUNxyloFUN Member Posts: 1,593
    SingleSparq,
    that is good to hear! I did have issues with discrepancies between the simulator and test build and naturally, I am worried that now, that i'm working on two resolutions where I have hardly control over how things scale down .... will see tomorrow as I might be able to test then.

    John, if you happen to catch this, and you are not too busy, could we do a few things with the menu? i tried a few things but don't get what i'm after ....

    give me a shout if you're still up? :)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Im always up i have insomnia haha :) Whatever you need just let me know, ill be here
  • xyloFUNxyloFUN Member Posts: 1,593
    Maybe we could/should contact the Guinness Book of Records then? I usually crawl by with about 4 hrs a day give or take one here and there.

    The iPhone screen is tiny (im so used to the ipad) and i am afraid that I can not implement the buttons on the screen like i did with the trumpet so, i have to learn how to make a sliding menu which you have already told me how to proceed.
    I have never used "interpolate" so I like that! Previously, when I watched others and how liquid everything came on screen, I loved the look of that ....

    But how do i actually make an actor that causes an other actor to slide in?
    I assume i need to ad a scene attribute, integer set to 0 or 1?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yes say you when the menu to slide when u press button 1. Make a attribute called slide, and in buttton 1 havw rule when touched is pressed change slide to 1. Then when slide = 1 interpolate in the menu. Then for the button to exit the menu, just change slide to zero, and have another rule in the menu when slide = 0 interpolate. Sorry i took long to answer i was eating lol
  • xyloFUNxyloFUN Member Posts: 1,593
    eating game salad? (jk)

    thanks John,
    i will do that! I'm having a lot of fun with the little screen app and have decided to make it super simple!
    How ever, I always include three different ways to do something in my apps (remember the trumpet offers "learn, play and compose") so this time, i will have 10 lessons, each taking one scene but, and this is the good part, students who are not sure how to play the song can tap the notes and the notes will play the clarinet.
    I've done that a few months back with a flash app and it works great!
    Earlier, i registered the domain tapasong.com so that I can branch out, offering an additional product down the road ....

    So, the first part will be the lessons, the second part will be a few songs (with more on the web page) and the last, I repeat the composing module like the trumpet has!

    OK, in another post, someone mentioned that we can control where to "place" an actor on the screen (drag & drop)

    Have you done something like that? and if yes, could I also read out which actor (say from 8 different ones) was dropped where? THAT would be ultra cool for my piano app which i'm hoping to start on Monday :)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    I cant wait to see the new app! And yes drag and drop is pretty simple actually. In the actor you want to drag around, have a rule in it when touch is pressed, then touch the + sign to add another rule in that same one. And make that rule when touch is inside. Then drag to constrain attribute behaviors under the rule. For the first have constrain self.Position.X , constrain it to devices mouse position x. Then for the second constrain behavior have constrain self.Position Y to mouse position y. And thats it! And then you could tell whats dropped where with a couple attributes. Im thinking that part threw now, let me know how the drag and drop works.
  • xyloFUNxyloFUN Member Posts: 1,593
    John, I think i can probably finish tonight .... or sometime tomorrow (because I'm picky)!

    The plan is to test tomorrow night or Saturday and then send another one to the Apple tree ;)

    Question:
    can i make it so that scenes change smoothly (by using the "next scene" function?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You cant control how fast your switch scenes, it all depends on your project. The one work around is that if you only have a couple scenes, you can just make one really wide scene, and have the first scene in the original position then put the second scene stuff right next to the first one, the keep going. Then when you want it switch scenes, you just change the camera position. So it jumps imediatly.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    and your on a role! haha
  • xyloFUNxyloFUN Member Posts: 1,593
    WOW, i got a lot done :)
    I wish it wasn't such a pain to get the iphone viewer installed ....

    It's been a good day :) The Little Composers Clarinet is 90% done ... and so am i :)
  • JoeMeisterJoeMeister Member Posts: 602
    A word on "resolution independence". DON'T USE IT,unless you have a good reason for it.
    When I started my first app I thought RI would be a good idea. The two words suggest that
    when selected that graphics will look good across all platforms. WRONG.
    When I finally loaded my app onto my iPhone 3GS everything was blurry...just terrible.
    I went back and deselected RI, loaded the app back onto iPhone and everything looked great.
    My app "Coin Fountain" was released 3 days ago and so I checked it out on both the new iPhone4 and an iPad.
    It looks great on both screens.
    Its easy to mistake RI for a magic bullet which it isn't.
    I created my app as a 320x480 and it looks great.
    It's a small app and comes in at just over 8.3MB cause of 3 full size screen images.
    If I would have set it to the suggested larger res for the new iPhone 4 it would be way over 10MB.
  • simo103simo103 Member, PRO Posts: 1,331
    thanks Joe ... could a few other 'pros' weigh in on this topic also ... ie: are you or are you not using RI? Kind of important for us noobies.
  • xyloFUNxyloFUN Member Posts: 1,593
    WOW and thank you for saving my last grey hair!

    i did not know this but asked earlier because of the discrepancy between testing in the simulator and then on the ipad. The simulator looked perfect (no strange movement) but exporting to the ipad revealed a problem.
    The fix was to adjust them images from "stretch" to "fixed" which took care of my problem!

    Now, with RI, i don't have that option so i was concerned ..... will see what the actual test reveals but yeah, i'm ready to drop RI in need be.

    Question: How did you submit to Apple? Two separate builds?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    almost done!
  • xyloFUNxyloFUN Member Posts: 1,593
    JohnPapiomitis said:
    almost done!

    Every developers "favourite" words ;o)

    p.s. I've decided to add a third column to my web page ... so that's all the fun i'm having :)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    xyloFUN said:
    Every developers "favourite" words ;o)

    p.s. I've decided to add a third column to my web page ... so that's all the fun i'm having :)

    ill drink to that! well not now,... its only 2 in the afternoon here, but soon very soon :P hehe
  • xyloFUNxyloFUN Member Posts: 1,593
    you know, in a few weeks, when we are both millionaires, we should so something .... like meet in NY for coffee or maybe in Florida because it's warmer there!
Sign In or Register to comment.