From: Melissa LeBlanc-Williams Date: Mon, 16 May 2022 19:02:17 +0000 (-0600) Subject: Merge pull request #90 from FoamyGuy/size_props X-Git-Tag: 0.10.2~2 X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/commitdiff_plain/d8002953e29e7fb5e7c844a2f7c911970d8c6bb5?hp=3089355207bdcb7aa096dde8c10fb9b1a881e645 Merge pull request #90 from FoamyGuy/size_props size properties for TileGrid --- diff --git a/displayio/_tilegrid.py b/displayio/_tilegrid.py index 25b0c73..999ddb2 100644 --- a/displayio/_tilegrid.py +++ b/displayio/_tilegrid.py @@ -408,3 +408,23 @@ class TileGrid: if not 0 <= value <= 255: raise ValueError("Tile value out of bounds") self._tiles[index] = value + + @property + def width(self) -> int: + """Width in tiles""" + return self._width + + @property + def height(self) -> int: + """Height in tiles""" + return self._height + + @property + def tile_width(self) -> int: + """Width of each tile in pixels""" + return self._tile_width + + @property + def tile_height(self) -> int: + """Height of each tile in pixels""" + return self._tile_height