Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LCDCreateStaticText

From RoR Wiki

UI Lua API · LCD functions
Version: WAR 1.4.8

Adds a text element to an LCD page.

LCDCreateStaticText(pageName, textName, textSize, alignment, width, numLines)

Arguments

pageName
string – Name of the page.
textName
string – Name of the new element.
textSize
number – Text size, 0, 1 or 2. Each line of the element is 12, 13 or 20 pixels high for these values.
alignment
string – "left", "center" or "right". The client compares it ignoring case.
width
number – Width of the element in pixels.
numLines
number – Number of text lines the element has room for.

Returns

Nothing.

Details

  • The element uses the font "Microsoft Sans Serif". Set its text with LCDStaticTextSetText.
  • The element's height is numLines times the line height of textSize. For any other textSize the height is 13 pixels, whatever numLines is.
  • With more than one line the element is set up for multi-line text.
  • If the page already has an element with this name, nothing is created.
  • If the page does not exist, the error below is logged and nothing is created.
  • The function needs at least six arguments and only reads the last six.

Errors

  • Error in function call 'LCDCreateStaticText': Page '%s' does not exist.

Example

From ea_lcdkeyboard/source/g15test.lua:

LCDCreateStaticText( EA_LCDKeyboard.Page1, "HPTitle", 1, "left", 30, 1 )
LCDSetLocation( EA_LCDKeyboard.Page1, "HPTitle", 0, 0 )
LCDStaticTextSetText( EA_LCDKeyboard.Page1, "HPTitle", GetStringFromTable( "LCDStrings", StringTables.LCDStrings.HIT_POINT_TITLE ) )

-- a three-line alert area
LCDCreateStaticText( EA_LCDKeyboard.Page3, "AlertText", 1, "left", 160, 3 )

See also