Drawing ellipses
Posted: Wed Mar 23, 2011 9:51 pm
I hacked an addition to the current version of love that adds love.graphics.ellipse(). (I needed it to draw noncircular planetary orbits). I've sent a pull request to rude, but in case anyone else wants to draw ellipses in the meantime, you can get it here: https://bitbucket.org/IdahoEv/love
Usage:
love.graphics.ellipse(mode, x, y, a, b, phi, segments)
mode, x, y, segments: same as love.graphics.circle()
a: semimajor axis
b: semiminor axis
phi: angle between the major axis and the horizontal, defaults to 0.0
Example:
Usage:
love.graphics.ellipse(mode, x, y, a, b, phi, segments)
mode, x, y, segments: same as love.graphics.circle()
a: semimajor axis
b: semiminor axis
phi: angle between the major axis and the horizontal, defaults to 0.0
Example:
Code: Select all
--main.lua
draws = 0
function love.draw()
love.graphics.setColor(0,0,255)
love.graphics.ellipse('line',400,150,100,50)
love.graphics.ellipse('fill',400,400,150,100, .01 * draws, 30)
draws = draws + 1
end