camera
camera
Note:
set camera, use OB in front
of the camera name.
In other
words, use "OBCam_Race" and not "Cam_Race"
gets/sets the name of camera the actuator is set to switch to.
Type: string
Sample
Code
################## Get camera
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named
switchCam
act = controller.actuators["switchCam"]
# get camera name
name = act.camera
################## Set camera
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named
switchCam
act = controller.actuators["switchCam"]
# get camera name
act.camera = "OBCam_Race"
mode
mode
gets/sets mode of the Scene actuator
Type: integer
1 = Restart Scene
2 = Set Scene
3 = Set Camera
4 = Add Overlay Scene
5 = Add Background Scene
6 = Remove Scene
7 = Suspend Scene
8 = Resume Scene
Sample
Code
#################### Get mode
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named Scene
act = controller.actuators["Scene"]
# get scene modeactMode = act.mode
#################### Set scene
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named Scene
act = controller.actuators["Scene"]
# set to restart
act.mode = 1
scene
scene
Note:
set scene, don't use SCE in
front of the scene name.
In other
words, use "HUD" and not "SCEHUD"
gets/sets the name of the scene you want to:
switch to / overlay
/
underlay / remove / suspend / resume.
Returns an empty string if a scene hasn't been set.
Type: string
Sample
Code
#################### Get scene
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named
switchScene
act = controller.actuators["switchScene"]
# get scene name
name = act.scene
#################### Set scene
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named
switchScene
act = controller.actuators["switchScene"]
# set scene name
act.scene = "HUD"
useRestart
useRestartNote:Doesn't work gets/sets if the scene will be restarted.
Type: Bool
1 = True = want scene to be restarted
0 = False = don't want scene to be restarted
Sample
Code
################## Get useRestart
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named
restartScene
act = controller.actuators["restartScene"]
# will scene be restarted?
restart = act.useRestart
################## Set useRestart
# get controller
controller = GameLogic.getCurrentController()
# get actuator attached to the controller named
restartScene
act = controller.actuators["restartScene"]
# set scene to be restarted
act.useRestart = True
|