Menu Creation

  • I just wanted to guage some of your brains to get a basic overview of the flow you use to create ingame menus. Things like clicking a computer screen and having it come up with a menu that is interactive without going to another layout.

    Im experimenting with keeping things in layers now and I'm having relatively good success, just wanted to hear some of your suggestions.

  • One piece of advice I would give is to add a local variable that is set to 1 when a menu button is pushed. Then as a condition of pressing a button, make it so that variable needs to be 0. This just overcomes a lot of issues like touching underlying buttons or two at a time. Then also/instead use 'pick top' if using a button family.

    And if your menus get really complicated with a lot of things overlapping and remaining on-screen, I use a text variable that defines which group of buttons are active (purchase, equipment, etc.).

  • One piece of advice I would give is to add a local variable that is set to 1 when a menu button is pushed. Then as a condition of pressing a button, make it so that variable needs to be 0. This just overcomes a lot of issues like touching underlying buttons or two at a time. Then also/instead use 'pick top' if using a button family.

    And if your menus get really complicated with a lot of things overlapping and remaining on-screen, I use a text variable that defines which group of buttons are active (purchase, equipment, etc.).

    I already use your original suggestion, and thanks for the others! Good thoughts. I don't have very complex menus yet, but they will become that way in due course.

  • I'm also making a menu right now and I want it to be as user friendly as possible. My game support mouse/touch, keyboard and gamepad, all at the same time, and that include inside menus too.

    For the mouse, it's pretty straight foreward, I highlight the menu items on mouse-over and select on click. I had to use some of the workarounds you mentioned, especially for sub-menus in hidden layers still catching clicks (I was actually pulling my hair on this one until I realized what was really happening).

    For keyboard and gamepad, each menu item has a variable named index (I created a specific family for menu items). it's a numeric value and I give each item a different number. This allow me to navigate through the menu with keyboard and gamepad, when pressing up or down, I highlight the item with next greater/lower index value. If I reach the end of the menu (no more greater index available) I jump back to the first item (the one with the lowest index). Then for selection I use the button A or enter. In case I'm in a sub-menu (options, confirm quit...) button B and Escp act as a shortcut for going back to the main menu (as well if I'm in the pause menu, this will resume the game), you don't have to move the selection to the "back" item and confirm (but you still need to keep it for mouse/touch users). This might be a bit over the top, but it's this kind of polishing that really increase the user experience overall (sure if the rest of the game is crappy, it's no need to have a fancy menu)

    While all this is handled in a generic form with Families and function (I can easy create new menus and item on the fly now), I still need to specify for each menu what each item does when selected.

    For that I use a variable named in the menu item, which contain a string.

    Then when an item is selected, I run a function which get this variable, compare it to a bunch of keywords, and do the corresponding action:

    if action = "start" -> go to layout "firstLevel"

    if action = "options" -> Call Function openSubmenu("option")

    ...

    That's when I wish there were a Switch statement

  • OlivierC

    Great post and some excellent ideas. I will be experimenting more with how I want things to work but I may just incorporate some of those methods that you mentioned. I too am trying to make the menu very user friendly and an experience that is both pleasant and relevant to the game.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • : I created a Switch-Case plugin a while ago that I use with a lot of success.

    SwitchCase Plugin

    I hope you find it useful.

  • One way that I have done this was to bring up a rectangle to hide most of the screen and then place my text and buttons on it. Move it off screen and deactivate menu objects till needed again. Also I deactivate any objects that are underneath the menu so they cant be accidentally clicked on.

  • What I tried for my RTS game under works was to have each Menu Object have an "IsActive" variable like mentioned above, and also Xcoord and Ycoord instance variables. I create and throw my HUD elements out of screen before startup. And when the menu is activated, I change the position of HUD elements to their corresponding locations(Xcoord,Ycoord). Upon deactivations I just send them to -500,-500. Since I am doing all of this in a seperate event sheet, as soon as I include them in any level, I automatically have a global solution.

    However, you have to decide Xcoord and Ycoord manually which takes a few tries. Also, since I used a lot of pin objects on my UI elements, it became a little bit of a messy code and I decided to look if there was a better alternative. Just my 2 cents.

  • One way that I have done this was to bring up a rectangle to hide most of the screen and then place my text and buttons on it. Move it off screen and deactivate menu objects till needed again. Also I deactivate any objects that are underneath the menu so they cant be accidentally clicked on.

    Why not just use a new layout and switch between the two? Or even have a menu on a layer that you can hide/unhide?

  • Why not just use a new layout and switch between the two? Or even have a menu on a layer that you can hide/unhide?

    THe question was to do it without switching the layout. I can see this being useful for many reasons.....

    A popup to ask a question such as...Continue or quit.... objective display or a popup hint...etc.

    Just a simple dialogue menu that will not change the current game position making it easy to return to game.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)