You mean clear everything? I think @ar2rsawseen posted something in the forum some time ago to do that...
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
That's what I requested when Arturs posted the code, the code worked though - I can't find a copy of it though.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@totebo - do you mean something that will clear userspace?
I've suggested...
Application:reset([state]) state could be default to just restart, possibly flags for clear user area (delete any files created) and/or jump into the player (ignore assets folder).
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
I meant clearing anything in memory only. It would be a cheap way for a player to change their language, without having to find every textfield and update it:
1. User taps "change language to Swedish" 2. App saves their choice on disk in a config file 3. App resets 4. App loads config file and starts game in the chosen language
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Don't know how this would fit in Gideros though...
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
If the issue is really about TextFields and changing those I would think that whenever you create a TextField that you add it to a table called something like allTextFields and when the player changes the language, just iterate through that table, changing the text, destroying the TextField, and recreating it with the new font. Once all TextFields have been recreated, garbage collect the old font and you should be good to go. You could just use a simple alpha fade to fade the app to black and then fade it back in when complete.
It might sound bothersome but I think it would certainly be less of a PITA than basically shutting down and restarting the entire game.
@antix, yeah that's what I thought too, and it makes sense in theory. In practice, each TextField I use have specific caching strings and are repositioned after their text have changed. That makes adding something like this in retrospect quite difficult. For the next project I may make a class to keep track of all textfields and their respective properties and how they are laid out. Tricky.
Comments
https://deluxepixel.com
http://giderosmobile.com/forum/discussion/4900/i-dont-understand-how-to-restart-my-game/p1
But if you have a settings class storing all your settings, you can also have default values there and reset it withing the class
Likes: antix, SinisterSoft
Dislikes: theone10
https://deluxepixel.com
I've suggested...
Application:reset([state])
state could be default to just restart, possibly flags for clear user area (delete any files created) and/or jump into the player (ignore assets folder).
https://deluxepixel.com
1. User taps "change language to Swedish"
2. App saves their choice on disk in a config file
3. App resets
4. App loads config file and starts game in the chosen language
https://deluxepixel.com
Don't know how this would fit in Gideros though...
https://deluxepixel.com
It might sound bothersome but I think it would certainly be less of a PITA than basically shutting down and restarting the entire game.
Likes: antix, totebo