setLightBrightness()
Purpose
Set the brightness of a light source
Description
Set the brightness of a light source to the specified value
Syntax
setLightBrightness( light, brightness )
Arguments
light handle of the light source
brightness brightness of the light source (0 - 100)
Example
setCamera( { 0, 10, 10 }, { 0, 0, 0 } )
bright = 50
light = worldLight( { -1, -1, -1 }, white, bright )
ballmodel = loadModel( "Kat Deak/Discoball" )
ball = placeObject( ballmodel, { 0, -0, 0 }, { 10, 10, 10 } )
loop
c = controls( 0 )
if c.up then
bright += 1
endIf
if c.down then
bright -= 1
endIf
bright = clamp( bright, 0, 100 )
setLightBrightness( light, bright )
rotateObject( ball, { 0, 1, 0 }, 1.0 )
drawObjects()
printAt( 0, 0, "Use up and down arrows to adjust brightness: ", bright )
update()
repeat
Associated Commands
pointLight(), pointShadowLight(), removeLight(), setAmbientLight(), setLightColour(), setLightDir(), setLightPos(), setLightSpread(), spotLight(), worldLight(), worldShadowLight()