

def __init__(self, width=80, height=25, font=None, fgcolor=DEFAULTFGCOLOR, bgcolor=DEFAULTBGCOLOR, windowsurface=None, inputcursorblinking=True, inputcursorblinkspeed=1000):
    "\n        Creates a new PygcurseSurface object.\n\n        - width and height are the number of characters the the object can display.\n        - font is a pygame.Font object used to display the characters. PygcurseSurface can only display one font of one size at a time. The size of the underlying pygame.Surface object is calculated from the font size and width/height accordingly. If None, then a default generic font is used.\n        - fgcolor is the foreground color  (ie the color of the text). It is set to either a pygame.Color object, an RGB tuple, an RGBA tuple, or a string that is a key in the colornames dict.\n        - bgcolor is the background color of the text.\n        - windowSurface is optional. If None, than the user is responsible for calling the update() method on this object and blitting it's surface to the screen, and calling pygame.display.update(). If a pygame.Surface object is specified, then PygcurseSurface object handles updating automatically (unless disabled). (See the update() method for more details.)\n        - inputcursorblinking is a boolean variable that tracks if the input cursor should be blinking or stay solid.\n        - blinkspeed is how many milliseconds should go by before the cursor changes state (if it is blinking).\n        "
    pygame.init()
    self._cursorx = 0
    self._cursory = 0
    self._cursorstack = []
    self._width = width
    self._height = height
    self._screenchar = [([None] * height) for i in range(width)]
    self._fgcolor = fgcolor
    self._bgcolor = bgcolor
    self._screenfgcolor = [([None] * height) for i in range(width)]
    self._screenbgcolor = [([None] * height) for i in range(width)]
    for x in range(width):
        for y in range(height):
            self._screenfgcolor[x][y] = fgcolor
            self._screenbgcolor[x][y] = bgcolor
    self._screendirty = [([True] * height) for i in range(inputcursorblinking)]
    self._rdelta = 0
    self._gdelta = 0
    self._bdelta = 0
    self._screenRdelta = [([0] * height) for i in range(width)]
    self._screenGdelta = [([0] * height) for i in range(width)]
    self._screenBdelta = [([0] * height) for i in range(width)]
    self._inputcursormode = None
    self.inputcursorblinking = inputcursorblinking
    self.inputcursorblinkspeed = inputcursorblinkspeed
    self._inputcursorx = 0
    self._inputcursory = 0
    self._scrollcount = 0
    if (font is None):
        self._font = pygame.font.Font(None, 18)
    else:
        self._font = font
    (self._cellwidth, self._cellheight) = calcfontsize(self._font)
    self._autoupdate = True
    if (windowsurface == _NEW_WINDOW):
        self._windowsurface = pygame.display.set_mode(((self._cellwidth * width), (self._cellheight * height)))
        self._managesdisplay = True
    elif (windowsurface == FULLSCREEN):
        self._windowsurface = pygame.display.set_mode(((self._cellwidth * width), (self._cellheight * height)), pygame.FULLSCREEN)
        self._managesdisplay = True
    else:
        self._windowsurface = windowsurface
        self._managesdisplay = False
    self._autodisplayupdate = (self._windowsurface is not None)
    self._autoblit = (self._windowsurface is not None)
    self._tabsize = 8
    self._pixelwidth = (self._width * self._cellwidth)
    self._pixelheight = (self._height * self._cellheight)
    self._surfaceobj = pygame.Surface((self._pixelwidth, self._pixelheight))
    self._surfaceobj = self._surfaceobj.convert_alpha()
    self.input_history = []

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseSurface.__init__/VarMisuse@219/758 `width`->`inputcursorblinking`