OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/h58pcdgame/GameScriptCore...
authorttwilb <ttwilb@users.sourceforge.jp>
Mon, 19 Aug 2013 10:27:38 +0000 (19:27 +0900)
committerttwilb <ttwilb@users.sourceforge.jp>
Mon, 19 Aug 2013 10:27:38 +0000 (19:27 +0900)
Conflicts:
www/corelib/core.js

削除禁止! コメントよく読め!って書いた(core.js)

www/corelib/classes/MessageWidghetClass.js
www/corelib/core.js [changed mode: 0755->0644]

index d8171c8..0e1b78a 100644 (file)
@@ -56,34 +56,35 @@ var MessageWidghetClass = function(manager, args)
        draw : function(){
                this.manager.mainContext.globalAlpha = 0.5;
                this.manager.mainContext.fillRect(this.origin.x, this.origin.y, this.size.x, this.size.y);
+               this.manager.mainContext.globalAlpha = 1.0;
                
                var lineHead = 0;
                var lines = [];
                var height = 0;
-               for(var index = 0; i <= this.messageIndex; i++)
+               var ysiz = 16;
+               for(var index = 0; index <= this.messageIndex; index++)
                {
-                       var siz = this.manager.mainContext.measureText(this.message.slice(lineHead, index - lineHead));
-                       if(siz.x > this.size.x){
-                               index--;
+                       var siz = this.manager.mainContext.measureText(this.message.slice(lineHead, index + 1 - lineHead));
+                       if(siz.x > this.size.x || this.message[index] == "\n"){
                                lines.push(this.message.slice(lineHead, index - lineHead));
                                lineHead = index;
-                               height += siz.y;
+                               height += ysiz;
                        }
                }
                
                var yloc = this.origin.y + this.size.y - height;
-               for(var line in lines)
+               for(var i = 0; i < lines.length; i++)
                {
-                       var siz = this.manager.mainContext.measureText(line);
-                       
-                       if(yloc > this.origin.y)
+                       var line = lines[i];
+                       if(yloc >= this.origin.y)
                        {
                                drawText(this.manager.mainContext, line, this.origin.x, yloc);
                        }
                        
-                       yloc += siz.y;
+                       yloc += ysiz;
                }
                
-               this.manager.mainContext.globalAlpha = 1.0;
+               
+               
        }
 });
old mode 100755 (executable)
new mode 100644 (file)
index 3b9ddb9..bd911a4
@@ -163,6 +163,11 @@ GameManager.prototype = {
                                //ステージ
                                this.runningStage.timerTick();
                        }
+               }//削除禁止
+               //コメントよく読め
+               // runningStage.timerTick() 内でpauseStage()された時、ここで再度判定しないとWidghetのtickが実行されてしまう
+               if(this.stagePausedFunction == null)//削除禁止
+               {
                        //ウィジェット
                        for(var i = 0; i < this.runningWidghets.length; i++){
                                var w = this.runningWidghets[i];