Skip to main content
gamedev.net
🔒 Locked

gotoxy function

Started by dk32321 Sep 15, 2005 at 11:09 PM 3 replies 800+ views
Original Post
dk32321
dk32321
I have seen this function before, but is it possible to see it in action.. so i know how to use it, language c++
Drew_Benton
Drew_Benton
Here's an example of that function useage. To find this, I did a google search for "gotoxy".

Note that this is an old DOS function and might not still be a part of todays compilers. I tried to use it in VS7 and it didn't work. So you might need to "create your own" instead. Not to worry though, you can find a complete example that should work right here.
anist
anist
here's some msdn goodness for dealing with consoles. it's not as straightforward as it was in DOS, but you can still set the cursor position and change the text attributes (colors).
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
silverphyre673
silverphyre673
Just so you know, gotoxy isn't a cross-platform function call, like for example printf. This kind of function has to be defined by the operating system, so there isn't a nice header you can include to use it =( Sorry. Anyways, look up MSDN's console functions if you're using windows, or ncurses.h if you are using linux.
my siteGenius is 1% inspiration and 99% perspiration
WhatEver
WhatEver
The function name gotoxy() is a bit missleading for people who want to draw graphics to the screen. If you are one of those people, then prepare to be disapointed, because gotoxy() doesn't take you to the pixel's xy position on the screen, it takes you to the character position on the screen. And like silverphyre673 said, it's not a standard function so you'll probably be needing a Borland compiler to utilize it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.