User interface 如何在pygame中blit pgu gui对象

User interface 如何在pygame中blit pgu gui对象,user-interface,pygame,User Interface,Pygame,我有图像。我正在尝试加载一个按钮。我正在使用pygame.image.load函数加载图像。我正在使用pygame的pgu gui库创建一个gui.button。现在我必须在图像上单击此按钮。您将首先在图像上创建一个应用程序容器,然后将该按钮添加到此框架中,如下所示: from pgu import gui my_app = gui.App() my_container = gui.Container(width =1200,height = 900)#or whate

我有图像。我正在尝试加载一个按钮。我正在使用pygame.image.load函数加载图像。我正在使用pygame的pgu gui库创建一个gui.button。现在我必须在图像上单击此按钮。

您将首先在图像上创建一个应用程序容器,然后将该按钮添加到此框架中,如下所示:

    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)'
我希望这有帮助