'Adding a text input field in PyGame Zero?
Is it possible to add a text input field into a Pygame Zero game? I can't see it in the docs but may have overlooked it.
Solution 1:[1]
Pygame is made to be very minimal. But there are libraries like pygame-gui that implement common UI-utilities and -elements like the UITextEntryLine.
It might not be compatible with pgzero. In that case you can still look at the pygame-gui source code to understand, how text-entry might be implemented.
For example it is a bit more than just reacting to global key-down events but also about tracking the focused element so that the right element gets the text as suggested in this answer.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Hacker |