def METHOD_NAME(self, i):
    """
    Return the image offset (upper-left coord) of the i-th tile,
    where the tiles are ordered row-wise, top to bottom.
    """
    return (i%self.tile_grid[0]*self.tile_size[0],
            i//self.tile_grid[0]*self.tile_size[1])