我运行项目后没有出现pygame窗口

发布于 2025-02-06 18:55:16 字数 47 浏览 0 评论 0原文

我为我的立方体安装了pygame和OpenGL,但我的问题是立方体永远不会弹出。

I install PyGame and OpenGL to my PyCharm for my cube but my problem is the cube never pop up.

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

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

发布评论

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

评论(1

天生の放荡 2025-02-13 18:55:16

我们将需要一些代码来帮助您。

这是一个基本的清单,您是:

  1. 从图像创建立方体吗?
    1.1。如果是,这个名字正确吗?
    1.2。是否在正确的工作目录中(通过脚本给定路径访问)中的图像?
  2. 用pygame.surface创建立方体?
    2.1。颜色与黑色不同吗?
  3. 您是否拨打屏幕。Blit(your_cube)以复制屏幕表面上的立方体图像/表面?
  4. 您是否打电话给pygame.display.flip()以相应地更新整个显示?
  5. 您有任何屏幕。填充(颜色)吗?
    5.1。如果是的,那是在命中任何东西之前放置吗?否则,您只会闪烁立方体并在此之后擦除

We will need some code to be able to help you.

Here is a basic checklist, did you:

  1. create the cube from an image?
    1.1. If yes, is the name correct?
    1.2. Is the image in the correct working directory (accessible by the script given its path)?
  2. create the cube with pygame.Surface?
    2.1. is the color something different than black?
  3. have you called screen.blit(your_cube) to copy the cube image/surface on the screen's surface?
  4. have you called pygame.display.flip() to update the whole display accordingly?
  5. do you have any screen.fill(color)?
    5.1. if yes, is that placed before blitting anything? Otherwise you would just blit your cube and erase it right after
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文