-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMask.h
More file actions
49 lines (45 loc) · 1.55 KB
/
Mask.h
File metadata and controls
49 lines (45 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef MASK_H
#define MASK_H
#include <SFML/Graphics.hpp>
#include <Thor/Animations.hpp>
#include "MoveAnimation.h"
using namespace sf;
class Mask : public Drawable
{
public:
Mask(Vector2f source, Vector2f destination, Time duration, Vector2f wing_vector, Color color);
void update(Time elapsed);
Vector2f getPosition(short index = 2);
float getProgress() { return this->move.getProgress(); }
void setTailPowerScale(double scale) { this->tail_speed_scale = scale; }
void setBackTexture(const Texture * back_texture, float back_texture_coefficient = 1.f);
void setBodyTexture(const Texture* body_texture, float body_texture_coefficient = 1.f);
void setBodyTextureColor(Color color);
void setBodyShader(Shader* shader) { this->body_shader = shader; }
void reset();
private:
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
void setPosition(Vector2f position);
Vector2f source;
Vector2f movement_vector;
Vector2f wing_vector;
VertexArray vertices;
double tail_speed_scale = 1.0;
VertexArray body; //target for body_texture
Texture* body_texture = nullptr;
float body_texture_coefficient; //affects size of texture on target
VertexArray back; //target for back_texture
Texture* back_texture = nullptr;
float back_texture_coefficient; //affects size of texture on target
Shader* body_shader;
//VertexArray glow;
VertexArray front_glow;
VertexArray back_glow;
VertexArray fill;
VertexArray body_fill;
Color color;
MoveAnimation move;
thor::Animator<Mask, std::string> animator;
friend class MoveAnimation;
};
#endif // !MASK_H