Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LabelSetTextAlign

From RoR Wiki
Revision as of 19:46, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 textalign attribute 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 exist
  • Error in function call 'LabelSetTextAlign': Window %s is not a Label
  • Error 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" )

See also