while true loop doesn't work inside another in python -


i have while true loop (code below) within loop. want check if clicked on button , if so, change cursor image have imported before. tried hiding cursor , let image follow it. when run this, hides cursor draws image was, doesn't move cursor.

while true:     event in pygame.event.get():         if event.type == mousebuttonup:             mousex, mousey = pygame.mouse.get_pos()             if mousex > 100 , mousex < 200 , mousey > 50 , mousey < 100:  # button on screen                  pygame.mouse.set_visible(false)                 while true:                     mousex, mousey = pygame.mouse.get_pos()                     displaysurf.blit(cursorimg, (mousex,mousey))                     pygame.display.update() 

can tell me doing wrong please?

change code this:

while true:     event in pygame.event.get():         if event.type == mousebuttonup:             mousex, mousey = pygame.mouse.get_pos()             if mousex > 100 , mousex < 200 , mousey > 50 , mousey < 100:  # button on screen                  pygame.mouse.set_visible(false)                 mousex, mousey = pygame.mouse.get_pos()                 displaysurf.blit(cursorimg, (mousex,mousey))     pygame.display.update() 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -