本文整理汇总了Python中Button.Button.add方法的典型用法代码示例。如果您正苦于以下问题:Python Button.add方法的具体用法?Python Button.add怎么用?Python Button.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Button.Button
的用法示例。
在下文中一共展示了Button.add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Button
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import add [as 别名]
# Make a heart
heart = pygame.image.load("images/heart.png").convert_alpha()
start_button = Button(["images/start_0.png","images/start_1.png", "images/start_2.png"],
button_leftalign, button_base_y + button_spacing*0,
1, 0)
highscores_button = Button(["images/high_0.png","images/high_1.png", "images/high_2.png"],
button_leftalign, button_base_y + button_spacing*1,
2, 0)
exit_button = Button(["images/exit_0.png","images/exit_1.png", "images/exit_2.png"],
button_leftalign, button_base_y + button_spacing*2,
3, 0)
back_from_highscores_button = Button(["images/back_0.png", "images/back_1.png", "images/back_2.png"],
500, 400,
0, 2)
start_button.add(menubuttonGroup)
highscores_button.add(menubuttonGroup)
exit_button.add(menubuttonGroup)
back_from_highscores_button.add(highbuttonGroup)
gametype = 0
# Make a menu splash background
menu_bg = pygame.image.load("images/menu_bg.png").convert()
while True:
# --------------------------------------------
# Menu Game Loop
# --------------------------------------------
while gametype == 0:
# --------------------------------------------