def draw_str(self, string, coord=(0, 0), color=None): y, x = coord if color is None: fg, bg = Pair.Normal else: fg, bg = color libtcod.console_set_color_control(libtcod.COLCTRL_1, self.color_map[fg], self.color_map[bg]) string = chr(libtcod.COLCTRL_1) + string + chr(libtcod.COLCTRL_STOP) libtcod.console_print(self.win, x, y, string)
def printex(self,x,y,string,color,flush): if color: libtcod.console_set_color_control(libtcod.COLCTRL_1,color,False) libtcod.console_print(self.console,x,y,string) if flush: self.flush()