我有一个图像。我正在尝试加载一个按钮在it.The图像上,我正在使用pygame.image.load函数加载。我正在使用pgu gui库和pygame来创建一个gui.button.Now,我必须在图像上点击这个按钮。
发布于 2010-12-19 22:17:14
您将首先在图像上创建一个应用程序容器,然后将按钮添加到此框架中,如下所示:
from pgu import gui
my_app = gui.App()
my_container = gui.Container(width =1200,height = 900)#or whatever width, height you wish
my_button = gui.Button("Quit")
app.connect(gui.QUIT,app.quit,None)
##The button CLICK event is connected to the app.close method.
my_button.connect(gui.CLICK,app.quit,None)
my_container.add(my_button,100,100)'我希望这能帮到你。
https://stackoverflow.com/questions/2613878
复制相似问题