Difference between revisions of "love.graphics.getLineWidth"

(Snippet for fixing a bug in 0.8.0 to model the expected behavior, as in 0.9.0.)
m (Newin template)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{newin|[[0.3.2]]|032|type=function}}
 
Gets the current line width.
 
Gets the current line width.
 
== Function ==
 
== Function ==
Line 10: Line 11:
 
{{param|number|width|The current line width.}}
 
{{param|number|width|The current line width.}}
  
'''Note:''' This function does not work in 0.8.0, but has been fixed in tip (0.9.0). Use the following snippet to circumvent this;
+
== Notes ==
 +
This function does not work in 0.8.0, but has been fixed in version 0.9.0. Use the following snippet to circumvent this in 0.8.0;
  
 
<source lang="lua">
 
<source lang="lua">
Line 16: Line 18:
 
love.graphics._setLineWidth = love.graphics.setLineWidth
 
love.graphics._setLineWidth = love.graphics.setLineWidth
 
function love.graphics.getLineWidth() return love.graphics.varlinewidth or 1 end
 
function love.graphics.getLineWidth() return love.graphics.varlinewidth or 1 end
function love.graphics.setLineWidth(w) love.grapihcs.varlinewidth = w; return love.graphics._setLineWidth(w) end
+
function love.graphics.setLineWidth(w) love.graphics.varlinewidth = w; return love.graphics._setLineWidth(w) end
 
</source>
 
</source>
  
 
== See Also ==
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]
 +
* [[love.graphics.setLineWidth]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Gets the current line width.}}
 
{{#set:Description=Gets the current line width.}}
{{#set:Since=000}}
 
 
{{#set:Sub-Category=State}}
 
{{#set:Sub-Category=State}}
 +
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.graphics.getLineWidth}}
 
{{i18n|love.graphics.getLineWidth}}

Latest revision as of 09:04, 31 December 2019

Available since LÖVE 0.3.2
This function is not supported in earlier versions.

Gets the current line width.

Function

Synopsis

width = love.graphics.getLineWidth( )

Arguments

None.

Returns

number width
The current line width.

Notes

This function does not work in 0.8.0, but has been fixed in version 0.9.0. Use the following snippet to circumvent this in 0.8.0;

love.graphics._getLineWidth = love.graphics.getLineWidth
love.graphics._setLineWidth = love.graphics.setLineWidth
function love.graphics.getLineWidth() return love.graphics.varlinewidth or 1 end
function love.graphics.setLineWidth(w) love.graphics.varlinewidth = w; return love.graphics._setLineWidth(w) end

See Also


Other Languages