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
44
asloengine/builtin/text_only_button.cpp
Executable file
44
asloengine/builtin/text_only_button.cpp
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#include "headers/text_only_button.hpp"
|
||||
|
||||
namespace asloengine
|
||||
{
|
||||
|
||||
TextOnlyButton::TextOnlyButton(sf::String _name, sf::String _text, sf::Font& _font, uint _text_size)
|
||||
: TextObject(_name, _text, _font, _text_size), GameObject(_name), Clickable(sf::Mouse::Left) {}
|
||||
|
||||
TextOnlyButton::~TextOnlyButton() {}
|
||||
|
||||
void TextOnlyButton::draw()
|
||||
{
|
||||
|
||||
TextObject::draw();
|
||||
|
||||
}
|
||||
|
||||
void TextOnlyButton::on_main_property_update()
|
||||
{
|
||||
|
||||
TextObject::on_main_property_update();
|
||||
|
||||
update_clickable(text->getGlobalBounds());
|
||||
|
||||
}
|
||||
|
||||
void TextOnlyButton::on_start()
|
||||
{
|
||||
|
||||
set_clickable(text->getGlobalBounds(), render_window);
|
||||
|
||||
}
|
||||
|
||||
void TextOnlyButton::on_update(float delta_time)
|
||||
{
|
||||
|
||||
if (clicked_press_and_release())
|
||||
{
|
||||
signal_on_clicked();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue