Added AsloEngine 0.9.0 to Repository
This commit is contained in:
parent
d017dd84b3
commit
881e6c70f2
60 changed files with 2648 additions and 0 deletions
39
asloengine/headers/clickable.hpp
Executable file
39
asloengine/headers/clickable.hpp
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "helpers.hpp"
|
||||
|
||||
namespace asloengine
|
||||
{
|
||||
|
||||
class Clickable
|
||||
{
|
||||
|
||||
public:
|
||||
enum ClickAction
|
||||
{
|
||||
Nothing, Pressed, Released
|
||||
};
|
||||
|
||||
sf::Mouse::Button click_button;
|
||||
|
||||
Clickable(sf::Mouse::Button _click_button);
|
||||
virtual ~Clickable();
|
||||
|
||||
void set_clickable(sf::FloatRect rect, sf::RenderWindow *window);
|
||||
void update_clickable(sf::FloatRect rect);
|
||||
bool is_mouse_in() const;
|
||||
ClickAction get_click_action() const;
|
||||
bool clicked_press() const;
|
||||
bool clicked_release() const;
|
||||
bool clicked_press_and_release() const;
|
||||
|
||||
private:
|
||||
sf::FloatRect clickable_rect;
|
||||
sf::RenderWindow *clickable_window;
|
||||
mutable bool pressed = false;
|
||||
mutable bool clicking = false;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue