Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Передвижение консольного курсора*/
- #include "pch.h"
- #include <iostream>
- #include <conio.h>
- #include <windows.h>
- using namespace std;
- class Draw
- {
- private:
- COORD position;
- HANDLE hConsole;
- public:
- Draw()
- {
- position.X = 0;
- position.Y = 0;
- hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- }
- void set_cursor(int x, int y)
- {
- position.X = x;
- position.Y = y;
- SetConsoleCursorPosition(hConsole, position);
- }
- void Hello()
- {
- cout << "Hello!";
- }
- };
- int main()
- {
- setlocale(LC_ALL, "Russian");
- Draw game;
- game.set_cursor(35, 12);
- game.Hello();
- game.set_cursor(35, 14);
- game.Hello();
- game.set_cursor(35, 17);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement