Example #1
0
 /// <summary>
 /// Puts a character on screen at a specific position.
 /// </summary>
 /// <param name="y">Screen Row</param>
 /// <param name="x">Screen Column</param>
 /// <param name="sc">Character to display</param>
 public static void PutChar(int y, int x, ScreenChar sc)
 {
     if (!screenChars [y, x].Equals(sc) && IsPrintable(sc.DisplayChar))
     {
         screenChars [y, x] = sc;
         C.SetCursorPosition(x, y);
         C.ForegroundColor = sc.Foreground;
         C.BackgroundColor = sc.Background;
         C.Write(sc.DisplayChar);
     }
 }
Example #2
0
 /// <summary>
 /// Converts the string to an array of ScreenChar elements.
 /// </summary>
 /// <returns>ScreenChar array</returns>
 public              ScreenChar[] ToCharArray()
 {
     if (DisplayString == null)
     {
         return(null);
     }
     char[]       stringChars = DisplayString.ToCharArray();
     ScreenChar[] arr         = new ScreenChar[stringChars.Length];
     for (int i = 0; i < stringChars.Length; ++i)
     {
         arr [i] = new ScreenChar()
         {
             Foreground  = this.Foreground,
             Background  = this.Background,
             DisplayChar = stringChars[i]
         };
     }
     return(arr);
 }