UIOBJECT FontString

From Wowpedia
Jump to: navigation, search

Behavior change in 6.1

The following comes from a Blizzard developer:

So what happened was that we fixed font strings to calculate height like every other object in the game. Unfortunately, some code relied on the old, broken behavior. The main difference is when "TOP" and "CENTER" were the only points anchored and there wasn't an absolute height. For every other frame, it would set the height to be 2 * the distance between TOP and CENTER. For font strings, it just didn't update the height

The fix is to just add wordwrap="false" to the things you don't want to wrap

Or actually use anchors that fit what you want more accurately

If you still have both TOP and CENTER anchored, setting an absolute height might not do much, but you could remove one of the anchors and then set an absolute height

Behavior change in 4.1

Prior to Patch 4.1, :GetWidth() and :GetHeight() would sometimes return the region size and sometimes the actual size of the text, depending on which :Set()s you had previously used.

Now, :GetWidth() and :GetHeight() always return the size of the region - as automatically computed or as set by you (via SetWidth/SetHeight or via multiple SetPoints)

To get the width of the string prior to wrapping, use :GetStringWidth(). To get the width after wrapping (because the region was too small), use :GetWrappedWidth()