StdPaint.ConsoleBuffer.DrawString C# (CSharp) Method

DrawString() public method

Draws a string to the buffer with the specified alignment.
public DrawString ( int x, int y, Alignment alignment ) : void
x int The X coordinate to start printing at.
y int The Y coordinate to start printing at.
alignment Alignment The alinment to assign to the string.
return void
        public void DrawString(int x, int y, Alignment alignment, params object[] args)
        {
            var color = BufferColor.Gray;
            foreach (var arg in args)
            {
                if (arg is BufferColor)
                {
                    color = (BufferColor)arg;
                }
                else
                {
                    string[] lines = arg.ToString().Split(new[] { '\n' });
                    foreach (string line in lines)
                    {
                        DrawString(x, lines.Length > 1 ? y++ : y, line, color, alignment);
                    }
                }
            }
        }

Same methods

ConsoleBuffer::DrawString ( int x, int y, string text, BufferColor color, Alignment alignment = Alignment.Left ) : void