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
Build new image base on newQuads
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Build new image base on newQuads
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
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
- Attachments
-
- flags.love
- (2.34 KiB) Downloaded 23 times
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 4 guests