Menu Creation

Discussion and feedback on Construct 2

Post » Thu Sep 26, 2013 1:42 am

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.
B
5
S
1
Posts: 14
Reputation: 413

Post » Thu Sep 26, 2013 2:08 am

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.).
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Thu Sep 26, 2013 6:29 am

[QUOTE=Tobye] 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.).[/QUOTE]

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.
B
5
S
1
Posts: 14
Reputation: 413

Post » Thu Sep 26, 2013 12:29 pm

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 statementOlivierC2013-09-26 12:33:01
B
12
S
5
G
2
Posts: 132
Reputation: 2,637

Post » Thu Sep 26, 2013 2:49 pm

@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.
B
5
S
1
Posts: 14
Reputation: 413

Post » Sun Dec 22, 2013 8:49 pm

@OliverC: 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.Wastrel2013-12-22 20:49:58
Don't see the fnords and they won't eat you!
B
79
S
17
G
12
Posts: 323
Reputation: 11,850

Post » Mon Dec 23, 2013 1:13 am

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.
B
28
S
5
G
2
Posts: 77
Reputation: 3,087

Post » Mon Dec 23, 2013 9:55 am

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.Windwalker2013-12-23 09:57:18
B
18
S
4
G
1
Posts: 332
Reputation: 3,149

Post » Mon Dec 23, 2013 3:52 pm

[QUOTE=Pennington Games] 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.[/QUOTE]

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?
cherbert2013-12-23 15:54:28
B
10
S
2
Posts: 26
Reputation: 927

Post » Mon Dec 23, 2013 8:06 pm

[QUOTE=cherbert]
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?
[/QUOTE]

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.
B
28
S
5
G
2
Posts: 77
Reputation: 3,087

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Ted Games and 5 guests