Skip to main content

LineBuilder

A builder for the Line item.

Extends GenericItemBuilder

Example

import OBR, { buildLine } from "@owlbear-rodeo/sdk";

const item = buildLine().endPosition({ x: 150, y: 150 }).build();
OBR.scene.items.addItems([item]);

Reference

Methods

style

style(style);

Set the lines style.

Parameters

NAMETYPEDESCRIPTION
styleLineStyle[]The lines style

Returns the current builder.


strokeColor

strokeColor(strokeColor);

Set the line styles strokeColor.

Parameters

NAMETYPEDESCRIPTION
strokeColorstringThe lines stroke color

Returns the current builder.


strokeOpacity

strokeOpacity(strokeOpacity);

Set the line styles strokeOpacity.

Parameters

NAMETYPEDESCRIPTION
strokeOpacitynumberThe lines stroke opacity

Returns the current builder.


strokeWidth

strokeWidth(strokeWidth);

Set the line styles strokeWidth.

Parameters

NAMETYPEDESCRIPTION
strokeWidthnumberThe lines stroke width

Returns the current builder.


strokeDash

strokeDash(strokeDash);

Set the line styles strokeDash.

Parameters

NAMETYPEDESCRIPTION
strokeDashnumber[]The lines stroke dash

Returns the current builder.


startPosition

startPosition(startPosition);

Set the lines startPosition.

Parameters

NAMETYPEDESCRIPTION
startPositionVector2The lines start position

Returns the current builder.


endPosition

endPosition(endPosition: Vector2)

Set the lines endPosition.

Parameters

NAMETYPEDESCRIPTION
endPositionVector2The lines end position

Returns the current builder.


build

build();

Returns the final Line item.