CheVeyo Posted January 21, 2017 Share Posted January 21, 2017 Hello :), i am facing an the following issue: How do i preserve my sprites, buttons etc. after switiching back from another state. Example: 1. First State: I have several sprites, which i drag an drop around, draw some lines etc. The moment i click on a certan button State 2 is loaded up Sso when i go back to State 1 from State 2,everything is resetted and my sprites are at the wrong place etc. Question: What can i do about it? greets and thanks Link to comment Share on other sites More sharing options...
phreaknation Posted January 22, 2017 Share Posted January 22, 2017 (edited) I would suggest saving your positions out between the states and on load call them back. If you need a good lib to do such then you can use the one I recently released. Allows saving to Cookies, LocalStorage, or to a RESTful API Edited January 23, 2017 by phreaknation Updated the plugin url Link to comment Share on other sites More sharing options...
samme Posted January 22, 2017 Share Posted January 22, 2017 I think you can remove a Group from the World, keep a reference to it, switch states, switch back, and then insert the Group back into the World. Link to comment Share on other sites More sharing options...
Recommended Posts