Hi I think you need to store all the variables you need to save in a table, then you can use this module to write it down as a json, and reload it later if the scene is "resuming". (this is what I do, but I'm still far away from considering myself as a "developer", maybe others have better answers )
Ummm, objects could be serialized but not as easily as properties.
The biggest issue is that Lua works on pointers and every object created gets a new address, so if these addresses are serialized, they would not point back to the relevant objects.
@Jacko You should store scene info into LUA table {} (ex level, score, button position) and then save that table. After that you can restore scene by reading saved table and re construct GUI and state...
Couldn't you just save it all to a .txt file and load it up next time around? ex. x=5 y=62 health=2 etc.
“ The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time. ” - Tom Cargill
Comments
http://dev.appcodingeasy.com/Gideros-Mobile/Save-and-load-data-module-for-Gideros-Mobile
hope this helps
The biggest issue is that Lua works on pointers and every object created gets a new address, so if these addresses are serialized, they would not point back to the relevant objects.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
ex. x=5 y=62 health=2 etc.