コード例 #1
0
ファイル: pygamecore.py プロジェクト: aquach/volt
def choiceBox(message, choices):
    """Wrapper choice dialog generator. Returns the index of the chosen
    value."""
    c = pygame.ChoiceBoxDef()
    c.text = message
    c.choices = pygame.StringVector(choices)
    choice = disown(pygame.ChoiceBox(c))
    pygame.scene().ShowDialogBox(choice)
    return choice.WaitForChoice()
コード例 #2
0
ファイル: pygamecore.py プロジェクト: aquach/volt
def messageBox(message, wait=False, modal=True, canSkip=True,
               pauseDuration=1.0):
    """Wrapper message box generator."""
    b = pygame.MessageBoxDef()
    b.text = message
    b.pauseDuration = pauseDuration
    b.modal = modal
    b.canSkip = canSkip
    
    box = disown(pygame.MessageBox(b))
    pygame.scene().ShowDialogBox(box)
    if wait:
        box.WaitForFinish()