In Game Menus

Get help using Construct 2

Post » Sun Mar 20, 2016 5:13 pm

For an in game menu is it a good idea to just have hidden layers for each menu screen?

I don't have a good understanding on the factors that will cause slow down issues. Will a bunch of hidden menus have much effect?

Instead of hiding (visibility) should I get used to spawning and destroying the menus? How beneficial is that?

Example:
    Options
    Controls
    Inventory
    Upgrade Character
    Load/Save
    Etc.

Is it worth making a separate layout for certain menus?
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Mon Mar 21, 2016 8:50 am

I don't believe non-visible sprites should have any impact on fill rate, unlike "visible" transparent pixels. Layers is one fairly clean way to do menus, and you can do some nice effects with blend modes using this method as well.

I generally only use separate layout menu for things like the main menu or transition menus between other layouts, as loading time can be an issue.

Spawning menus also work well if you are more comfortable creating it in the event system rather than putting it together in the layout view, but I find this method slower (in terms of programming and creation) than just placing the objects in the layout view. Dynamically creating menus (and anything else) is usually best in cases where the content can change or is otherwise not always the same, depending on the situation. If your menu is static and will be the same every time, it is probably better to use the layout view.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133

Post » Wed Mar 23, 2016 1:28 pm

Thanks @oosyrag

I figured I would make a layer for each sub menu but was worried if I kept adding menu items that would be more and more layers. If I get too many I'll work on a spawning system.

I won't need a dynamic menu for this project . . . but I'm sure I will for some project. Have you mastered a dynamic menu before? I'm assuming an array or multiple arrays would be the best option.
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Wed Mar 23, 2016 8:13 pm

Hmm... creating the menu with events is very flexible by nature, there are many ways to do it.

One way I've done it in the past is just have one menu sprite object with all the menu options as animation frames, with an instance variable MenuItem.

When the menu is triggered, use a loop to place each menu selection, incrementing the position, animation frame, and MenuItem variable.

On clicked MenuSprite, compare MenuItem value and do whatever.

To close the menu, destroy all MenuSprite.

If you use a For loop, you can control the loopindex numbers for submenus.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133


Return to How do I....?

Who is online

Users browsing this forum: MassimoF and 20 guests