cocos-vuecli-demo/vueTem/static/cocos-build/web-mobile/cocos2d-js-min.js

1 line
1.8 MiB
JavaScript
Raw Normal View History

2021-04-09 06:43:19 +00:00
(function(t,e,i){function n(i,r){var s=e[i];if(!s){var a=t[i];if(!a)return;var o={};s=e[i]={exports:o},a[0]((function(t){return n(a[1][t]||t)}),s,o)}return s.exports}for(var r=0;r<i.length;r++)n(i[r])})({1:[(function(t,e,i){"use strict";t("../core/platform/CCClass");var n=t("../core/utils/misc");cc.Action=cc.Class({name:"cc.Action",ctor:function(){this.originalTarget=null,this.target=null,this.tag=cc.Action.TAG_INVALID},clone:function(){var t=new cc.Action;return t.originalTarget=null,t.target=null,t.tag=this.tag,t},isDone:function(){return!0},startWithTarget:function(t){this.originalTarget=t,this.target=t},stop:function(){this.target=null},step:function(t){cc.logID(1006)},update:function(t){cc.logID(1007)},getTarget:function(){return this.target},setTarget:function(t){this.target=t},getOriginalTarget:function(){return this.originalTarget},setOriginalTarget:function(t){this.originalTarget=t},getTag:function(){return this.tag},setTag:function(t){this.tag=t},retain:function(){},release:function(){}}),cc.Action.TAG_INVALID=-1,cc.FiniteTimeAction=cc.Class({name:"cc.FiniteTimeAction",extends:cc.Action,ctor:function(){this._duration=0},getDuration:function(){return this._duration*(this._timesForRepeat||1)},setDuration:function(t){this._duration=t},reverse:function(){return cc.logID(1008),null},clone:function(){return new cc.FiniteTimeAction}}),cc.Speed=cc.Class({name:"cc.Speed",extends:cc.Action,ctor:function(t,e){this._speed=0,this._innerAction=null,t&&this.initWithAction(t,e)},getSpeed:function(){return this._speed},setSpeed:function(t){this._speed=t},initWithAction:function(t,e){return t?(this._innerAction=t,this._speed=e,!0):(cc.errorID(1021),!1)},clone:function(){var t=new cc.Speed;return t.initWithAction(this._innerAction.clone(),this._speed),t},startWithTarget:function(t){cc.Action.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},stop:function(){this._innerAction.stop(),cc.Action.prototype.stop.call(this)},step:function(t){this._innerAction.step(t*this._speed)},isDone:function(){return this._innerAction.isDone()},reverse:function(){return new cc.Speed(this._innerAction.reverse(),this._speed)},setInnerAction:function(t){this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return this._innerAction}}),cc.speed=function(t,e){return new cc.Speed(t,e)},cc.Follow=cc.Class({name:"cc.Follow",extends:cc.Action,ctor:function(t,e){this._followedNode=null,this._boundarySet=!1,this._boundaryFullyCovered=!1,this._halfScreenSize=null,this._fullScreenSize=null,this.leftBoundary=0,this.rightBoundary=0,this.topBoundary=0,this.bottomBoundary=0,this._worldRect=cc.rect(0,0,0,0),t&&(e?this.initWithTarget(t,e):this.initWithTarget(t))},clone:function(){var t=new cc.Follow,e=this._worldRect,i=new cc.Rect(e.x,e.y,e.width,e.height);return t.initWithTarget(this._followedNode,i),t},isBoundarySet:function(){return this._boundarySet},setBoudarySet:function(t){this._boundarySet=t},initWithTarget:function(t,e){if(!t)return cc.errorID(1022),!1;e=e||cc.rect(0,0,0,0),this._followedNode=t,this._worldRect=e,this._boundarySet=!(0===e.width&&0===e.height),this._boundaryFullyCovered=!1;var i=cc.winSize;return this._fullScreenSize=cc.v2(i.width,i.height),this._halfScreenSize=this._fullScreenSize.mul(.5),this._boundarySet&&(this.leftBoundary=-(e.x+e.width-this._fullScreenSize.x),this.rightBoundary=-e.x,this.topBoundary=-e.y,this.bottomBoundary=-(e.y+e.height-this._fullScreenSize.y),this.rightBoundary<this.leftBoundary&&(this.rightBoundary=this.leftBoundary=(this.leftBoundary+this.rightBoundary)/2),this.topBoundary<this.bottomBoundary&&(this.topBoundary=this.bottomBoundary=(this.topBoundary+this.bottomBoundary)/2),this.topBoundary===this.bottomBoundary&&this.leftBoundary===this.rightBoundary&&(this._boundaryFullyCovered=!0)),!0},step:function(t){var e=this.target.convertToWorldSpaceAR(cc.Vec2.ZERO),i=this._followedNode.convertToWorldSpaceAR(cc.Vec2.ZERO),r=e.sub(i),s=this.target.parent.convertToNodeSpaceAR(r.add(this._halfScreenSize));if(this._boundarySet){if(this._boundaryFullyCovered)return;this.target.setPosition(