Skip to content

Commit b9805a7

Browse files
Remove the max_size parameter when creating a displayio.Group
Update the requirements.txt Remove deprecated usage of Button.group property. Update audioio.WaveFile to audiocore.WaveFile (Closes #21)
1 parent 03075ac commit b9805a7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

adafruit_pyoa.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from adafruit_cursorcontrol.cursorcontrol_cursormanager import CursorManager
4141
except ImportError:
4242
pass
43+
import audiocore
4344
import audioio
4445
from adafruit_display_text.label import Label
4546
from adafruit_button import Button
@@ -53,13 +54,13 @@ class PYOA_Graphics:
5354
"""A choose your own adventure game framework."""
5455

5556
def __init__(self):
56-
self.root_group = displayio.Group(max_size=15)
57+
self.root_group = displayio.Group()
5758
self._display = board.DISPLAY
58-
self._background_group = displayio.Group(max_size=1)
59+
self._background_group = displayio.Group()
5960
self.root_group.append(self._background_group)
60-
self._text_group = displayio.Group(max_size=1)
61+
self._text_group = displayio.Group()
6162
self.root_group.append(self._text_group)
62-
self._button_group = displayio.Group(max_size=2)
63+
self._button_group = displayio.Group()
6364
self.root_group.append(self._button_group)
6465

6566
if self._display.height > 250:
@@ -203,10 +204,10 @@ def _display_buttons(self, card):
203204
self._right_button.label = button02_text
204205
if button01_text and not button02_text:
205206
# show only middle button
206-
self._button_group.append(self._middle_button.group)
207+
self._button_group.append(self._middle_button)
207208
if button01_text and button02_text:
208-
self._button_group.append(self._right_button.group)
209-
self._button_group.append(self._left_button.group)
209+
self._button_group.append(self._right_button)
210+
self._button_group.append(self._left_button)
210211

211212
def _display_background_for(self, card):
212213
"""If there's a background on card, display it.
@@ -346,7 +347,7 @@ def play_sound(self, filename, *, wait_to_finish=True, loop=False):
346347
except OSError as err:
347348
raise OSError("Could not locate sound file", filename) from err
348349

349-
wavedata = audioio.WaveFile(self._wavfile)
350+
wavedata = audiocore.WaveFile(self._wavfile)
350351
self._speaker_enable.value = True
351352
self.audio.play(wavedata, loop=loop)
352353
if loop or not wait_to_finish:

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: Unlicense
44

5-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
6-
#
7-
# SPDX-License-Identifier: Unlicense
8-
95
Adafruit-Blinka
6+
adafruit-circuitpython-display-button
7+
adafruit-circuitpython-display-text
8+
adafruit-circuitpython-touchscreen

0 commit comments

Comments
 (0)