coordinates - pygame.mouse.get_pos()..... the x/y co-oridinates not updating -


trying box change color when mouse goes over. problem i'm having mouse co-ordinates not updating. program doesn't know mouse on specific location. how keep updated mouse co-ordinates?

def start_screen():     game_display.blit(selection_screen,(0,0))     #buttons      mouse = pygame.mouse.get_pos()     print(mouse)     if 200 + 100 > mouse[0] > 200 , 550 + 50 > mouse[1] > 550:         pygame.draw.rect(game_display,black,(200,550,100,50))     else:         pygame.draw.rect(game_display,white,(200,550,100,50))     pygame.draw.rect(game_display,white,(700,550,100,50))      pygame.display.update()  start_screen() 

fixed it...

def start_screen():      intro = true     while intro:         event in pygame.event.get():              game_display.blit(selection_screen,(0,0))             #buttons              mouse = pygame.mouse.get_pos()              if 200 + 100 > mouse[0] > 200 , 550 + 50 > mouse[1] > 550:                 pygame.draw.rect(game_display,black,(200,550,100,50))             else:                 pygame.draw.rect(game_display,white,(200,550,100,50))              pygame.draw.rect(game_display,white,(700,550,100,50))              pygame.display.update()  start_screen() 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -