📜  如何在 pygame 中检测鼠标点击 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:13.744000             🧑  作者: Mango

代码示例2
while running: # Gameloop
  for event in pygame.event.get(): # Checks all events
    if event.type == pygame.MOUSEBUTTONDOWN: # If the current event is the mouse button down event
      pos = pygame.mouse.get_pos() # Stores the mouse position