Skip to content

Text

Text is a label of any size and font: an equipment name, a note, an area heading. It has a background, a border, rounded corners, a shadow and flashing, line wrapping and line spacing.

Text that depends on a tag value is easier to show with a symbolic field (a “value — text” list) or a Text property animation. Use a script when the text is built from several tags.

Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:

Property Values Default Description
Text text Текст Text
NoWrap true / false false No line wrapping
LineHeight number Line spacing. Line height in pixels; empty — by font
FontFamily text Font. Windows font name: Segoe UI, Arial, Consolas, Tahoma; empty — default
FontSize number 14 Font size
Bold true / false false Bold
Italic true / false false Italic
Underline true / false false Underlined
Foreground #RRGGBB #1E2328 Text color. Empty — default
Alignment Left, Center, Right Left Alignment
VerticalAlignment Top, Center, Bottom Top Vertically
Background #RRGGBB Background. Empty — default
BackgroundStyle Solid, VerticalGradient, HorizontalGradient, Transparent Solid Background fill. Solid, gradient (3D) or transparent
Background2 #RRGGBB Second background color. For gradient; empty — lighter than background
BorderColor #RRGGBB Border color. Empty — default
BorderWidth number 1 Border width. 0 — no border
BorderStyle Solid, Dash, Dot, DashDot Solid Border style
CornerRadius number 0 Corner radius
Padding number Padding. From border to text; empty — default
Shadow true / false false Shadow
FlashBackground true / false false Flash background. Background alternates with the flash color; to switch by tag — use property animation
FlashBackgroundColor #RRGGBB #D32F2F Background flash color
FlashForeground true / false false Flash text
FlashForegroundColor #RRGGBB #FFFFFF Text flash color
FlashRate Slow, Medium, Fast Medium Flash rate

Item.Type = Text. Any property is read and changed by name: Item.Foreground = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.

Mouse, hover, focus and keyboard — as for any element (see Events and functions).

An area status line from several tags — the screen’s Cycle event script.

var running = ["Pump1", "Pump2", "Pump3"].filter(function (p) { return Tags(p + ".Run").Value; });
var msg = Screen.Items("Status");
msg.Text = running.length ? "Running: " + running.join(", ") : "All pumps stopped";
msg.FlashBackground = running.length === 0;

An operator hint that is shown until a mode is selected.

Screen.Items("Hint").Visible = Tags("Mode").Value === 0;