generated from mcmarius/oop-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButton.h
41 lines (30 loc) · 794 Bytes
/
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
//
// Created by raduc on 19.04.2023.
//
#ifndef OOP_BUTTON_H
#define OOP_BUTTON_H
//
// Created by raduc on 19.04.2023.
//
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include "Button.h"
#include <iostream>
#include <string>
class Button {
public:
Button();
Button(sf::Vector2f position, sf::Vector2f size, std::string text, int textSize, sf::Color idleColor, sf::Color hoverColor);
~Button() = default;
std::string handleEvent(sf::Event event, sf::RenderWindow& window);
void draw(sf::RenderWindow& window);
void setPosition(sf::Vector2f position);
friend class Button_builder;
private:
sf::RectangleShape m_shape;
sf::Text m_text;
sf::Color m_idleColor;
sf::Color m_hoverColor;
sf::Font m_font;
};
#endif //OOP_BUTTON_H