hat
hat
gets/sets the hat and the direction that triggers the sensor.
Type: list [ hat, direction]
direction
Type: integer.
1 is up
2 is right
4 is down
etc--see image to right
Sample
Code
############### Get hat
# get controller
controller = GameLogic.getCurrentController()
# get sensor attached to controller named FlightStick
sen = controller.sensors["FlightStick"]
# get hat and trigger direction
hatDir = sen.hat
############### Set hat
# get controller
controller = GameLogic.getCurrentController()
# get sensor attached to controller named FlightStick
sen = controller.sensors["FlightStick"]
# set hat and trigger direction
sen.hat = [ 1, 4]
|