-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaid.h
68 lines (48 loc) · 1.37 KB
/
aid.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
/// <- menuDeJeu.h
void aideMenu(int w,int h){
/// counter to select from menu
int counter =0;
/// double buffering screen
BITMAP *menuScreen = create_bitmap(w,h);
/// background image
BITMAP *menuImg = load_bitmap("assets/aide/aide1.bmp",NULL);
/// not exiting till esc is pressed
bool isDone= false;
while(!isDone)
{
/// menu functionlity
if(key[KEY_ESC])
{
isDone=true;
}
/// logic de selection
if(counter>3 )
counter=1;
if(counter<0)
counter=3;
if(key[KEY_RIGHT])
counter++;
if(key[KEY_LEFT])
counter--;
/// anim les screen
switch(counter)
{
case 1:
menuImg = load_bitmap("assets/aide/aide1.bmp",NULL);
break;
default:
menuImg = load_bitmap("assets/aide/aide1.bmp",NULL);
break;
}
///set background image for menu
blit(menuImg,menuScreen,0,0,0,0,w,h);
//texte à afficher dans l'application
textout_ex (menuScreen,font,"Appuyer sur ESC pour retourner",0,h-10,makecol(32,29,240),makecol(109,158,235));
/// double buffering
blit(menuScreen,screen,0,0,0,0,w,h);
///show mouse
show_mouse(screen);
rest (50);
clear_bitmap(menuScreen);
}
}