【发布时间】:2014-01-16 23:31:08
【问题描述】:
我正在使用 pygame.image.load 将图片加载到游戏界面:
self.picture = pygame.image.load("some_img.png")
在游戏运行时,可以更改此图像文件(通过一些事件),例如通过按下按钮 y 将 self.picture 中的图片更改为其他图像文件。 我真正需要的是每次都将当前图像文件名加载到self.picture中。
我尝试打印 self.picture 以查看值是什么,但不是图片文件名而是目标代码:
<Surface(30x52x30 SW)>
干杯
【问题讨论】:
标签: oop python-3.x pygame