setLightSpread()
Purpose
Sets the spread of a light source
Description
Set the amount of spread of a light source to the specified value
Syntax
setLightSpread( light, spread )
Arguments
light handle of the light source
spread a measure of how much the light from the light source spreads
Example
setCamera( { 0, 6, 10 }, { 0, 0, 0 } )
spread = 50
light = spotLight( { 0, 4, 0 }, { 4, 0.1, 4 }, white, 100, spread )
obj = [
placeObject( cube, { 0, 0, 0 }, { 4, 0.1, 4 } ),
placeObject( cube, { 0, 1.1, 0 }, { 1, 1, 1 } )
]
setObjectMaterial( obj[0], white, 0, 1 )
setObjectMaterial( obj[1], cyan, 0, 1 )
loop
c = controls( 0 )
spread += c.ly
spread = clamp( spread, 0, 100 )
setLightSpread( light, spread )
rotateObject( obj[1], { 0, 1, 0 }, 1 )
drawObjects()
printAt( 0, 0, "Use Joy-Con left Control Stick to adjust light spread: " + spread )
update()
repeat
Associated Commands
pointLight(), pointShadowLight(), removeLight(), setAmbientLight(), setLightBrightness(), setLightColour(), setLightDir(), setLightPos(), spotLight(), worldLight(), worldShadowLight()