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 80 by tsugehara, Thu Apr 11 18:37:18 2013 UTC revision 81 by tsugehara, Sat Apr 13 13:03:09 2013 UTC
# Line 571  var ENTITY_OPTIONS_DEFAULT_VALUES = { Line 571  var ENTITY_OPTIONS_DEFAULT_VALUES = {
571  })();  })();
572  var E = (function () {  var E = (function () {
573      function E() {      function E() {
574            this.opacity = 1;
575            this.x = 0;
576            this.y = 0;
577      }      }
578      E.prototype.enablePointingEvent = function () {      E.prototype.enablePointingEvent = function () {
579          this.pointCapture = true;          this.pointCapture = true;
# Line 774  var E = (function () { Line 777  var E = (function () {
777          }          }
778      };      };
779      E.prototype.updated = function () {      E.prototype.updated = function () {
780          if(this.parent) {          var p = this;
781              this.parent.updated();          while(p.parent) {
782          } else {              p = p.parent;
             this.isUpdated = true;  
783          }          }
784            p.isUpdated = true;
785      };      };
786      E.prototype.isUpdate = function () {      E.prototype.isUpdate = function () {
787          return this.isUpdated;          return this.isUpdated;
# Line 889  var E = (function () { Line 892  var E = (function () {
892      };      };
893      E.prototype.draw = function (context) {      E.prototype.draw = function (context) {
894      };      };
895        E.prototype.show = function () {
896            this.opacity = 1;
897        };
898        E.prototype.hide = function () {
899            this.opacity = 0;
900        };
901      return E;      return E;
902  })();  })();
903  var __extends = this.__extends || function (d, b) {  var __extends = this.__extends || function (d, b) {
# Line 2417  var Renderer = (function () { Line 2426  var Renderer = (function () {
2426              parent.orderDraw();              parent.orderDraw();
2427          }          }
2428          c.save();          c.save();
2429            if(parent.opacity != 1) {
2430                c.globalAlpha = parent.opacity;
2431            }
2432          if(parent.options) {          if(parent.options) {
2433              if(this.useDrawOption(parent, c)) {              if(this.useDrawOption(parent, c)) {
2434                  c.restore();                  c.restore();
# Line 2432  var Renderer = (function () { Line 2444  var Renderer = (function () {
2444          c.restore();          c.restore();
2445      };      };
2446      Renderer.prototype.renderEntity = function (entity, c) {      Renderer.prototype.renderEntity = function (entity, c) {
2447            if(!entity.opacity) {
2448                return;
2449            }
2450          if(entity.disableTransform) {          if(entity.disableTransform) {
2451              entity.draw(c);              entity.draw(c);
2452          } else {          } else {
2453              c.save();              c.save();
2454              c.translate(entity.x, entity.y);              c.translate(entity.x, entity.y);
2455                if(entity.opacity != 1) {
2456                    c.globalAlpha *= entity.opacity;
2457                }
2458              if(entity.options) {              if(entity.options) {
2459                  if(this.useDrawOption(entity, c)) {                  if(this.useDrawOption(entity, c)) {
2460                      c.restore();                      c.restore();
# Line 2479  var Renderer = (function () { Line 2497  var Renderer = (function () {
2497              if(this.drawOptionFunctions[p]) {              if(this.drawOptionFunctions[p]) {
2498                  this.drawOptionFunctions[p].call(this, c, entity, entity.options[p]);                  this.drawOptionFunctions[p].call(this, c, entity, entity.options[p]);
2499              } else {              } else {
                 if(entity.options[p] === 0 && p == "globalAlpha") {  
                     return true;  
                 }  
2500                  c[p] = entity.options[p];                  c[p] = entity.options[p];
2501              }              }
2502          }          }
# Line 4470  var Timeline = (function () { Line 4485  var Timeline = (function () {
4485      };      };
4486      Timeline.prototype.fadeTo = function (opacity, time, easing) {      Timeline.prototype.fadeTo = function (opacity, time, easing) {
4487          this.tween({          this.tween({
4488              globalAlpha: opacity,              opacity: opacity,
4489              time: time,              time: time,
4490              easing: easing              easing: easing
4491          });          });
# Line 4484  var Timeline = (function () { Line 4499  var Timeline = (function () {
4499      };      };
4500      Timeline.prototype.hide = function () {      Timeline.prototype.hide = function () {
4501          return this.then(function () {          return this.then(function () {
4502              this.setDrawOption("globalAlpha", 0);              this.hide();
4503          });          });
4504      };      };
4505      Timeline.prototype.show = function () {      Timeline.prototype.show = function () {
4506          return this.then(function () {          return this.then(function () {
4507              this.setDrawOption("globalAlpha", 1);              this.show();
4508          });          });
4509      };      };
4510      Timeline.prototype.resizeTo = function (size, time, easing, easing2) {      Timeline.prototype.resizeTo = function (size, time, easing, easing2) {
# Line 5268  var EffectScene = (function (_super) { Line 5283  var EffectScene = (function (_super) {
5283          _super.call(this, game);          _super.call(this, game);
5284          var sp1 = this.captureScene(scene1);          var sp1 = this.captureScene(scene1);
5285          var sp2 = this.captureScene(scene2);          var sp2 = this.captureScene(scene2);
5286          sp2.setDrawOption("globalAlpha", 0);          sp2.hide();
5287          sp1.x = sp1.y = sp2.x = sp2.y = 0;          sp1.x = sp1.y = sp2.x = sp2.y = 0;
5288          this.append(sp1);          this.append(sp1);
5289          this.append(sp2);          this.append(sp2);
# Line 5295  var EffectScene = (function (_super) { Line 5310  var EffectScene = (function (_super) {
5310      EffectScene.prototype._fadeColor = function (color) {      EffectScene.prototype._fadeColor = function (color) {
5311          var _this = this;          var _this = this;
5312          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);
5313          shape.setDrawOption("globalAlpha", 0);          shape.hide();
5314          this.root.append(shape);          this.root.append(shape);
5315          var t = Effect.time / 2;          var t = Effect.time / 2;
5316          this.sp1.tl().fadeOut(t);          this.sp1.tl().fadeOut(t);
# Line 5423  var EffectScene = (function (_super) { Line 5438  var EffectScene = (function (_super) {
5438          if(color) {          if(color) {
5439              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);
5440              this.root.insert(bg, 1);              this.root.insert(bg, 1);
5441              bg.setDrawOption("globalAlpha", 0);              bg.hide();
5442              bg.tl().fadeIn(t * 0.6);              bg.tl().fadeIn(t * 0.6);
5443          }          }
5444          if(rotate) {          if(rotate) {
# Line 5459  var EffectScene = (function (_super) { Line 5474  var EffectScene = (function (_super) {
5474              var bg = new Shape(sp.width, sp.height, ShapeStyle.Fill, color);              var bg = new Shape(sp.width, sp.height, ShapeStyle.Fill, color);
5475              bg.moveTo(sp.x, sp.y);              bg.moveTo(sp.x, sp.y);
5476              this.root.append(bg);              this.root.append(bg);
5477              bg.setDrawOption("globalAlpha", 0);              bg.hide();
5478              bg.tl().fadeIn(t * 0.8).and().resizeTo(1, 1, t).and().moveTo(this.game.width / 2, this.game.height / 2, t);              bg.tl().fadeIn(t * 0.8).and().resizeTo(1, 1, t).and().moveTo(this.game.width / 2, this.game.height / 2, t);
5479              if(rotate) {              if(rotate) {
5480                  bg.setDrawOption("rotate", rotate);                  bg.setDrawOption("rotate", rotate);
# Line 5483  var EffectScene = (function (_super) { Line 5498  var EffectScene = (function (_super) {
5498          if(color) {          if(color) {
5499              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);
5500              this.root.insert(bg, 1);              this.root.insert(bg, 1);
5501              bg.setDrawOption("globalAlpha", 0);              bg.hide();
5502              bg.tl().fadeIn(t * 0.6);              bg.tl().fadeIn(t * 0.6);
5503          }          }
5504          sp.tl().resizeTo(this.game.width * 2, this.game.height * 2, t).and().moveTo(-this.game.width / 2, -this.game.height / 2, t);          sp.tl().resizeTo(this.game.width * 2, this.game.height * 2, t).and().moveTo(-this.game.width / 2, -this.game.height / 2, t);
# Line 5506  var EffectScene = (function (_super) { Line 5521  var EffectScene = (function (_super) {
5521              var bg = new Shape(sp.width, sp.height, ShapeStyle.Fill, color);              var bg = new Shape(sp.width, sp.height, ShapeStyle.Fill, color);
5522              bg.moveTo(sp.x, sp.y);              bg.moveTo(sp.x, sp.y);
5523              this.root.append(bg);              this.root.append(bg);
5524              bg.setDrawOption("globalAlpha", 0);              bg.hide();
5525              bg.tl().fadeIn(t * 0.9).and().resizeTo(1, 1, t).and().moveTo(this.game.width / 2, this.game.height / 2, t);              bg.tl().fadeIn(t * 0.9).and().resizeTo(1, 1, t).and().moveTo(this.game.width / 2, this.game.height / 2, t);
5526          } else {          } else {
5527              this.sp1.tl().fadeOut(t);              this.sp1.tl().fadeOut(t);
# Line 5558  var EffectScene = (function (_super) { Line 5573  var EffectScene = (function (_super) {
5573          var _this = this;          var _this = this;
5574          var t = Effect.time / 2;          var t = Effect.time / 2;
5575          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);
5576          shape.setDrawOption("globalAlpha", 0);          shape.hide();
5577          this.root.insert(shape, 0);          this.root.insert(shape, 0);
5578          this.sp1.tl().filter(ImageFilter.UniversalTransitionFilter, {          this.sp1.tl().filter(ImageFilter.UniversalTransitionFilter, {
5579              image: image,              image: image,
# Line 5741  var MessageWindow = (function (_super) { Line 5756  var MessageWindow = (function (_super) {
5756          if(fade) {          if(fade) {
5757              this.tl().fadeOut(200);              this.tl().fadeOut(200);
5758          } else {          } else {
5759              this.setDrawOption("globalAlpha", 0);              _super.prototype.hide.call(this);
5760          }          }
5761      };      };
5762      MessageWindow.prototype.show = function (fade) {      MessageWindow.prototype.show = function (fade) {
5763          if(fade) {          if(fade) {
5764              this.tl().fadeIn(200);              this.tl().fadeIn(200);
5765          } else {          } else {
5766              this.removeDrawOption("globalAlpha");              _super.prototype.show.call(this);
5767          }          }
5768      };      };
5769      MessageWindow.prototype.showText = function () {      MessageWindow.prototype.showText = function () {

Legend:
Removed from v.80  
changed lines
  Added in v.81

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