如何指定pygame在何处创建游戏窗口 [英] How to designate where pygame creates the game window

查看:312
本文介绍了如何指定pygame在何处创建游戏窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以控制pygame在何处创建游戏屏幕?它似乎总是在相同的一般区域中创建,而不是在一致的位置中创建.

Is there any way to control where pygame creates the game screen? It seems to always create it in the same general area but not in a consistent location.

推荐答案

客户端应用程序不处理Windows的位置.它由窗口管理器处理(移动性等).

Positioning of windows is not handled by the client application. It's handled by the Window manager (metacity etc.).

PyGame所基于的SDL库确实具有少量环境变量,可用于提供提示.这些是WM可能会忽略的提示,但这是您可以做的最好的事情.

The SDL library on which PyGame is based does have a few environment variables which can be used to give hints to the Window manager. These are hints which the WM may ignore but it's the best you can do.

此处上的评论有一个示例.

The comments over here have an example.

这篇关于如何指定pygame在何处创建游戏窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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