/*! * pixi-animate - v1.3.3 * Compiled Mon, 08 Jan 2018 01:44:54 UTC * * pixi-animate is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pixiAnimate=t()}}(function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=r[a]={exports:{}};e[a][0].call(f.exports,function(t){var r=e[a][1][t];return i(r||t)},f,f.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a=t.totalFrames)throw new Error("End frame is out of bounds");if(e>=r)throw new Error("End frame is before start frame");this.stop(t),n=!!n;var l=a.default.create(t,e,r,n,i);return this._timelines.push(l),t.currentFrame!==e?t.gotoAndPlay(e):t.play(),l},t.stop=function(t){for(var e=0,r=this._timelines.length;e=0;t--)this._internalStop(this._timelines[t])},t._internalStop=function(t){this._timelines.splice(this._timelines.indexOf(t),1),t.instance.stop(),t.destroy()},i(t,null,[{key:"_timelines",get:function(){return s}},{key:"STOP_LABEL",get:function(){return"_stop"}},{key:"LOOP_LABEL",get:function(){return"_loop"}}]),t}();e.exports=l},{"./AnimatorTimeline":2}],2:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var r=0;r=this.end&&(t.currentFrame=this.end,this.loop?(t._updateTimeline(),t.gotoAndPlay(this.start)):(t.stop(),this.callback&&(e=this.callback),this.stop())),e},t.prototype.stop=function(){PIXI.animate.Animator._internalStop(this)},t.create=function(e,r,n,i,o){var a;return a=this._pool.length?this._pool.pop():new t,a.init(e,r,n,i,o),a},i(t,[{key:"progress",get:function(){var t=(this.instance.currentFrame-this.start)/(this.end-this.start);return Math.max(0,Math.min(1,t))}}],[{key:"_pool",get:function(){return o}}]),t}();e.exports=a},{}],3:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}r.__esModule=!0;var s=function(){function t(t,e){for(var r=0;r=0;--e)if(this._timelines[e].target===t)return this._timelines[e];var r=new u.default(t);return this._timelines.push(r),r},e.prototype.addTimedMask=function(t,e){for(var r in e)this.addKeyframe(t,{m:e[r]},parseInt(r,10));return this._setTimelinePosition(this.currentFrame,this.currentFrame,!0),this},e.prototype.am=function(t,e){return this.addTimedMask(t,e)},e.prototype.addTween=function(t,e,r,n,i){var o=this._getChildTimeline(t);return this._parseProperties(e),o.addTween(e,r,n,i),this._autoExtend(r+n),this},e.prototype.addKeyframe=function(t,e,r){var n=this._getChildTimeline(t);return this._parseProperties(e),n.addKeyframe(e,r),this._autoExtend(r),this},e.prototype.at=function(t,e,r,n){return this.addTimedChild(t,e,r,n)},e.prototype.addTimedChild=function(t,r,n,i){void 0===r&&(r=0),(void 0===n||n<1)&&(n=this._totalFrames||1),t.mode===e.SYNCHED&&(t.parentStartPosition=r);var o=void 0,a=void 0;for(a=this._timedChildTimelines.length-1;a>=0;--a)if(this._timedChildTimelines[a].target===t){o=this._timedChildTimelines[a];break}if(o||(o=[],o.target=t,this._timedChildTimelines.push(o)),c.default.fillFrames(o,r,n),this._totalFramesthis._duration&&(this._t=this.loop?this._t-this._duration:this._duration),this.currentFrame=Math.floor(this._t*this._framerate+1e-8),this.currentFrame>=this._totalFrames&&(this.currentFrame=this._totalFrames-1);var e=void 0;this._beforeUpdate&&(e=this._beforeUpdate(this)),this._updateTimeline(),e&&e()},e.prototype._goto=function(t){var e="string"==typeof t?this._labelDict[t]:t;void 0!==e&&(this._prevPos=NaN,this.currentFrame=e,this._framerate||(this.framerate=this.parentFramerate),this._framerate>0?this._t=e/this._framerate:this._t=0,this._updateTimeline())},e.prototype._reset=function(){this._prevPos=-1,this._t=0,this.currentFrame=0},e.prototype._updateTimeline=function(){var t=this.mode!==e.INDEPENDENT;t&&(this.currentFrame=this.startPosition+(this.mode===e.SINGLE_FRAME?0:this._synchOffset),this.currentFrame>=this._totalFrames&&(this.currentFrame%=this._totalFrames)),this._prevPos!==this.currentFrame&&(this._setTimelinePosition(this._prevPos,this.currentFrame,!t&&this.actionsEnabled),this._prevPos=this.currentFrame)},e.prototype._setTimelinePosition=function(t,r,n){var i=void 0,o=void 0,a=void 0,s=this._timelines;for(i=s.length-1;i>=0;--i){var l=s[i];for(o=0,a=l.length;o=u.startFrame&&r<=u.endFrame){u.setPosition(r);break}}}var f=this._timedChildTimelines,c=this._depthSorted;for(i=0,a=f.length;i=0?t+1:r;i0?(this._framerate=t,this._duration=t?this._totalFrames/t:0,this._t=this.currentFrame/t):this._t=this._framerate=this._duration=0}},{key:"totalFrames",get:function(){return this._totalFrames}},{key:"parentFramerate",get:function(){for(var t=this,r=t._framerate;(t=t.parent)&&!r;)t.mode===e.INDEPENDENT&&(r=t._framerate);return r||e.DEFAULT_FRAMERATE}}]),e}(h);p.INDEPENDENT=0,p.SINGLE_FRAME=1,p.SYNCHED=2,p.DEFAULT_FRAMERATE=24,p.extend=p.e=function(t){return t.prototype=Object.create(p.prototype),t.prototype.__parent=p.prototype,t.prototype.constructor=t,t},r.default=p},{"./Timeline":7,"./utils":12}],4:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}r.__esModule=!0;var s=t("./load"),l=n(s),u=t("./sound"),f=n(u),c=function(t){function e(r,n,a,s){i(this,e);var l=o(this,t.call(this,r,n,a,s));return l.sound=f.default,l.instance=null,l}return a(e,t),e.prototype.load=function(t,e,r){var n=this;return(0,l.default)(t,this.stage,function(t){n.instance=t,e&&e(t)},r)},e.prototype.destroy=function(e){this.instance&&(this.instance.destroy(!0),this.instance=null),t.prototype.destroy.call(this,e)},e}(PIXI.Application);r.default=c},{"./load":10,"./sound":11}],5:[function(t,e,r){"use strict";r.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=t("./utils"),o=function(t){return t&&t.__esModule?t:{default:t}}(i),a={};Object.defineProperty(a,"add",{enumerable:!1,value:function(t,e){"string"==typeof e&&(e=o.default.deserializeShapes(e));for(var r=0;r-1?i.default.add(t.name,n):n.nodeName&&"IMG"===n.nodeName&&PIXI.Texture.addTextureToCache(t.texture,t.name):e(),e()}};PIXI.loaders.Loader.addPixiMiddleware(o),r.default=o},{"./ShapesCache":5}],7:[function(t,e,r){"use strict";r.__esModule=!0;var n=t("./Tween"),i=function(t){return t&&t.__esModule?t:{default:t}}(n),o=function(t){Array.call(this),this.target=t,this._currentProps={}},a=o.prototype=Object.create(Array.prototype);a.addTween=function(t,e,r,n){this.extendLastFrame(e-1);var o={},a=void 0;for(a in t)if(this._currentProps.hasOwnProperty(a))o[a]=this._currentProps[a];else for(var s=o[a]=this.getPropFromShorthand(a),l=this.length-1;l>=0;--l)this[l].startProps[a]=s,this[l].endProps[a]=s;var u=new i.default(this.target,o,t,e,r,n);this.push(u),Object.assign(this._currentProps,u.endProps)},a.addKeyframe=function(t,e){this.extendLastFrame(e-1);var r=Object.assign({},this._currentProps,t),n=new i.default(this.target,r,null,e,0);this.push(n),Object.assign(this._currentProps,n.endProps)},a.extendLastFrame=function(t){if(this.length){var e=this[this.length-1];e.endFrameu&&(e>t?t+=f:e+=u+f),t+(e-t)*r}function a(t,e,r){switch(e){case"x":t.transform.position.x=r;break;case"y":t.transform.position.y=r;break;case"sx":t.transform.scale.x=r;break;case"sy":t.transform.scale.y=r;break;case"kx":t.transform.skew.x=r;break;case"ky":t.transform.skew.y=r;break;case"r":t.transform.rotation=r;break;case"a":t.alpha=r;break;case"t":t.i(r);break;case"c":t.c.apply(t,r);break;case"v":t.visible=r;break;case"m":t.ma(r)}}r.__esModule=!0;var s=function(){function t(e,r,i,o,a,s){n(this,t),this.target=e,this.startProps=r,this.endProps={},this.duration=a,this.startFrame=o,this.endFrame=o+a,this.ease=s,this.isTweenlessFrame=!i;var l=void 0;if(i)for(l in i)this.endProps[l]=i[l];for(l in r)this.endProps.hasOwnProperty(l)||(this.endProps[l]=r[l])}return t.prototype.setPosition=function(t){if(t>=this.endFrame)return void this.setToEnd();if(this.isTweenlessFrame)return void this.setToEnd();var e=(t-this.startFrame)/this.duration;this.ease&&(e=this.ease(e));var r=this.target,n=this.startProps,i=this.endProps;for(var o in i){var s=l[o];s?a(r,o,s(n[o],i[o],e)):a(r,o,n[o])}},t.prototype.setToEnd=function(){var t=this.endProps,e=this.target;for(var r in t)a(e,r,t[r])},t}(),l={x:i,y:i,sx:i,sy:i,kx:i,ky:i,r:o,a:i,t:null,v:null,c:null,m:null,g:null},u=Math.PI,f=2*u;r.default=s},{}],9:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0,r.VERSION=r.Tween=r.Timeline=r.SymbolLoader=r.ShapesCache=r.Scene=r.MovieClip=r.utils=r.sound=r.load=r.AnimatorTimeline=r.Animator=void 0;var i=t("./load"),o=n(i),a=t("./sound"),s=n(a),l=t("./utils"),u=n(l),f=t("./MovieClip"),c=n(f),h=t("./Scene"),d=n(h),p=t("./ShapesCache"),m=n(p),_=t("./SymbolLoader"),y=n(_),v=t("./Timeline"),b=n(v),g=t("./Tween"),P=n(g),T=t("./Animator"),w=n(T),F=t("./AnimatorTimeline"),I=n(F);r.Animator=w.default,r.AnimatorTimeline=I.default,r.load=o.default,r.sound=s.default,r.utils=u.default,r.MovieClip=c.default,r.Scene=d.default,r.ShapesCache=m.default,r.SymbolLoader=y.default,r.Timeline=b.default,r.Tween=P.default,r.VERSION="1.3.3"},{"./Animator":1,"./AnimatorTimeline":2,"./MovieClip":3,"./Scene":4,"./ShapesCache":5,"./SymbolLoader":6,"./Timeline":7,"./Tween":8,"./load":10,"./sound":11,"./utils":12}],10:[function(t,e,r){"use strict";r.__esModule=!0;var n=function(t,e,r,n,i,o){function a(){var e=new t.stage;t.parent&&t.parent.addChild(e),t.complete&&t.complete(e,i)}"function"==typeof e?(n=r,r=e,e=null):"string"==typeof r&&(n=r,r=null),"function"==typeof t&&(t={stage:t,parent:e,basePath:n||"",complete:r}),t=Object.assign({stage:null,parent:null,basePath:"",complete:null},t||{}),i=i||new PIXI.loaders.Loader;var s=t.stage.assets||{};if(s&&Object.keys(s).length){var l=t.basePath;l&&(l+="/");for(var u in s){var f=null;o&&(o[u]?f=o[u]:o.default&&(f=o.default)),i.add(u,l+s[u],f)}i.once("complete",a).load()}else a();return i};r.default=n},{}],11:[function(t,e,r){"use strict";r.__esModule=!0,r.default=new PIXI.utils.EventEmitter},{}],12:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var i=null,o=function(){function t(){n(this,t)}return t.hexToUint=function(t){return t=t.substr(1),3===t.length&&(t=t.replace(/([a-f0-9])/g,"$1$1")),parseInt(t,16)},t.fillFrames=function(t,e,r){var n=t.length;if(n>16&255,r=t>>8&255,n=255&t;return this.c(e/255,0,r/255,0,n/255,0)},o.setColorTransform=o.c=function(t,e,r,n,i,o){var a=this.colorTransformFilter;return a.matrix[0]=t,a.matrix[4]=e,a.matrix[6]=r,a.matrix[9]=n,a.matrix[12]=i,a.matrix[14]=o,this.filters=[a],this},o.hasOwnProperty("colorTransformFilter")||Object.defineProperty(o,"colorTransformFilter",{set:function(t){this._colorTransformFilter=t},get:function(){return this._colorTransformFilter||new a}}),PIXI.DisplayObject.extend=PIXI.DisplayObject.e=function(t){return t.prototype=Object.create(o),t.prototype.__parent=o,t.prototype.constructor=t,t}},{"../animate/utils":12}],15:[function(t,e,r){"use strict";var n=PIXI.Graphics.prototype;n.drawCommands=n.d=function(t){for(var e,r=[],n=0;n<=t.length;){var i=t[n++];void 0===i||this[i]?(e&&(this[e].apply(this,r),r.length=0),e=i):r.push(i)}return this},n.c=n.closePath,n.h=n.addHole,n.m=n.moveTo,n.l=n.lineTo,n.q=n.quadraticCurveTo,n.b=n.bezierCurveTo,n.f=n.beginFill,n.s=n.lineStyle,n.dr=n.drawRect,n.rr=n.drawRoundedRect,n.rc=n.drawRoundedRect,n.dc=n.drawCircle,n.ar=n.arc,n.at=n.arcTo,n.de=n.drawEllipse,n.lf=function(t){return this.f(t[0])},n.rf=function(t){return this.f(t[0])},n.bf=function(){return this.f(0)},n.sd=function(){return this},n.bs=function(){return this},n.ls=function(){return this},n.rs=function(){return this}},{}],16:[function(t,e,r){"use strict";var n=PIXI.Sprite.prototype;PIXI.Sprite.extend=PIXI.Sprite.e=function(t){return t.prototype=Object.create(n),t.prototype.__parent=n,t.prototype.constructor=t,t}},{}],17:[function(t,e,r){"use strict";var n=PIXI.Text.prototype,i=["center","right"];n.setAlign=n.g=function(t){return"string"==typeof t&&(t=i.indexOf(t)),this.style.align=i[t]||"left",this.anchor.x=(t+1)/2,this};var o={o:"font",z:"fontSize",f:"fontFamily",y:"fontStyle",g:"fontWeight",i:"fill",a:"align",s:"stroke",t:"strokeThickness",w:"wordWrap",d:"wordWrapWidth",l:"lineHeight",h:"dropShadow",c:"dropShadowColor",n:"dropShadowAngle",b:"dropShadowBlur",p:"padding",x:"textBaseline",j:"lineJoin",m:"miterLimit",e:"letterSpacing"};n.setStyle=n.ss=function(t){for(var e in o)void 0!==t[e]&&(t[o[e]]=t[e],delete t[e]);return this.style=t,this},n.setShadow=n.sh=function(t,e,r){var n=this.style;return n.dropShadow=!0,void 0!==t&&(t="#"+t.toString(16)),n.dropShadowColor=a(t,n.dropShadowColor),n.dropShadowAngle=a(e,n.dropShadowAngle),n.dropShadowDistance=a(r,n.dropShadowDistance),this};var a=function(t,e){return void 0===t?e:t}},{}],18:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var i=t("./Container"),o=n(i),a=t("./DisplayObject"),s=n(a),l=t("./Sprite"),u=n(l),f=t("./Graphics"),c=n(f),h=t("./Text"),d=n(h);r.default={Container:o.default,DisplayObject:s.default,Sprite:u.default,Graphics:c.default,Text:d.default}},{"./Container":13,"./DisplayObject":14,"./Graphics":15,"./Sprite":16,"./Text":17}],19:[function(t,e,r){"use strict";if("undefined"==typeof PIXI)throw"Requires PIXI";PIXI.animate||(t("./mixins"),Object.defineProperty(PIXI,"animate",{enumerable:!0,get:function(){return t("./animate")}})),void 0!==e&&e.exports&&(e.exports=PIXI.animate)},{"./animate":9,"./mixins":18}]},{},[19])(19)}); //# sourceMappingURL=pixi-animate.min.js.map