Difference between revisions of "love.graphics.setLineJoin"

(Undo revision 27186 by Darkfrei (talk). The added example explains exactly what LineJoin already explains.)
(Tag: Undo)
(Added example.)
 
Line 1: Line 1:
 
Sets the line join style. See [[LineJoin]] for the possible options.
 
Sets the line join style. See [[LineJoin]] for the possible options.
 +
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 9: Line 10:
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
 +
== Examples ==
 +
=== Showcase the styles ===
 +
<source lang="lua">
 +
function love.draw()
 +
local line = {0,0, 100,20, 40,40, 50,80}
 +
love.graphics.setLineWidth(15)
 +
love.graphics.setColor(1, 1, 1, .7)
 +
 +
love.graphics.translate(300, 100)
 +
love.graphics.setLineJoin("miter")
 +
love.graphics.line(line)
 +
 +
love.graphics.translate(0, 150)
 +
love.graphics.setLineJoin("none")
 +
love.graphics.line(line)
 +
 +
love.graphics.translate(0, 150)
 +
love.graphics.setLineJoin("bevel")
 +
love.graphics.line(line)
 +
end
 +
</source>
 +
 
== See Also ==
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]
 
* [[love.graphics.getLineJoin]]
 
* [[love.graphics.getLineJoin]]
 +
 +
== Other Languages ==
 +
{{i18n|love.graphics.setLineJoin}}
 +
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Sets the line join style.}}
 
{{#set:Description=Sets the line join style.}}
 
{{#set:Since=090}}
 
{{#set:Since=090}}
 
{{#set:Sub-Category=State}}
 
{{#set:Sub-Category=State}}
== Other Languages ==
 
{{i18n|love.graphics.setLineJoin}}
 

Latest revision as of 01:52, 1 September 2022

Sets the line join style. See LineJoin for the possible options.

Function

Synopsis

love.graphics.setLineJoin( join )

Arguments

LineJoin join
The LineJoin to use.

Returns

Nothing.

Examples

Showcase the styles

function love.draw()
	local line = {0,0, 100,20, 40,40, 50,80}
	love.graphics.setLineWidth(15)
	love.graphics.setColor(1, 1, 1, .7)

	love.graphics.translate(300, 100)
	love.graphics.setLineJoin("miter")
	love.graphics.line(line)

	love.graphics.translate(0, 150)
	love.graphics.setLineJoin("none")
	love.graphics.line(line)

	love.graphics.translate(0, 150)
	love.graphics.setLineJoin("bevel")
	love.graphics.line(line)
end

See Also

Other Languages