s-ol wrote:
you use bitser.dumps and bitser.loads to save/load tables into strings you can then store where/however you want.
Ahh, ok. I got it to serialize the save data, but if I try to put filedata in the table, it throws an error. How should I go about writing filedata to a file as part of a table?
zorg wrote:- Get the small canvas' imagedata (Canvas:newImageData), encode that as 'png', receiving a FileData, which you can do :getString on, so you now have a string representation of the PNG image. combine it into your savefile, and it should be small enough.
yourtable.previewimage = canvas:newImageData():encode('png'):getString() -- as a string.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
s-ol wrote:
you use bitser.dumps and bitser.loads to save/load tables into strings you can then store where/however you want.
Ahh, ok. I got it to serialize the save data, but if I try to put filedata in the table, it throws an error. How should I go about writing filedata to a file as part of a table?
zorg wrote:- Get the small canvas' imagedata (Canvas:newImageData), encode that as 'png', receiving a FileData, which you can do :getString on, so you now have a string representation of the PNG image. combine it into your savefile, and it should be small enough.
yourtable.previewimage = canvas:newImageData():encode('png'):getString() -- as a string.
Oh. Yeah. That would make sense. I probably should've figured that out :X