gamify Posted February 21, 2017 Share Posted February 21, 2017 how to create popup modal onclick Quote Link to comment Share on other sites More sharing options...
Parasyte Posted February 21, 2017 Share Posted February 21, 2017 Something like this ... Define a globally-accessible boolean property: https://github.com/blipjoy/nm-prototype/blob/gh-pages/js/objects/dialog.js#L24 Feature-gate your entity updates on the value of the boolean: https://github.com/blipjoy/nm-prototype/blob/gh-pages/js/entities/weapon.js#L151 https://github.com/blipjoy/nm-prototype/blob/gh-pages/js/objects/npc.js#L322 Alternatively, you could use me.state.pause() and allow only your modal popup to accept inputs with this boolean. gamify 1 Quote Link to comment Share on other sites More sharing options...
gamify Posted February 22, 2017 Author Share Posted February 22, 2017 k fine thank you for reply i will try Quote Link to comment Share on other sites More sharing options...
gamify Posted February 27, 2017 Author Share Posted February 27, 2017 how to add user input textbox in popup Quote Link to comment Share on other sites More sharing options...
obiot Posted February 27, 2017 Share Posted February 27, 2017 https://github.com/melonjs/melonJS/wiki/Frequently-Asked-Questions#form_inputs for example Parasyte 1 Quote Link to comment Share on other sites More sharing options...
gamify Posted February 28, 2017 Author Share Posted February 28, 2017 ok thanks you i will try Quote Link to comment Share on other sites More sharing options...
gamify Posted February 28, 2017 Author Share Posted February 28, 2017 error : rect is undefined why ? Quote Link to comment Share on other sites More sharing options...
gamify Posted February 28, 2017 Author Share Posted February 28, 2017 rect is it specifying to set width and height? Quote Link to comment Share on other sites More sharing options...
gamify Posted February 28, 2017 Author Share Posted February 28, 2017 Rect issue i solved thank you Quote Link to comment Share on other sites More sharing options...
gamify Posted February 28, 2017 Author Share Posted February 28, 2017 how to make textbox mapped with modal because i am trying to move the popup modal and modal,buttons, label is moved but the text box retains in same position http://melonjs.github.io/melonJS/examples/UI/ Quote Link to comment Share on other sites More sharing options...
gamify Posted March 1, 2017 Author Share Posted March 1, 2017 can anyone help me for this Quote Link to comment Share on other sites More sharing options...
Parasyte Posted March 1, 2017 Share Posted March 1, 2017 When you move the modal, you need to move the child DOM elements, too. If you have multiple form fields, it will be easiest to make them children of a `<div>` element. Then you only need to move the div element. Quote Link to comment Share on other sites More sharing options...
gamify Posted March 2, 2017 Author Share Posted March 2, 2017 ok i will try thank you Quote Link to comment Share on other sites More sharing options...
gamify Posted March 8, 2017 Author Share Posted March 8, 2017 how to remove uimodal condition: if i click for new uimodal the old uimodal should be removed onclick Requirement : the uimodal only one to be shown at a time Quote Link to comment Share on other sites More sharing options...
Parasyte Posted March 8, 2017 Share Posted March 8, 2017 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.) Quote Link to comment Share on other sites More sharing options...
obiot Posted March 9, 2017 Share Posted March 9, 2017 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 Quote Link to comment Share on other sites More sharing options...
gamify Posted March 9, 2017 Author Share Posted March 9, 2017 okay i will try thank you Quote Link to comment Share on other sites More sharing options...
gamify Posted March 13, 2017 Author Share Posted March 13, 2017 making global also i am not able to remove the old ui popup so can you show me any example Quote Link to comment Share on other sites More sharing options...
gamify Posted March 13, 2017 Author Share Posted March 13, 2017 how can i do reference Quote Link to comment Share on other sites More sharing options...
obiot Posted March 13, 2017 Share Posted March 13, 2017 game.currentMenu = this; assuming currentMenu is where you keep hold of the current menu, and assuming you do this from the current menu open (so this is your current menu instance) Quote Link to comment Share on other sites More sharing options...
gamify Posted March 14, 2017 Author Share Posted March 14, 2017 okay i will try thank you Quote Link to comment Share on other sites More sharing options...
gamify Posted March 14, 2017 Author Share Posted March 14, 2017 is any other way to do because the above method giving child is not mine while removing it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.