Contents Up Previous Next

GUI Label functions and properties

Enabled property (inherited)
Height property (inherited)
ID property (inherited)
OwningGUI property (inherited)
SetPosition (inherited)
SetSize (inherited)
Visible property (inherited)
Width property (inherited)
X property (inherited)
Y property (inherited)

GetText (label)
SetText (label)
Font property (label)
TextColor property (label)


GetText (label)

Label.GetText(string buffer)
Gets the current text on the label into the string BUFFER.

Example:

string buffer;
lblStatus.GetText(buffer);
Display("The label says %s.", buffer);
will display the label's contents in a message box.

See Also: Button.NormalGraphic, Button.SetText, Label.TextColor, Label.Font


SetText (label)

(Formerly known as SetLabelText, which is now obsolete)

Label.SetText(string newtext)
Changes the text displayed in the specified label to NEWTEXT. This command allows you to change the text during the game, for example to create a Lucasarts-style status line.

Example:

string buffer;
GetLocationName(mouse.x, mouse.y, buffer);
lblStatus.SetText(buffer);
will display the name of the location the cursor is over on label 'lblStatus'

See Also: Button.NormalGraphic, Button.SetText, Label.TextColor, Label.Font


Font property (label)

(Formerly known as SetLabelFont, which is now obsolete)

int Label.Font;
Gets/sets the font used to display the label's text. This is useful if you have a standard SCI font for your English version, but want to change to a TTF font for foreign language versions.

Example:

if (IsTranslationAvailable()) {
  lblStatus.Font = 2;
}
will change label 'lblStatus' to use font 2 if a game translation is in use.

See Also: IsTranslationAvailable, Label.SetText, TextBox.Font


TextColor property (label)

(Formerly known as SetLabelColor, which is now obsolete)

int Label.TextColor;
Gets/sets the text colour used to display the label's text.

Example:

lblStatus.TextColor = 14;
will change label 'lblStatus' to have yellow text.

See Also: Label.Font, Label.SetText

Browser Based Help. Published by chm2web software.
1