Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LabelSetFont

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

Changes the font of a Label.

LabelSetFont(labelName, fontName, lineSpacing)

Arguments

labelName
string – Name of a Label window.
fontName
string – Name of the font, for example "font_default_text_large". These are the names used with the font attribute in XML.
lineSpacing
number – Required, but not used by the client. The stock UI passes WindowUtils.FONT_DEFAULT_TEXT_LINESPACING (20).

Returns

Nothing.

Details

  • All three arguments must be given. lineSpacing is checked to be a number and then ignored.
  • If the font is the one the label already uses, nothing happens. Otherwise the label's text is laid out again with the new font.
  • If no font has the given name, the label is left unchanged and the client reports ERROR: Invalid font definition for Label %s (%s) (label name, font name).

Errors

  • Error in function call 'LabelSetFont': Window %s does not exist
  • Error in function call 'LabelSetFont': Window %s is not a Label
  • ERROR: Invalid font definition for Label %s (%s)

Example

From easystem_eventtext/source/system_eventtext.lua:

LabelSetFont( self:GetName(), "font_default_text_huge", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )

See also