Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hey guys,

i just thought of a great idea for a game and i want to get started on it right away, the only thing is, i need to be able to scroll left and right. In C# Console, if you write too much to the right, then the text just goes down onto the next line, i want to be able to extend that limit so that it can go past the screen and you need to scroll to see it, but when it reaches a curtain character limit, it goes down onto the next line. Please Help!
Posted
Comments
BillWoodruff 6-Oct-12 22:37pm    
Why do you want to use a Console ? Rather than a Form (WinForms) or a Window (WPF), or some other alternative ?

Please tag your question with more information. Is this XNA based, etc.
Member 8378691 7-Oct-12 2:08am    
well, one of the main reasons that i want to use console is the feel of it. i don't want to have fancy graphics, i just want to keep it simple. i like the feel of the ascii art console games. and another reason is because it is really easy :)

1 solution

The better way of doing this would be to keep a buffer in memory the size of your "board", then just draw the portion of the board that is visible on screen. If you try to do it using the Console API, you'll end up with scroll bars that will be a pain in the ass to work with.

Frankly, you can do this in Windows Forms WITHOUT a console window and have better performance and control. You can draw your text any way you want, preferrably using a mono-spaced font, and you don't have to have any of the "fancy" graphics if you don't want to. Just draw the text where it needs to go.

Oh, the buffering technique works even better in Windows Forms than it does in a console.
 
Share this answer
 
Comments
Member 8378691 8-Oct-12 2:09am    
thanks for this, the reasons that i am not doing this in windows forms is because i am making this game a console game, a console rpg, like angband, and the way that i a making this game isn't as easy on forms than console.
Dave Kreskowiak 8-Oct-12 8:09am    
Hehe. You're going to QUICKLY find just how limited the console can be. The console you see now is not like the old DOS console of decades past. It's just a "simulation" to make it look like the old console.

Good luck!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900