I tried to use .blit but an issue occurs, here is a screenshot to explain my problem furthermore:
The image appears to be smudged across the screen following my mouse
code:
import pygame
import keyboard
black = (0,0,0)
white = (255, 255, 255)
pygame.init()
screen = pygame.display.set_mode((600, 400))
screen.fill(black)
screen.convert()
icon = pygame.image.load('cross.png')
pygame.display.set_icon(icon)
pygame.display.set_caption('MouseLoc')
cross = pygame.image.load('cross.png')
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT or keyboard.is_pressed(' '):
running = False
mx, my = pygame.mouse.get_pos()
screen.blit(cross, (mx-48, my-48))
print(my, mx)
pygame.display.update()
