def draw(self, screen): """ Drawing method called by C{BoomBoomDrawer} @param screen: Offscreen to draw in. @type screen: C{L{Window<bb_drawer.Window>}} """ if self.color == None: self.color = random.randint(0, 6) x, y = convertXY(screen, int(self.x), int(self.y)) w, h = convertXY(screen, int(self.width), int(self.height)) for line in range(y, y + h): screen.addstr(line, x, "#" * w, curses.color_pair(self.color))
def draw(self, screen): """ Drawing method called by C{BoomBoomDrawer} @param screen: Offscreen to draw in. @type screen: C{L{Window<bb_drawer.Window>}} """ if self.color == None: self.color = random.randint(0, 6) x, y = convertXY(screen, int(self.x), int(self.y)) w, h = convertXY(screen, int(self.width), int(self.height)) for line in range(y, y+h): screen.addstr(line, x, "#" * w, curses.color_pair(self.color))
def draw(self, screen): if not self.display: return maxy, maxx = screen.getmaxyx() x, y = convertXY(screen, int(self.x), int(self.y)) if x < 0 or maxx <= x: return if y < 0 or maxy <= y: return screen.addstr(y,x,")"+" "*maxx, curses.color_pair(curses.COLOR_YELLOW))
def draw(self, screen): if not self.display: return maxy, maxx = screen.getmaxyx() x, y = convertXY(screen, int(self.x), int(self.y)) if x < 0 or maxx <= x: return if y < 0 or maxy <= y: return screen.addstr(y, x, ")" + " " * maxx, curses.color_pair(curses.COLOR_YELLOW))
def draw(self, screen): """ Drawing method called by C{BoomBoomDrawer} @param screen: Offscreen to draw in. @type screen: C{L{Window<bb_drawer.Window>}} """ if self.__angle == None: return if self.__strength == None: return if self.x == None: return maxy,maxx = screen.getmaxyx() x, y = convertXY(screen, self.x, self.y) if x < maxx/2: x = 1 else: x = maxx - 20 y = 1 txt = "Angle: %s" % self.__angle screen.addstr(y, x, txt) txt = "Strength: %s" % self.__strength screen.addstr(y+1, x, txt)
def draw(self, screen): if self.x == None: return x, y = convertXY(screen, int(self.x), int(self.y)) screen.addstr(y, x, "oo") screen.addstr(y+1, x-1, "(ww)"+" "*screen.getmaxyx()[1])