{{newin|[[0.10.1]]|101|type=function}}
Gets the width and height of the text in pixels.

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

== Function ==
Gets the width and height of a specific sub-string that was previously added to the Text object.
=== Synopsis ===
<source lang="lua">
width, height = Text:getDimensions( 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).}}
{{param|number|height|The height of the sub-string (before scaling and other transformations).}}

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