diff --git a/python_payload/apps/demo_scroll/__init__.py b/python_payload/apps/demo_scroll/__init__.py index 530dd08b91267812dbc62ad5070419f3ca3006b2..b649f7d1bb7f745fd3990079abba8ad90066ee2e 100644 --- a/python_payload/apps/demo_scroll/__init__.py +++ b/python_payload/apps/demo_scroll/__init__.py @@ -4,12 +4,13 @@ import time import math # flow3r imports -from st3m import Ctx, InputState +from st3m import InputState from st3m.application import Application from st3m.property import BLUE, WHITE from st3m.goose import Optional from st3m.utils import xy_from_polar, tau from st3m.ui.interactions import CapScrollController +from ctx import Context class ScrollDemo(Application): @@ -19,7 +20,7 @@ class ScrollDemo(Application): super().__init__(name) self.scroll = CapScrollController() - def draw(self, ctx: Ctx) -> None: + def draw(self, ctx: Context) -> None: ctx.save() ctx.move_to(0, 0) ctx.gray(0) diff --git a/python_payload/apps/demo_worms/__init__.py b/python_payload/apps/demo_worms/__init__.py index 9a462e817be74a807d2d40cec4528782af33ea69..8f73ea532ae8d54f2f15ec557db478eb5b19d0d5 100644 --- a/python_payload/apps/demo_worms/__init__.py +++ b/python_payload/apps/demo_worms/__init__.py @@ -4,12 +4,13 @@ import time import math # flow3r imports -from st3m import Ctx, InputState +from st3m import InputState from st3m.application import Application from st3m.property import BLUE, WHITE from st3m.goose import Optional from st3m.utils import xy_from_polar from st3m.ui.view import ViewManager +from ctx import Context tau = 2 * math.pi @@ -46,7 +47,7 @@ class AppWorms(Application): super().on_enter(vm) self.just_shown = True - def draw(self, ctx: Ctx) -> None: + def draw(self, ctx: Context) -> None: if self.bufn <= 5: # TODO (q3k) bug: we have to do this, otherwise we have horrible blinking @@ -105,7 +106,7 @@ class Worm: # (self.dx,self.dy) = xy_from_polar(1,self.direction) self._lastdist = 0.0 - def draw(self, ctx: Ctx) -> None: + def draw(self, ctx: Context) -> None: ctx.rgb(*self.color) ctx.round_rectangle( self.x - self.size / 2,