summaryrefslogtreecommitdiff
path: root/vfg/src/Tag.h
blob: 7174872e85e7bd35b5ead12e6f757b492a31d860 (plain)
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
#ifndef TAG_H
#define TAG_H

#include "ofMain.h"

//class for resolution independent ofImage billbaord & level tag animator

class Billboard
{
	public:
		Billboard(string name,float xPct=0.5f,float yPct=0.5f) {
			img.loadImage(name);
			anchorPoint=ofPoint(img.getWidth()*xPct,img.getHeight()*yPct);
		}
		void draw(float x, float y, float scale=1.0f);
	protected:
		ofImage img;
		ofPoint anchorPoint;
        private:
	    
};

class Tag: public Billboard {
	public:
		Tag(string name,int d,float xPct=0.5f,float yPct=0.5f): Billboard(name,xPct,yPct) {duration =d; end=false; };
		void draw(float x, float y, float scale=1.0f);
		void play(int time=0);
		void playEnd();
		bool isPlaying;
	protected:		
		int startTime;
		int duration;
		bool end;
};

#endif // TAG_H