G.DynamicLight

From GMod Wiki

Jump to: navigation, search
Function
Syntax DynamicLight( Integer Unique Identifier )
Where is this used?
Description:
Creates a dynamic light and returns a table to define it.
Returns: Table
Part of Library: Global Functions
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.DynamicLight]G.DynamicLight [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates or updates a dynamic light originating from this entity the same color as the entity.
Used onNewerClient.png
Code
function ENT:Think()
	local dlight = DynamicLight( self:EntIndex() )
	if ( dlight ) then
		local r, g, b, a = self:GetColor()
		dlight.Pos = self:GetPos()
		dlight.r = r
		dlight.g = g
		dlight.b = b
		dlight.Brightness = 1
		dlight.Size = 256
		dlight.Decay = dlight.Size * 5
		dlight.DieTime = CurTime() + 1
                dlight.Style = 0
	end
end
OutputN/A


Additional Notes

All these styles only controll the brightness.

It does not seem to use the same scale as Brightness, MinLight seems to range from 0 - 1, when MinLight is set to 0 however, the light will NOT go completly dark.

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox