Version 0.3.2
LÖVE Documentation
OverviewLicenseCreditsInstallingGetting started
Devices
love.graphicslove.audiolove.keyboardlove.mouselove.filesystemlove.timerlove.system
Types
AnimationColorFontFileImageMusicParticleSystemSound
Callbacks
loadupdatedrawmousepressedmousereleasedkeypressedkeyreleased
Miscellaneous
ConstantsConfig filesKeyboard shortcuts
Function
love.graphics.triangle( type, x1, y1, x2, y2, x3, y3 )
Note: When drawing a filled triangle, the coordinates must be passed in a counter-clockwise order.
Usage
love.graphics.triangle( type, x1, y1, x2, y2, x3, y3 )
Arguments
typeThe type of triangle (outline/filled).
x1First x-coordinate.
y1First y-coordinate.
x2Second x-coordinate.
y2Second y-coordinate.
x3Third x-coordinate.
y3Third y-coordinate.
Returns
Nothing
Examples
Example 1: Draw two triangles. love.graphics.triangle(love.draw_line, 200,200, 200,400, 500,300) -- outline
love.graphics.triangle(love.draw_fill, 200,200, 200,400, 500,300) -- filled