Scripts and codes that enhances or changes the GUI in the engine.

Jason Campbell
Posts: 270
Joined: Fri Feb 13, 2015 2:51 am

A very simple pause menu with options, exit, restart and continue buttons. Figured it might help someone learn simple gui or otherwise come in handy.

Uses the escape key to open this menu and freezes time. Sound remains.

The background is one of yughues textures.
https://opengameart.org/users/yughues?page=1

Attachments

version 2
game_menu2.jpg (20.31 KiB) Viewed 1301 times
version 1
game_menu.jpg (27.16 KiB) Viewed 1741 times
Last edited by Jason Campbell on Wed Apr 11, 2018 2:10 am, edited 1 time in total.

Duion
Posts: 1114
Joined: Sun Feb 08, 2015 1:51 am

A bit critic to the design choices:

The "continue" button should always be the most obvious one in the most easily clickable area, since that is what people will click most times.
So in your example "continue" should be the top button, "restart mission" should be where "exit to main menu" is now and "exit to main menu" should be where "continue" is now.
Most people are used to the "continue" button being the big one above, so many people will instintively click the first button, which in your case will destroy all their progress and restart the mission.

Also the square texture as background for the menu does not look good, you don't need a background there, you could just leave the buttons floating on their own, or have a transparent menu background with glowing corners or so, but the way it is is not that ideal.

And lastly the clouds in the background are repeating too often, this looks very unnatural. I always use the clouds texture big enough that you cannot spot the repeating pattern that easiy, additionally you could layer multipler cloud layers on top over each other with different wind speeds and directions to further break the repeating patterns.

Jason Campbell
Posts: 270
Joined: Fri Feb 13, 2015 2:51 am

Thanks Duion, this is just a pause menu I made a long time ago for learning purposes. I'm not thinking anyone would use this in a finished game. I installed it now because I want to be able to pause the gameplay. I was just thinking people might find it useful to set up their own. The sky and clouds are by no means staying that way but thanks for the input. Honestly, since Ubergame is open source, I don't see why anyone wouldn't just use your UI as a starting point. Pretty polished.

Duion
Posts: 1114
Joined: Sun Feb 08, 2015 1:51 am

How you do it is your personal design choice, I'm not suggesting that my way of doing it is better, but what I do is suggesting to look how others do it, so that whatever design you use, it will be similar to what people are used to so they instantly understand it, also it should be ergonomic and efficient to use.

Even though it is just a template, I would still suggest doing the layout correct, since most people tend to not change it or investigage further, they just assume it is correct that way.

A design choice I made for example as I saw it on some other games is that to not make separate GUIs but to use the same main menu for everything, so to pause the game you would just press esc and it will pause, while doing so it will blend in the main menu, where you can exit the game if you want to or exit the current game, which may require a modification of the main menu in case you were in a game, but this design is pretty efficient, as it allows you to do anything anywhere.

Steve_Yorkshire
Posts: 296
Joined: Tue Feb 03, 2015 10:30 pm

Nice.
I noticed that sounds still play though.
After a bit of digging around I found how to also pause all sounds.

When pause starts: (eg: onAwake())
//pause all the sounds using the sfxSource channels
%sfx = AudioChannelMaster.getId();
%sfx.pause();
And when pause ends: (eg: onSleep())
//reset the audio effect channel to play
%sfx = AudioChannelMaster.getId();

if(%sfx.isPlaying() == false)
%sfx.play();

aunaseef
Posts: 7
Joined: Wed Mar 28, 2018 6:40 pm
Thanks for the install instructions.

Jason Campbell
Posts: 270
Joined: Fri Feb 13, 2015 2:51 am

@Steve, Thank you! The sound continuing always bothered me.

@
aunaseef
, cool, it is easy to change the background and move the buttons around in the GUI editor.