Level H Engine
Button.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include "../Maths/Vec2.h"
5 
9 class Button
10 {
11 public:
19  Button(std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos, Vec2 inDim);
20 
27  Button(std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos);
28 
32  ~Button();
33 
38  bool input();
39 
43  void draw();
44 
45 private:
49  bool pressed;
52 };
bool pressed
A boolean for if the button is pressed.
Definition: Button.h:49
std::string buttonSprite
The menu sprite.
Definition: Button.h:47
Contains the Vec2 structure with functions and overloaded operators.
Definition: Vec2.h:8
Button(std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos, Vec2 inDim)
Constructs the Button object.
Definition: Button.cpp:7
Vec2 dim
Definition: Button.h:51
void draw()
Draws the button.
Definition: Button.cpp:50
~Button()
Destructs the Button object.
Definition: Button.cpp:24
std::string buttonHeldSprite
Definition: Button.h:47
Vec2 pos
The button position and dimensions.
Definition: Button.h:51
A State for a button.
Definition: Button.h:9
bool input()
Handles the Button input.
Definition: Button.cpp:28