Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/src/js/jgame.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 55 by tsugehara, Thu Mar 7 06:32:53 2013 UTC revision 56 by tsugehara, Thu Mar 7 08:18:30 2013 UTC
# Line 1567  var TextLineInfo = (function () { Line 1567  var TextLineInfo = (function () {
1567      }      }
1568      return TextLineInfo;      return TextLineInfo;
1569  })();  })();
1570    var MultilineScriptAnalyzer = (function () {
1571        function MultilineScriptAnalyzer() { }
1572        MultilineScriptAnalyzer.prototype.init = function (owner, context, pos) {
1573            this.mode = 0;
1574            this.owner = owner;
1575            this.context = context;
1576            this.pos = pos;
1577        };
1578        MultilineScriptAnalyzer.prototype.next = function (c) {
1579            if(this.mode) {
1580                if(c == " ") {
1581                    this.mode = 0;
1582                    if(this.buf == "page") {
1583                        return -1;
1584                    }
1585                } else {
1586                    this.buf += c;
1587                }
1588                return 1;
1589            }
1590            if(c == "#") {
1591                this.mode = 1;
1592                this.buf = "";
1593                return 1;
1594            }
1595            return 0;
1596        };
1597        return MultilineScriptAnalyzer;
1598    })();
1599  var MultilineText = (function (_super) {  var MultilineText = (function (_super) {
1600      __extends(MultilineText, _super);      __extends(MultilineText, _super);
1601      function MultilineText(size, offset) {      function MultilineText(size, offset) {
1602          _super.call(this);          _super.call(this);
1603            this.scriptAnalyzer = new MultilineScriptAnalyzer();
1604          this.width = size.width;          this.width = size.width;
1605          this.height = size.height;          this.height = size.height;
1606          if(offset) {          if(offset) {
# Line 1660  var MultilineText = (function (_super) { Line 1690  var MultilineText = (function (_super) {
1690              _this.lines.push(lineInfo);              _this.lines.push(lineInfo);
1691              return true;              return true;
1692          };          };
1693            this.scriptAnalyzer.init(this, c, pos);
1694          while(offset < len) {          while(offset < len) {
1695              s = script.substr(offset, 1);              s = script.substr(offset, 1);
1696                var script_ret = this.scriptAnalyzer.next(s);
1697                if(script_ret) {
1698                    if(script_ret < 0) {
1699                        offset -= script_ret;
1700                        break;
1701                    }
1702                    offset += script_ret;
1703                    continue;
1704                }
1705              if(s == "\n") {              if(s == "\n") {
1706                    offset++;
1707                  if(!_newLine()) {                  if(!_newLine()) {
1708                      break;                      break;
1709                  }                  }
                 offset++;  
1710                  continue;                  continue;
1711              }              }
1712              var metric = c.measureText(s);              var metric = c.measureText(s);
# Line 5205  var MessageWindow = (function (_super) { Line 5245  var MessageWindow = (function (_super) {
5245      };      };
5246      MessageWindow.prototype.showText = function () {      MessageWindow.prototype.showText = function () {
5247          var textArea = this.getTextArea();          var textArea = this.getTextArea();
5248          textArea.startAnimation(this.normalSpeed);          textArea.startAnimation();
5249      };      };
5250      MessageWindow.prototype.fastMode = function () {      MessageWindow.prototype.fastMode = function () {
5251          var textArea = this.getTextArea();          var textArea = this.getTextArea();
# Line 5226  var MessageWindow = (function (_super) { Line 5266  var MessageWindow = (function (_super) {
5266      };      };
5267      MessageWindow.prototype.oldWipeOut = function (time) {      MessageWindow.prototype.oldWipeOut = function (time) {
5268          if(time === undefined) {          if(time === undefined) {
5269              time = 500;              time = 800;
5270          }          }
5271          var textArea = this.getTextArea();          var textArea = this.getTextArea();
5272          var old = textArea.createSprite();          var old = textArea.createSprite();
# Line 5236  var MessageWindow = (function (_super) { Line 5276  var MessageWindow = (function (_super) {
5276          var movePoint = lastLine.offsetY + lastLine.height;          var movePoint = lastLine.offsetY + lastLine.height;
5277          textArea.moveTo(textArea.x, textArea.y + movePoint);          textArea.moveTo(textArea.x, textArea.y + movePoint);
5278          old.tl().moveBy(0, -textArea.height, time).removeFromScene();          old.tl().moveBy(0, -textArea.height, time).removeFromScene();
5279          textArea.tl().moveBy(0, -movePoint, time);          textArea.tl().moveBy(0, -movePoint, (movePoint / textArea.height) * time);
5280      };      };
5281      MessageWindow.prototype.oldFadeOut = function (time) {      MessageWindow.prototype.oldFadeOut = function (time) {
5282          if(time === undefined) {          if(time === undefined) {

Legend:
Removed from v.55  
changed lines
  Added in v.56

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26