{{newin|[[0.10.0]]|100|type=function}}
Gets the width of the text in pixels.

== Function ==
=== Synopsis ===
<source lang="lua">
width = Text:getWidth( )
</source>
=== Arguments ===
None.
=== Returns ===
{{param|number|width|The width of the text. If multiple sub-strings have been added with [[Text:add]], the width of the last sub-string is returned.}}

== Function ==
Gets the width of a specific sub-string that was previously added to the Text object.
=== Synopsis ===
<source lang="lua">
width = Text:getWidth( index )
</source>
=== Arguments ===
{{param|number|index|An index number returned by [[Text:add]] or [[Text:addf]].}}
=== Returns ===
{{param|number|width|The width of the sub-string (before scaling and other transformations).}}

== See Also ==
* [[parent::Text]]
* [[Text:getHeight]]
* [[Text:set]]
* [[Text:setf]]
* [[Text:add]]
* [[Text:addf]]
[[Category:Functions]]
{{#set:Description=Gets the width of the text.}}
== Other Languages ==
{{i18n|Text:getWidth}}