T
T
tipmoyid322020-12-17 17:26:59
pygame
tipmoyid32, 2020-12-17 17:26:59

How to fix the cursor in the center of the Pygame screen?

I want the cursor to make micro movements from which it will be possible to change variables. Is it somehow possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tipmoyid32, 2020-12-17
@tipmoyid32

x, y = pygame.mouse.get_pos()
if x > 600:
angel += (x - 600) / 100
elif x < 600:
angel -= (600 - x) / 100
pygame.mouse.set_pos((600, 350))
I came up with the solution myself, it does not work perfectly, but it will do for a start.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question