Class: LightManager
Defined in: render/light.ts:4
Constructors
Constructor
new LightManager(): LightManager;
Returns
LightManager
Methods
Create()
static Create(entity, type): boolean;
Defined in: render/light.ts:11
Create a Light component and attach it to the specified entity
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity to attach the light to |
type | LightType | The type of light to create |
Returns
boolean
boolean indicating success
Destroy()
static Destroy(entity): boolean;
Defined in: render/light.ts:25
Destroy the Light component from the specified entity
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity to remove the light from |
Returns
boolean
boolean indicating success
HasComponent()
static HasComponent(entity): boolean;
Defined in: render/light.ts:34
Check if the entity has a Light component
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity to check |
Returns
boolean
boolean indicating if light component exists
SetColor()
static SetColor(
entity,
r,
g,
b): boolean;
Defined in: render/light.ts:63
Set the color of the light
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity with the light component |
r | number | Red component (0-1) |
g | number | Green component (0-1) |
b | number | Blue component (0-1) |
Returns
boolean
boolean indicating success
SetCullingMask()
static SetCullingMask(entity, mask): boolean;
Defined in: render/light.ts:147
Set the culling mask for the light
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity with the light component |
mask | number | The culling mask |
Returns
boolean
boolean indicating success
SetIntensity()
static SetIntensity(entity, intensity): boolean;
Defined in: render/light.ts:80
Set the intensity of the light
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity with the light component |
intensity | number | The light intensity |
Returns
boolean
boolean indicating success
SetRange()
static SetRange(entity, range): boolean;
Defined in: render/light.ts:95
Set the range of the light
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity with the light component |
range | number | The light range |
Returns
boolean
boolean indicating success
SetShadows()
static SetShadows(entity, mode): boolean;
Defined in: render/light.ts:132
Set the shadow mode for the light
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity with the light component |
mode | LightShadowMode | The shadow mode |
Returns
boolean
boolean indicating success
SetSpotAngle()
static SetSpotAngle(
entity,
angle,
asDegrees): boolean;
Defined in: render/light.ts:111
Set the spot angle for spot lights
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
entity | number | undefined | The entity with the light component |
angle | number | undefined | The spot angle |
asDegrees | boolean | true | Whether the angle is in degrees (default: true) |
Returns
boolean
boolean indicating success
SetType()
static SetType(entity, type): boolean;
Defined in: render/light.ts:46
Set the type of light
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The entity with the light component |
type | LightType | The light type |
Returns
boolean
boolean indicating success