Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API FontString GetStringHeight
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{widgetmethod}} Returns how tall the string would be, in pixels, without wrapping: Height= MyFontString:GetStringHeight(); == Note == * The height of the text will take into account manually set line breaks ("\n" characters). * This does not necessarily correlate with the height of the FontString object, see the [[UIOBJECT FontString|FontString object information]] for details. * If you want to use this to set the height of a FontString object after setting its text, you will need to make sure the initial size of the FontString object is big enough to allow the text. EXAMPLE: If the object will fit 2 lines, and you set the text to a 4 line string, the string will be truncated with "..." when it is set by SetText(), and this function will return the height of 2 lines of text instead of 4. MyFrameText:SetHeight(1000); -- Arbitrary number, this is about 83 lines of text, assuming ~12 pixels each MyFrameText:SetText("This\nIs\Four\nLines"); MyFrameText:SetHeight(MyFrameText:GetStringHeight()); print(MyFrameText:GetHeight(); -- We will see that the new frame height is about 48.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Widget
(
edit
)
Template:Widgetmethod
(
edit
)