Search code examples
pythonpygamemouse-cursor

Pygame Set Mouse Cursor from Bitmap


I'm making an image editor using pygame and I was wondering if it was possible to change the mouse cursor to something more suitable (for instance a circle or rectangle) for brushes. Pygame has a really weird way of doing it that I'm not sure would work very well. Is there a way I can write to a bitmap and then use that?

If there is a way to do it with Python generally, that would work too I suppose.


Solution

  • Another option is to simply hide the cursor, load any arbitrary bitmap that you like and draw it every frame where the cursor is.