Adds handy meta object, methods and functions for working with dynamic light sources.
-
number
game.GetDynamicLightCount() - Returns the number of valid dynamic light objects. -
dlight
game.GetDynamicLight(number
index ) - Returns an existing light object based on a unique index. -
GM:DLightCreated(
dlight
light ) - This hook is called if a new dynamic light object has been created. -
GM:DLightRemoved(
dlight
light ) - This hook is called if the dynamic light object has been removed.
-
DynamicLight
dlight
:GetLight() - Returns a standard dynamic light object, which isuserdata
. -
boolean
dlight
:IsValid() - Returns whether the light source is valid or not. -
number
dlight
:LightIndex() - Returns a uniquedlight
index. -
vector
dlight
:GetPos() - Returns the light source position in the world. (def.0 0 0
) -
dlight
:SetPos(vector
vec ) - Sets the position of light source in the world. -
color
dlight
:GetColor() - Returns color of light source. (def.255 255 255 255
) -
dlight
:SetColor(color
col ) - Sets color of the light source. -
number
dlight
:GetAlpha() - Returns alpha of the light source. (def.255
) -
dlight
:SetAlpha(number
a ) - Sets alpha of the light source. -
number
dlight
:GetDieTime() - Returns time when the light source will die, the default is infinity. (def.inf
) -
dlight
:SetDeathTime(number
int ) - Sets time of death of the light source. -
number
dlight
:GetLifeTime() - Returns the lifetime remaining of the light source. (def.-inf
) -
dlight
:SetLifeTime(number
int ) - Sets lifetime of the light source. -
number
dlight
:GetBrightness() - Returns brightness of the light source. (def.1
) -
dlight
:SetBrightness(number
int ) - Sets brightness of the light source. -
number
dlight
:GetSize() - Returns light source size. (def.64
) -
dlight
:SetSize(number
int ) - Sets light source size. -
number
dlight
:GetStyle() - Returns light source style. (See Appearances) -
dlight
:SetStyle(number
int ) - Sets light source style. (See Appearances) -
boolean
dlight
:GetNoWorld() - Returns whether light should not illuminate the world. (def.false
) -
dlight
:SetNoWorld(boolean
bool ) - Sets a restriction on illumination of the light of the world. -
boolean
dlight
:GetNoModel() - Returns whether light should not illuminate the models and entities. (def.false
) -
dlight
:SetNoModel(boolean
bool ) - Sets a restriction on light should not illuminate the models and entities. -
number
dlight
:GetMinLight() - Returns the minimum light level. (def.0
) -
dlight
:SetMinLight(number
int ) - Sets the minimum light level.