def draw (self, screen, pos, draw_bg = True): rtn = False if ui.Widget.draw(self, screen, pos, draw_bg): draw_bg = False if self.dirty: rtn = True self.dirty = False return combine_drawn(rtn, self.text.draw(screen, pos, draw_bg))
def draw (self, screen, pos, draw_bg = True): # Container doesn't draw its BG, but we want to, so call Widget.draw rtn = False if ui.Widget.draw(self, screen, pos, draw_bg): rtn = True draw_bg = False return combine_drawn(rtn, ui.Container.draw(self, screen, pos, draw_bg))
def draw (self, screen): rtn = False draw_bg = True if self.dirty: self.ui.dirty = True screen.blit(self.game.img('bg.png'), (0, 0)) rtn = True draw_bg = False self.dirty = False return combine_drawn(rtn, self.ui.draw(screen, draw_bg = draw_bg))
def draw (self, screen, pos = (0, 0), draw_bg = True): Widget.draw(self, screen, pos, False) if self.dirty: for p, w in self.widgets: w.dirty = True self.dirty = False ox, oy = pos rtn = [] for (x, y), w in self.widgets: pos = (ox + x, oy + y) this_rtn = w.draw(screen, pos, draw_bg) if this_rtn is True: this_rtn = [Rect(pos, w.size)] rtn.append(this_rtn) return combine_drawn(*rtn)
def draw (self, screen, pos = (0, 0), draw_bg = True): rtn = False if Widget.draw(self, screen, pos, draw_bg): rtn = True draw_bg = False return combine_drawn(rtn, Container.draw(self, screen, pos, draw_bg))