-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiceAnimation.h
More file actions
44 lines (35 loc) · 819 Bytes
/
DiceAnimation.h
File metadata and controls
44 lines (35 loc) · 819 Bytes
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
#pragma once
#define DICEANIMATION_H
#include<vector>
#include<iostream>
#include<ctime>
#include<cstdlib>
#include<fstream>
#include<sstream>
#include<stack>
#include<map>
#include"SFML\System.hpp"
#include"SFML\Window.hpp"
#include"SFML\Network.hpp"
#include"SFML\Graphics.hpp"
#include"SFML\Audio.hpp"
class DiceAnimation
{
private:
float totalTime;
float switchTime;
sf::Vector2u imageCount;
sf::Vector2u currentImage;
public:
sf::IntRect uvRect;
//Init components
void initVariables();
void initComponents();
void initTextures();
//constructor
DiceAnimation(sf::RectangleShape* texture, sf::Vector2u imageCount, float switchTime);
~DiceAnimation() {}
//functions
void update(const float& dt);
void setFrame(unsigned short pos, const float& dt);
};