-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fader.h
42 lines (36 loc) · 1.11 KB
/
Fader.h
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
#ifndef FADER_H_
#define FADER_H_
#include "entity/Sprite.h"
#include "util/AnimationHelper.h"
using namespace anengine;
class Fader : public Sprite
{
static StaticAsset<VertexBuffer> FaderVertexBuffer;
static StaticAsset<Program> FaderProgram;
virtual void OnDraw(FrameTime elapsed);
virtual void OnNewProgram();
virtual void OnCreate();
virtual void OnPropertyChanged(const PropertyInfo *info, bool implicit);
public:
static PropertyInfo FadingProperty;
Property<real> Fading;
Fader()
: Fading(&FadingProperty, this) { }
virtual ~Fader() { }
virtual AssetRef<VertexBuffer> GetGeometry(AssetManager *manager)
{
return FaderVertexBuffer.Get(manager);
}
};
class FaderAnimationData : public AnimationHelper::AnimationData
{
public:
FaderAnimationData(Fader *animated, real duration, bool reverse,
AnimationHelper::AnimationCurve curve)
: AnimationData(duration, curve), Animated(animated), Reverse(reverse) { }
virtual ~FaderAnimationData() { }
Fader *Animated;
bool Reverse;
virtual void Update(real t);
};
#endif