Best way to do popup menus

0 favourites
  • 3 posts
From the Asset Store
Relax and relieve stress by popping bubbles in Fidget Anti- Stress Releaser!
  • During gameplay, I want to briefly show menus that partially cover the game window, that the player can interact with, then close, and resume gameplay. (so having them on separate layouts is not an option)

    There's 2 ways I can think of doing them:

    1) Create popup in editor on a layer and turn visibility on/off

    Pro: easy to set up in the editor

    Con: items in the popup will still get updated even if they are not visible and take up memory (performance)

    2) Spawn & destroy popup as needed using system -> create object

    Pro/Con: basically the opposite of layers... annoying to create because the popups consist of lots of pieces so lots of 'create object' actions are needed but probably better performance wise

    So far I've been using the layer method, but now that I'm up to 6 fairly graphical popup layers that are invisible most of the time and want to add another 2 I'm starting to wonder if there's a better way.

    Your thoughts?

  • Oh and one more thing, how do you suggest creating a popup that can be used across multiple layouts? Specifically I have an 'options' popup that I want the player to be able to access from any layout but with the layers method I would have to put the layer in each layout so for that I'm doing the spawning method by embedding an 'options' event sheet into each layout.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • How i made it in my game:

    Created an Event Sheet just for the popup or if you want to generalize for the game GUI in whole. It would contain the GUI events like mouse over, mouse out mouse click etc.

    Using the Function plugin create functions like CreatePopup, CreateMenu etc, that would be responsible for creating all needed objects, with respective Destroy functions , responsible for cleaning up. Creating and destroying things is very fast no problem on that. More or less like that. Of course you should put a variable telling when to update the Gui components.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)