in game menus [SOLVED]

Sunny

  • Posts: 53
Dear all,

I would like to ask what is the best way to create an in game menu, which overlays the scene(which is still running). For example the menu contains buttons which may go to further menus such as settings --> sound. What is the best way to create such a menu? Is it using buttons or is there a better way?

Thanks,
Sunny

« Last Edit: June 29, 2013, 03:38:35 am by Sunny »

Tuo

  • *
  • Posts: 2469
I personally like using "draw" codes for them, but others prefer actors. Either way, be sure to pause all of your actors while doing it. I have done similar things for my "Demo-" tutorials (search the games section of the StencylForge for "Demo-" to find them), such as my first part of the RPG series. I also have several that show how to make actorless buttons (most of them actually have it, although my actorless card duel takes it to the extreme).

In the end, a pop-up menu is just some sort of rectangle with buttons on it which comes up over the game (and pauses the game).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

vikingpotato

  • Posts: 852
Dont believe what anyone says :P Making in-game UI can be the most un-fun and time taking part of the game, i wish there was something simpler that could help, but for now its just labour

Tuo

  • *
  • Posts: 2469
Making ANY menus are not fun. I once even started making a game based on that idea (where you just spend the entire game destroying the menus :P). That doesn't mean it's hard... just time-consuming and yes, not fun.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

definitely not fun as i am saving that for the final part of my game

Sunny

  • Posts: 53
Thank you for the replies, i shall try using actors and i will check out Tuo's demos. I was just worried that a lot of actors will be used and it may affect the game's performance (i am trying to create an iOS game)

Tuo

  • *
  • Posts: 2469
If making an iOS game, know that using drawing codes instead is generally laggier than actors, or at least that is what I have been told.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

vikingpotato

  • Posts: 852
Try reusing as many buttons as you can; Have generic button actors wherever posible so you dont add up on button sprites, have their behaviours/triggers and display contents parametrized

Tuo

  • *
  • Posts: 2469
Here's a great resource for making quick, reusable in-game buttons: http://www.kongregate.com/games/Abigayl/stencyl-2-0-tutorial-5-menus
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Sunny

  • Posts: 53
Thank you again for the replies! It has helped me a lot!!  :D

JoeRice

  • Posts: 18
I'm fairly new to Stencyl but I haven't had nearly as much trouble as others seem to...

First, create a layer and position it at the front of the scene. When the scene is created, fade the layer to 0% over 0.01 seconds, then when the user clicks/presses the menu button, fade the layer in. You'll need a boolean attribute to monitor if the menu is visible or clicks on the buttons will still register whether the layer is showing or not*. Then your buttons just check if the menu is visible before they perform their actions. To hide the menu again, just fade back to 0% and set the menu boolean to false.

*this also goes the other way too - you probably won't want your in-game buttons to trigger if the menu is showing.

I think as far as whether to draw or use actors, you'll more than likely have to use a combination of both. Dynamic data such as scores/lives etc will almost always need to be drawn, but there's no reason you can't use actors for buttons, logos etc. To me, the question is whether you'd rather place the actors in the Stencyl scene editor or use a behaviour to create them on the fly. Placing them manually will mean you'll need to add them to each scene yourself, so it may not be the best way to go if you have a lot of levels (any changes you make you'll have to do in each level) but using a behaviour is just a bit more tedious than drag and drop....

Hope this helps.

Sunny

  • Posts: 53
yeah layers will help when drawing borders etc. Thanks!