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
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| style | LineStyle[] | The lines style |
Returns the current builder.
strokeColor
strokeColor(strokeColor);
Set the line styles strokeColor.
Parameters
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| strokeColor | string | The lines stroke color |
Returns the current builder.
strokeOpacity
strokeOpacity(strokeOpacity);
Set the line styles strokeOpacity.
Parameters
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| strokeOpacity | number | The lines stroke opacity |
Returns the current builder.
strokeWidth
strokeWidth(strokeWidth);
Set the line styles strokeWidth.
Parameters
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| strokeWidth | number | The lines stroke width |
Returns the current builder.
strokeDash
strokeDash(strokeDash);
Set the line styles strokeDash.
Parameters
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| strokeDash | number[] | The lines stroke dash |
Returns the current builder.
startPosition
startPosition(startPosition);
Set the lines startPosition.
Parameters
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| startPosition | Vector2 | The lines start position |
Returns the current builder.
endPosition
endPosition(endPosition: Vector2)
Set the lines endPosition.
Parameters
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| endPosition | Vector2 | The lines end position |
Returns the current builder.
build
build();
Returns the final Line item.