Skip to content

Commit 92c9abb

Browse files
Remove max_size usage with displayio.Group
1 parent ddc4f95 commit 92c9abb

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

CLUE_Rock_Paper_Scissors/advanced/rps_display.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def blankScreen(disp, pix):
7878
if disp is None:
7979
return
8080

81-
disp.show(Group(max_size=1))
81+
disp.show(Group())
8282

8383

8484
class RPSDisplay():
@@ -235,7 +235,7 @@ def showChoice(self,
235235

236236
self.emptyGroup(self.disp_group)
237237
# Would be slightly better to create this Group once and re-use it
238-
round_choice_group = Group(max_size=3)
238+
round_choice_group = Group()
239239

240240
if round_no is not None:
241241
title_dob = Label(self.font,
@@ -261,7 +261,7 @@ def showChoice(self,
261261
gamesum_dob.y = round(self.height - 2 * self.font_height // 2)
262262
round_choice_group.append(gamesum_dob)
263263

264-
s_group = Group(scale=3, max_size=1)
264+
s_group = Group(scale=3)
265265
s_group.x = 32
266266
s_group.y = (self.height - 3 * self.sprite_size) // 2
267267
s_group.append(self.sprites[ch_idx])
@@ -275,7 +275,7 @@ def introductionScreen(self):
275275
"""Introduction screen."""
276276
if self.disp is not None:
277277
self.emptyGroup(self.disp_group)
278-
intro_group = Group(max_size=7)
278+
intro_group = Group()
279279
welcometo_dob = Label(self.font,
280280
text="Welcome To",
281281
scale=3,
@@ -289,7 +289,7 @@ def introductionScreen(self):
289289
spacing = 3 * self.sprite_size + extra_space
290290
y_adj = (-6, -2, -2)
291291
for idx, sprite in enumerate(self.sprites):
292-
s_group = Group(scale=3, max_size=1)
292+
s_group = Group(scale=3)
293293
s_group.x = -96
294294
s_group.y = round((self.height - 1.5 * self.sprite_size) / 2
295295
+ (idx - 1) * spacing) + y_adj[idx]
@@ -384,7 +384,7 @@ def playerListScreen(self):
384384

385385
self.emptyGroup(self.disp_group)
386386
# The two multiplier allows for rssi as separate label
387-
playerlist_group = Group(max_size=self.max_players * 2)
387+
playerlist_group = Group()
388388
self.showGroup(playerlist_group)
389389

390390

@@ -460,7 +460,7 @@ def showGameResultScreen(self, pla, sco, rounds_tot=None):
460460
self.emptyGroup(self.disp_group)
461461

462462
# Score list group + background + question mark for sorting
463-
gs_group = Group(max_size=4)
463+
gs_group = Group()
464464

465465
# Pale grey large GAME SCORES background
466466
bg_scale = 6
@@ -500,7 +500,7 @@ def showGameResultScreen(self, pla, sco, rounds_tot=None):
500500
- len(pla) * scale * self.font_height
501501
- (len(pla) - 1) * spacing) / 2
502502
+ scale * self.font_height / 2)
503-
scores_group = Group(max_size=len(pla))
503+
scores_group = Group()
504504
gs_group.append(scores_group)
505505
for idx, (name, _) in enumerate(pla):
506506
op_dob = Label(self.font,
@@ -648,7 +648,7 @@ def showPlayerVPlayerScreen(self, me_name, op_name, my_ch_idx, op_ch_idx,
648648

649649
if void:
650650
error_tot = 3
651-
error_group = Group(max_size=error_tot + 1)
651+
error_group = Group()
652652
# Opponent's name helps pinpoint the error
653653
op_dob = Label(self.font,
654654
text=op_name,
@@ -677,7 +677,7 @@ def showPlayerVPlayerScreen(self, me_name, op_name, my_ch_idx, op_ch_idx,
677677

678678
else:
679679
# Would be slightly better to create this Group once and re-use it
680-
pvp_group = Group(max_size=3)
680+
pvp_group = Group()
681681

682682
# Add player's name and sprite just off left side of screen
683683
# and opponent's just off right
@@ -696,7 +696,7 @@ def showPlayerVPlayerScreen(self, me_name, op_name, my_ch_idx, op_ch_idx,
696696
for (name, sprite,
697697
start_x,
698698
fg, bg) in player_detail:
699-
s_group = Group(scale=2, max_size=2) # Audio is choppy at scale=3
699+
s_group = Group(scale=2) # Audio is choppy at scale=3
700700
s_group.x = start_x
701701
s_group.y = (self.height - 2 * (self.sprite_size + self.font_height)) // 2
702702

CLUE_Rock_Paper_Scissors/simple/clue-simple-rpsgame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def flashWinner(c_idx, who):
177177

178178
# The 6x14 terminalio classic font
179179
FONT_WIDTH, FONT_HEIGHT = terminalio.FONT.get_bounding_box()
180-
screen_group = Group(max_size=len(choices) * 2 + 1 + 1)
180+
screen_group = Group()
181181

182182
# The position of the two players RPS Label objects inside screen_group
183183
rps_dob_idx = []

0 commit comments

Comments
 (0)