LightBuilder
A builder for the Light item.
Extends GenericItemBuilder
Example
import OBR, { buildLight } from "@owlbear-rodeo/sdk";
const gridDpi = await OBR.scene.grid.getDpi();
// 12 grid squares or 60ft in a 5ft grid system
const visionRadius = gridDpi * 12;
const myCharacter = await OBR.scene.items.get(id);
const item = buildLight()
.position(myCharacter.position)
.attenuationRadius(visionRadius)
.attachedTo(myCharacter.id)
.build();
OBR.scene.local.addItems([item]);
Reference
Methods
sourceRadius
sourceRadius(sourceRadius);
Set the lights sourceRadius
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
sourceRadius | number | The lights sourceRadius value |
Returns the current builder.
attenuationRadius
attenuationRadius(attenuationRadius);
Set the lights attenuationRadius
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
attenuationRadius | number | The lights attenuationRadius value |
Returns the current builder.
falloff
falloff(falloff);
Set the lights falloff
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
falloff | number | The lights falloff value |
Returns the current builder.
innerAngle
innerAngle(innerAngle);
Set the lights innerAngle
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
innerAngle | number | The lights innerAngle value |
Returns the current builder.
outerAngle
outerAngle(outerAngle);
Set the lights outerAngle
.
Parameters
NAME | TYPE | DESCRIPTION |
---|---|---|
outerAngle | number | The lights outerAngle value |
Returns the current builder.
build
build();
Returns the final Light item.