0

please tell me how to create an input line in pygame as easy as possible? For example, such as the password entry line in Windows, not in terms of graphics, but in terms of functionality. (sorry for possible grammatical errors. I'm not English)enter image description here

Weeper
  • 1
  • 1

1 Answers1

0

If I'm not wrong, pygame doesn't have a way to create inputs easily (You can use some libraries but in my case, none of them worked for my project needs), but that doesn't mean that it can't be done, I leave you the link of a project that I elaborated with pygame where I created a simple input line Repository in github. I also share with you a video that can help you (Credits to the corresponding channel, I am not the creator of that content) Python / Pygame tutorial: Getting text input

If you want a more concrete answer, I would recommend that you create a rectangle and detect a collision (click) with the mouse, and from that, listen to the keyboard inputs, add them to a string and display them on the screen.

Harold
  • 1
  • 1
  • Thank you very much for such a detailed answer. I managed to implement my idea, approximately as described in the video, although I learned something new from it. Special thanks for GitHub, because the code I'm trying to implement touches on similar things, so studying it will help me a lot to gain new knowledge. – Weeper Feb 09 '22 at 07:34