How can I blit a pgu gui object in pygame

I have image.I am trying to load a button on it.The image I'm loading using pygame.image.load function.I'm using pgu gui library with pygame to create a gui.button.Now I have to blit this button on the image.

Answers


You will first create a app container "over" the image, and then add the button to this frame, like this:

    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)'

I hope this helps.


Need Your Help

How to test tensorflow cifar10 cnn tutorial model

python testing machine-learning tensorflow

I am relatively new to machine-learning and currently have almost no experiencing in developing it.

Where are setters/getters when using YAML/XML mapping for Doctrine in Symfony?

php symfony doctrine-orm doctrine yaml

In Symfony2, when adding mapping information to tell Doctrine how to map my entity to the database, if I use YAML or XML format instead of PHP annotations, how/where do I write getters/setters/other