[英]Game console as StringBuilder, String[] or something else?
I'm making an XNA game console which should draw the output lines as they are added. 我正在制作XNA游戏机,该游戏机应在添加输出时绘制输出线。 I want to draw only the last 10 lines and I can't figure out how to produce the actual output string.
我只想画最后10行,我不知道如何产生实际的输出字符串。
I was trying to use StringBuilder
to collect all lines in it and then read the last lines into a String
, but it turns out StringBuilder
doesn't have a specific line retrieval method. 我试图使用
StringBuilder
收集其中的所有行,然后将最后几行读入String
,但是事实证明StringBuilder
没有特定的行检索方法。 I tried using String[]
, but it adds significant lag increasing over time. 我尝试使用
String[]
,但是随着时间的推移,它会增加明显的延迟。 How should I do this? 我应该怎么做?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.