Draws lines between points.
love.graphics.line( x1, y1, x2, y2, ... )
number x1
number y1
number x2
number y2
number ...
Nothing.
love.graphics.line( points )
table points
Nothing.
Draw the outline of a simple trapezoid.
function love.draw() love.graphics.line(200,50, 400,50, 500,300, 100,300, 200,50) -- last pair is a repeat to complete the trapezoid end
Draw a line from the center of the screen to the mouse pointer.
w = love.graphics.getWidth() / 2 -- half the window width h = love.graphics.getHeight() / 2 -- half the window height function love.draw() local mx, my = love.mouse.getPosition() -- current position of the mouse love.graphics.line(w, h, mx, my) end
Draw a zigzag line from a single table.
sometable = { 100, 100, 200, 200, 300, 100, 400, 200, } function love.draw() love.graphics.line(sometable) end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.graphics.line