import pygame
pygame.init()
DISPLAY = pygame.display.set_mode((640, 480))
cursorImg = pygame.image.load('cursor.png')
# Hide cursor and initialise cursor rectangle
pygame.mouse.set_visible(False)
cursorImgRect = cursorImg.get_rect()
# Main game loop
running = True
while running:
# Draw cursor
cursorImgRect.center = pygame.mouse.get_pos()
DISPLAY.blit(cursorImg, cursorImgRect)
# Quit the game if they close the program
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.display.update()
pygame.quit()