NWengine 0.9
Loading...
Searching...
No Matches
Animation.h
1#pragma once
2#include <vector>
3#include <string>
4#include "Globals.h"
5#include "Texture.h"
6
10class Animation {
11public:
12 std::vector<Texture*> frames;
13 std::vector<double> durations;
14 bool repeat = false;
21 void AddFrame(Texture* texture, double duration);
22
27 void DeleteFrame(uint16 index);
28
33 void SetLinearDuration(double totalDuration);
34};
The Animation class represents a sequence of frames with durations.
Definition Animation.h:10
void SetLinearDuration(double totalDuration)
Sets the duration of each frame to make the animation linear.
Definition Animation.cpp:3
std::vector< double > durations
Definition Animation.h:13
std::vector< Texture * > frames
Definition Animation.h:12
void AddFrame(Texture *texture, double duration)
Adds a frame to the animation.
Definition Animation.cpp:16
void DeleteFrame(uint16 index)
Deletes a frame from the animation.
Definition Animation.cpp:21
bool repeat
Definition Animation.h:14
Class representing a texture asset.
Definition Texture.h:81