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

查看:224
本文介绍了如何指定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.

推荐答案

窗口的定位不是由客户端应用程序处理的.它由窗口管理器(metacity 等)处理.

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.

此处的评论有一个例子.

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

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