View Single Post
Old 02-14-13, 08:50 PM   #24
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,706
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")
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote