I made a pattern that i want to set as the background of the rectangle, i know i can just put the image at the same position but i want it to respect the radius, how can i do that
local scaleX = 200/image:getWidth() -- 200 and 100 from rectangle width and height
local scaleY = 100/image:getHeight() -- e.g. 100/200 -> scales by 0.5
love.graphics.draw(image, 0,0, 0, scaleX, scaleY)
If your issue is that you're drawing a rectangle -with rounded corners-, and you want the image to not show outside of the rounded edges, then it's a bit tricky to accomplish that; my first idea would be to use stencils: draw the rounded rectangle to a canvas with stencils enabled, then use that as a test when drawing the image - only the parts that are covered by the stencil should be drawn.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.