def draw(self): for y in range(self.height): for x in range(self.width): #top row if y == 0: if x == 0: ch = self._chars['tl'] elif x == self.width - 1: ch = self._chars['tr'] else: ch = self._chars['t'] #bottom row elif y == self.height - 1: if x == 0: ch = self._chars['bl'] elif x == self.width - 1: ch = self._chars['br'] else: ch = self._chars['b'] #middle rows else: if x == 0: ch = self._chars['l'] elif x == self.width - 1: ch = self._chars['r'] else: ch = None if ch: libtcod.console_put_char(self.console, x, y, ch) libtcod.console_print(self.console, 1, 0, self._title) self.setDirty(False)
def draw(self): for y in range(self.height): for x in range(self.width): #top row if y == 0: if x == 0: ch = self._chars['tl'] elif x == self.width - 1: ch = self._chars['tr'] else: ch = self._chars['t'] #bottom row elif y == self.height - 1: if x == 0: ch = self._chars['bl'] elif x == self.width - 1: ch = self._chars['br'] else: ch = self._chars['b'] #middle rows else: if x == 0: ch = self._chars['l'] elif x == self.width - 1: ch = self._chars['r'] else: ch = None if ch: libtcod.console_put_char(self.console, x, y, ch) libtcod.console_print(self.console, 1, 0, self._title)
def draw(self): y = 0 for key in self._items: val = self._items[key] libtcod.console_print(self.console, 0, y, key) val = str(val) libtcod.console_print(self.console, self.width - len(val), y, val) y = y + 1
def draw(self): y = 0 for key in self._items: val = self._items[key] libtcod.console_print(self.console, 0, y, key) val = str(val) libtcod.console_print(self.console, self.width - len(val), y, val) y += 1 self.setDirty(False)
def draw(self): for y in range(self.height): index = y + self._offset if index >= len(self._items): continue item = self._items[index] libtcod.console_print(self.console, 0, y, item) if self._offset > 0: libtcod.console_put_char(self.console, self.width - 1, 0, libtcod.CHAR_ARROW_N) if len(self._items) > self._offset + self.height: libtcod.console_put_char(self.console, self.width - 1, self.height - 1, libtcod.CHAR_ARROW_S) self.setDirty(False)
def draw(self): libtcod.console_print(self.console, 0, 0, self._label) self.setDirty(False)
def draw(self): libtcod.console_print(self.console, 0, 0, self._label)