Currently, to save an image from LÖVE, you need to use ImageData:encode(format) to produce an EncodedImageData, and then use love.filesystem to put it in a file. This is kind of kludgy, and having the separate EncodedImageData step doesn't make a lot of sense since there's really nothing else you can use it for.
Instead, change the method to ImageData:encode(path, format) or ImageData:encode(file, format), passing a string or a File, which encodes the ImageData to the specified format and writes it to the relevant location in one fell swoop. Bonus points for making format optional and autodetecting the proper format from the file extension in its absence.
(Hat tip to itsnotabigtruck for the idea.)
4条回答 默认 最新
- 点赞 评论 复制链接分享
Original comment by Anonymous.
Notice that there are some things to take into account, related with transparency:
http://love2d.org/forums/viewtopic.php?f=4&t=2273点赞 评论 复制链接分享