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
NAME | TYPE | DESCRIPTION |
---|---|---|
points | Vector2[] | The curves points |
Returns the current builder.
style
style(style);
Set the curves style
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
style | CurveStyle[] | The curves style |
Returns the current builder.
fillColor
fillColor(fillColor);
Set the curve styles fillColor
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
fillColor | string | The curves fill color |
Returns the current builder.
fillOpacity
fillOpacity(fillOpacity);
Set the curve styles fillOpacity
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
fillOpacity | number | The curves fill opacity |
Returns the current builder.
strokeColor
strokeColor(strokeColor);
Set the curve styles strokeColor
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
strokeColor | string | The curves stroke color |
Returns the current builder.
strokeOpacity
strokeOpacity(strokeOpacity);
Set the curve styles strokeOpacity
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
strokeOpacity | number | The curves stroke opacity |
Returns the current builder.
strokeWidth
strokeWidth(strokeWidth);
Set the curve styles strokeWidth
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
strokeWidth | number | The curves stroke width |
Returns the current builder.
strokeDash
strokeDash(strokeDash);
Set the curve styles strokeDash
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
strokeDash | number[] | The curves stroke dash |
Returns the current builder.
tension
tension(tension);
Set the curve styles tension
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
tension | number | The curves tension |
Returns the current builder.
closed
closed(closed);
Set the curve styles closed
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
closed | boolean | The curves closed state |
Returns the current builder.
build
build();
Returns the final Curve item.