Added Sprite Coloring and Value Animations
This commit is contained in:
parent
e0e5298c81
commit
0cc5c0badf
11 changed files with 175 additions and 11 deletions
38
asloengine/headers/animation.hpp
Normal file
38
asloengine/headers/animation.hpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include <math.h>
|
||||
#include "helpers.hpp"
|
||||
|
||||
namespace asloengine
|
||||
{
|
||||
|
||||
class Animation
|
||||
{
|
||||
|
||||
public:
|
||||
enum Function
|
||||
{
|
||||
LINEAR, EASE_IN, EASE_OUT, EASE_IN_OUT
|
||||
};
|
||||
|
||||
Animation(Function _function, float _start_value, float _end_value, float _duration);
|
||||
|
||||
void reset(Function _function, float _start_value, float _end_value, float _duration);
|
||||
float animate(float delta_time);
|
||||
|
||||
protected:
|
||||
Function function;
|
||||
float start_value;
|
||||
float current_value;
|
||||
float end_value;
|
||||
float time;
|
||||
float duration;
|
||||
|
||||
float calculate_linear();
|
||||
float calculate_ease_in();
|
||||
float calculate_ease_out();
|
||||
float calculate_ease_in_out();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ namespace asloengine
|
|||
uint resolution_y = 480;
|
||||
uint bit_depth = 24;
|
||||
uint max_framerate = 60;
|
||||
sf::Vector2i window_position = sf::Vector2i(0, 0);
|
||||
bool vsync_enabled = true;
|
||||
bool fullscreen_enabled = false;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ namespace asloengine
|
|||
virtual ~SpriteObject() override;
|
||||
|
||||
void load_texture(sf::Texture& _texture);
|
||||
void set_color(sf::Color& _color);
|
||||
sf::Color get_color() const;
|
||||
virtual void draw() override;
|
||||
virtual void on_main_property_update() override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue