import pygame import sys pygame.init() WHITE=(255,255,255) RED=(255,0,0) BLUE=(0,0,255) GREEN=(0,255,0) BLACK=(0,0,0) color_dark = (100, 100, 100) color_light = (50, 50, 50) pygame.display.set_caption("Buttons") display = pygame.display.set_mode((800, 800)) display.fill(WHITE) pygame.draw.rect(display, color_dark, [590, 315, 80, 30]) small_font = pygame.font.SysFont("Corbel", 16) text = small_font.render("LOAD", True, color_light) while True: events = pygame.event.get() for event in events: if event.type == pygame.QUIT: pygame.quit() sys.exit() mouse = pygame.mouse.get_pos() if event.type == pygame.MOUSEBUTTONDOWN: if 590 <+ mouse[0] <= 670 and 315 <= mouse[1] <= 345: print("Buton clicked!") else: print("Not Clicked!") pygame.display.update()