Pop-up Menu

KatAppsKatApps Member, PRO Posts: 84
edited February 2012 in Working with GS (Mac)
Hey all,

I'm wondering if anyone can advise, or direct me to a tutorial for creating a pop-up menu for my app?

(This meaning, if I press a button within my game a menu-box with some text can pop up on the screen. And then if I press another button within that menu, the menu will disappear again..)

Thanks so much!

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    so many ways!

    you can have the menu off-screen and trigger with:
    -a gameAttribute (suggest Index type, though boolean works) named Menu

    on button in gamePlay:
    Rule: when
    Event: touched is pressed
    --changeAttribute: game.Menu To: 1 (or true if boolean, though 1 also works)

    on menu items (have their Position.X set to correct X for when on-screen):
    on Prototypes:
    -add attribute real type named screenY and set at the correct on-screen Y
    -add attribute real type named OffscreenY and set at the correct off-screen Y
    Rule: when
    Attribute: game.Menu = 1 (or is true)
    --changeAttribute: self.Position.Y To: screenY
    Otherwise:
    --changeAttribute: self.Position.Y To: OffscreenY

    on the menu button:
    Rule: when
    Event: touched is pressed
    --changeAttribute: game.Menu To: 0 (or false if boolean, though 0 also works)

    or still using attributes to change states
    you can interpolate things … or change Color.Alpha … or pause game with a pause scene

    @};- MH
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    A Pause Game behavior (e.g. on a "Menu" button) works great for this, using when touch is pressed. Create a scene and add an actor that is the size of the pop up menu (say 1/3 of the size of the scene, centered). I use Illustrator to draw a rectangle with a thick border, but anything will work. Add a button (e.g. "Resume") on that scene with the Unpause Game behavior, using when touch is pressed.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.