mode
mode
gets/sets the operation mode of the sound actuator.
Type: integer
1 =
KX_SOUNDACT_PLAYSTOP
2 = KX_SOUNDACT_PLAYEND
3 = KX_SOUNDACT_LOOPSTOP
4 = KX_SOUNDACT_LOOPEND
5 = KX_SOUNDACT_LOOPBIDIRECTIONAL (Ping Pong)
6 = KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (Ping Pong Stop)
Sample
Code
################ Get mode
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named slam
act = controller.actuators["slam"]
# get the operation mode
opMode = act.mode
################ Set mode
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named slam
act = controller.actuators["slam"]
# set the operation mode
act.mode = 2
|