Skip to content

Commit d5db09a

Browse files
authored
Merge pull request #24 from lesamouraipourpre/ondiskbitmap-changes
Update the pixel_shader usage of OnDiskBitmap
2 parents 2c3c937 + 8724471 commit d5db09a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

adafruit_pyoa.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,14 @@ def set_background(self, filename, *, with_fade=True):
406406
self._background_file = open(self._gamedirectory + "/" + filename, "rb")
407407
background = displayio.OnDiskBitmap(self._background_file)
408408
self._background_sprite = displayio.TileGrid(
409-
background, pixel_shader=displayio.ColorConverter(), x=0, y=0
409+
background,
410+
pixel_shader=getattr(
411+
background, "pixel_shader", displayio.ColorConverter()
412+
),
413+
# TODO: Once CP6 is no longer supported, replace the above line with below
414+
# pixel_shader=background.pixel_shader,
415+
x=0,
416+
y=0,
410417
)
411418
self._background_group.append(self._background_sprite)
412419
if with_fade:

0 commit comments

Comments
 (0)