chrisalviola
- 80
- 0
Is there a way I can write characters or numbers anywhere on the screen in C++ like the ones used in pascal like gotoxy where I simply write screen coordinates as x & y.
This discussion focuses on positioning characters on the screen in C++ using the gotoxy function, similar to Pascal. Standard C++ lacks built-in graphics functions, necessitating the use of external libraries such as ncurses for Unix systems or Windows-specific functions like SetConsoleCursorPosition. For GUI applications, the Qt framework is recommended for its robust event handling and cross-platform capabilities, allowing developers to position text using QTextEdit or QPainter. The Borland compiler also supports gotoxy through conio.h, providing an alternative for those using that environment.
PREREQUISITESDevelopers working with C++ who need to position text on the screen, including game developers, GUI application developers, and those transitioning from Pascal to C++. This discussion is particularly beneficial for those using Windows or Unix systems.
mgb_phys said:Under unix there is a library called curses (or ncurses in newer versions) to do printing effects on a character terminal.
Under a GUI it would depend on what platform but most have the ability to write text at a particular coordinate in a window, or you could use something like OpenGL.