Example #1
0
class UiWin:
    
    def __init__(self, height = 640, weight = 480):
        pygame.init()

        self.screen = pygame.display.set_mode((height,weight),0,32)
        self.canvas = UiCanvas(0,0,height,weight);

        self.animationList = []

    def getAnimationList(self):
        return self.animationList
    
    def setWinName(self,name):
        pygame.display.set_caption(name)

    def getCanvas(self):
        return self.canvas

    def show(self):
        while True:
            self.canvas.draw(self.screen)

            pygame.display.update()

            for action in self.animationList:
                action.play()

            eventList = pygame.event.get()

            for event in eventList:
                self.canvas.eventHandle(event)
                if event.type == QUIT:
                    exit()
Example #2
0
    def __init__(self, height = 640, weight = 480):
        pygame.init()

        self.screen = pygame.display.set_mode((height,weight),0,32)
        self.canvas = UiCanvas(0,0,height,weight);

        self.animationList = []