What's the best approach to drawing a square image with borders and rounded-corners.
To give an example, from this:
To this:
My first thought are line mode rectangle with radius on top of the image, but what about the image itself, how can I mask / clip the image with a rounded-corner square efficiently. I don't need a mesh here, do I?
PS: this is my post here, let me know if I am missing any forum rules
Best way to draw a rounded-corner square image with borders?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Best way to draw a rounded-corner square image with borders?
If the border is thick enough, the corner will be hidden. In your case it is:
So, the most efficient way is probably to draw the image (with a size smaller than the rounded rect) and the rounded rect over it.
So, the most efficient way is probably to draw the image (with a size smaller than the rounded rect) and the rounded rect over it.
Re: Best way to draw a rounded-corner square image with borders?
and otherwise, you can use a stencstencil function to do the clipping. I would advise to make the stencil a bit smaller than the border also though, so you don't end up with any weird edges.
Re: Best way to draw a rounded-corner square image with borders?
Thx folks, stencil is what I want.
Re: Best way to draw a rounded-corner square image with borders?
For border you can use GLSL shaders
function love.load() end
function love.update(dt) end
function love.draw() end
function love.update(dt) end
function love.draw() end
Who is online
Users browsing this forum: Google [Bot], t3hgreen and 0 guests