setting rectangle angle ? (not image)
Posted: Tue Apr 25, 2017 2:23 pm
so to spawn a basic rectangle, i use draw function, but i have no idea how to set its angle, help ?
Code: Select all
function rotatingRectangle( mode,x,y,w,h,a,ox,oy,r )
ox = ox or 0 -- if ox & oy not provided, rotate around upper left corner
oy = oy or 0 -- if ox,oy = w/2,h/2 then rotation is around center
a = a or 0 -- if no angle provided, angle assumed to be zero
r = r or 5 -- corner radius
love.graphics.push()
love.graphics.translate( x, y )
love.graphics.rotate( a )
love.graphics.rectangle( mode, -ox, -oy, w, h, r )
love.graphics.pop()
end