Skip to main content

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

ParameterTypeDescription
entitynumberThe entity to attach the light to
typeLightTypeThe 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

ParameterTypeDescription
entitynumberThe 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

ParameterTypeDescription
entitynumberThe 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

ParameterTypeDescription
entitynumberThe entity with the light component
rnumberRed component (0-1)
gnumberGreen component (0-1)
bnumberBlue 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

ParameterTypeDescription
entitynumberThe entity with the light component
masknumberThe 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

ParameterTypeDescription
entitynumberThe entity with the light component
intensitynumberThe 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

ParameterTypeDescription
entitynumberThe entity with the light component
rangenumberThe 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

ParameterTypeDescription
entitynumberThe entity with the light component
modeLightShadowModeThe 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

ParameterTypeDefault valueDescription
entitynumberundefinedThe entity with the light component
anglenumberundefinedThe spot angle
asDegreesbooleantrueWhether 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

ParameterTypeDescription
entitynumberThe entity with the light component
typeLightTypeThe light type

Returns

boolean

boolean indicating success