如何在Pygbag中制作全屏模式?

发布于 2025-02-13 11:44:28 字数 247 浏览 0 评论 0原文

当我打开使用Pygbag创建的PyGame HTML页面时,控制台在全屏上打开,而Pygame窗口在角落:(请参见下图)

如何使Pygbag窗口全屏打开?

When I open the pygame html page created with pygbag, the console opens in full screen and the pygame window is in the corner: (see image below)

How can I make the pygbag window open in full screen?

1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心如荒岛 2025-02-20 11:44:28

简短的答案,您不能,没有用户干预的情况下,没有网络浏览器允许您的代码切换到页面加载的全屏。

因此,现在pygbag中的默认值是“全屏窗口”:这样的方式,PyGame屏幕总是在页面内最大化,这似乎是一个不错的权衡。

要获得控制台,只需将#debug添加到URL中,

但是一旦用户与PyGame进行交互,您可以通过Python调用真实的全屏,并使用相同的代码在台式机上使用。

Short answer, you cannot, no web browser will allow your code to switch to fullscreen on page load without user intervention.

So now the default in pygbag is "fullscreen windowed" : that way pygame screen is always maximized inside the page which seems a good trade off.

To get console back, just add #debug to the url

but once user is -already- interacting with pygame, you can call real full screen via python with same code you would use on desktop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文