Skip to content
Snippets Groups Projects
Commit 966a2b3a authored by schneider's avatar schneider
Browse files

assets: make them work for the app directory

parent 33d755d4
No related branches found
No related tags found
1 merge request!1assets: make them work for the app directory
......@@ -8,6 +8,11 @@ class NyanCat(Application):
super().__init__(app_ctx)
self.picidx: int = 0;
try:
self.bundle_path = app_ctx.bundle_path
except:
self.bundle_path = "/flash/sys/apps/chubbson-nyan-cat"
def draw(self, ctx: Context) -> None:
# Paint the background black
ctx.rgb(0, 0, 0).rectangle(-120, -120, 240, 240).fill()
......@@ -41,7 +46,7 @@ class NyanCat(Application):
leds.update()
def nextImage(self, ctx: Context):
path = f"/flash/sys/apps/nyan-cat/cbimage{str(self.picidx)}_240.png"
path = f"{self.bundle_path}/cbimage{str(self.picidx)}_240.png"
self.picidx = self.picidx + 1
if self.picidx > 11:
self.picidx = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment