Simple Pause Menu

Scripts and codes that enhances or changes the GUI in the engine.
8 posts Page 1 of 1
Jason Campbell
Posts: 358
Joined: Fri Feb 13, 2015 2:51 am
by Jason Campbell » Wed Mar 14, 2018 5:40 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.

Download (version 1): ... qdzrJfYZhc

Follow the instructions in INSTALL.txt

Download (version 2) ... fwlqJY188w


version 2
game_menu2.jpg (20.31 KiB) Viewed 4726 times
version 1
game_menu.jpg (27.16 KiB) Viewed 5166 times
Last edited by Jason Campbell on Wed Apr 11, 2018 2:10 am, edited 1 time in total.
Posts: 1605
Joined: Sun Feb 08, 2015 1:51 am
by Duion » Wed Mar 14, 2018 8:09 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: 358
Joined: Fri Feb 13, 2015 2:51 am
by Jason Campbell » Wed Mar 14, 2018 12:06 pm
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.
Posts: 1605
Joined: Sun Feb 08, 2015 1:51 am
by Duion » Wed Mar 14, 2018 1:12 pm
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.
Posts: 337
Joined: Tue Feb 03, 2015 10:30 pm
by Steve_Yorkshire » Mon Mar 19, 2018 4:26 pm
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();
And when pause ends: (eg: onSleep())
//reset the audio effect channel to play
   %sfx = AudioChannelMaster.getId();
   if(%sfx.isPlaying() == false);
Posts: 7
Joined: Wed Mar 28, 2018 6:40 pm
by aunaseef » Fri Mar 30, 2018 10:12 am
Thanks for the install instructions.
Jason Campbell
Posts: 358
Joined: Fri Feb 13, 2015 2:51 am
by Jason Campbell » Sat Mar 31, 2018 3:43 am
@Steve, Thank you! The sound continuing always bothered me.

User avatar
, cool, it is easy to change the background and move the buttons around in the GUI editor.
Jason Campbell
Posts: 358
Joined: Fri Feb 13, 2015 2:51 am
by Jason Campbell » Wed Apr 11, 2018 2:23 am
I have uploaded an alternate version 2 that uses some of Duion's advice but again this is just really for learning purposes.

@Steve, your sound fix works with everything except sound emitters. Perhaps if I had music playing, I could temporarily remove the ambient sound emitter, then replace it again?
8 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest