Jump to content

popup modal


gamify
 Share

Recommended Posts

Something like this ...

Alternatively, you could use me.state.pause() and allow only your modal popup to accept inputs with this boolean.

Link to comment
Share on other sites

It sounds like you will want to implement some state manager for changing between modals. We have a very rudimentary state manager for the overall game (e.g. title screen -> play screen -> game over screen, etc.) You won't be able to use it directly to manage modal menus. But you can use it as a guide for how to implement such a thing at a high level.

Some other tips:

  • Menu systems can often be implemented as a stack, where a "back button" will take you back to the previous menu, and allows for a great deal of depth for complex navigation needs.
  • Simpler navigation UIs can be implemented with as little as a single variable to store the "current menu".
  • Try not to get too crazy with it. (Personally, I am not a fan of menu-driven games like classic RPGs. I prefer games to be fun, and selecting items in a menu is not fun.)
Link to comment
Share on other sites

indeed, keep it simple I can only agree with that. And as for the UI navigation I would also use a global variable to store the reference to the current menu. And when opening a new one, you just need to close the current one and replace the global variable reference with the one from the new menu. Easy peasy :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...