Cosmos icon indicating copy to clipboard operation
Cosmos copied to clipboard

cannot set cursor y position

Open cabfile opened this issue 1 year ago • 6 comments

Area of Cosmos - What area of Cosmos are we dealing with?

the console. im trying to put a digital clock in the top right corner

Expected Behaviour - What do you think that should happen?

the clock appears in the top right corner, and is put there right before a Console.ReadLine()

Actual Behaviour - What unexpectedly happens?

the clock appears in the correct x position but above the text/command prompt

Reproduction - How did you get this error to appear?

change the position of the cursor by changing Console.CursorTop or calling Console.SetCursorPosition()

Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?

dev kit, commit 1f3bb52

cabfile avatar Sep 23 '24 19:09 cabfile

can we get a test project

zarlo avatar Sep 24 '24 10:09 zarlo

TestProject.zip

cabfile avatar Sep 24 '24 13:09 cabfile

any progress?

cabfile avatar Sep 29 '24 10:09 cabfile

?

cabfile avatar Oct 15 '24 11:10 cabfile

...?

cabfile avatar Nov 22 '24 13:11 cabfile

...???

cabfile avatar Jan 04 '25 19:01 cabfile

I might be too late and i can't explain it, but this sample works for me:

Console.WriteLine("Printing time. . .");                                               // Just info
string time = DateTime.Now.Hour.ToString() + ':' + DateTime.Now.Minute.ToString();     // Make time string for output
int cols = Cosmos.HAL.Global.TextScreen.Cols;                                          // Get chars count in row
int rows = Cosmos.HAL.Global.TextScreen.Rows;                                          // Get console row count
Console.WriteLine($"{cols}x{rows}");                                                   // Print info
Sys.Global.Console.X = cols - time.Length;                                             // Set console cursor X position
Sys.Global.Console.Y = -1;                                                             // Set console cursor Y position
Console.Write(time);                                                                   // Print our time string

Dimkqo avatar Mar 13 '25 19:03 Dimkqo