Added Sprite Coloring and Value Animations
This commit is contained in:
parent
e0e5298c81
commit
0cc5c0badf
11 changed files with 175 additions and 11 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#include "framerate_counter.hpp"
|
||||
#include "scroll_view.hpp"
|
||||
#include "grid_container.hpp"
|
||||
#include "../../headers/animation.hpp"
|
||||
|
||||
namespace asloengine
|
||||
{
|
||||
|
|
@ -20,6 +21,7 @@ namespace asloengine
|
|||
|
||||
sf::Texture button_texture;
|
||||
sf::Font button_font;
|
||||
Animation *test_animation;
|
||||
|
||||
void on_load() override;
|
||||
void on_update(float delta_time) override;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace asloengine
|
|||
toif->set_position(200, 300);
|
||||
|
||||
InputField *if1 = new InputField("if_1", sf::Vector2f(200, 30), button_font, button_texture, 30, 20);
|
||||
if1->set_position(100, 420);
|
||||
if1->set_position(0, 420);
|
||||
if1->signal_on_focus.connect_member(to1, &TextObject::set_text, sf::String("gained focus"));
|
||||
if1->signal_on_lost_focus.connect_member(to1, &TextObject::set_text, sf::String("lost focus"));
|
||||
//if1->signal_on_text_changed.connect_member(this, &SceneDefault::on_test);
|
||||
|
|
@ -53,6 +53,8 @@ namespace asloengine
|
|||
//if2->set_position(20, 20);
|
||||
if2->signal_on_focus.connect_member(to1, &TextObject::set_text, sf::String("gained focus"));
|
||||
if2->signal_on_lost_focus.connect_member(to1, &TextObject::set_text, sf::String("lost focus"));
|
||||
sf::Color *test_color = new sf::Color(192, 128, 96, 255);
|
||||
if2->set_color(*test_color);
|
||||
|
||||
/*sc1->objects.emplace_back(if2);
|
||||
|
||||
|
|
@ -73,10 +75,13 @@ namespace asloengine
|
|||
|
||||
|
||||
base_layer.emplace_back(container);
|
||||
base_layer.emplace_back(if1);
|
||||
|
||||
layers.emplace_back(base_layer);
|
||||
fixed_layers.emplace_back(gui_layer);
|
||||
|
||||
test_animation = new Animation(Animation::EASE_IN_OUT, 380, 200, 3);
|
||||
|
||||
}
|
||||
|
||||
void SceneDefault::on_update(float delta_time)
|
||||
|
|
@ -84,6 +89,10 @@ namespace asloengine
|
|||
|
||||
//move_camera(sf::Vector2f(1, 2));
|
||||
|
||||
float value = test_animation->animate(delta_time);
|
||||
|
||||
layers[0][1]->set_position(value, 420);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue