Scrooling控制台游戏窗口 [英] Scrooling Console Game Window

查看:97
本文介绍了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 [<一种href ="http://msdn.microsoft.com/en-us/library/system.console.setcursorposition.aspx" target ="_ blank" title ="New Window"> ^ ]方法,该方法允许垂直滚动,但您必须自己模仿水平滚动.这是一项相当大的工作,很可能根本看起来不会很漂亮.

我不会这样做-而是使用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.


这篇关于Scrooling控制台游戏窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆