'How to obtain both position and direction of scroll with pygame?
I am making a game, with various menus and informations displayed around the play area, and I am making some of those with custom Vertical_list and Horizontal_list objects that are part of my display structure.
I would like to be able to scroll through those lists using pygame events.
In pygame 1, the mouse wheel produced pygame.MOUSEBUTTONDOWN events. In pygame 2, a pygame.MOUSEWHEEL event was added, which distinguishes between horizontal and vertical scroll. But the MOUSEWHEEL event doesn't specify the position of the mouse at the time of the scroll. The MOUSEBUTTON events are still produced, but they provide no way to distinguish between vertical and horizontal scroll.
I would like to get both informations: the position of the scroll, because my game often displays several such lists at the same time, and the direction of the scroll, so that one cannot trigger a vertical list's scroll while trying to scroll an horizontal one.
Is there a way to do this?
Coincidentally, why does the MOUSEWHEEL event not include position information?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
