setting rectangle angle ? (not image)
setting rectangle angle ? (not image)
so to spawn a basic rectangle, i use draw function, but i have no idea how to set its angle, help ?
-
Re: setting rectangle angle ? (not image)
Angles in rectangles are always right angles (90°) by definition. You can't set em.
But you could rotate the rectangle.
https://love2d.org/wiki/love.graphics.rotate
But you could rotate the rectangle.
https://love2d.org/wiki/love.graphics.rotate
Re: setting rectangle angle ? (not image)
Example:
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
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests