Mercurial > hg > Members > e105711
diff webGL/src/mainfunc.js @ 2:55702e139f69 draft
3rd,show Notes and set Timing, but it is not completely.
author | e105711 <yomitan.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 03 May 2012 00:52:06 +0900 |
parents | 9285dae61395 |
children | a22ff379000f |
line wrap: on
line diff
--- a/webGL/src/mainfunc.js Thu Apr 26 00:34:45 2012 +0900 +++ b/webGL/src/mainfunc.js Thu May 03 00:52:06 2012 +0900 @@ -1,29 +1,47 @@ function gameRender(ctx,MODE){ - switch(MODE){ - case TITLE: - titleRender(ctx); - break; - case MAIN: - mainRender(ctx); - break; - } + switch(MODE){ + case TITLE: + titleRender(ctx); + break; + case MAIN: + mainRender(ctx); + break; + case PLAY: + playRender(ctx); + } } function titleRender(ctx){ - reshape(ctx); - ctx.clearColor(0,0,0,1); + reshape(ctx); + ctx.clearColor(0,0,0.15,1); ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); PutSpriteF(ctx,100,30,1,imgs[0]); - PutSpriteF(ctx,98,90,1,imgs[1]); + PutSpriteF(ctx,100,90,1,imgs[1]); + PutSpriteF(ctx,100,70,1,imgs[6]); ctx.flush(); } function mainRender(ctx){ - reshape(ctx); - ctx.clearColor(0,0,0,1); + reshape(ctx); + ctx.clearColor(0,0,0.15,1); ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); - if(!AUTO){ - PutSpriteF(ctx,100,30,1,imgs[2]); - } + PutSpriteF(ctx,100,7.8125,1,imgs[2]); + PutSpriteF(ctx,100,105,1,imgs[3]); //y == 480 + + PutSpriteF(ctx,100,70,1,imgs[6]); + ctx.flush(); +} + +function playRender(ctx){ + reshape(ctx); + ctx.clearColor(0,0,0.15,1); + ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT); + PutSpriteF(ctx,100,7.8125,1,imgs[2]); + PutSpriteF(ctx,100,105,1,imgs[3]); //y == 480 + for(i=0;i<notesArray.length;i++){ +// notesArray[i].updLocate(150,1.0); + drawNote(ctx,notesArray[i]); + } + PutSpriteF(ctx,100,70,1,imgs[6]); ctx.flush(); } \ No newline at end of file