/// <summary> /// returns gylfh at point given /// </summary> /// <param name="selectedPoint"></param> /// <returns></returns> public Glyph PixelAt(Point selectedPoint) { if (selectedPoint.X > 0 && selectedPoint.X < GlyphBuffer.GetLength(0) && selectedPoint.Y > 0 && selectedPoint.Y < GlyphBuffer.GetLength(1)) { return(GlyphBuffer[selectedPoint.X, selectedPoint.Y]); } else { return(null); } }
//new Draw method, which supports background public void SetPixel(Point selectedPoint, int fgColor, int bgColor, char character) { if (selectedPoint.X >= GlyphBuffer.GetLength(0) || selectedPoint.Y >= GlyphBuffer.GetLength(1) || selectedPoint.X < 0 || selectedPoint.Y < 0) { return; } /*CharBuffer[selectedPoint.X, selectedPoint.Y] = character; * ColorBuffer[selectedPoint.X, selectedPoint.Y] = fgColor; * BackgroundBuffer[selectedPoint.X, selectedPoint.Y] = bgColor;*/ GlyphBuffer[selectedPoint.X, selectedPoint.Y].set(character, fgColor, bgColor); }
/// <summary> Clears the screenbuffer. </summary> public void ClearBuffer() { /*Array.Clear(CharBuffer, 0, CharBuffer.Length); * Array.Clear(ColorBuffer, 0, ColorBuffer.Length); * Array.Clear(BackgroundBuffer, 0, BackgroundBuffer.Length);*/ for (int y = 0; y < GlyphBuffer.GetLength(1); y++) { for (int x = 0; x < GlyphBuffer.GetLength(0); x++) { GlyphBuffer[x, y] = new Glyph(); } } }