View Single Post
02-14-13, 09:50 PM   #24
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by gmarco View Post
Later I'll try to understand how to make a left justified button text :-)
Code:
button:GetFontString():SetJustifyH("LEFT")
However, depending on the template used, you may need to adjust the font string's points as well. For example, if the font string is anchored by its CENTER point to the button's CENTER point, left-aligning the text will make it start in the center of the button, so you'd need to do something like this:

Code:
local fontstring = button:GetFontString()
fontstring:ClearAllPoints()
fontstring:SetPoint("LEFT", button, 8, 0)
fontstring:SetPoint("RIGHT", button, -8, 0)
fontstring:SetJustifyH("LEFT")
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote