Description
Sets the text of a control of the currently active user dialog or display. This command can be used for static texts, buttons, edit lines and active texts as well as for images, where you can use it to set the image path.
Read Arma: GUI Configuration for more information about user dialogs and controls.
Use endl to insert line breaks.
Since Arma 3 v2.06 supported control types are:
- CT_STATIC
- CT_EDIT
- CT_XKEYDESC
- CT_XBUTTON
- CT_SHORTCUTBUTTON
- CT_STRUCTURED_TEXT
- CT_BUTTON
- CT_ACTIVETEXT
Since Arma 3 v2.22 CT_PROGRESS is also supported.
Syntax
Syntax 1
ctrlSetText [idc, text]
Parameters:
idc: Number - control IDCtext: String - text or image path or texture, depending on the control type
Returns: Nothing
Syntax 2
control ctrlSetText text
Parameters:
control: Control - controltext: String - text or image path or texture, depending on the control type
Returns: Nothing
Examples
Example 1
ctrlSetText [100, "Hello world"]; // for Dialogs
Example 2
_control ctrlSetText "Hello world."; // for Displays
Example 3
Since Arma 3 2.22:
with uiNamespace do
{
bar = findDisplay 46 ctrlCreate ["RscProgress", -1];
bar ctrlSetText "\A3\Data_F\Flags\Flag_red_CO.paa";
bar ctrlSetPosition [0,0,1,0.25];
bar ctrlCommit 0;
bar progressSetPosition 0.7;
};