4 Pygame Tools
The Wobbler edited this page 2024-03-25 17:20:24 +01:00
This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Pygame Tools

The module pg.py contains some Pygame tools.

pg.Hover (class)

Checks if the mouse is hovering over an specified pygame.Rect().

Hover(rect) -> Hover
Hover(rect, function) -> Hover
Hover(rect, function, args) -> Hover

pg.Hover.check


check()

Checks if the mouse is hovering over the rect. When the mouse is hovering over the rect, it returns True. If an additional function is given, it also executes the function.