Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Pika-Software/plib_dynamic_light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Dynamic Light

Adds handy meta object, methods and functions for working with dynamic light sources.

Requires

Developer API

  • dlight CreateDynamicLight() - Creates a new dynamic light object and returns it.

  • 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.

DLight Object

  • DynamicLight dlight:GetLight() - Returns a standard dynamic light object, which is userdata.

  • boolean dlight:IsValid() - Returns whether the light source is valid or not.

  • number dlight:LightIndex() - Returns a unique dlight index.

  • dlight:Remove() - Removes the object of light source.

  • 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.

  • dlight:SetColorUnpacked( number r, number g, number b, number a ) - Sets the color of the light source by r, g, b, a.

  • 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.