From 275acd8fe15ca66401cff428091772e7ab71444e Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sat, 10 Nov 2012 20:52:55 +0000 Subject: lyrics displaying correctly --- vfg/src/music.h | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'vfg/src/music.h') diff --git a/vfg/src/music.h b/vfg/src/music.h index 292e05f..f20838f 100755 --- a/vfg/src/music.h +++ b/vfg/src/music.h @@ -79,14 +79,22 @@ class lyric { class score { //basics of timelime public: - long startTime; - protected: + long startTime; + void start() { startTime=ofGetElapsedTimeMillis(); } + void start(int _st) { startTime=_st; } ofxXmlSettings XML; }; //--------------------------------------------------------------------------------------------------------------------------------------------- class lyricscore: public score { //draws lyrics to screen for a certain time - public: + public: + lyricscore() { + font.loadFont("verdana.ttf", 30, true, true); + font.setLineHeight(34.0f); + font.setLetterSpacing(1.035); + ypos=(int)(((float)ofGetHeight())*0.9f); //set lyric position + fadeout=500; //ms + } void load(string filename) { if( !XML.loadFile(filename) ){ printf("unable to load %s check data/ folder\n",filename.c_str()); @@ -99,11 +107,15 @@ class lyricscore: public score { } printf("processed %s: %i lyrics \n",filename.c_str(),lyrics.size()); } - + } - } + } + void draw(); private: - map lyrics; + map lyrics; + ofTrueTypeFont font; + int ypos; + int fadeout; }; //--------------------------------------------------------------------------------------------------------------------------------------------- class musicscore: public score { @@ -147,8 +159,8 @@ class song { levelscore levels; long startTime; bool isPreroll; - - int fThreshStart,fThreshEnd,keyThresh; + + int fThreshStart,fThreshEnd,keyThresh; }; //--------------------------------------------------------------------------------------------------------------------------------------------- /* @@ -163,7 +175,7 @@ Stage 2 Stage 3 – 4 notes missed will mean Game Over Stage 4 – 3 notes missed will mean Game Over -Scoring – Scoring will be based on the level of the game you achieve. There will be 4 scoring brackets (subject to testing and tweaking): +Scoring – Scoring will be based on the level of the game you achieve. There will be 4 scoring brackets (subject to testing and tweaking): Scoring Bracket 1 - Those who make it to Level 2 (see above - it's not possible to be kicked out in Level 1) Scoring Bracket 2 – Those who make it to Level 3 -- cgit v1.2.3