I am using Pygame and I want to have a sprite be able to detect if the mouse is over it. Here's the code I got: if axe_button.get_rect().collidepoint(pygame.mouse.get_pos()):
It sort of works.
Here's what I mean. It detects it only when my mouse is at (0, 0); I think that it's because I used pygame.display.blit(axe_button, (30, 70))
. So it only draws it at the right place but the actual thing is still at 0, 0.
I don't know if my theory is right, but can you please help me?