Beispiel #1
0
  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)
Beispiel #2
0
 def drawItemChar():
   if self.player.item:
     ch = self.player.item.ch
   else:
     ch = " "
   libtcod.console_put_char(self.invItemChar.console, 0, 0, ch)
   self.invItemChar.setDirty(False)
Beispiel #3
0
 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)
Beispiel #4
0
 def drawItemChar():
     if self.player.item:
         ch = self.player.item.ch
     else:
         ch = " "
     libtcod.console_put_char(self.invItemChar.console, 0, 0, ch)
     self.invItemChar.setDirty(False)
Beispiel #5
0
 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)
Beispiel #6
0
    def draw(self):
        for y in range(self.height):
            for x in range(self.width):
                c = self._map.getCell(x + self._offsetX, y + self._offsetY)
                libtcod.console_put_char_ex(self.console, x, y, c.terrain.char,
                                            c.terrain.fg, c.terrain.bg)

                for i in range(len(c.entities)):
                    e = c.entities[i]
                    libtcod.console_put_char(self.console, x, y, e.char)
                    libtcod.console_set_char_foreground(
                        self.console, x, y, e.color)
Beispiel #7
0
 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)
Beispiel #8
0
    def draw(self):
        libtcod.console_put_char(self.console, 0, 0, self._left)
        for x in range(self.sliderWidth):
            libtcod.console_put_char(self.console, x + 1, 0, self._center)
        libtcod.console_put_char(self.console, self.width - 1, 0, self._right)

        sliderPosition = min(self.sliderWidth - 1, self._val / self.valPerChar)
        libtcod.console_put_char(self.console, sliderPosition + 1, 0,
                                 self._bar)
Beispiel #9
0
 def drawMagicOverlay():
   con = self.magicOverlay.console
   onscreenX, onscreenY = self.mapElement.onScreen(self.focusX, self.focusY)
   libtcod.console_put_char(con, onscreenX, onscreenY, '+')
Beispiel #10
0
 def drawMagicOverlay():
     con = self.magicOverlay.console
     onscreenX, onscreenY = self.mapElement.onScreen(
         self.focusX, self.focusY)
     libtcod.console_put_char(con, onscreenX, onscreenY, '+')