I'm new to python. I'm making tic-tac-toe that two user can play against each other. I'm using Pygame. The idea is that when the user clicks the button "player vs player", a text box will appear and both user can enter their name, after that their name appears in a label and the game can begin.
Asked
Active
Viewed 18 times
0
-
PyGame is a low level library, so if you want a text box, you'll need to draw the box, then handle the keydown/up events and then render the characters entered and and then the enter key to submit and so on. If this doesn't sound exciting, you could use a [simple tkdialog](https://docs.python.org/3.9/library/dialog.html#module-tkinter.simpledialog) to use one of the builtin dialogs. Perhaps [this answer](https://stackoverflow.com/a/63803803/2280890) might be helpful. – import random Feb 04 '22 at 13:37
-
Does this help? https://stackoverflow.com/questions/46390231/how-can-i-create-a-text-input-box-with-pygame – Roni Feb 04 '22 at 13:44