Difference between revisions of "Font:getWidth"

m (1 revision: Imported docs from potato.)
m
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
+
Determines the maximum width (accounting for newlines) taken by the given string.
 
 
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
width = Font:getWidth( line )
+
width = Font:getWidth( text )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|line|A line of text.}}
+
{{param|string|text|A string.}}
 
=== Returns ===
 
=== Returns ===
{{param|number|width|The width of the line.}}
+
{{param|number|width|The width of the text.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::Font]]
 
* [[parent::Font]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=}}
+
{{#set:Description=Determines the width of the given text. }}
 +
{{#set:Since=000}}
 +
== Other Languages ==
 +
{{i18n|Font:getWidth}}

Revision as of 16:13, 25 March 2018

Determines the maximum width (accounting for newlines) taken by the given string.

Function

Synopsis

width = Font:getWidth( text )

Arguments

string text
A string.

Returns

number width
The width of the text.

See Also


Other Languages