Forum rules - please read before posting.

Menu interaction

edited September 2014 in Technical Q&A
1) I'd like the player to be able to close menu if he clicks anywhere, except on a menu button.

So:
-> if player clicks on a menu button -> he activates it
-> if player clicks somewhere else -> menu closes

What can I use?

2) Other thing, I'd like the player to be able to click "esc" to exit any menu.
-> click "esc" -> menu.TurnOff (for all menus)

How can I get the "esc" click?

Thank you very much!

Comments

  • 1) You should be able to do this by creating an "invisble" Button underneath, that spans the whole Menu.  If it's layered correctly (I forget which way round it'll need to be, but you can use the Menu Manager to re-order elements), it should pick up clicks only if you're not clicking on the Button in front of it.

    2) When any such menu is on, call a looping ActionList that uses the Input: Check Action.  Set it to Run In Background, and check for "Escape" (this must be a defined Input axis).  If the Action returns True, use Menu: Change state Actions to turn off all the Menus.  If false, just loop it back on itself (easier to do within the ActionList Editor window).
  • 1) I tried 1, but seems it stops every other menus. No other buttons work. Maybe is a issue of raycast?
    I tried to place this "large button" on top of every other buttons and on bottom of them, but it activates always, disabling all other buttons.

    2) Great! I'll use it. Thanks.
  • Are you talking about buttons in other menus, or in the same menu?  From your description, I thought there was only one button in question here.  If it's always activated regardless, I suppose you could just create multiple "invisible" buttons, but I don't know how complex your menu is.
  • I was using a large button at the bottom of the same menu.. 
    Using multiple buttons in the empty spaces works fine. Thank you very much.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.