Пример #1
0
  def __init__(self, x, y, w, h):
    self.x = x
    self.y = y
    self.width = w
    self.height = h

    self.visible = True
    self.enabled = True

    self.setDirty(True)

    self.console = libtcod.console_new(w, h)

    self.setDefaultColors()
    self.clear()

    self._elements = []
    self._inputs = {}

    self.fgOpacity = 1
    self.bgOpacity = 1
    self.parent = None

    self.fg = libtcod.white
    self.bg = libtcod.black

    self.bgFlag = libtcod.BKGND_SET
Пример #2
0
 def setLabel(self, label):
     self._label = label
     if self.width != len(self._label):
         self.width = len(self._label)
         # TODO This is not subject to constraint by the parent element, and can therefore spill outside its parent.
         # TODO investigate / fix segfault when calling libtcod.console_delete(self.console)
         self.console = libtcod.console_new(len(self._label), 1)
Пример #3
0
    def __init__(self, x, y, w, h):
        self.x = x
        self.y = y
        self.width = w
        self.height = h

        self.visible = True
        self.enabled = True

        self.setDirty(True)

        self.console = libtcod.console_new(w, h)

        self.setDefaultColors()
        self.clear()

        self._elements = []
        self._inputs = {}

        self.fgOpacity = 1
        self.bgOpacity = 1
        self.parent = None

        self.fg = libtcod.white
        self.bg = libtcod.black

        self.bgFlag = libtcod.BKGND_SET
Пример #4
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)
Пример #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, 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()
Пример #6
0
  def setLabel(self, label):
    if self._label == label:
      pass

    self._label = label
    self.setDirty()

    if self.width != len(self._label):
      self.width = len(self._label)
      # TODO This is not subject to constraint by the parent element, and can therefore spill outside its parent.
      # TODO investigate / fix segfault when calling libtcod.console_delete(self.console)
      self.console = libtcod.console_new(len(self._label), 1)
      self.setDefaultColors(self.fg, self.bg)
Пример #7
0
    def __init__(self, ui):
        self.x = 0
        self.y = 0
        self.width = ui.getWidth()
        self.height = ui.getHeight()

        self._elements = []
        self._inputs = {}

        self._storedEnabled = None

        self.console = libtcod.console_new(self.width, self.height)
        self.inputsEnabled = True
        self.fg = libtcod.white
        self.bg = libtcod.black
Пример #8
0
    def __init__(self, w, h, x=0, y=0):

        self.width = w
        self.height = h
        self.x = x
        self.y = y

        self.setDirty(True)

        self._elements = []
        self._inputs = {}

        self._storedEnabled = None

        self.console = libtcod.console_new(self.width, self.height)
        self.inputsEnabled = True
        self.fg = libtcod.white
        self.bg = libtcod.black
Пример #9
0
  def __init__(self, w, h, x=0, y=0 ):

    self.width = w
    self.height = h
    self.x = x
    self.y = y

    self.setDirty(True)

    self._elements = []
    self._inputs = {}
    
    self._storedEnabled = None
    
    self.console = libtcod.console_new(self.width, self.height)
    self.inputsEnabled = True
    self.fg = libtcod.white
    self.bg = libtcod.black
Пример #10
0
 def __init__(self, x, y, w, h):
   print "attack overlay created"
   super(AttackOverlay, self).__init__(x, y, w, h)
   self.bgOpacity = 0;
   self.explConsole = libtcod.console_new(w, h)