Class KX_CDActuator (2.48)


Methods
getGain startCD
pauseCD stopCD
setGain ----------
 
Variables
---------- ----------
 
Constants
---------- ----------

Inherited Methods:  Class SCA_ILogicBrick
getExecutePriority setExecutePriority
getOwner ----------

Inherited Methods:  Class PyObjectPlus
isA ----------

Inherited Methods:  Class Value
getName ----------


Methods



getGain

getGain()

Gets the CD volume (gain) setting.

Return type:  Float

Range: 0.0 (no sound) to 1.0 (maximum).

Sample Code

# get the controller
controller = GameLogic.getCurrentController()

# get the cd actuator attached to the controller named act
cd = controller.getActuator("act")

# get volume
volume = cd.getGain()

pauseCD

pauseCD()

Pauses the cd player.

Note:
There isn't a python function to resume playing.

Sample Code

# get the controller
controller = GameLogic.getCurrentController()

# get the cd actuator attached to the controller named act
cd = controller.getActuator("act")

# pause the cd
cd.pauseCD()

setGain

setGain(gain)

Sets the volume (gain) level.

gain:
Type:  float value.
range:  0.0 (silent) to 1.0 (max volume)

Note:
Doesn't work.

Sample Code

# get the controller
controller = GameLogic.getCurrentController()

# get the cd actuator attached to the controller named act
cd = controller.getActuator("act")

# set volume
cd.setGain(0.5)

startCD

startCD()

Starts the CD player.

Sample Code

# get the controller
controller = GameLogic.getCurrentController()

# get the cd actuator attached to the controller named act
cd = controller.getActuator("act")

# play cd
cd.startCD()

stopCD

stopCD()

Stops the CD player.

Sample Code

# get the controller
controller = GameLogic.getCurrentController()

# get the cd actuator attached to the controller named act
cd = controller.getActuator("act")

# stop playing CD
cd.stopCD()



Blender 3D
Game Engine