Ejemplo n.º 1
0
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()
Ejemplo n.º 2
0
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()