OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to change the cursor in Pygame to a custom image

  • Thread starter Thread starter ArjunSahlot
  • Start date Start date
A

ArjunSahlot

Guest
I have a button in my Pygame program.
Whenever my cursor is hovering over the button, I want the cursor to change to this image (but it could be any custom image), which is different from the default pointer image for Pygame:

enter image description here

I already know how to get the position of the mouse and when it is pressed. I just don't know how to change the cursor.
<p>I have a button in my Pygame program.<br />
Whenever my cursor is hovering over the button, I want the cursor to change to this image (but it could be any custom image), which is different from the default pointer image for Pygame:</p>
<p><a href="https://i.sstatic.net/lSNJu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lSNJu.png" alt="enter image description here" /></a></p>
<p>I already know how to get the position of the mouse and when it is pressed. I just don't know how to change the cursor.</p>
 

Latest posts

M
Replies
0
Views
1
MOHAMED AMIIN ABDI AADAN
M
Top