API:LabelSetTextAlign
From RoR Wiki
UI Lua API · Label functions
Version: WAR 1.4.8
Sets how the text in a Label is aligned.
LabelSetTextAlign(labelName, alignment)
Arguments
- labelName
string– Name of a Label window.- alignment
string– One of"left","top","center","right","leftcenter","rightcenter","bottom","bottomleft","bottomright".
Returns
Nothing.
Details
- The stock XML uses the same names in the
textalignattribute of Label elements.* Any other string raises the Invalid alignment type error and leaves the alignment unchanged. - After a valid alignment is set, the label's text is laid out again.
- The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'LabelSetTextAlign': Window %s does not existError in function call 'LabelSetTextAlign': Window %s is not a LabelError in function call 'LabelSetTextAlign': Invalid alignment type %s in window %s(alignment string, then label name)
Example
From eatemplate_unitframes/source/targetunitframe.lua:
LabelSetTextAlign (windowName.."TierLabel", "rightcenter")
From ea_guildwindow/source/guildwindowtabprofile.lua:
LabelSetTextAlign( "GWProfileMOTDText", "center" )
