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)
示例#2
0
def dpad_right_pressed():
    return input_manager.pressed('ht00_right')
示例#3
0
 def is_button_pressed(self, button_code):
     return im.pressed('bt' + str(self.joystick_number) + str(button_code))
示例#4
0
def dpad_down_pressed():
    return input_manager.pressed('ht00_down')
示例#5
0
def dpad_left_pressed():
    return input_manager.pressed('ht00_left')
示例#6
0
def dpad_up_pressed():
    return input_manager.pressed('ht00_up')
示例#7
0
def Y_pressed():
    return input_manager.pressed('bt03')
示例#8
0
def X_pressed():
    return input_manager.pressed('bt02')
示例#9
0
def B_pressed():
    return input_manager.pressed('bt01')
示例#10
0
def A_pressed():
    return input_manager.pressed('bt00')