-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathofxSprite.h
62 lines (51 loc) · 1.33 KB
/
ofxSprite.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "ofMain.h"
#include "ofxAssets.h"
class ofxSprite : public ofNode {
public:
ofxSprite();
void load(string filename, int numFrames=1, int start=0, string id="");
void customDraw();
void draw(float x, float y);
void draw(ofVec2f v);
void draw();
void setAnchorPercent(float xPct, float yPct);
void setFrameRate(int frameRate);
void setSpeed(float speed);
void setProgress(float pct);
void setPosition(float x, float y);
void setPosition(ofVec3f v);
void setRotation(float rotation);
void addFile(string filename);
void setCurrentFrame(float frame);
void setLoop(bool loop);
void nextFrame();
void previousFrame();
void center();
void play();
void pause();
void stop();
void update();
float getProgress(); // 0..1
int getTotalFrames();
int getCurrentFrame();
bool getIsPlaying();
float getWidth();
float getHeight();
ofImage& getImageAtFrame(int frame);
ofImage& getCurrentImage();
ofRectangle getBounds();
ofVec2f getSize();
string id;
bool visible;
private:
int totalFrames;
int frameRate;
bool loop;
float speed;
float pos;
bool isPlaying;
ofPoint anchorPoint;
vector<string> filenames;
static ofxImageAssets assets;
};