-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjingumdari.h
77 lines (64 loc) · 1.38 KB
/
jingumdari.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#ifndef KEY_CODE
#define KEY_CODE
/*기본 함수*/
void init();
void gotoxy(int, int);
void setColor(int, int);
/*함수 선언*/
void drawTitle();
int menuDraw();
int keyControl();
void gloop();
//키보드 값
#define ESC 27
#define ENTER 13
#define UP 72
#define DOWN 80
#define LEFT 75
#define RIGHT 77
#endif
#ifndef __COLOR_LIST_
#define __COLOR_LIST_
enum {
black,
blue,
green,
cyan,
red,
purple,
brown,
lightgray,
darkgray,
lightblue,
lightgreen,
lightcyan,
lightred,
lightpurple,
yellow,
white
};
#endif
void init() {
//system("mode con cols=120 lines=30 | title JingrumdariGame");
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); //콘솔 핸들 가져오기
CONSOLE_CURSOR_INFO ConsoleCursor;
ConsoleCursor.bVisible = 0;
ConsoleCursor.dwSize = 1;
SetConsoleCursorInfo(consoleHandle, &ConsoleCursor);
}
void gotoxy(int x, int y) {
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); //콘솔 핸들 가져오기
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(consoleHandle, pos);
}
//첫번 : 텍스트, 두번 : 배경
void setColor(int forground, int background) {
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); //콘솔 핸들 가져오기
int code = forground + background * 16;
SetConsoleTextAttribute(consoleHandle, code);
}