Esempio n. 1
0
def drawWindow(surface, width, height, data):
    font = vpet_data.getFont(data)
    
    clearBackground(surface, width, height)
    
    state = vpet_data.getState(data)
    if state == vpet_data.STATE_HAPPY:
        drawHappy(surface, width, height, font)
    elif state == vpet_data.STATE_ANGRY:
        drawAngry(surface, width, height, font)
    elif state == vpet_data.STATE_SLEEPY:
        drawSleepy(surface, width, height, font)
    elif state == vpet_data.STATE_BORED:
        drawBored(surface, width, height, font)
    elif state == vpet_data.STATE_HUNGRY:
        drawHungry(surface, width, height, font)
    elif state == vpet_data.STATE_DEAD:
        drawDead(surface, width, height, font)
    else:
        # draw nothing
        pass
    
    buttons = vpet_data.getButtons(data)
    for b in buttons:
        drawButton(surface, font, b, state)
        
    return