Ejemplo n.º 1
0
        public AsciiPixel(char c, AsciiColor cc)
        {
            character = c;
            color     = cc;
            bgcolor   = AsciiColor.FromRGB(0, 0, 0);

            updated = true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Set a background color in the screen buffer.
        /// </summary>
        public static void SetBackgroundColor(int x, int y, AsciiColor cc)
        {
            if (IsOnScreen(x, y) == false)
            {
                throw new Exception("Attempt at setting buffer element outside of the buffer size");
            }

            screenBuffer[x, y].SetBackgroundColor(cc);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Set the background color.
 /// </summary>
 public static void SetBackground(AsciiColor cc)
 {
     for (int y = 0; y < screenBuffer.GetLength(1); y++)
     {
         for (int x = 0; x < screenBuffer.GetLength(0); x++)
         {
             screenBuffer[x, y].SetBackgroundColor(cc);
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Set a colored string in the screen buffer.
        /// </summary>
        public static void SetString(int x, int y, string s, AsciiColor cc)
        {
            if (IsOnScreen(x, y) == false)
            {
                throw new Exception("Attempt at setting buffer element outside of the buffer size");
            }
            if (IsOnScreen(x + s.Length, y) == false)
            {
                throw new Exception("Attempt at setting buffer element outside of the buffer size");
            }

            for (int c = 0; c < s.Length; c++)
            {
                screenBuffer[x + c, y].SetChar(s[c]);
                screenBuffer[x + c, y].SetColor(cc);
            }
        }
Ejemplo n.º 5
0
 public void SetBackgroundColor(AsciiColor cc)
 {
     bgcolor = cc; updated = true;
 }
Ejemplo n.º 6
0
 public void SetColor(AsciiColor cc)
 {
     color = cc; updated = true;
 }
Ejemplo n.º 7
0
 internal static void Init(this CellDescription[] image, AsciiColor color)
 {
     for (uint i = 0; i < image.Length; i++)
         image[i] = new CellDescription(' ', color); ;
 }
Ejemplo n.º 8
0
 internal static void Init(this Image image, AsciiColor color)
 {
     for (uint i = 0; i < image.Size; i++)
         image[i] = new CellDescription(' ', color); ;
 }