-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.h
More file actions
45 lines (39 loc) · 660 Bytes
/
Button.h
File metadata and controls
45 lines (39 loc) · 660 Bytes
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
#pragma once
#include <SDL.h>
#include <stdio.h>
#include <random>
#include "Source.h"
class Button
{
public:
Button();
~Button();
int getXPos();
int getYPos();
int getWidth();
int getHeight();
int getDir();
SDL_Color getColor();
SDL_Rect getRect();
bool setColor(SDL_Color color);
bool setPos(int x, int y);
bool setRect(SDL_Rect rect);
bool setDir(int degrees);
bool setActive(bool b);
bool modulateDirection(int degrees);
bool move();
bool isActive();
void goBack();
//void explode();
private:
int mX;
int mY;
int mW;
int mH;
SDL_Color mColor;
int mDir;
bool mActive;
int mPrevX;
int mPrevY;
void _validateDirection();
};