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.
Asked
Active
Viewed 347 times
1
-
You have to implement it all yourself. I think it is very hard to do this i pygame zero. I only know a pygame implementation: [How to create a text input box with pygame?](https://stackoverflow.com/questions/46390231/how-to-create-a-text-input-box-with-pygame/64613666#64613666) – Rabbid76 Mar 15 '22 at 06:03
1 Answers
0
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.

Hacker
- 180
- 2
- 14