本文整理汇总了Python中Menu.main_loop方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.main_loop方法的具体用法?Python Menu.main_loop怎么用?Python Menu.main_loop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu.main_loop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: stage_select
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import main_loop [as 别名]
def stage_select():
# Screen
screen = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
ACTUAL_STAGE
#Background
background = pygame.image.load(os.path.join('', 'images', 'menu_bg.jpg'))
background = background.convert()
#Cursor
pygame.mouse.set_visible(False)
cursor = Cursor(16,16,'images/cursor.png')
#Put Here the Stages of the game
stage1 = Option(100,150,250,327,'images/fase1_small.jpg','images/fase1.jpg',stage1_function,1.2,0.05,True)
stage2 = Option(400,400,250,278,'images/fase2.jpg','images/fase2_big.jpg',stage2_function,1.2,0.05,True)
# ...
# Create menu
select_menu = Menu()
select_menu.append(stage1)
select_menu.append(stage2)
# ...
select_menu.main_loop(cursor,screen,background)
示例2: set_credits_menu
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import main_loop [as 别名]
def set_credits_menu():
width = 1024
height = 768
pygame.display.init
menu_screen = pygame.display.set_mode((width,height))
# Background
background = pygame.image.load(os.path.join('', 'images', 'creditos_menu_bg.jpg'))
background = background.convert()
# Cursor
pygame.mouse.set_visible(False)
cursor = Cursor(16,16,'images/cursor.png')
#Options in menu
back = Option(700,645,279,92,'images/voltar.png','images/voltar_big.png',main_menu, 1.182648402,0.05)
# Menu
menu = Menu()
menu.append(back)
menu.main_loop(cursor,menu_screen,background)
示例3: main_menu
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import main_loop [as 别名]
def main_menu():
pygame.display.init
menu_screen = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
# Background
background = pygame.image.load(os.path.join('', 'images', 'menu_bg.jpg'))
background = background.convert()
# Cursor
pygame.mouse.set_visible(False)
cursor = Cursor(16,16,'images/cursor.png')
#Options in menu
new_game = Option(300,250,161,63,'images/jogar.png','images/jogar_big.png',stage_select,1.248,0.05,True)
creditos = Option(290,350,256,87,'images/creditos.png','images/creditos_big.png',set_credits_menu,1.85,0.05,True)
# Menu
main_menu = Menu()
main_menu.append(new_game)
main_menu.append(creditos)
main_menu.main_loop(cursor,menu_screen,background)
示例4: set_game_over_menu
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import main_loop [as 别名]
def set_game_over_menu(function_retry,function_quit=sys.exit):
width = 1024
height = 768
pygame.display.init
menu_screen = pygame.display.set_mode((width,height))
# Background
background = pygame.image.load(os.path.join('', 'images', 'game_over_bg.jpg'))
background = background.convert()
# Cursor
pygame.mouse.set_visible(False)
cursor = Cursor(16,16,'images/cursor.png')
#Options in menu
retry = Option(100,200,550,61,'images/retry.png','images/retry_big.png',function_retry, 1.109,0.05)
quit = Option(100,270,274,60,'images/quit.png','images/quit_big.png',function_quit, 1.11,0.05)
# Menu
menu = Menu()
menu.append(retry)
menu.append(quit)
menu.main_loop(cursor,menu_screen,background)