| Class KX_CDActuator (2.48) |
|
|
| getGain |
startCD |
| pauseCD |
stopCD |
| setGain |
----------
|
|
|
|
| getExecutePriority |
setExecutePriority |
| getOwner |
---------- |
|
|
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()
|