Scrooling控制台游戏窗口

Scrooling控制台游戏窗口

问题描述:

大家好,

我要开始另一个项目,一个游戏,但是有一个小问题……我想将地图放大到比实际控制台窗口大的地方,并且我需要一个视图".如果我在其中放置地图的盒子,那么我将移动到地图移动的特定位置,并且它会滚动".我不知道如何滚动,我希望它类似于游戏angband.

hey guys,

i am going to start another project, a game, but there is one small problem...i want to make my map bigger that the actual console window and i need a ''view''. If i make a box with my map inside it, then i move to a particular position the map moves and it ''scrolls''. i don''t know how to do the scroll through, i want it to be similar to the game angband.

我必须说((找到您引用的游戏,从来没有听说过,不要特别想看),您将无法通过C#控制台应用程序获得良好的结果-水平滚动根本不是一件容易的事,而且确实不是.不是为游戏设计的.
您可以在窗口中四处移动,但可以使用 Console.SetCursorPosition [ ^ ]方法,该方法允许垂直滚动,但您必须自己模仿水平滚动.这是一项相当大的工作,很可能根本看起来不会很漂亮.

我不会这样做-而是使用WinForms应用程序,它们非常适合滚动等等.
I have to say that (without trying to find the game you reference, never heard of it, don''t particularly want to look) you aren''t going to get a good result with a C# Console application - horizontal scrolling is not simple at all, and it really isn''t designed for games.
You can move around in the window, but using the Console.SetCursorPosition[^] method, which allows you the vertical scroll, but you will have to emulate the horizontal scroll yourself. Which is a fair amount ot work, and not going to look pretty at all, most likely.

I wouldn''t do it - use a WinForms app instead, they are much, much better suited to scrolling and so forth.