Page 1 of 1

Build new image base on newQuads

Posted: Sun Feb 19, 2023 1:17 pm
by shaan1974
Hello,

I'v got a base image with flags. Base on this image:
https://github.com/lafeber/world-flags- ... lags32.png

I want to create a new image related to defined flags that i need. By ex i need only flags of France, Italy and Spain.

I know that it's possible to get the 3 flags i need with Quads.

But after i'v got my 3 quads, is it possible to create a new image on the fly containing the 3 flags ? Like witdh of 100px and height of 300px.
And defined flag position y at 0px (FR) 100px (IT) and 200px (SP).

Thanks

Re: Build new image base on newQuads

Posted: Sun Feb 19, 2023 3:46 pm
by Bigfoot71
You might as well keep only the images you need and everything is said in the wiki, I don't see what to add.

If you want to have them at the size you want, use the sx,sy parameters of love.graphics.draw.

The target size is 100px and the original size is 32px so to get the scaling value you do: 100/32=3.125 -> 3.125*32=100

Then draw the whole thing in a canvas if you want to make an image of it.

https://love2d.org/wiki/love.graphics.newQuad
https://love2d.org/wiki/love.graphics.newCanvas
https://love2d.org/wiki/love.graphics.draw