Archived

This topic is now archived and is closed to further replies.

Screenbuffer - help

This topic is 5274 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi... i'm working on this tamagotchi-like game on c++ and i'm having trouble positioning my text on the screen. i read the one tutorial at gametutorials.com about screenbuffering and that's the way i'm displaying my ascii art creature on the screen. that seems to be working pretty good, except that the rectangle i draw with my creature (the ascii art in the buffer) inside, goes over my menu. i can move the rectangle down, so that i don't draw over my menu, but i want the text to be down on the bottom of the screen (get it?) so here's my question: how do print text on the screen, starting half way down? (0, 50) thanks!

Share this post


Link to post
Share on other sites
AHHHHHHHHH!!!!! Tomagachies!!!!!!!
**TheFiend runs away screaming that the world has come to an end**



-- M I S F I T S --

[edited by - TheFiend on July 5, 2003 12:04:20 AM]

Share this post


Link to post
Share on other sites
just the console. i''m just displaying text, really... (in the form of ascii art)
that (the ''graphics'') i can position wherever i want, but i can''t move the text ( cout << "Welcome!"; ) half way down the screen...

Share this post


Link to post
Share on other sites
ahhhahahah...im odin the same sorta thing...only like a counter-strike rpg thing... but anyways.....the best way i can think of would be to do cout<<"\n\n\n\n\n\n Welcome."; i think we call that brute force.....but im new to this...it should do for now tho

Share this post


Link to post
Share on other sites
thanks! I got it (looked up SetConsoleCursorPosition at msdn...)
and by the way, Ademan, try this function instead (it works better than the 'brute force' method):

void setPosition(short x, short y){

HANDLE HndoutPut = GetStdHandle(STD_OUTPUT_HANDLE);
COORD position = { x, y};

SetConsoleCursorPosition(HndoutPut, position);

}


thanks again!


[edited by - pimple on July 7, 2003 1:56:45 AM]

Share this post


Link to post
Share on other sites