Skip to content

Remove max_size parameter #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2021
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
17 changes: 9 additions & 8 deletions adafruit_pyoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from adafruit_cursorcontrol.cursorcontrol_cursormanager import CursorManager
except ImportError:
pass
import audiocore
import audioio
from adafruit_display_text.label import Label
from adafruit_button import Button
Expand All @@ -53,13 +54,13 @@ class PYOA_Graphics:
"""A choose your own adventure game framework."""

def __init__(self):
self.root_group = displayio.Group(max_size=15)
self.root_group = displayio.Group()
self._display = board.DISPLAY
self._background_group = displayio.Group(max_size=1)
self._background_group = displayio.Group()
self.root_group.append(self._background_group)
self._text_group = displayio.Group(max_size=1)
self._text_group = displayio.Group()
self.root_group.append(self._text_group)
self._button_group = displayio.Group(max_size=2)
self._button_group = displayio.Group()
self.root_group.append(self._button_group)

if self._display.height > 250:
Expand Down Expand Up @@ -203,10 +204,10 @@ def _display_buttons(self, card):
self._right_button.label = button02_text
if button01_text and not button02_text:
# show only middle button
self._button_group.append(self._middle_button.group)
self._button_group.append(self._middle_button)
if button01_text and button02_text:
self._button_group.append(self._right_button.group)
self._button_group.append(self._left_button.group)
self._button_group.append(self._right_button)
self._button_group.append(self._left_button)

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

wavedata = audioio.WaveFile(self._wavfile)
wavedata = audiocore.WaveFile(self._wavfile)
self._speaker_enable.value = True
self.audio.play(wavedata, loop=loop)
if loop or not wait_to_finish:
Expand Down
21 changes: 6 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,23 @@
"sphinx.ext.todo",
]

# TODO: Please Read!
# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
autodoc_mock_imports = [
"rtc",
"supervisor",
"pulseio",
"analogio",
"audiocore",
"audioio",
"displayio",
"neopixel",
"microcontroller",
"adafruit_touchscreen",
"adafruit_bitmap_font",
"adafruit_display_text",
"adafruit_esp32spi",
"secrets",
"adafruit_sdcard",
"neopixel",
"pulseio",
"rtc",
"storage",
"adafruit_io",
"adafruit_button",
"adafruit_cursorcontrol",
"supervisor",
"terminalio",
]


intersphinx_mapping = {
"python": ("https://docs.python.org/3.4", None),
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#
# SPDX-License-Identifier: Unlicense

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

Adafruit-Blinka
adafruit-circuitpython-display-button
adafruit-circuitpython-display-text
adafruit-circuitpython-touchscreen