is it possible to create a png?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Isaias Torres
Prole
Posts: 3
Joined: Wed Nov 30, 2022 5:20 pm

is it possible to create a png?

Post by Isaias Torres »

Is it possible to create a png file by love2d and store this file in some folder?
User avatar
knorke
Party member
Posts: 274
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: is it possible to create a png?

Post by knorke »

welcome :)
yes, see https://love2d.org/wiki/ImageData:encode and the example "Draw a circle to a canvas and save it to a file"
Isaias Torres
Prole
Posts: 3
Joined: Wed Nov 30, 2022 5:20 pm

Re: is it possible to create a png?

Post by Isaias Torres »

thank you so much
Isaias Torres
Prole
Posts: 3
Joined: Wed Nov 30, 2022 5:20 pm

Re: is it possible to create a png?

Post by Isaias Torres »

knorke wrote: Wed Nov 30, 2022 9:35 pm welcome :)
yes, see https://love2d.org/wiki/ImageData:encode and the example "Draw a circle to a canvas and save it to a file"
but I have another question, how can I get this file and put it in a directory?
MrFariator
Party member
Posts: 548
Joined: Wed Oct 05, 2016 11:53 am

Re: is it possible to create a png?

Post by MrFariator »

If you give the encode function a filename to use (the second parameter if you check the wiki), it will save the resulting image file in your save folder. The save folder location will depend on system, whether your project is running in fused mode or not, and what your project's app identity is set to.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests