Difference between revisions of "love.graphics.setLineJoin"

(Returns)
(Added example.)
 
(One intermediate revision by the same user not shown)
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 10: Line 11:
 
Nothing.
 
Nothing.
  
=== Examples ===
+
== Examples ==
The ends of the line segments beveled in an angle so that they join seamlessly.
+
=== Showcase the styles ===
 
<source lang="lua">
 
<source lang="lua">
love.graphics.setLineJoin( 'miter')
+
function love.draw()
</source>
+
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)
  
No cap applied to the ends of the line segments.
+
love.graphics.translate(0, 150)
<source lang="lua">
+
love.graphics.setLineJoin("none")
love.graphics.setLineJoin( 'none')
+
love.graphics.line(line)
</source>
 
  
Flattens the point where line segments join together.
+
love.graphics.translate(0, 150)
<source lang="lua">
+
love.graphics.setLineJoin("bevel")
love.graphics.setLineJoin( 'bevel')
+
love.graphics.line(line)
 +
end
 
</source>
 
</source>
  
Line 29: Line 36:
 
* [[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