pygame.draw.circle(s, (150, 255, 0), (int(input_manager.axes['ax00'] * 30 + 220), int(input_manager.axes['ax01'] * 30 + 250)), 4, 0) pygame.draw.circle(s, (0, 150, 255), (300, 250), 30, 1) if 'ax03' in input_manager.axes and 'ax04' in input_manager.axes: pygame.draw.circle(s, (0, 150, 255), (int(input_manager.axes['ax04'] * 30 + 300), int(input_manager.axes['ax03'] * 30 + 250)), 4, 0) # ---- Draw triggers. ---- pygame.draw.rect(s, (150, 255, 0), (220, 300, 80, 10), 2) pygame.draw.rect(s, (150, 255, 0), (220, 300, input_manager.left[0] * 80, 10), 0) pygame.draw.rect(s, (0, 150, 255), (220, 320, 80, 10), 2) pygame.draw.rect(s, (0, 150, 255), (220, 320, input_manager.right[0] * 80, 10), 0) # ---- Draw hat. ----- if 'ht00' in input_manager.hats: pygame.draw.rect(s, (255, 0, 150), (350 + input_manager.hats['ht00'][0] * 10, 250 - input_manager.hats['ht00'][1] * 10, 10, 10), 0) # --- Respond to button presses. input_manager.update_inputs(pygame.event.get(), debug=True) if input_manager.pressed("bt00"): print("Hit A button") j.dispatch_events() p_clock.tick(60)
def dpad_right_pressed(): return input_manager.pressed('ht00_right')
def is_button_pressed(self, button_code): return im.pressed('bt' + str(self.joystick_number) + str(button_code))
def dpad_down_pressed(): return input_manager.pressed('ht00_down')
def dpad_left_pressed(): return input_manager.pressed('ht00_left')
def dpad_up_pressed(): return input_manager.pressed('ht00_up')
def Y_pressed(): return input_manager.pressed('bt03')
def X_pressed(): return input_manager.pressed('bt02')
def B_pressed(): return input_manager.pressed('bt01')
def A_pressed(): return input_manager.pressed('bt00')