diff webGL/src/mainfunc.js @ 15:80789d11de5c draft

add function for text draw
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Sun, 01 Jul 2012 22:01:18 +0900
parents 74dc1d5f2e47
children b322a8557f93
line wrap: on
line diff
--- a/webGL/src/mainfunc.js	Thu Jun 07 23:12:53 2012 +0900
+++ b/webGL/src/mainfunc.js	Sun Jul 01 22:01:18 2012 +0900
@@ -12,6 +12,9 @@
 	break;
     case PLAY:
 	playUpdate();
+	break;
+    case RESULT:
+	break;
     }    
 }
 
@@ -40,9 +43,12 @@
     objsArray.length = 0;
     objsArray.push(new Obj(100,7.8125,1,2)); // main mode
     loadMusics(musicsArray[cursor.getIndex()]);
-//    audioBGM.play();
 }
 
+function toResult(){
+    MODE = RESULT;
+    showResult();
+}
 
 function drawObj(ctx){
     reshape(ctx);
@@ -50,18 +56,20 @@
     ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT);
     for(var i=0;i < objsArray.length;i++){
 	var obj = objsArray[i];
-	PutSpriteF(ctx,obj.x,obj.y,obj.scale,imgs[obj.imgNo]);
+	PutSpriteF(ctx,obj.x,obj.y,obj.scale,imgs[obj.imgNo],imgs[obj.imgNo].texture);
     }
     if(MODE==PLAY){
 	drawNote(ctx);
-	PutSpriteF(ctx,100,105,1,imgs[3]); // line
+	PutSpriteF(ctx,100,105,1,imgs[3],imgs[3].texture); // line
     }
-    PutSpriteF(ctx,100,70,1,imgs[6]); // background
-    
+    PutSpriteF(ctx,100,70,1,imgs[6],imgs[6].texture); // background
     ctx.flush();
 }
 
 function playUpdate(){
     updateNote();
+    if(BGMEndCheck()){
+	toResult();
+    }
 }