Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions TFT_Gizmo_Snowglobe/snowglobe_fancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
bitmap=displayio.Bitmap,
palette=displayio.Palette)
# Or just use solid color
except (OSError, TypeError):
except (OSError, TypeError, AttributeError):
BACKGROUND = BACKGROUND if isinstance(BACKGROUND, int) else 0x000000
bg_bitmap = displayio.Bitmap(display.width, display.height, 1)
bg_palette = displayio.Palette(1)
Expand All @@ -52,7 +52,7 @@
break
NUM_SPRITES = flake_bitmap.width // FLAKE_WIDTH * flake_bitmap.height // FLAKE_HEIGHT
flake_pos = [0.0] * NUM_FLAKES
flakes = displayio.Group(max_size=NUM_FLAKES)
flakes = displayio.Group()
for _ in range(NUM_FLAKES):
flakes.append(displayio.TileGrid(flake_bitmap, pixel_shader=flake_palette,
width = 1,
Expand Down
4 changes: 2 additions & 2 deletions TFT_Gizmo_Snowglobe/snowglobe_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
bitmap=displayio.Bitmap,
palette=displayio.Palette)
# Or just use solid color
except (OSError, TypeError):
except (OSError, TypeError, AttributeError):
BACKGROUND = BACKGROUND if isinstance(BACKGROUND, int) else 0x000000
bg_bitmap = displayio.Bitmap(display.width, display.height, 1)
bg_palette = displayio.Palette(1)
Expand All @@ -50,7 +50,7 @@
for i, value in enumerate(FLAKES):
flake_sheet[i] = value
flake_pos = [0.0] * NUM_FLAKES
flakes = displayio.Group(max_size=NUM_FLAKES)
flakes = displayio.Group()
for _ in range(NUM_FLAKES):
flakes.append(displayio.TileGrid(flake_sheet, pixel_shader=palette,
width = 1,
Expand Down