Skip to content

Commit 4f59a42

Browse files
Remove max_size usage with displayio.Group
Update OnDiskBitmap with filename string usage for CP7
1 parent ddc4f95 commit 4f59a42

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Clue_Step_Counter/clue_step_counter.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,23 @@
5858
clue_display.brightness = 0.5
5959

6060
# graphics group
61-
clueGroup = displayio.Group(max_size=20)
61+
clueGroup = displayio.Group()
6262

6363
# loading bitmap background
64+
# CircuitPython 6 & 7 compatible
6465
clue_bg = displayio.OnDiskBitmap(open(clue_bgBMP, "rb"))
65-
clue_tilegrid = displayio.TileGrid(clue_bg, pixel_shader=getattr(clue_bg, 'pixel_shader', displayio.ColorConverter()))
66+
clue_tilegrid = displayio.TileGrid(
67+
clue_bg, pixel_shader=getattr(clue_bg, 'pixel_shader', displayio.ColorConverter())
68+
)
6669
clueGroup.append(clue_tilegrid)
6770

71+
# # CircuitPython 7+ compatible
72+
# clue_bg = displayio.OnDiskBitmap(clue_bgBMP)
73+
# clue_tilegrid = displayio.TileGrid(clue_bg, pixel_shader=clue_bg.pixel_shader)
74+
# clueGroup.append(clue_tilegrid)
75+
6876
# creating the ProgressBar object
69-
bar_group = displayio.Group(max_size=20)
77+
bar_group = displayio.Group()
7078
prog_bar = ProgressBar(1, 1, 239, 25, bar_color=0x652f8f)
7179
bar_group.append(prog_bar)
7280

0 commit comments

Comments
 (0)