import pygame import sys pygame.init() display = pygame.display.set_mode((800, 800)) display.fill((255, 255, 255)) color_light = (0,255,0) color_dark = (100,100,100) pygame.draw.rect(display, color_dark, [590, 315, 80, 30]) smallfont = pygame.font.SysFont('Corbel',23) text = smallfont.render('LOAD' , True , color_light) while True: for event in pygame.event.get(): mouse = pygame.mouse.get_pos() if event.type == pygame.MOUSEBUTTONDOWN: if 590 <= mouse[0] <= 670 and 315 <= mouse[1] <=345: print("button clicked") if event.type == pygame.QUIT: pygame.quit() sys.exit() display.blit(text , (602 , 320)) pygame.display.update()