def draw(self): font = pygame.font.Font(self.fontname, 72) self.surface.fill((0, 0, 255)) render(font, text['wpl0'], surface=self.surface, topleft=(0, 0)) render(font, text['wpl8'], surface=self.surface, topleft=(0, 72)) render(font, text['wpl9'], surface=self.surface, topleft=(0, 144)) for x in boundary(self.screen.ppl, 1120, 800): for i in range(self.screen.wpl): pygame.draw.line(self.surface, (255, 255, 255), (int(x + i), 100), (int(x + i), 980))
def draw(self): font = pygame.font.Font(self.fontname, 72) self.surface.fill(0) render(font, text['ppl0'], surface=self.surface, topleft=(0, 0)) render(font, text['ppl2'] % self.step, surface=self.surface, topleft=(0, 72)) render(font, text['ppl3'] % self.screen.ppl, surface=self.surface, topleft=(0, 144)) render(font, text['ppl7'], surface=self.surface, topleft=(0, 216)) render(font, text['ppl8'], surface=self.surface, topleft=(0, 288)) render(font, text['ppl9'], surface=self.surface, topleft=(0, 360)) for x in boundary(self.screen.ppl, self.surface.get_width()): pygame.draw.line(self.surface, (0, 255, 0), (x, 100), (x, 980))
def draw(self): self.surface.fill(0) begin = int((self.sub_window.position[0] - self.screen['offset']) / self.screen['period'] % 1. * self.screen['ppl']) for x in boundary(self.screen['ppl'], 1120, 800): for i in range(begin, begin + self.screen['wpl']): pygame.draw.line(self.surface, (0, 255, 0), (x + i, 100), (x + i, 980)) # for i in range(self.screen.offset + self.screen.wpl, self.screen.offset + self.screen.wpl * 2): # pygame.draw.line(self.surface, (0, 0, 255), (x + i, 100), (x + i, 980)) self.sub_window.draw()
def transform(surface, screen): result = surface.copy() if not hasattr(screen, 'ppl'): return result for x in boundary(screen.ppl, surface.get_width()): for y in range(surface.get_height()): colors = [ surface.get_at((x + i, y)) for i in range(int(screen.ppl)) ] average = tuple(map(lambda l: sum(l) // len(l), zip(*colors))) for i in range(int(screen.ppl)): result.set_at((x + i, y), average) return result
def draw(self): font = pygame.font.Font(self.fontname, 72) self.surface.fill(0) render(font, text['offset0'], surface=self.surface, topleft=(0, 0)) render(font, text['offset1'], surface=self.surface, topleft=(0, 72)) render(font, text['offset2'], surface=self.surface, topleft=(0, 144)) render(font, text['offset9'], surface=self.surface, topleft=(0, 216)) for x in boundary(self.screen.ppl, 1120, 800): for i in range(self.screen.wpl): pygame.draw.line(self.surface, (0, 255, 0), (x + i, 100), (x + i, 980)) # for i in range(self.screen.offset + self.screen.wpl, self.screen.offset + self.screen.wpl * 2): # pygame.draw.line(self.surface, (0, 0, 255), (x + i, 100), (x + i, 980)) self.sub_window.draw()