How to make a pop-up menu while the game still is running?

How to let a pop-up menu appear when I click on a button, while the game is still running not pausing˜

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited September 2013
    Add the menu actors (buttons, background, titles) to your scene, have them hidden off the side of the scene when it starts, then when the 'menu' button is pressed change (or interpolate) the menu actors positions so they're visible in the scene for the player to use. If you don't want it to pause, don't use the pause behavior and don't build your menu in a different scene.

    Hope it makes sense.
  • TheGabfatherTheGabfather Member Posts: 633
    edited September 2013
    Create your popup using a group of Actors (most likely on a single Layer of their own). One for the window, one for a "Confirm" button, another for a "Cancel" button, etc.
    Either Spawn it into screen when you want it to and Destroy afterwards, or Spawn it outside of view initially and just move them into view when needed, then back out.

    If you want your Game mechanics to pause while your popup is activated, you have to work that out as well.

    edit: Whoops too slow. Now you have two references. You can't muck this up now for sure :)
  • CroissantCroissant Member Posts: 21
    I basically understand your meanings. Thank you two~

    But another problem has encountered:

    How to group different parts of a menu, that once I create a behavior to let them move or what, the behavior would effect to them all at one time?
  • TheGabfatherTheGabfather Member Posts: 633
    edited September 2013
    Read up on the Constrain behaviour. That's one way of doing it, and shouldn't be too taxing if it's just for your popup.
  • CroissantCroissant Member Posts: 21
    So, as you mean, if there's one button on a panel, is the way I constrain the button to this panel like this?

    constrain attribute (self.Position.X) to [(current.Layer1.Menu.Position.X)±n],
    constrain attribute (self.Position.Y) to [(current.Layer1.Menu.Position.Y)±n]

    or what?
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    yup.. that'll be the way to do it...
  • TheGabfatherTheGabfather Member Posts: 633
    @Croissant
    Next time, try it first. After all, it seems like you have the logic + code in mind already. Yeah?

    Anyway, glad you got to your solution :)
  • CroissantCroissant Member Posts: 21
    Thank you very much˜
Sign In or Register to comment.