API:LabelSetText
From RoR Wiki
UI Lua API · Label functions
Version: WAR 1.4.8
Sets the text shown by a Label.
LabelSetText(labelName, text)
Arguments
- labelName
string– Name of a Label window.- text
wstring– The text to show. It must be a wide string:L"Hello"works,"Hello"does not.
Returns
Nothing.
Details
- Passing an ordinary Lua string or a number as
textraises an Invalid Parameters error. Convert withtowstring()first if necessary. - If the new text is the same as the current text, nothing happens.
- Otherwise the client stores the text, processes a copy for display, shortens that copy if it is longer than the label's maximum length, and lays the text out again. LabelGetText returns the displayed copy.
- For windows with state tracking enabled, the client writes the new text to
labelName.STATE.LABEL_TEXT(see LabelGetText). - The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'LabelSetText': Window %s does not existError in function call 'LabelSetText': Window %s is not a Label
Example
From easystem_dialogmanager/source/dialogmanager.lua:
LabelSetText( "TwoButtonDlg"..dlgIndex.."BoxText", dialogText ) LabelSetText( "TwoButtonDlg"..dlgIndex.."BoxTimer", L"" )
