Exemple #1
0
 def init(self, w, h, fs, title='RoguePy Game'):
   self.width = w
   self.height = h
   libtcod.console_set_custom_font(self._font, libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD)
   libtcod.console_set_default_foreground(0, libtcod.white)
   libtcod.console_set_default_background(0, libtcod.black)
   libtcod.console_init_root(w, h, title, fs, self._renderer)
Exemple #2
0
    def setDefaultBackground(self, bg, cascade=False):
        self.bg = bg
        libtcod.console_set_default_background(self.console, bg)
        if cascade:
            for e in self._elements:
                e.setDefaultBackground(bg, True)

        self.setDirty()
Exemple #3
0
 def init(self, w, h, fs):
     self._width = w
     self._height = h
     libtcod.console_set_custom_font(
         self._font, libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD)
     libtcod.console_set_default_foreground(0, libtcod.white)
     libtcod.console_set_default_background(0, libtcod.black)
     libtcod.console_init_root(w, h, b'title', fs, self._renderer)
Exemple #4
0
  def setDefaultBackground(self, bg, cascade=False):
    self.bg = bg
    libtcod.console_set_default_background(self.console,bg)
    if cascade:
      for e in self._elements:
        e.setDefaultBackground(bg, True)

    self.setDirty()
Exemple #5
0
 def renderOverlay(el):
     if not (el.width and el.height):
         return
     con = libtcod.console_new(el.width, el.height)
     libtcod.console_set_default_background(con, libtcod.black)
     libtcod.console_blit(con, 0, 0, el.width, el.height, el.console, 0, 0,
                          0.0, 0.4)
     libtcod.console_delete(con)
Exemple #6
0
  def renderOverlay(el):
    if not (el.width and el.height):
      return
    con = libtcod.console_new(el.width, el.height)
    libtcod.console_set_default_background(con, el.bg)
    libtcod.console_clear(con)
    libtcod.console_blit(con, 0, 0, el.width, el.height, el.console, 0, 0, 0.0, 0.4)
    libtcod.console_delete(con)

    el.setDirty()