-
Notifications
You must be signed in to change notification settings - Fork 0
/
Button.h
62 lines (60 loc) · 1.12 KB
/
Button.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
#pragma once
#include "SceneManager.h"
#include "SFXManager.h"
enum ButtomState
{
MouseOff,MouseOver,MouseDown
};
class Button :
public GameObject
{
public:
Button(float x, float y, SceneNumber scenenumber,int buttonnum1,float buttonwidth,float buttonheight);
~Button();
virtual void action();
virtual void born()
{
SetSize(1.0);
SetAlive(true);
finishb = true;
};
virtual void death()
{
Contract();
};
virtual void Underattack(){};
virtual bool CanChangeGlobalPos(){ return true; };
virtual bool NeedChangeBlendMode(){ return true; };
virtual int TellType()
{
switch (state)
{
case MouseOff:
return buttonnum;
case MouseOver:
return buttonnum + 1;
case MouseDown:
return buttonnum + 2;
}
};
virtual bool IsSkill(){ return false; };
virtual bool IsBoss(){ return false; };
virtual bool IsItem(){ return false; };
virtual bool AfterBlur()
{
return true;
};
private:
ButtomState state;
int buttonnum;
float width, height;
int count;
bool buttondown;
bool colorreverse;
bool finishchangecolor;
bool finishmove;
int countdelay;
int countalpha;
bool playsound;
bool flag;
};