Hello,
Thanks for the tool, I'm not a good programmer so it's saved a lot of headaches with saving
I was wondering if it's possible to have a Save/Load UI icon with a gameplay preview image?
Example:
https://www.gameuidatabase.com/uploads/ ... -28250.jpg
I've so far tested by taking a screenshot of gameplay when the player clicks the save button, then applying the Texture2D sprite to an Image component next to the Load button.
Testing with saving the Texture2D works but this made the save file more than 50MBs.
Testing with ES3.SaveImage works with a much smaller file size but at the cost of having an image file in the folder.
I tried saving the Sprite which created a small file size but doesn't seem to load anything when relaunching the game.
I was wondering if there is a way to have the image saved as part of the save file whilst maintaining the file itself respectably small?
Or maybe if I'm overcomplicating things & there is a more efficient way to achieve a Save/Load UI with gameplay image?
Thanks!
Save file slot with gameplay image
Re: Save file slot with gameplay image
Hi there,
Saving a Texture2D will save it uncompressed as that's how it's stored internally.
Generally in these cases you would save the image separately, and save the filename of the image in the save file so you know what image to display.
An alternative if you need to have the image in the save file would be to use ES3.SaveImage with the cache, and then use ES3.LoadRawBytes to get the compressed image as a byte array and save this to the file. Then to load, load the byte array, use ES3.SaveRaw to save it to the cache and then ES3.LoadImage to load it from the cache.
A code example of using the cache in this way is here, though you would use SaveImage and LoadImage instead of Save and Load:
https://docs.moodkie.com/easy-save-3/es ... rage-apis/
All the best,
Joel
Saving a Texture2D will save it uncompressed as that's how it's stored internally.
Generally in these cases you would save the image separately, and save the filename of the image in the save file so you know what image to display.
An alternative if you need to have the image in the save file would be to use ES3.SaveImage with the cache, and then use ES3.LoadRawBytes to get the compressed image as a byte array and save this to the file. Then to load, load the byte array, use ES3.SaveRaw to save it to the cache and then ES3.LoadImage to load it from the cache.
A code example of using the cache in this way is here, though you would use SaveImage and LoadImage instead of Save and Load:
https://docs.moodkie.com/easy-save-3/es ... rage-apis/
All the best,
Joel
Re: Save file slot with gameplay image
Hi Joel,
Thanks for the quick reply
Using the cache sounds like it's above my current capabilities
Thanks!
Thanks for the quick reply
Using the cache sounds like it's above my current capabilities
For this method, am I understanding correctly that this would use ES3.SaveImage to save the image as a .jpeg file, then when loading use ES3.LoadImage to create a sprite for the image component?Generally in these cases you would save the image separately, and save the filename of the image in the save file so you know what image to display.
Thanks!
Re: Save file slot with gameplay image
That is correctFor this method, am I understanding correctly that this would use ES3.SaveImage to save the image as a .jpeg file, then when loading use ES3.LoadImage to create a sprite for the image component?
Re: Save file slot with gameplay image
Appreciate the confirmation, thanks!