當前位置: 首頁>>代碼示例>>Python>>正文


Python Input.main方法代碼示例

本文整理匯總了Python中Input.main方法的典型用法代碼示例。如果您正苦於以下問題:Python Input.main方法的具體用法?Python Input.main怎麽用?Python Input.main使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Input的用法示例。


在下文中一共展示了Input.main方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: tamanho

# 需要導入模塊: import Input [as 別名]
# 或者: from Input import main [as 別名]
def tamanho(tipo_campeonato):
    background = pygame.image.load("Interface/background/number.png")
    
    botao2 = pygame.image.load("Interface/botoes/2eq.png")
    botaoRect = botao2.get_rect()
    botaoRect.x = 310
    botaoRect.y = 140
        
    botao4 = pygame.image.load("Interface/botoes/4eq.png")
    botao4Rect = botao4.get_rect()
    botao4Rect.x = 310
    botao4Rect.y = 240
    
    botao8 = pygame.image.load("Interface/botoes/8eq.png")
    botao8Rect = botao8.get_rect()
    botao8Rect.x = 310
    botao8Rect.y = 340
    
    botao16 = pygame.image.load("Interface/botoes/16eq.png")
    botao16Rect = botao16.get_rect()
    botao16Rect.x = 310
    botao16Rect.y = 440
    
    botao32 = pygame.image.load("Interface/botoes/32eq.png")    
    botao32Rect = botao32.get_rect()
    botao32Rect.x = 310
    botao32Rect.y = 540
    
    
    voltar = pygame.image.load("Interface/botoes/VOLTAR.png")
    botao_VOLTAR_Rect = voltar.get_rect()
    botao_VOLTAR_Rect.x = 575
    botao_VOLTAR_Rect.y = 500
    
    while 1:
        screen.blit(background,(0,0))
        if tipo_campeonato == "mata_mata":
            screen.blit(voltar,(575,500))
            screen.blit(botao2,(310,140))
            screen.blit(botao4,(310,240))
            screen.blit(botao8,(310,340))
            screen.blit(botao16,(310,440))
            screen.blit(botao32,(310,540))
            
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    sys.exit()
                
                if event.type == pygame.MOUSEBUTTONDOWN:
                    pos = pygame.mouse.get_pos()
                    if (botaoRect.collidepoint(pos[0],pos[1])):
                        Input.main(2,tipo_campeonato)
                    if (botao4Rect.collidepoint(pos[0],pos[1])):
                        Input.main(4,tipo_campeonato)
                    if (botao8Rect.collidepoint(pos[0],pos[1])):
                        Input.main(8,tipo_campeonato)
                    if (botao16Rect.collidepoint(pos[0],pos[1])):
                        Input.main(16,tipo_campeonato)
                    if (botao32Rect.collidepoint(pos[0],pos[1])):
                        Input.main(32,tipo_campeonato)
                    if (botao_VOLTAR_Rect.collidepoint(pos[0],pos[1])):
                        selecao_campeonato()
        elif tipo_campeonato == "pontos_corridos":
            screen.blit(voltar,(575,500))
            screen.blit(botao2,(310,140))
            screen.blit(botao4,(310,240))
            screen.blit(botao8,(310,340))
            screen.blit(botao16,(310,440))
            screen.blit(botao32,(310,540))
            
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    sys.exit()
                
                if event.type == pygame.MOUSEBUTTONDOWN:
                    pos = pygame.mouse.get_pos()
                    if (botaoRect.collidepoint(pos[0],pos[1])):
                        Input.main(2,tipo_campeonato)
                    if (botao4Rect.collidepoint(pos[0],pos[1])):
                        Input.main(4,tipo_campeonato)
                    if (botao8Rect.collidepoint(pos[0],pos[1])):
                        Input.main(8,tipo_campeonato)
                    if (botao16Rect.collidepoint(pos[0],pos[1])):
                        Input.main(16,tipo_campeonato)
                    if (botao32Rect.collidepoint(pos[0],pos[1])):
                        Input.main(32,tipo_campeonato)
                    if (botao_VOLTAR_Rect.collidepoint(pos[0],pos[1])):
                        selecao_campeonato()
        elif tipo_campeonato == "3":
            Input.main(4,tipo_campeonato)
            
            
        pygame.display.flip()
開發者ID:MatheusUehara,項目名稱:engenharia-de-software-ufrpe-2014-1,代碼行數:95,代碼來源:MENU.py


注:本文中的Input.main方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。