Skip to main content

CurveBuilder

A builder for the Curve item.

Extends GenericItemBuilder

Example

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

const item = buildCurve()
.points([
{ x: 0, y: 0 },
{ x: 150, y: 0 },
{ x: 150, y: 150 },
])
.tension(0)
.build();
OBR.scene.items.addItems([item]);

Reference

Methods​

points​

points(points);

Set the curves points array.

Parameters

NAMETYPEDESCRIPTION
pointsVector2[]The curves points

Returns the current builder.


style​

style(style);

Set the curves style.

Parameters

NAMETYPEDESCRIPTION
styleCurveStyle[]The curves style

Returns the current builder.


fillColor​

fillColor(fillColor);

Set the curve styles fillColor.

Parameters

NAMETYPEDESCRIPTION
fillColorstringThe curves fill color

Returns the current builder.


fillOpacity​

fillOpacity(fillOpacity);

Set the curve styles fillOpacity.

Parameters

NAMETYPEDESCRIPTION
fillOpacitynumberThe curves fill opacity

Returns the current builder.


strokeColor​

strokeColor(strokeColor);

Set the curve styles strokeColor.

Parameters

NAMETYPEDESCRIPTION
strokeColorstringThe curves stroke color

Returns the current builder.


strokeOpacity​

strokeOpacity(strokeOpacity);

Set the curve styles strokeOpacity.

Parameters

NAMETYPEDESCRIPTION
strokeOpacitynumberThe curves stroke opacity

Returns the current builder.


strokeWidth​

strokeWidth(strokeWidth);

Set the curve styles strokeWidth.

Parameters

NAMETYPEDESCRIPTION
strokeWidthnumberThe curves stroke width

Returns the current builder.


strokeDash​

strokeDash(strokeDash);

Set the curve styles strokeDash.

Parameters

NAMETYPEDESCRIPTION
strokeDashnumber[]The curves stroke dash

Returns the current builder.


tension​

tension(tension);

Set the curve styles tension.

Parameters

NAMETYPEDESCRIPTION
tensionnumberThe curves tension

Returns the current builder.


closed​

closed(closed);

Set the curve styles closed.

Parameters

NAMETYPEDESCRIPTION
closedbooleanThe curves closed state

Returns the current builder.


build​

build();

Returns the final Curve item.