-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpauseScreen.cpp
72 lines (57 loc) · 1.86 KB
/
pauseScreen.cpp
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
#include <graphics.h>
#include <dirent.h>
#include <iostream>
#include <string>
#include <fstream>
#include <Windows.h>
#include <vector>
#include "MusicGame.h"
using namespace std;
int MusicGame::pauseScreen(void *paused, void *pause_back){
void *frame = malloc(imagesize(0, 0, 1440, 900));
getimage(0, 0, 1440, 900, frame);
int cur_page=0;
/*void *paused = malloc(imagesize(0, 0, 1240, 200));
readimagefile( ".\\resources\\paused2.jpg", 200, 350, 1440, 550);
getimage(200, 350, 1440, 550, paused);
void *pause_back = malloc(imagesize(0, 0, 1440, 200));
readimagefile( ".\\resources\\pause_back.jpg", 0, 0, 1440, 200);
getimage(0, 0, 1440, 200, pause_back);*/
for(int i = 0; i <= 10; i++){
cur_page = -cur_page + 1; //0 1 toggle
setactivepage(cur_page);
cleardevice();
putimage(1440-i*144, 350, pause_back, COPY_PUT);
putimage(0, 0, frame, OR_PUT);
putimage(1440-i*144 + 250, 350, paused, COPY_PUT);
Sleep(5);
setvisualpage(cur_page);
}
int clicked = 0;
while(1){
if(GetAsyncKeyState(0x01)!=0){
cout << mousex() << ", " << mousey() << endl;
if(mousex() > 850 && mousex() < 951 && mousey() > 375 && mousey() < 505){
clicked = 1;
}
else if(mousex() > 1050 && mousex() < 1181 && mousey() > 375 && mousey() < 505){
clicked = 2;
}
else if(mousex() > 1250 && mousex() < 1381 && mousey() > 375 && mousey() < 505){
clicked = 3;
}
}
if(clicked) break;
}
for(int i = 10; i >=0; i--){
cur_page = -cur_page + 1; //0 1 toggle
setactivepage(cur_page);
cleardevice();
putimage(1440-i*144, 350, pause_back, COPY_PUT);
putimage(0, 0, frame, OR_PUT);
putimage(1440-i*144 + 250, 350, paused, COPY_PUT);
Sleep(5);
setvisualpage(cur_page);
}
return clicked;
}