Skip to content

Rectangle

The rectangle is the basis of a screen: a backdrop under a group of instruments, an equipment body, a frame around an area, a colored status tile. The fill can be solid, gradient (3D look) or transparent, the outline solid or dashed, and the corners can be rounded.

Color by state is set with the Appearance animation (see Animations): for example, green while the pump runs and red on a fault. Use a script when the rule is more complex than an animation can express.

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

Property Values Default Description
Fill #RRGGBB #9AA3AB Fill
Stroke #RRGGBB #5C646C Outline
StrokeThickness number 1 Outline thickness
CornerRadius number 0 Corner radius
FillStyle Solid, VerticalGradient, HorizontalGradient, Transparent Solid Fill style
Fill2 #RRGGBB Second gradient color. Empty — lighter than the main color
DashStyle Solid, Dash, Dot, DashDot Solid Outline style

Item.Type = Rectangle. Any property is read and changed by name: Item.Fill = "#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).

Color from two tags. The screen’s Cycle event script paints the tile: a fault wins over running.

var box = Screen.Items("Tile1");
box.Fill = Tags("Pump1.Fault").Value ? "#D32F2F"
: Tags("Pump1.Run").Value ? "#3C9A5F" : "#C3C9CF";

Dashed frame around the selected area. Clicking an area highlights its frame.

Screen.All().filter(function (e) { return e.Name.indexOf("Area") === 0; })
.forEach(function (e) { e.DashStyle = "Solid"; e.StrokeThickness = 1; });
Item.DashStyle = "Dash";
Item.StrokeThickness = 3;