Thread Tools Display Modes
01-24-14, 12:06 PM   #1
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
set origin of text

How would I set the origin of the text to be on the left instead of center?

I would like the text to extend to the right of it's position rather than extend in both directions and place the text in the center as seen in this example: http://i.imgur.com/m16B9zV.png
  Reply With Quote
01-24-14, 12:18 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
I think you're looking for this using "LEFT".
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-24-14, 12:35 PM   #3
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
That seems right but it isn't quite working for me, here is my code:

Lua Code:
  1. local titleText = frame:CreateFontString("sdr_title_text", "OVERLAY")
  2. titleText:SetFont("Fonts\\FRIZQT__.TTF", 13, "THICKOUTLINE")
  3. titleText:SetPoint("TOP",0,20)
  4. titleText:SetText("AbilityNameHere")
  5. titleText:SetJustifyH("LEFT")

and in game I get no errors but it is not working.
  Reply With Quote
01-24-14, 12:39 PM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
The text is not aligned to the left? Or it is not shown? What does "not working" mean?
  Reply With Quote
01-24-14, 12:40 PM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
You're not providing an anchor point for your text. Try this:

Code:
titleText:SetPoint("TOPLEFT", frame, "TOP", 0, 20)
  Reply With Quote
01-24-14, 12:43 PM   #6
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
Thank you Fizzlemizz and haleth that has solved my problem. =)
  Reply With Quote
01-27-14, 06:15 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Setting the text alignment for a fontstring only really applies to displaying multiple lines in a single object. When you have one line in a box without defined dimensions, it's left to the anchor to dictate how the text is aligned.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » set origin of text


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