(self, x, y, width=1, height=1)
return result
Gets a rectangel of map tiles as pixels.

        This is similar to get_rect_tiles() except the tiles are
        extracted from Gfx data and returned as a rectangle of pixels.

        Just like PICO-8, tile ID 0 is rendered as empty (all 0's),
        not the actual tile at ID 0.

        Args:
          x: The map cell x (column) coordinate. (0-127)
          y: The map cell y (row) coordinate. (0-63) If y + height > 31, Map
            must have a Gfx.
          width: The width of the rectangle, as a number of tiles.
          height: The height of the rectangle, as a number of tiles.

        Returns:
          The rectangle of pixels, as a list of bytearrays of pixel colors.
Gets a rectangel of map tiles as pixels.
Gets a rectangel of map tiles as pixels .
def get_rect_pixels(self, x, y, width=1, height=1):
        """Gets a rectangel of map tiles as pixels.

        This is similar to get_rect_tiles() except the tiles are
        extracted from Gfx data and returned as a rectangle of pixels.

        Just like PICO-8, tile ID 0 is rendered as empty (all 0's),
        not the actual tile at ID 0.

        Args:
          x: The map cell x (column) coordinate. (0-127)
          y: The map cell y (row) coordinate. (0-63) If y + height > 31, Map
            must have a Gfx.
          width: The width of the rectangle, as a number of tiles.
          height: The height of the rectangle, as a number of tiles.

        Returns:
          The rectangle of pixels, as a list of bytearrays of pixel colors.

        """
        assert self._gfx is not None
        assert 0 <= x <= 127
        assert 1 <= width
        assert 1 <= height
        assert 0 <= y + height <= 64
        tile_rect = self.get_rect_tiles(x, y, width, height)
        result = []
        for tile_row in tile_rect:
            pixel_row = [bytearray(), bytearray(), bytearray(), bytearray(),
                         bytearray(), bytearray(), bytearray(), bytearray()]
            for id in tile_row:
                if id == 0:
                    sprite = [bytearray(b'\x00' * 8)] * 8
                else:
                    sprite = self._gfx.get_sprite(id)
                for i in range(0, 8):
                    pixel_row[i].extend(sprite[i])
            for i in range(0, 8):
                result.append(pixel_row[i])
        return result
def get_rect_pixels ( self , x , y , width = 1 , height = 1 ) : assert self . _gfx is not None assert 0 <= x <= 127 assert 1 <= width assert 1 <= height assert 0 <= y + height <= 64 tile_rect = self . get_rect_tiles ( x , y , width , height ) result = [ ] for tile_row in tile_rect : pixel_row = [ bytearray ( ) , bytearray ( ) , bytearray ( ) , bytearray ( ) , bytearray ( ) , bytearray ( ) , bytearray ( ) , bytearray ( ) ] for id in tile_row : if id == 0 : sprite = [ bytearray ( b'\x00' * 8 ) ] * 8 else : sprite = self . _gfx . get_sprite ( id ) for i in range ( 0 , 8 ) : pixel_row [ i ] . extend ( sprite [ i ] ) for i in range ( 0 , 8 ) : result . append ( pixel_row [ i ] ) return result