Light: spotsize

spotsize
  • gets/sets the cone angle of the spot light.

Type:

  • float number

Range:

  • 1.00 to 180.00 degrees
Note:
  • Spotlights only.
Sample Code

################## get the cone angle of the spotlight
 
# import bge
import bge

# get current scene
scene = bge.logic.getCurrentScene()

# get a list of the lights in the scene
lightList = scene.lights

# get spotlight named SearchLight
light = lightList["SearchLight"]

# get the cone angle of the spotlight
cone= light.spotsize

Sample Code

################## set the cone angle of the spotlight
 
# import bge
import bge

# get current scene
scene = bge.logic.getCurrentScene()

# get a list of the lights in the scene
lightList = scene.lights

# get spot light named SearchLight
light = lightList["SearchLight"]

# set the cone angle of the spotlight
light.spotsize = 60.00