Simple Pause Menu

Scripts and codes that enhances or changes the GUI in the engine.
8 posts Page 1 of 1
Jason Campbell
Posts: 266
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.
https://opengameart.org/users/yughues?page=1

Download Game_Menu.zip (version 1):
https://drive.google.com/open?id=1tS3e0 ... qdzrJfYZhc

Follow the instructions in INSTALL.txt

Download gameMenu_v2.zip (version 2)
https://drive.google.com/open?id=1gwOsO ... fwlqJY188w

Attachments

game_menu2.jpg
version 2
game_menu2.jpg (20.31 KiB) Viewed 877 times
game_menu.jpg
version 1
game_menu.jpg (27.16 KiB) Viewed 1317 times
Last edited by Jason Campbell on Wed Apr 11, 2018 2:10 am, edited 1 time in total.
Duion
Posts: 1082
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: 266
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.
Duion
Posts: 1082
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.
Steve_Yorkshire
Posts: 291
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Mon Mar 19, 2018 4:26 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
by aunaseef » Fri Mar 30, 2018 10:12 am
Thanks for the install instructions.
Jason Campbell
Posts: 266
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
aunaseef
, cool, it is easy to change the background and move the buttons around in the GUI editor.
Jason Campbell
Posts: 266
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