Class KX_Light -- Blender Game Engine 2.49b



 
 




layer

layer

get/set the layer mask on which this light will illuminate objects.

Type: interger

1 = layer 1
2 = layer 2
3 = layer 2 and 1
4 = layer 3
5 = layer 3 and 1
6 = layer 3 and 2
7 = layer 3 and 2 and 1
8 = layer 4
etc.
16 = layer 5
etc.
32 = layer 6
etc.

Note:
A lamp can be on more than one layer.

If the light  is on layer 1,  layer 2 and layer 3 
layer = light.layer will return 7
1 (for layer 1) + 2 (for layer 2) + 4 (for layer 3)

Sample Code


########################## get light layer mask

# get the current scene
scene = GameLogic.getCurrentScene()

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

# get the light named Lamp
light = lightList["OBLamp"]

# get the layer(s) that the light illuminates
layers = light.layer

########################## set light layer mask

# get the current scene
scene = GameLogic.getCurrentScene()

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

# get the light named Lamp
light = lightList["OBLamp"]

# set the light to illuminate layers to 1, 2 and 4
light.layer = 11

 
Game developers can use the game engine to create casual video games, first and third person shooters, role playing games, racing simulations and more. The game engine can be used to make both 2D games and 3D games.  Beginning game developers will only need basic knowledge of game design and programming to create rich and complex game models with photo realistic textures to add detail to the graphics of the video game.  Today's games need more than good looking low polygon game models.  Use normal maps and photo realistic textures to create high quality game models.