Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:UIOBJECT FontString
(section)
Jump to navigation
Jump to search
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!
=== Anchoring 1 corner === Let's assume we have a frame that is 100x100, and that we anchor our fontstring to the topleft corner only, and tell it to display a sizeable chunk of text in a 10 point font, that is ~250 pixels long if nonwrapped (i.e. [[API FontString GetStringWidth|GetStringWidth()]] would return 250). {| style="background-color: transparent;" | [[Image:fontstring-wrapping-100x100-topleft.gif]] | * The text runs off as far as it needs to. * GetWidth() will return 250, the same as GetStringWidth() * GetHeight() will return 10 |} Now, if we explicitly SetWidth(100), the following happens: {| style="background-color: transparent;" | [[Image:fontstring-wrapping-100x100-topleft-w100.gif]] | * The output is clamped to 100 pixels wide * GetWidth() will always return return 100 no matter how much text there is * GetHeight() will return 40 (it needed 4 lines to display the entire text) |} And if we add a SetHeight(20), it will do what we expect: {| style="background-color: transparent;" | [[Image:fontstring-wrapping-100x100-topleft-w100-h20.gif]] | * The output is clamped to 100 pixels wide and 20 pixels high * GetWidth() will always return 100 no matter how much text there is * GetHeight() will always return 20 no matter how much text there is |} So far, no real surprises, except for the fact that fontstrings will display without a width and height set, while other objects do not. The fun starts when we anchor more points.
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)