-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenu.cpp
79 lines (70 loc) · 1.77 KB
/
Menu.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
73
74
75
76
77
78
79
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <bits/stdc++.h>
#include <FL/Fl_Box.H>
#include <FL/Fl_JPEG_Image.H>
//#include "Common.cpp"
using namespace std;
//void Snake_Game(){}
//void Infinite_Runner(){}
int Tic_Tac_Toe();
int Flappy_UFO();
class Button_For_Snake: public Fl_Button{
public:
Button_For_Snake(int x,int y,int w,int h,const char* l): Fl_Button(x,y,w,h,l){}
int handle(int e);
};
int Button_For_Snake:: handle(int e){
if (e==FL_PUSH){
//Snake_Game();
}
return 0;
}
class Button_For_IR: public Fl_Button{
public :
Button_For_IR(int x,int y,int w,int h,const char* l): Fl_Button(x,y,w,h,l){}
int handle(int e);
};
int Button_For_IR:: handle(int e){
if (e==FL_PUSH){
//Infinite_Runner();
}
return 0;
}
class Button_For_FB: public Fl_Button{
public:
Button_For_FB(int x,int y,int w,int h,const char* l): Fl_Button(x,y,w,h,l){}
int handle(int e);
};
int Button_For_FB:: handle(int e){
if (e==FL_PUSH){
Flappy_UFO();
}
return 0;
}
class Menu{
private:
Fl_Button* menutext;
Button_For_Snake* option1;
Button_For_IR* option2;
Button_For_FB* option3;
Fl_Box* box;
Fl_JPEG_Image* backimg;
//Fl_JPEG_Image* IRImg;
//Fl_JPEG_Image* SnakeImg;
public:
void initMenu();
};
void Menu:: initMenu(){
box= new Fl_Box(0,0,800,800);
backimg=new Fl_JPEG_Image("retro.jpg");
box->image(backimg);
//IRImg= new Fl_JPEG_Image("IR.jpg");
option2= new Button_For_IR(150,500,200,100,"Mario Infinite Runner");
//option2->image(IRImg);
//option2->label("Mario Infinite Runner");
option1= new Button_For_Snake(450,500,200,100,"Snake Game");
menutext= new Fl_Button(200,200,400,100,"Welcome to our Arcade Machine");
option3= new Button_For_FB(300,620,200,100,"Flappy UFO");
}