Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to detect mouse click in pygame

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #detect #mouse #click #pygame
ADD COMMENT
Topic
Name
5+7 =