如何接受来自 pygame GUI 的文本输入 [英] How to accept text input from a pygame GUI
问题描述
我正在使用 Python 和 Pygame 开发 RPG 游戏,并且正在尝试制作一个由两部分组成的 GUI,包括类似于基本命令行的下部和将显示所有图形动作"的顶部."
I am working on a RPG game using Python and Pygame, and am trying to make a two-part GUI, including a lower part that is like the basic command line, and a top part that will show all graphical "action."
我需要找出一种将两者都包含在 pygame 窗口中的方法,而不是使用 pygame 窗口和终端窗口.另外,是否有适合这种用途的 Pygame GUI 工具包?
What I need to find out is a way to include both in a pygame window, instead of using a pygame window and terminal window. As well, are there any Pygame GUI toolkits that would be appropriate for this use?
谢谢大家!
推荐答案
我可以建议改用 ezText 吗?这是将文本输入栏添加到 pygame 的一种很酷的方式.自己之前用过,用起来真的很方便.
May I suggest using ezText instead? It's a cool way to add text inupt bars to pygame. I used it before my self, and It's really easy to use.
http://www.pygame.org/project-EzText-920-.html
(如果您需要帮助使用它,请随时发表评论,尽管您需要知道的一切都在它附带的 example.py 中)
(feel free to leave a comment if you want help using it, although everything you need to know is in the example.py that comes with it)
这篇关于如何接受来自 pygame GUI 的文本输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!