You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure what the best design for this API would be - whether to offer a save(filename) method on Texture that directly saves the file or a method that returns JPG/PNG binary data to be passed to FS.writeFile. I lean towards the latter for flexibility.
The text was updated successfully, but these errors were encountered:
There's currently an experimental function Texture#download() that returns the raw uncompressed pixels of an image. It would be easy enough to add an extra parameter to say you want the image in PNG format instead.
Note that Sphere v1 has Surface#save() and it does work in neoSphere; I didn't implement image saving in Sphere v2 initially because it didn't seem super useful given how sandboxed the file system is. What are the use cases you're envisioning for this feature?
Sorry only just noticed this reply :) The download function should be enough for what I was thinking. The use case is storing a thumbnail of the current game screen with save data so it can be displayed in a save game list, similar to this:
It could also be useful for a "photo mode" feature, although I'm sure they're not too common in 2D games.
Not sure what the best design for this API would be - whether to offer a
save(filename)
method on Texture that directly saves the file or a method that returns JPG/PNG binary data to be passed toFS.writeFile
. I lean towards the latter for flexibility.The text was updated successfully, but these errors were encountered: