本文整理汇总了Python中menu.Menu.disp_special方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.disp_special方法的具体用法?Python Menu.disp_special怎么用?Python Menu.disp_special使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu.Menu
的用法示例。
在下文中一共展示了Menu.disp_special方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_menu
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import disp_special [as 别名]
def init_menu(self):
self.clear_screen()
menu=Menu(("Play!","About","Help","Exit"))
selection=-1
while True:
events=pygame.event.get()
selection=self.menu_action(events,menu)
if selection >= 0:
if selection == 0:
break
if selection == 1:
menu.disp_special(self.about_menu)
if selection == 2:
menu.disp_special(self.help_menu)
if selection == 3:
sys.exit(0)
menu.render()
globalvars.clock.tick(globalvars.FPS)
self.clear_screen()
pygame.mouse.set_visible(0)
pygame.event.set_grab(1)
示例2: exit_menu
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import disp_special [as 别名]
def exit_menu(self,points):
self.clear_screen()
pygame.mouse.set_visible(1)
menu=Menu(("Again?","About","Help","Exit","!Score: %s"%points.get_points()))
selection=-1
while True:
events=pygame.event.get()
selection=self.menu_action(events,menu)
if selection >= 0:
if selection == 0:
break
if selection == 1:
menu.disp_special(self.about_menu)
if selection == 2:
menu.disp_special(self.help_menu)
if selection == 3:
return False
menu.render()
globalvars.clock.tick(globalvars.FPS)
self.clear_screen()
pygame.mouse.set_visible(0)
return True
示例3: pause_menu
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import disp_special [as 别名]
def pause_menu(self,**kwargs):
#self.clear_screen()
pygame.mouse.set_visible(1)
pygame.event.set_grab(0)
menu=Menu(("Resume","About","Help","Exit"),45,globalvars.logo)
selection=-1
while True:
events=pygame.event.get()
selection=self.menu_action(events,menu)
if selection >= 0:
if selection == 0:
break
if selection == 1:
menu.disp_special(self.about_menu)
if selection == 2:
menu.disp_special(self.help_menu)
if selection == 3:
sys.exit(0)
menu.render()
globalvars.clock.tick(globalvars.FPS)
self.clear_screen()
pygame.mouse.set_visible(0)
pygame.event.set_grab(1)