I have image.I am tr开发者_如何转开发ying 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.
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.
精彩评论