chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Pygame Mouse Events Trouble filter_list
Author
Message
RE: Pygame Mouse Events Trouble #11
(12-12-2015, 09:09 PM)xxxxxxxxxxxxxxxxxxxxxxxxx Wrote: No didn't notice I had to call screen only used pygameinit()
Any recommendations then?

This should work:
Code:
import pygame
import sys

# initilalization
pygame.init()
screen = pygame.display.set_mode((1024, 1024))
running = True

while running:
    # proceed events
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        
        elif event.type == pygame.MOUSEBUTTONUP:
            print("Mouse event...")

pygame.quit()
sys.exit()

As you will see, it might not be exactly what you want...

Reply






Users browsing this thread: 1 Guest(s)