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 66 by tsugehara, Fri Mar 22 03:41:17 2013 UTC revision 67 by tsugehara, Fri Mar 22 05:57:24 2013 UTC
# Line 39  window.createCanvas = function (width, h Line 39  window.createCanvas = function (width, h
39  var Angle;  var Angle;
40  (function (Angle) {  (function (Angle) {
41      Angle._map = [];      Angle._map = [];
42      Angle._map[0] = "left";      Angle._map[0] = "Unknown";
43      Angle.left = 0;      Angle.Unknown = 0;
44      Angle._map[1] = "right";      Angle._map[1] = "Left";
45      Angle.right = 1;      Angle.Left = 1;
46      Angle._map[2] = "up";      Angle._map[2] = "Right";
47      Angle.up = 2;      Angle.Right = 2;
48      Angle._map[3] = "down";      Angle._map[3] = "Up";
49      Angle.down = 3;      Angle.Up = 3;
50        Angle._map[4] = "Down";
51        Angle.Down = 4;
52  })(Angle || (Angle = {}));  })(Angle || (Angle = {}));
53    var RenderTransferMode;
54    (function (RenderTransferMode) {
55        RenderTransferMode._map = [];
56        RenderTransferMode._map[0] = "Unknown";
57        RenderTransferMode.Unknown = 0;
58        RenderTransferMode._map[1] = "Transfer";
59        RenderTransferMode.Transfer = 1;
60        RenderTransferMode._map[2] = "Flip";
61        RenderTransferMode.Flip = 2;
62        RenderTransferMode._map[3] = "Direct";
63        RenderTransferMode.Direct = 3;
64    })(RenderTransferMode || (RenderTransferMode = {}));
65    var InputEventType;
66    (function (InputEventType) {
67        InputEventType._map = [];
68        InputEventType._map[0] = "Unknown";
69        InputEventType.Unknown = 0;
70        InputEventType._map[1] = "Keyboard";
71        InputEventType.Keyboard = 1;
72        InputEventType._map[2] = "Point";
73        InputEventType.Point = 2;
74    })(InputEventType || (InputEventType = {}));
75    var Keytype;
76    (function (Keytype) {
77        Keytype._map = [];
78        Keytype._map[0] = "Unknown";
79        Keytype.Unknown = 0;
80        Keytype._map[1] = "Left";
81        Keytype.Left = 1;
82        Keytype._map[2] = "Right";
83        Keytype.Right = 2;
84        Keytype._map[3] = "Up";
85        Keytype.Up = 3;
86        Keytype._map[4] = "Down";
87        Keytype.Down = 4;
88        Keytype._map[5] = "Enter";
89        Keytype.Enter = 5;
90        Keytype._map[6] = "Esc";
91        Keytype.Esc = 6;
92    })(Keytype || (Keytype = {}));
93    var ShapeStyle;
94    (function (ShapeStyle) {
95        ShapeStyle._map = [];
96        ShapeStyle._map[0] = "Unknown";
97        ShapeStyle.Unknown = 0;
98        ShapeStyle._map[1] = "Stroke";
99        ShapeStyle.Stroke = 1;
100        ShapeStyle._map[2] = "Fill";
101        ShapeStyle.Fill = 2;
102    })(ShapeStyle || (ShapeStyle = {}));
103    var ShapeType;
104    (function (ShapeType) {
105        ShapeType._map = [];
106        ShapeType._map[0] = "Unknown";
107        ShapeType.Unknown = 0;
108        ShapeType._map[1] = "Rect";
109        ShapeType.Rect = 1;
110        ShapeType._map[2] = "Arc";
111        ShapeType.Arc = 2;
112    })(ShapeType || (ShapeType = {}));
113    var EffectType;
114    (function (EffectType) {
115        EffectType._map = [];
116        EffectType._map[0] = "None";
117        EffectType.None = 0;
118        EffectType._map[1] = "Fade";
119        EffectType.Fade = 1;
120        EffectType._map[2] = "Mosaic";
121        EffectType.Mosaic = 2;
122        EffectType._map[3] = "Blur";
123        EffectType.Blur = 3;
124        EffectType._map[4] = "SlideUp";
125        EffectType.SlideUp = 4;
126        EffectType._map[5] = "SlideDown";
127        EffectType.SlideDown = 5;
128        EffectType._map[6] = "SlideLeft";
129        EffectType.SlideLeft = 6;
130        EffectType._map[7] = "SlideRight";
131        EffectType.SlideRight = 7;
132        EffectType._map[8] = "WipeUp";
133        EffectType.WipeUp = 8;
134        EffectType._map[9] = "WipeDown";
135        EffectType.WipeDown = 9;
136        EffectType._map[10] = "WipeLeft";
137        EffectType.WipeLeft = 10;
138        EffectType._map[11] = "WipeRight";
139        EffectType.WipeRight = 11;
140        EffectType._map[12] = "WipeFadeUp";
141        EffectType.WipeFadeUp = 12;
142        EffectType._map[13] = "WipeFadeDown";
143        EffectType.WipeFadeDown = 13;
144        EffectType._map[14] = "WipeFadeLeft";
145        EffectType.WipeFadeLeft = 14;
146        EffectType._map[15] = "WipeFadeRight";
147        EffectType.WipeFadeRight = 15;
148        EffectType._map[16] = "BoxOut";
149        EffectType.BoxOut = 16;
150        EffectType._map[17] = "BoxOut45";
151        EffectType.BoxOut45 = 17;
152        EffectType._map[18] = "BoxIn";
153        EffectType.BoxIn = 18;
154        EffectType._map[19] = "BoxIn45";
155        EffectType.BoxIn45 = 19;
156        EffectType._map[20] = "ArcOut";
157        EffectType.ArcOut = 20;
158        EffectType._map[21] = "ArcIn";
159        EffectType.ArcIn = 21;
160        EffectType._map[22] = "BoxOutBlack";
161        EffectType.BoxOutBlack = 22;
162        EffectType._map[23] = "BoxOut45Black";
163        EffectType.BoxOut45Black = 23;
164        EffectType._map[24] = "BoxInBlack";
165        EffectType.BoxInBlack = 24;
166        EffectType._map[25] = "BoxIn45Black";
167        EffectType.BoxIn45Black = 25;
168        EffectType._map[26] = "ArcOutBlack";
169        EffectType.ArcOutBlack = 26;
170        EffectType._map[27] = "ArcInBlack";
171        EffectType.ArcInBlack = 27;
172        EffectType._map[28] = "BoxOutWhite";
173        EffectType.BoxOutWhite = 28;
174        EffectType._map[29] = "BoxOut45White";
175        EffectType.BoxOut45White = 29;
176        EffectType._map[30] = "BoxInWhite";
177        EffectType.BoxInWhite = 30;
178        EffectType._map[31] = "BoxIn45White";
179        EffectType.BoxIn45White = 31;
180        EffectType._map[32] = "ArcOutWhite";
181        EffectType.ArcOutWhite = 32;
182        EffectType._map[33] = "ArcInWhite";
183        EffectType.ArcInWhite = 33;
184    })(EffectType || (EffectType = {}));
185  var Rectangle = (function () {  var Rectangle = (function () {
186      function Rectangle(left, top, right, bottom) {      function Rectangle(left, top, right, bottom) {
187          this.left = left;          this.left = left;
# Line 657  var __extends = this.__extends || functi Line 791  var __extends = this.__extends || functi
791      __.prototype = b.prototype;      __.prototype = b.prototype;
792      d.prototype = new __();      d.prototype = new __();
793  };  };
 var ShapeStyle;  
 (function (ShapeStyle) {  
     ShapeStyle._map = [];  
     ShapeStyle._map[0] = "stroke";  
     ShapeStyle.stroke = 0;  
     ShapeStyle._map[1] = "fill";  
     ShapeStyle.fill = 1;  
 })(ShapeStyle || (ShapeStyle = {}));  
 var ShapeType;  
 (function (ShapeType) {  
     ShapeType._map = [];  
     ShapeType._map[0] = "rect";  
     ShapeType.rect = 0;  
     ShapeType._map[1] = "arc";  
     ShapeType.arc = 1;  
 })(ShapeType || (ShapeType = {}));  
794  var Shape = (function (_super) {  var Shape = (function (_super) {
795      __extends(Shape, _super);      __extends(Shape, _super);
796      function Shape(width, height, style, color, type) {      function Shape(width, height, style, color, type) {
# Line 681  var Shape = (function (_super) { Line 799  var Shape = (function (_super) {
799          this.y = 0;          this.y = 0;
800          this.width = width;          this.width = width;
801          this.height = height;          this.height = height;
802          this.style = style ? style : ShapeStyle.stroke;          this.style = style ? style : ShapeStyle.Stroke;
803          if(color) {          if(color) {
804              this.setColor(color);              this.setColor(color);
805          }          }
806          this.type = type ? type : ShapeType.rect;          this.type = type ? type : ShapeType.Rect;
807      }      }
808      Shape.PI_200_PER = Math.PI * 2;      Shape.PI_200_PER = Math.PI * 2;
809      Shape.prototype.setClip = function (value) {      Shape.prototype.setClip = function (value) {
# Line 707  var Shape = (function (_super) { Line 825  var Shape = (function (_super) {
825          return this.getDrawOption("lineWidth");          return this.getDrawOption("lineWidth");
826      };      };
827      Shape.prototype.setColor = function (color) {      Shape.prototype.setColor = function (color) {
828          if(this.style == ShapeStyle.stroke) {          if(this.style == ShapeStyle.Stroke) {
829              this.setDrawOption("strokeStyle", color);              this.setDrawOption("strokeStyle", color);
830          } else {          } else {
831              this.setDrawOption("fillStyle", color);              this.setDrawOption("fillStyle", color);
832          }          }
833      };      };
834      Shape.prototype.getColor = function () {      Shape.prototype.getColor = function () {
835          if(this.style == ShapeStyle.stroke) {          if(this.style == ShapeStyle.Stroke) {
836              return this.getDrawOption("strokeStyle");              return this.getDrawOption("strokeStyle");
837          } else {          } else {
838              return this.getDrawOption("filltyle");              return this.getDrawOption("filltyle");
# Line 737  var Shape = (function (_super) { Line 855  var Shape = (function (_super) {
855          }          }
856          context.beginPath();          context.beginPath();
857          switch(this.type) {          switch(this.type) {
858              case ShapeType.rect:              case ShapeType.Rect:
859                  context.rect(0, 0, this.width, this.height);                  context.rect(0, 0, this.width, this.height);
860                  break;                  break;
861              case ShapeType.arc:              case ShapeType.Arc:
862                  var w2 = this.width / 2;                  var w2 = this.width / 2;
863                  context.arc(w2, w2, w2, 0, Shape.PI_200_PER, false);                  context.arc(w2, w2, w2, 0, Shape.PI_200_PER, false);
864                  break;                  break;
# Line 748  var Shape = (function (_super) { Line 866  var Shape = (function (_super) {
866          if(this.clip) {          if(this.clip) {
867              context.restore();              context.restore();
868              context.clip();              context.clip();
869          } else if(this.style == ShapeStyle.fill) {          } else if(this.style == ShapeStyle.Fill) {
870              context.fill();              context.fill();
871          } else {          } else {
872              context.stroke();              context.stroke();
# Line 1287  var Character = (function (_super) { Line 1405  var Character = (function (_super) {
1405      }      }
1406      Character.prototype.moveLeft = function (stackNext) {      Character.prototype.moveLeft = function (stackNext) {
1407          if(this.move(-this.movePixel, 0, this.moveTime)) {          if(this.move(-this.movePixel, 0, this.moveTime)) {
1408              this.angle(Angle.left);              this.angle(Angle.Left);
1409              return true;              return true;
1410          }          }
1411          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {
# Line 1297  var Character = (function (_super) { Line 1415  var Character = (function (_super) {
1415      };      };
1416      Character.prototype.moveRight = function (stackNext) {      Character.prototype.moveRight = function (stackNext) {
1417          if(this.move(this.movePixel, 0, this.moveTime)) {          if(this.move(this.movePixel, 0, this.moveTime)) {
1418              this.angle(Angle.right);              this.angle(Angle.Right);
1419              return true;              return true;
1420          }          }
1421          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {
# Line 1307  var Character = (function (_super) { Line 1425  var Character = (function (_super) {
1425      };      };
1426      Character.prototype.moveUp = function (stackNext) {      Character.prototype.moveUp = function (stackNext) {
1427          if(this.move(0, -this.movePixel, this.moveTime)) {          if(this.move(0, -this.movePixel, this.moveTime)) {
1428              this.angle(Angle.up);              this.angle(Angle.Up);
1429              return true;              return true;
1430          }          }
1431          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {
# Line 1317  var Character = (function (_super) { Line 1435  var Character = (function (_super) {
1435      };      };
1436      Character.prototype.moveDown = function (stackNext) {      Character.prototype.moveDown = function (stackNext) {
1437          if(this.move(0, 64, this.moveTime)) {          if(this.move(0, 64, this.moveTime)) {
1438              this.angle(Angle.down);              this.angle(Angle.Down);
1439              return true;              return true;
1440          }          }
1441          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {          if(stackNext && this.moveInfo.t * 2 >= this.moveInfo.f) {
# Line 1372  var Character = (function (_super) { Line 1490  var Character = (function (_super) {
1490          this.currentAngle = angle;          this.currentAngle = angle;
1491          var rowP = Math.floor(this.charaSeq / this.charaCol) * 4;          var rowP = Math.floor(this.charaSeq / this.charaCol) * 4;
1492          switch(angle) {          switch(angle) {
1493              case Angle.up:              case Angle.Up:
1494                  rowP += (this.angleSeq ? this.angleSeq[Angle.up] : 3);                  rowP += (this.angleSeq ? this.angleSeq[Angle.Up] : 3);
1495                  break;                  break;
1496              case Angle.down:              case Angle.Down:
1497                  rowP += (this.angleSeq ? this.angleSeq[Angle.down] : 0);                  rowP += (this.angleSeq ? this.angleSeq[Angle.Down] : 0);
1498                  break;                  break;
1499              case Angle.left:              case Angle.Left:
1500                  rowP += (this.angleSeq ? this.angleSeq[Angle.left] : 1);                  rowP += (this.angleSeq ? this.angleSeq[Angle.Left] : 1);
1501                  break;                  break;
1502              case Angle.right:              case Angle.Right:
1503                  rowP += (this.angleSeq ? this.angleSeq[Angle.right] : 2);                  rowP += (this.angleSeq ? this.angleSeq[Angle.Right] : 2);
1504                  break;                  break;
1505          }          }
1506          var f = this.animeCnt * (this.charaSeq % this.charaCol) + this.charaCol * this.animeCnt * rowP;          var f = this.animeCnt * (this.charaSeq % this.charaCol) + this.charaCol * this.animeCnt * rowP;
# Line 1418  var CharacterFactory = (function () { Line 1536  var CharacterFactory = (function () {
1536          this.animeCnt = 2;          this.animeCnt = 2;
1537          this.moveTime = 300;          this.moveTime = 300;
1538          this.movePixel = 64;          this.movePixel = 64;
1539          this.angle = Angle.down;          this.angle = Angle.Down;
1540          this.createClass = Character;          this.createClass = Character;
1541      }      }
1542      CharacterFactory.prototype.create = function (charaSeq, offset, angle) {      CharacterFactory.prototype.create = function (charaSeq, offset, angle) {
# Line 1985  var LoadingScene = (function (_super) { Line 2103  var LoadingScene = (function (_super) {
2103          if(!noShape) {          if(!noShape) {
2104              this.shape = new Shape(game.width, 32);              this.shape = new Shape(game.width, 32);
2105              this.shape.moveTo(0, game.height / 2 - 16);              this.shape.moveTo(0, game.height / 2 - 16);
2106              this.shapeP = new Shape(1, 32, ShapeStyle.fill);              this.shapeP = new Shape(1, 32, ShapeStyle.Fill);
2107              this.shapeP.moveTo(0, game.height / 2 - 16);              this.shapeP.moveTo(0, game.height / 2 - 16);
2108              this.append(this.shape);              this.append(this.shape);
2109              this.append(this.shapeP);              this.append(this.shapeP);
# Line 2013  var LoadingScene = (function (_super) { Line 2131  var LoadingScene = (function (_super) {
2131      };      };
2132      return LoadingScene;      return LoadingScene;
2133  })(Scene);  })(Scene);
 var InputEventType;  
 (function (InputEventType) {  
     InputEventType._map = [];  
     InputEventType._map[0] = "Keyboard";  
     InputEventType.Keyboard = 0;  
     InputEventType._map[1] = "Point";  
     InputEventType.Point = 1;  
 })(InputEventType || (InputEventType = {}));  
 var Keytype;  
 (function (Keytype) {  
     Keytype._map = [];  
     Keytype._map[0] = "left";  
     Keytype.left = 0;  
     Keytype._map[1] = "right";  
     Keytype.right = 1;  
     Keytype._map[2] = "up";  
     Keytype.up = 2;  
     Keytype._map[3] = "down";  
     Keytype.down = 3;  
     Keytype._map[4] = "enter";  
     Keytype.enter = 4;  
     Keytype._map[5] = "esc";  
     Keytype.esc = 5;  
 })(Keytype || (Keytype = {}));  
2134  var InputEvent = (function () {  var InputEvent = (function () {
2135      function InputEvent(type, param) {      function InputEvent(type, param) {
2136          this.type = type;          this.type = type;
# Line 2178  var Renderer = (function () { Line 2272  var Renderer = (function () {
2272      };      };
2273      return Renderer;      return Renderer;
2274  })();  })();
 var RenderTransferMode;  
 (function (RenderTransferMode) {  
     RenderTransferMode._map = [];  
     RenderTransferMode._map[0] = "Transfer";  
     RenderTransferMode.Transfer = 0;  
     RenderTransferMode._map[1] = "Flip";  
     RenderTransferMode.Flip = 1;  
     RenderTransferMode._map[2] = "Direct";  
     RenderTransferMode.Direct = 2;  
 })(RenderTransferMode || (RenderTransferMode = {}));  
2275  var GameRenderer = (function (_super) {  var GameRenderer = (function (_super) {
2276      __extends(GameRenderer, _super);      __extends(GameRenderer, _super);
2277      function GameRenderer(game, container, transferMode, disableBg) {      function GameRenderer(game, container, transferMode, disableBg) {
# Line 2706  var Game = (function () { Line 2790  var Game = (function () {
2790      };      };
2791      Game.prototype.keyboardHandler = function () {      Game.prototype.keyboardHandler = function () {
2792          this.keymap = {          this.keymap = {
2793              13: Keytype.enter,              13: Keytype.Enter,
2794              27: Keytype.esc,              27: Keytype.Esc,
2795              37: Keytype.left,              37: Keytype.Left,
2796              38: Keytype.up,              38: Keytype.Up,
2797              39: Keytype.right,              39: Keytype.Right,
2798              40: Keytype.down              40: Keytype.Down
2799          };          };
2800          try  {          try  {
2801              document.addEventListener("keydown", JGUtil.proxy(this.onkeydown, this), false);              document.addEventListener("keydown", JGUtil.proxy(this.onkeydown, this), false);
# Line 3126  var ImageFilter; Line 3210  var ImageFilter;
3210                      }                      }
3211                  }                  }
3212              } else {              } else {
3213                  var xPer = w2 / w;                  var xPer = Math.round(w2 / w * 100) / 100;
3214                  var yPer = h2 / h;                  var yPer = Math.round(h2 / h * 100) / 100;
3215                  for(var x = 0; x < w; x++) {                  for(var x = 0; x < w; x++) {
3216                      for(var y = 0; y < h; y++) {                      for(var y = 0; y < h; y++) {
3217                          var x2 = Math.round(xPer * x);                          var x2 = Math.round(xPer * x);
# Line 4349  var JGUtil = (function () { Line 4433  var JGUtil = (function () {
4433              return null;              return null;
4434          }          }
4435          if(xp > yp) {          if(xp > yp) {
4436              return (_p1.x > _p2.x) ? Angle.left : Angle.right;              return (_p1.x > _p2.x) ? Angle.Left : Angle.Right;
4437          } else {          } else {
4438              return (_p1.y > _p2.y) ? Angle.up : Angle.down;              return (_p1.y > _p2.y) ? Angle.Up : Angle.Down;
4439          }          }
4440      };      };
4441      JGUtil.getDirectionKeytype = function getDirectionKeytype(p1, p2, minDistance) {      JGUtil.getDirectionKeytype = function getDirectionKeytype(p1, p2, minDistance) {
# Line 4363  var JGUtil = (function () { Line 4447  var JGUtil = (function () {
4447              return null;              return null;
4448          }          }
4449          if(xp > yp) {          if(xp > yp) {
4450              return (_p1.x > _p2.x) ? Keytype.left : Keytype.right;              return (_p1.x > _p2.x) ? Keytype.Left : Keytype.Right;
4451          } else {          } else {
4452              return (_p1.y > _p2.y) ? Keytype.up : Keytype.down;              return (_p1.y > _p2.y) ? Keytype.Up : Keytype.Down;
4453          }          }
4454      };      };
4455      JGUtil.homingX = function homingX(p1, p2, speed, t) {      JGUtil.homingX = function homingX(p1, p2, speed, t) {
# Line 4814  var Line = (function (_super) { Line 4898  var Line = (function (_super) {
4898      };      };
4899      return Line;      return Line;
4900  })(E);  })(E);
 var EffectType;  
 (function (EffectType) {  
     EffectType._map = [];  
     EffectType._map[0] = "None";  
     EffectType.None = 0;  
     EffectType._map[1] = "Fade";  
     EffectType.Fade = 1;  
     EffectType._map[2] = "Mosaic";  
     EffectType.Mosaic = 2;  
     EffectType._map[3] = "Blur";  
     EffectType.Blur = 3;  
     EffectType._map[4] = "SlideUp";  
     EffectType.SlideUp = 4;  
     EffectType._map[5] = "SlideDown";  
     EffectType.SlideDown = 5;  
     EffectType._map[6] = "SlideLeft";  
     EffectType.SlideLeft = 6;  
     EffectType._map[7] = "SlideRight";  
     EffectType.SlideRight = 7;  
     EffectType._map[8] = "WipeUp";  
     EffectType.WipeUp = 8;  
     EffectType._map[9] = "WipeDown";  
     EffectType.WipeDown = 9;  
     EffectType._map[10] = "WipeLeft";  
     EffectType.WipeLeft = 10;  
     EffectType._map[11] = "WipeRight";  
     EffectType.WipeRight = 11;  
     EffectType._map[12] = "WipeFadeUp";  
     EffectType.WipeFadeUp = 12;  
     EffectType._map[13] = "WipeFadeDown";  
     EffectType.WipeFadeDown = 13;  
     EffectType._map[14] = "WipeFadeLeft";  
     EffectType.WipeFadeLeft = 14;  
     EffectType._map[15] = "WipeFadeRight";  
     EffectType.WipeFadeRight = 15;  
     EffectType._map[16] = "BoxOut";  
     EffectType.BoxOut = 16;  
     EffectType._map[17] = "BoxOut45";  
     EffectType.BoxOut45 = 17;  
     EffectType._map[18] = "BoxIn";  
     EffectType.BoxIn = 18;  
     EffectType._map[19] = "BoxIn45";  
     EffectType.BoxIn45 = 19;  
     EffectType._map[20] = "ArcOut";  
     EffectType.ArcOut = 20;  
     EffectType._map[21] = "ArcIn";  
     EffectType.ArcIn = 21;  
     EffectType._map[22] = "BoxOutBlack";  
     EffectType.BoxOutBlack = 22;  
     EffectType._map[23] = "BoxOut45Black";  
     EffectType.BoxOut45Black = 23;  
     EffectType._map[24] = "BoxInBlack";  
     EffectType.BoxInBlack = 24;  
     EffectType._map[25] = "BoxIn45Black";  
     EffectType.BoxIn45Black = 25;  
     EffectType._map[26] = "ArcOutBlack";  
     EffectType.ArcOutBlack = 26;  
     EffectType._map[27] = "ArcInBlack";  
     EffectType.ArcInBlack = 27;  
     EffectType._map[28] = "BoxOutWhite";  
     EffectType.BoxOutWhite = 28;  
     EffectType._map[29] = "BoxOut45White";  
     EffectType.BoxOut45White = 29;  
     EffectType._map[30] = "BoxInWhite";  
     EffectType.BoxInWhite = 30;  
     EffectType._map[31] = "BoxIn45White";  
     EffectType.BoxIn45White = 31;  
     EffectType._map[32] = "ArcOutWhite";  
     EffectType.ArcOutWhite = 32;  
     EffectType._map[33] = "ArcInWhite";  
     EffectType.ArcInWhite = 33;  
 })(EffectType || (EffectType = {}));  
4901  var Effect = (function () {  var Effect = (function () {
4902      function Effect(method) {      function Effect(method) {
4903          this.method = method;          this.method = method;
# Line 4917  var Effect = (function () { Line 4929  var Effect = (function () {
4929                      effect.blur();                      effect.blur();
4930                      break;                      break;
4931                  case EffectType.SlideUp:                  case EffectType.SlideUp:
4932                      effect.slide(Angle.up);                      effect.slide(Angle.Up);
4933                      break;                      break;
4934                  case EffectType.SlideDown:                  case EffectType.SlideDown:
4935                      effect.slide(Angle.down);                      effect.slide(Angle.Down);
4936                      break;                      break;
4937                  case EffectType.SlideLeft:                  case EffectType.SlideLeft:
4938                      effect.slide(Angle.left);                      effect.slide(Angle.Left);
4939                      break;                      break;
4940                  case EffectType.SlideRight:                  case EffectType.SlideRight:
4941                      effect.slide(Angle.right);                      effect.slide(Angle.Right);
4942                      break;                      break;
4943                  case EffectType.WipeUp:                  case EffectType.WipeUp:
4944                      effect.wipe(Angle.up);                      effect.wipe(Angle.Up);
4945                      break;                      break;
4946                  case EffectType.WipeDown:                  case EffectType.WipeDown:
4947                      effect.wipe(Angle.down);                      effect.wipe(Angle.Down);
4948                      break;                      break;
4949                  case EffectType.WipeLeft:                  case EffectType.WipeLeft:
4950                      effect.wipe(Angle.left);                      effect.wipe(Angle.Left);
4951                      break;                      break;
4952                  case EffectType.WipeRight:                  case EffectType.WipeRight:
4953                      effect.wipe(Angle.right);                      effect.wipe(Angle.Right);
4954                      break;                      break;
4955                  case EffectType.WipeFadeUp:                  case EffectType.WipeFadeUp:
4956                      effect.wipeFade(Angle.up);                      effect.wipeFade(Angle.Up);
4957                      break;                      break;
4958                  case EffectType.WipeFadeDown:                  case EffectType.WipeFadeDown:
4959                      effect.wipeFade(Angle.down);                      effect.wipeFade(Angle.Down);
4960                      break;                      break;
4961                  case EffectType.WipeFadeLeft:                  case EffectType.WipeFadeLeft:
4962                      effect.wipeFade(Angle.left);                      effect.wipeFade(Angle.Left);
4963                      break;                      break;
4964                  case EffectType.WipeFadeRight:                  case EffectType.WipeFadeRight:
4965                      effect.wipeFade(Angle.right);                      effect.wipeFade(Angle.Right);
4966                      break;                      break;
4967                  case EffectType.BoxOut:                  case EffectType.BoxOut:
4968                      effect.boxOut(0, Effect.color);                      effect.boxOut(0, Effect.color);
# Line 5012  var EffectScene = (function (_super) { Line 5024  var EffectScene = (function (_super) {
5024      };      };
5025      EffectScene.prototype._fadeColor = function (color) {      EffectScene.prototype._fadeColor = function (color) {
5026          var _this = this;          var _this = this;
5027          var shape = new Shape(this.sp1.width, this.sp1.height, ShapeStyle.fill, color);          var shape = new Shape(this.sp1.width, this.sp1.height, ShapeStyle.Fill, color);
5028          shape.setDrawOption("globalAlpha", 0);          shape.setDrawOption("globalAlpha", 0);
5029          this.root.append(shape);          this.root.append(shape);
5030          var t = Effect.time / 2;          var t = Effect.time / 2;
# Line 5062  var EffectScene = (function (_super) { Line 5074  var EffectScene = (function (_super) {
5074          var _this = this;          var _this = this;
5075          var t = Effect.time;          var t = Effect.time;
5076          switch(angle) {          switch(angle) {
5077              case Angle.up:              case Angle.Up:
5078                  this.sp1.tl().moveTo(0, -this.game.height, t).removeFromScene();                  this.sp1.tl().moveTo(0, -this.game.height, t).removeFromScene();
5079                  this.sp2.moveTo(0, this.game.height);                  this.sp2.moveTo(0, this.game.height);
5080                  this.sp2.tl().show().moveTo(0, 0, t);                  this.sp2.tl().show().moveTo(0, 0, t);
5081                  break;                  break;
5082              case Angle.down:              case Angle.Down:
5083                  this.sp1.tl().moveTo(0, this.game.height, t).removeFromScene();                  this.sp1.tl().moveTo(0, this.game.height, t).removeFromScene();
5084                  this.sp2.moveTo(0, -this.game.height);                  this.sp2.moveTo(0, -this.game.height);
5085                  this.sp2.tl().show().moveTo(0, 0, t);                  this.sp2.tl().show().moveTo(0, 0, t);
5086                  break;                  break;
5087              case Angle.left:              case Angle.Left:
5088                  this.sp1.tl().moveTo(-this.game.width, 0, t).removeFromScene();                  this.sp1.tl().moveTo(-this.game.width, 0, t).removeFromScene();
5089                  this.sp2.moveTo(this.game.width, 0);                  this.sp2.moveTo(this.game.width, 0);
5090                  this.sp2.tl().show().moveTo(0, 0, t);                  this.sp2.tl().show().moveTo(0, 0, t);
5091                  break;                  break;
5092              case Angle.right:              case Angle.Right:
5093                  this.sp1.tl().moveTo(this.game.width, 0, t).removeFromScene();                  this.sp1.tl().moveTo(this.game.width, 0, t).removeFromScene();
5094                  this.sp2.moveTo(-this.game.width, 0);                  this.sp2.moveTo(-this.game.width, 0);
5095                  this.sp2.tl().show().moveTo(0, 0, t);                  this.sp2.tl().show().moveTo(0, 0, t);
# Line 5091  var EffectScene = (function (_super) { Line 5103  var EffectScene = (function (_super) {
5103          var _this = this;          var _this = this;
5104          var t = Effect.time;          var t = Effect.time;
5105          this.sp2.tl().show();          this.sp2.tl().show();
5106          var sp = new Shape(this.game.width, 1, ShapeStyle.fill);          var sp = new Shape(this.game.width, 1, ShapeStyle.Fill);
5107          sp.moveTo(0, 0);          sp.moveTo(0, 0);
5108          sp.setClip(true);          sp.setClip(true);
5109          this.root.insert(sp, 1);          this.root.insert(sp, 1);
5110          switch(angle) {          switch(angle) {
5111              case Angle.up:              case Angle.Up:
5112                  sp.width = this.game.width;                  sp.width = this.game.width;
5113                  sp.height = 1;                  sp.height = 1;
5114                  sp.y = this.game.height;                  sp.y = this.game.height;
5115                  sp.tl().resizeTo(this.game.width, this.game.height, t).and().moveTo(0, 0, t);                  sp.tl().resizeTo(this.game.width, this.game.height, t).and().moveTo(0, 0, t);
5116                  break;                  break;
5117              case Angle.down:              case Angle.Down:
5118                  sp.width = this.game.width;                  sp.width = this.game.width;
5119                  sp.height = 1;                  sp.height = 1;
5120                  sp.tl().resizeTo(this.game.width, this.game.height, t);                  sp.tl().resizeTo(this.game.width, this.game.height, t);
5121                  break;                  break;
5122              case Angle.left:              case Angle.Left:
5123                  sp.width = 1;                  sp.width = 1;
5124                  sp.height = this.game.height;                  sp.height = this.game.height;
5125                  sp.x = this.game.width;                  sp.x = this.game.width;
5126                  sp.tl().resizeTo(this.game.width, this.game.height, t).and().moveTo(0, 0, t);                  sp.tl().resizeTo(this.game.width, this.game.height, t).and().moveTo(0, 0, t);
5127                  break;                  break;
5128              case Angle.right:              case Angle.Right:
5129                  sp.width = 1;                  sp.width = 1;
5130                  sp.height = this.game.height;                  sp.height = this.game.height;
5131                  sp.tl().resizeTo(this.game.width, this.game.height, t);                  sp.tl().resizeTo(this.game.width, this.game.height, t);
# Line 5131  var EffectScene = (function (_super) { Line 5143  var EffectScene = (function (_super) {
5143          var _this = this;          var _this = this;
5144          var t = Effect.time;          var t = Effect.time;
5145          this.sp2.tl().fadeIn(t);          this.sp2.tl().fadeIn(t);
5146          var sp = new Shape(1, 1, ShapeStyle.fill);          var sp = new Shape(1, 1, ShapeStyle.Fill);
5147          sp.moveTo(this.game.width / 2, this.game.height / 2);          sp.moveTo(this.game.width / 2, this.game.height / 2);
5148          sp.setClip(true);          sp.setClip(true);
5149          if(rotate) {          if(rotate) {
# Line 5139  var EffectScene = (function (_super) { Line 5151  var EffectScene = (function (_super) {
5151          }          }
5152          this.root.insert(sp, 1);          this.root.insert(sp, 1);
5153          if(color) {          if(color) {
5154              var bg = new Shape(this.game.width, this.game.height, ShapeStyle.fill, color);              var bg = new Shape(this.game.width, this.game.height, ShapeStyle.Fill, color);
5155              this.root.insert(bg, 1);              this.root.insert(bg, 1);
5156              bg.setDrawOption("globalAlpha", 0);              bg.setDrawOption("globalAlpha", 0);
5157              bg.tl().fadeIn(t * 0.6);              bg.tl().fadeIn(t * 0.6);
# Line 5158  var EffectScene = (function (_super) { Line 5170  var EffectScene = (function (_super) {
5170          this.swapScene();          this.swapScene();
5171          var t = Effect.time;          var t = Effect.time;
5172          this.sp2.tl().fadeIn(t);          this.sp2.tl().fadeIn(t);
5173          var sp = new Shape(1, 1, ShapeStyle.fill);          var sp = new Shape(1, 1, ShapeStyle.Fill);
5174          if(rotate) {          if(rotate) {
5175              sp.moveTo(-this.game.width / 2, -this.game.height / 2);              sp.moveTo(-this.game.width / 2, -this.game.height / 2);
5176              sp.width = this.game.width * 2;              sp.width = this.game.width * 2;
# Line 5174  var EffectScene = (function (_super) { Line 5186  var EffectScene = (function (_super) {
5186          }          }
5187          this.root.insert(sp, 1);          this.root.insert(sp, 1);
5188          if(color) {          if(color) {
5189              var bg = new Shape(sp.width, sp.height, ShapeStyle.fill, color);              var bg = new Shape(sp.width, sp.height, ShapeStyle.Fill, color);
5190              bg.moveTo(sp.x, sp.y);              bg.moveTo(sp.x, sp.y);
5191              this.root.append(bg);              this.root.append(bg);
5192              bg.setDrawOption("globalAlpha", 0);              bg.setDrawOption("globalAlpha", 0);
# Line 5194  var EffectScene = (function (_super) { Line 5206  var EffectScene = (function (_super) {
5206          var _this = this;          var _this = this;
5207          var t = Effect.time;          var t = Effect.time;
5208          this.sp2.tl().fadeIn(t);          this.sp2.tl().fadeIn(t);
5209          var sp = new Shape(1, 1, ShapeStyle.fill, "black", ShapeType.arc);          var sp = new Shape(1, 1, ShapeStyle.Fill, "black", ShapeType.Arc);
5210          sp.moveTo(this.game.width / 2, this.game.height / 2);          sp.moveTo(this.game.width / 2, this.game.height / 2);
5211          sp.setClip(true);          sp.setClip(true);
5212          this.root.insert(sp, 1);          this.root.insert(sp, 1);
5213          if(color) {          if(color) {
5214              var bg = new Shape(this.game.width, this.game.height, ShapeStyle.fill, color);              var bg = new Shape(this.game.width, this.game.height, ShapeStyle.Fill, color);
5215              this.root.insert(bg, 1);              this.root.insert(bg, 1);
5216              bg.setDrawOption("globalAlpha", 0);              bg.setDrawOption("globalAlpha", 0);
5217              bg.tl().fadeIn(t * 0.6);              bg.tl().fadeIn(t * 0.6);
# Line 5214  var EffectScene = (function (_super) { Line 5226  var EffectScene = (function (_super) {
5226          this.swapScene();          this.swapScene();
5227          var t = Effect.time;          var t = Effect.time;
5228          this.sp2.tl().fadeIn(t);          this.sp2.tl().fadeIn(t);
5229          var sp = new Shape(1, 1, ShapeStyle.fill, "black", ShapeType.arc);          var sp = new Shape(1, 1, ShapeStyle.Fill, "black", ShapeType.Arc);
5230          sp.moveTo(-this.game.width / 2, -this.game.height / 2);          sp.moveTo(-this.game.width / 2, -this.game.height / 2);
5231          sp.width = this.game.width * 2;          sp.width = this.game.width * 2;
5232          sp.height = this.game.height * 2;          sp.height = this.game.height * 2;
5233          sp.setClip(true);          sp.setClip(true);
5234          this.root.insert(sp, 1);          this.root.insert(sp, 1);
5235          if(color) {          if(color) {
5236              var bg = new Shape(sp.width, sp.height, ShapeStyle.fill, color);              var bg = new Shape(sp.width, sp.height, ShapeStyle.Fill, color);
5237              bg.moveTo(sp.x, sp.y);              bg.moveTo(sp.x, sp.y);
5238              this.root.append(bg);              this.root.append(bg);
5239              bg.setDrawOption("globalAlpha", 0);              bg.setDrawOption("globalAlpha", 0);
# Line 5275  var EffectScene = (function (_super) { Line 5287  var EffectScene = (function (_super) {
5287      EffectScene.prototype.universalDelay = function (image, repeat, color) {      EffectScene.prototype.universalDelay = function (image, repeat, color) {
5288          var _this = this;          var _this = this;
5289          var t = Effect.time / 2;          var t = Effect.time / 2;
5290          var shape = new Shape(this.sp1.width, this.sp1.height, ShapeStyle.fill, color);          var shape = new Shape(this.sp1.width, this.sp1.height, ShapeStyle.Fill, color);
5291          shape.setDrawOption("globalAlpha", 0);          shape.setDrawOption("globalAlpha", 0);
5292          this.root.insert(shape, 0);          this.root.insert(shape, 0);
5293          this.sp1.tl().filter(ImageFilter.UniversalTransitionFilter, {          this.sp1.tl().filter(ImageFilter.UniversalTransitionFilter, {
# Line 5408  var MessageWindow = (function (_super) { Line 5420  var MessageWindow = (function (_super) {
5420              "rgba(138,193,255,0.5)",              "rgba(138,193,255,0.5)",
5421              "rgba(222, 235, 250, 0.5)"              "rgba(222, 235, 250, 0.5)"
5422          ]);          ]);
5423          var bg = new Shape(this.width, this.height, ShapeStyle.fill, bgColor);          var bg = new Shape(this.width, this.height, ShapeStyle.Fill, bgColor);
5424          this.setBg(bg);          this.setBg(bg);
5425          var textBg = new Shape(this.width - (this.padding.left + this.padding.right), this.height - (this.padding.top + this.padding.bottom), ShapeStyle.fill, "rgba(45,73,136,0.2)");          var textBg = new Shape(this.width - (this.padding.left + this.padding.right), this.height - (this.padding.top + this.padding.bottom), ShapeStyle.Fill, "rgba(45,73,136,0.2)");
5426          textBg.moveTo(this.padding.left, this.padding.top);          textBg.moveTo(this.padding.left, this.padding.top);
5427          this.setTextBg(textBg);          this.setTextBg(textBg);
5428          var textArea = new MultilineText({          var textArea = new MultilineText({

Legend:
Removed from v.66  
changed lines
  Added in v.67

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