From: foamyguy Date: Sat, 14 May 2022 16:31:23 +0000 (-0500) Subject: size properties X-Git-Tag: 0.10.2~2^2~2 X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/commitdiff_plain/d11bd79a7202d5a77327cbb65bce9455ec9f8f30?ds=sidebyside size properties --- diff --git a/displayio/_tilegrid.py b/displayio/_tilegrid.py index 25b0c73..f8d47c9 100644 --- a/displayio/_tilegrid.py +++ b/displayio/_tilegrid.py @@ -408,3 +408,39 @@ class TileGrid: if not 0 <= value <= 255: raise ValueError("Tile value out of bounds") self._tiles[index] = value + + @property + def width(self): + """Width in tiles""" + return self._width + + @width.setter + def width(self, new_width): + self._width = new_width + + @property + def height(self): + """Height in tiles""" + return self._height + + @height.setter + def height(self, new_height): + self._height = new_height + + @property + def tile_width(self): + """Width of each tile in pixels""" + return self._tile_width + + @tile_width.setter + def tile_width(self, new_tile_width): + self._tile_width = new_tile_width + + @property + def tile_height(self): + """Height of each tile in pixels""" + return self._tile_height + + @tile_height.setter + def tile_height(self, new_tile_height): + self._tile_height = new_tile_height