Thread Tools Display Modes
09-03-06, 06:24 PM   #1
pfhorge
A Defias Bandit
Join Date: Aug 2006
Posts: 2
Calculating FontString height

I've got an addon that my guild uses, but some people are having trouble when they use UI Scaling, and I can't quite get it fixed. We've got a FontString inside a Frame, and the Frame is resized as the FontString grows/shrinks. The width of the frame isn't a problem, but the height doesn't work right - some people are getting text cut off at the bottom. I'm calculating the height of the frame with the following formula:

number of lines of text * height of one line + 14

The "+ 14" is because the FontString is anchored 7 pixels from each edge of the Frame, so the Frame should always be 14 pixels (or units, or whatever you want to call it when scaling happens) taller and wider.

I'm getting the height of one line of text from the GetFont() method, but perhaps that isn't right? I'm not accounting for any scaling in my stuff because it seems like the engine should handle that. Any idea about what I'm doing wrong here?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Calculating FontString height


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off