Lower CPU usage

Screen will not be always updated
This commit is contained in:
Ander
2015-05-19 17:04:47 +02:00
parent 2ee9d41393
commit e98e198224
17 changed files with 325 additions and 174 deletions

View File

@@ -16,8 +16,12 @@ class MenuScreen(BaseScreen):
self.list.set_list(self.list_items)
def update(self, screen):
self.list.render(screen)
def should_update(self):
return self.list.should_update()
def update(self, screen, update_type, rects):
update_all = (update_type == BaseScreen.update_all)
self.list.render(screen, update_all, rects)
def touch_event(self, event):
clicked = self.list.touch_event(event)