Rect Area Light
Updated
A soft glowing rectangle, like a window or a panel light.
- Type
comp-rect-area-light- Script class
RectAreaLightComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Lights: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
height |
0 ≤ x ≤ 1000 |
|
intensity |
0 ≤ x ≤ 100000 |
|
width |
0 ≤ x ≤ 1000 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
RectAreaLight::change
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A softbox lit by a Rect Area LightA photo-studio softbox: a Rect Area Light with the runtime Lobby demo's warm settings throws soft, even light from a whole rectangle, and the script cycles its colour and size.
Watch the soft light on the floor and the shapes change as the panel changes colour and size. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(RectAreaLightComponent); if (component) log(component.props);}