public AsciiPixel(char c, AsciiColor cc) { character = c; color = cc; bgcolor = AsciiColor.FromRGB(0, 0, 0); updated = true; }
/// <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); }
/// <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); } } }
/// <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); } }
public void SetBackgroundColor(AsciiColor cc) { bgcolor = cc; updated = true; }
public void SetColor(AsciiColor cc) { color = cc; updated = true; }
internal static void Init(this CellDescription[] image, AsciiColor color) { for (uint i = 0; i < image.Length; i++) image[i] = new CellDescription(' ', color); ; }
internal static void Init(this Image image, AsciiColor color) { for (uint i = 0; i < image.Size; i++) image[i] = new CellDescription(' ', color); ; }