Exemplo n.º 1
0
 public ScreenLine()
 {
     Line = new ScreenChar[MainForm.SCREEN_WIDTH + 1];
     for (int i = 0; i < MainForm.SCREEN_WIDTH + 1; i++)
     {
         Line[i] = new ScreenChar();
     }
 }
Exemplo n.º 2
0
        public void Write(char c, ConsoleColor foreground = ConsoleColor.White)
        {
            if (CursorX >= Width)
            {
                CursorX -= Width; CursorY++;
            }
            if (CursorY >= Height)
            {
                return;
            }

            if (c != ' ')
            {
                var pos = new Point()
                {
                    x = CursorX, y = CursorY
                };
                var scrChar = new ScreenChar()
                {
                    c = c, fg = foreground
                };

                if (FramePoints.ContainsKey(pos))
                {
                    FramePoints[pos] = scrChar;
                }
                else
                {
                    FramePoints.Add(pos, scrChar);
                }
            }

            if (c == '\n')
            {
                CursorY++;
                CursorX = 0;
            }
            else
            {
                CursorX++;
            }
        }