Logo Search packages:      
Sourcecode: aewan version File versions

def aewan::AeLayer::render (   self,
  wnd,
  dest_x,
  dest_y,
  dest_w,
  dest_h,
  src_x,
  src_y,
  setattr_cb 
)

Render the contents of this layer using curses. The image will
be rendered on the curses window identified by wnd, and will
be confined to the rectangle defined by the dest_* arguments.
The image will be translated in such a way that the left-top
corner of the destination rectangle will show the layer cell
whose coordinates are src_x, src_y.

In order to set curses attributes for each cell, this function
will call setattr_cb passing it the window and the attribute as 
parameters.

Definition at line 122 of file aewan.py.

                         :
      """
      Render the contents of this layer using curses. The image will
      be rendered on the curses window identified by wnd, and will
      be confined to the rectangle defined by the dest_* arguments.
      The image will be translated in such a way that the left-top
      corner of the destination rectangle will show the layer cell
      whose coordinates are src_x, src_y.

      In order to set curses attributes for each cell, this function
      will call setattr_cb passing it the window and the attribute as 
      parameters.
      """
      for y in range(dest_h):
         wnd.move(y + dest_y, dest_x)
         for x in range(dest_w):
            sx = x + src_x
            sy = y + src_y
            if 0 <= sx < self.width and 0 <= sy < self.height:
               ch = self.char[sy][sx]
               if 0 <= ch < 32: ch = 32 # don't display control chars
               # FIXME: this doesn't display special line-graphics
               # characters. Ideally, we should convert special
               # characters into the appropriate ACS_* characters
               # at this point.

               at = self.attr[sy][sx]
            else:
               ch = 0x20
               at = 0x70

            setattr_cb(wnd, at)
            wnd.addch(chr(ch))


# ------------------------------------------------------------------------
def _read_marker(f, str):


Generated by  Doxygen 1.6.0   Back to index