tile_grid
– 2D grid of images¶
-
class
codex.tile_grid.
TileGrid
(tiles, map_width, map_height, x=0, y=0, transparent_color=(247, 251, 247), initial_index=0, scale=1)[source]¶ A grid of image tiles.
This object breaks its display area into a number of bitmap tiles. The user changes the display by changing the tile numbers for each cell in the grid.
Create a new TileGrid.
- Parameters
tiles (list[Bitmap]) – The tile pictures available in the grid.
map_width (int) – The number of tiles across the grid.
map_height (int) – The number of tiles down the grid.
x (int, optional) – The x coordinate relative to the parent object. Defaults to 0.
y (int, optional) – The y coordinate relative to the parent object. Defaults to 0.
transparent_color (tuple, optional) – The RGB clear-color value. Defaults to colors.TRANSPARENT.
initial_index (int, optional) – The tile to show in each cell on creation. Default is 0.
scale (int) – Scale factor for all tiles.