Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 6-Oct-12 16:26pm
Comments
BillWoodruff at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Member 8378691 at 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 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 499
1 Nirav Prabtani 298
2 OriginalGriff 215
3 _Amy 165
4 Abhinav S 160
0 OriginalGriff 7,715
1 Sergey Alexandrovich Kryukov 6,911
2 Maciej Los 3,954
3 Peter Leow 3,698
4 CHill60 2,742


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 7 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100