code: def get_tile_images_by_rect(self, rect):
          
          x1, y1, x2, y2 = rect_to_bb(rect)
          for layer in self.visible_tile_layers:
              for y, x in product(range(y1, y2 + 1),
                                  range(x1, x2 + 1)):
                  tile = self.get_tile_image(x, y, layer)
                  if tile:
                      yield x, y, layer, tile
docs: Given a 2d area, return generator of tile images inside
  
          Given the coordinates, yield the following tuple for each tile:
            X, Y, Layer Number, pygame Surface
  
          This method also defines render order by re arranging the
          positions of each tile as it is yielded to the renderer.
  
          There is an optimization that you can make for your data:
          If you can provide access to tile information in a batch,
          then pyscroll can access data faster and render quicker.
  
          To implement this optimization, override this method.
  
          Not like python 'Range': should include the end index!
  
          :param rect: a rect-like object that defines tiles to draw
          :return: generator