niromru

Спрайты ---> Свой курсор мыши

Jan 26th, 2021 (edited)
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import urllib.request
  2. import pygame
  3.  
  4. f, h = urllib.request.urlretrieve('https://yastatic.net/s3/lyceum/content/image/pygame/arrow.png')
  5. img = open(f)
  6. if __name__ == '__main__':
  7.     pygame.init()
  8.     x, y = 0, 0
  9.     size = width, height = 800, 600
  10.     sc = pygame.display.set_mode(size)
  11.     imgp = pygame.image.load(img).convert()
  12.     pygame.mouse.set_visible(False)
  13.     while True:
  14.         for i in pygame.event.get():
  15.             if i.type == pygame.QUIT:
  16.                 exit(0)
  17.             elif i.type == pygame.MOUSEMOTION:
  18.                 sc.fill((0, 0, 0))
  19.                 sc.blit(imgp, i.pos)
  20.                 pygame.display.update()
  21.     pygame.quit()
  22.  
Add Comment
Please, Sign In to add comment