-
Disable scrolling?
I'm making a pritty short game, but the console keeps auto-scrolling down. The othe thing is that its turned based, so users can scroll down at will. Is there any way to disable this scrolling?
(WinXP Borland C++ Free Command Line Compiler)
[Edit] To avoid making two posts, does anyone know how to get text from a particular line, or all text in the console currently?
Thank you in advance.
-
Well, I'm still working on my console game, but its save funcion is messed up. It should write the visible map to a file, but when it writes it, it doesnt write it like what the map looks like.
Only problem is that there are two squares that always come up at the very start of the writing... I cant figure out why?
Anyone?
Code:
void Save() {
COORD Pos;
HANDLE hOt = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD reader;
char buffer[2027];
char DELO[1];
int x_pos, y_pos;
SHORT bc;
ofstream file_out(MAINPATHNAME);
if(!file_out) {
clrscr();
cout << "Unable to open file!";
}
for(y_pos=0; y_pos <= 24; y_pos++)
for(x_pos=0; x_pos <= 80; x_pos++){
bc++;
Pos.X = x_pos;
Pos.Y = y_pos;
ReadConsoleOutputCharacter(hOt, &DELO[0], 1, Pos, &reader);
if(x_pos == 80) {
buffer[bc] = 'W';
} else
buffer[bc] = DELO[0];
}
for(bc=0; bc < 2027; bc++) {
if(buffer[bc] == 'W')
file_out << endl;
else
file_out << buffer[bc];
}
file_out.close();
clrscr();
exit(0);
}