Page 1 of 1

is it possible to create a png?

Posted: Wed Nov 30, 2022 5:25 pm
by Isaias Torres
Is it possible to create a png file by love2d and store this file in some folder?

Re: is it possible to create a png?

Posted: Wed Nov 30, 2022 9:35 pm
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"

Re: is it possible to create a png?

Posted: Wed Nov 30, 2022 10:55 pm
by Isaias Torres
thank you so much

Re: is it possible to create a png?

Posted: Thu Dec 01, 2022 1:28 am
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?

Re: is it possible to create a png?

Posted: Thu Dec 01, 2022 1:28 am
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.