예제 #1
0
    def repaint_tile(self, type):
        # fetch info tuple
        self.info_tuple = wd.TILE_LIB[type]

        framecount = self.info_tuple[3]
        self.images = [None for i in range(framecount)]
        # create blank image array of appropriate length
        for x in range(framecount):
            self.images[x] = tk.PhotoImage(file=m_c.tile_image(self.info_tuple[1] + str(x)))

        self.my_canvas.itemconfig(self.name, image=self.images[0])

        if framecount > 1:
            self.register_object()
            self.tick_til = self.info_tuple[4]
            # register for animation if frame count exceeds 1
        else:
            self.unregister_object()
예제 #2
0
    def create_tile(self, type):

        # fetch info tuple
        self.info_tuple = wd.TILE_LIB[type]
        # info tuple[0]: display name, [2]: display info
        # [1]: file name
        # [3]: total frames, [4]: tick interval
        framecount = self.info_tuple[3]
        self.images = [None for i in range(framecount)]
        # create blank image array of appropriate length
        for x in range(framecount):
            self.images[x] = tk.PhotoImage(file=m_c.tile_image(self.info_tuple[1] + str(x)))

        self.my_canvas.create_image(self.x * 50, self.y * 50, anchor="nw", image=self.images[0], tag=self.name)

        if framecount > 1:
            self.register_object()
            self.tick_til = self.info_tuple[4]