我应该在 Pygame 中使用什么 gui 工具包? [英] What gui toolkit should I use with Pygame?

查看:74
本文介绍了我应该在 Pygame 中使用什么 gui 工具包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个需要能够在 pygame 表面中弹出 gui 元素的游戏.这个问题是't 是我想要的,因为 wxPython 在 SDL 表面而不是内部运行.到目前为止,我只看到了 ocemppguGooeyPy 在这个问题空间.

I'm making a game that needs to be able to pop up gui elements within a pygame surface. This question isn't what I want because wxPython goes around the SDL surface, not inside it. So far I've only seen ocemp, pgu, and GooeyPy in this problem space.

  • Ocemp 看起来巨大而粗犷.它提到了 Python 2.3,而我在快速浏览 cvs 存储库时发现的最新文件已有 2 年历史.
  • 我无法让 GooeyPy 工作(虽然我没有很努力地尝试;eggs 和 Debian 不是朋友)并且 v0.2 上次更新是在 2009 年 2 月.
  • 我一直在使用 pgu,但它似乎没有维护(上次更新 11/2009 和原始维护者放弃了它)并且它开始显示其年龄.它使用旧式类并抛出字符串异常.

所以我要问你的问题是:我应该使用什么 gui 工具包来在你的 pygame 应用程序中弹出漂亮的可点击按钮?有没有正在积极开发中的?

So my question to you, SO, is this: What gui toolkit should I use for making pretty clickable buttons pop up in your pygame applications? Are there any in active development?

编辑,2011 年 9 月

看起来 PGU 仍在维护中.最后一次提交来自 4 天前.

It looks like PGU is still being maintained. The last commits are from 4 days ago.

推荐答案

尽管这已经很老了,但你真的不需要为它准备一个 gui 库,你只需要使用 sprite.对于标签,您可以使用精灵并为其提供要渲染的字体等.对于按钮,它继承了标签并添加了一个活动状态来检测变化并导致其他事情发生.滚动条与按钮的工作原理相同,只是更改标签或其他值

Despite this being old, you really don't have to have a gui library for it, you just use sprites. For labels you would take a sprite and give it the font to render and such. For buttons it inherits the label and adds a active state to detect changes and cause something else to happen. And a scroller works the same as a button and just changes a label or something elses value

这篇关于我应该在 Pygame 中使用什么 gui 工具包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆