New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alignment of text #9
Comments
Hi, Would it be possible to give some examples of what you mean? Thanks! |
like Console.WriteLineAligned("hello World!",Color.Red,Align.Center); |
I'm interested. This would be a welcome addition! 👍 |
Thanks for the feedback. I've planned to add alignment as a part of another feature which I'm working on at the moment. Unfortunately, I don't have an ETA (though I warn you that progress is slow due to other commitments), but I will update this thread when I get closer to release! |
For those looking for a simple solution this enables you to write to the console at any position you wish. However, this does not work with the library's ACSII method. Everything moves tot he x and y postion but the top of the ASCII dashes are out of order. If you want plain text this works everywhere in the console window. Please ignore my typewritter function. This function just adds a nice old school sound effect.
|
from msdn:Composite formatting,I can write line with alignment in consol like this: Console.WriteLine($" {123,-10}{"--123",-10}")
Console.WriteLine($" {123456,-10}{"--123",-10}") And in Colorful.Console.WriteLine($" {123,-10}{"--123",-10}")
Colorful.Console.WriteLine($" {123456,-10}{"--123",-10}") But,when I use this Code Colorful.Console.WriteLineFormatted(" {0,-10}--{1,-10}",Color.White,new Colorful.Formatter[]{new Colorful.Formatter(123,Color.Red),new Colorful.Formatter("--123",Color.Aqua)}); ,I will get error: 異常信息:
Input string was not in a correct format.
调用堆栈:
at System.Number.StringToNumber(ReadOnlySpan`1 str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(ReadOnlySpan`1 s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s)
at Colorful.TextFormatter.GetFormatMap(String input, Object[] args, Color[] colors)
at Colorful.Console.WriteInColorFormatted[T](String trailer, T target0, Formatter[] targets, Color defaultColor)
at Colorful.Console.WriteLineFormatted(String format, Color defaultColor, Formatter[] args) can the Colorful.Console support Alignment ? |
Has this been resolved? I still can't use alignments with formatted texts |
wouldn't it be handy if we can align text in console?
The text was updated successfully, but these errors were encountered: