2 # Documentation for Light game objects.
3 from KX_GameObject import *
5 class KX_LightObject(KX_GameObject):
11 # Turn on a red alert light.
14 co = GameLogic.getCurrentController()
18 light.colour = [1.0, 0.0, 0.0]
20 @group Constants: NORMAL, SPOT, SUN
21 @ivar SPOT: A spot light source. See attribute 'type'
22 @ivar SUN: A point light source with no attenuation. See attribute 'type'
23 @ivar NORMAL: A point light source. See attribute 'type'
25 @ivar type: The type of light - must be SPOT, SUN or NORMAL
26 @ivar layer: The layer mask that this light affects object on.
28 @ivar energy: The brightness of this light.
30 @ivar distance: The maximum distance this light can illuminate. (SPOT and NORMAL lights only)
32 @ivar colour: The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]
33 @type colour: list [r, g, b]
34 @ivar color: Synonym for colour.
35 @ivar lin_attenuation: The linear component of this light's attenuation. (SPOT and NORMAL lights only)
36 @type lin_attenuation: float
37 @ivar quad_attenuation: The quadratic component of this light's attenuation (SPOT and NORMAL lights only)
38 @type quad_attenuation: float
39 @ivar spotsize: The cone angle of the spot light, in degrees. (float) (SPOT lights only)
40 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted.
41 @ivar spotblend: Specifies the intensity distribution of the spot light. (float) (SPOT lights only)
42 Higher values result in a more focused light source.
43 0.0 <= spotblend <= 1.0.