Skip to content

How to make COSMOS console scrollable in C#? #2592

Answered by ascpixi
fakerybakery asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to make the default VGA console scroll up and down, you'll need to make a console buffer that will hold previous lines. This would be a ring buffer, with its length being equal to the amount of lines you want to store. You can implement this in a multitude of ways, but the most obvious way is a fixed size linked list of character arrays (with their lengths being equal to the text mode width).

Please keep in mind you'll need to handle things such as line wrapping yourself. Whenever you'll want to print a character, just get the last linked list element and set the element at the next character index to the character you want to print. You'll need to redraw the whole console scr…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by zarlo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants