NasNas
An intuitive and beginner friendly 2D game framework for C++
include
NasNas
ui
Button.hpp
1
// Created by Modar Nasser on 10/10/2021.
2
3
#pragma once
4
5
#include <SFML/Graphics/Text.hpp>
6
#include <SFML/Graphics/Rect.hpp>
7
#include <SFML/System/Vector2.hpp>
8
9
#include <NasNas/ui/Style.hpp>
10
#include <NasNas/ui/Widget.hpp>
11
12
namespace
ns::ui
{
13
14
class
Button
:
public
StyledWidget
<style::Button>,
public
ClickableWidget
{
15
public
:
16
Button
();
17
18
sf::Text text;
19
20
void
setTextAlign(TextAlign alignement);
21
22
auto
getGlobalBounds()
const
-> sf::FloatRect
override
;
23
auto
contains(
const
sf::Vector2f& pos)
const
->
bool
override
;
24
25
void
draw(sf::RenderTarget& target, sf::RenderStates states)
const override
;
26
};
27
28
}
ns::ui
Definition:
Button.hpp:12
ns::ui::Button
Definition:
Button.hpp:14
ns::ui::StyledWidget
Definition:
Widget.hpp:56
ns::ui::ClickableWidget
Definition:
Widget.hpp:66
Generated by
1.8.13