Skip to main content

Line

The line object draws a line between two points.

The start and end points are specified in the Start Point and End Point attributes.

Attributes

Common

ID

Sets the object's ID.

The ID identifies the object and is used to reference it in UISet actions, allowing to change its attributes dynamically.

The ID is not unique, it can be shared among multiple objects to quickly change a common attribute.

IDs can't be changed with a UISet action, but they can have a Value Binding assigned to them. Value Bindings on IDs allow an object to be dinamically attached to a set of attribute values.

E.g. the following Value Binding switches the ID of the object between mybutton1 and mybutton2 based on the value of the UISet button.address:

Value binding: ="mybutton" + ui('button', 'address')

UISet: UISet('button', 'address', '1') switches the ID to mybutton1 UISet('button', 'address', '2') switches the ID to mybutton2

Points

Start Point

Specifies the start point of the line.

Attribute Values
ValueDescriptionExample
x<left>y<top>Coordinates in pixels.x10y20

End Point

Specifies the end point of the line.

Attribute Values
ValueDescriptionExample
x<left>y<top>Coordinates in pixels.x10y20

Stroke

Stroke Color

Specifies the stroke color.

Attribute Values
ValueDescriptionExample
<html color>Color in any html accepted format.#ff0000

Stroke Width

Specifies the stroke width.

The default value is: 1.

Attribute Values
ValueDescription
<string>Stroke width in pixels.

Cap

Specifies the stroke cap.

The default value is: butt.

Attribute Values
ValueDescription
buttDefault value. Butt.
roundRound.
squareSquare.

Stroke Dash

Specifies the pattern of dashes and gaps used to form the shape of the stroke.

The value is a list of comma and/or white space separated lengths or percentages. Each value specifies a length along the line for which the stroke is a dash or a gap.

Attribute Values
ValueDescriptionExample
<comma-separated list>Dash pattern.5,3

Meta

Comment

Specifies a comment, visible only in the Project Editor. It can be used to add a note or a tag to the object. The filter in the object's SELECT panel applies to the comment as well.

note

This attribute is static. Its value can't be changed dynamically with a uiSet command or with a value binding.

Exclude

Excludes the object from the UI. Useful to temporarily hide an object without deleting it. Different from the "Visible" attribute, which hides the object in the UI but keeps it in the project, allowing it to be shown again with a UISet.

The default value is: false.

note

This attribute is static. Its value can't be changed dynamically with a uiSet command or with a value binding.

Attribute Values
ValueDescription
falseDefault value. Object is included in the UI.
trueObject is excluded from the UI.