text: var bma;!function(a){!function(a){var b=function(){function a(a,b,c,d){void 0===c&&(c=300),void 0===d&&(d=10),this.renderer=a,this.baseContainer=b,this.focalLength=c,this.movementDamping=d,this.x=0,this.y=0,this.layers=[],this._baseZoom=1,this._zoom=1,this._shakeEndTime=0,this._shakeStrength=0}return a.prototype.update=function(){if(this.baseContainer){var a=.5*this.renderer.width,b=.5*this.renderer.height,c=0,d=0,e=this._target;e&&(0==this.movementDamping?(this.x=-e.x,this.y=-e.y):(this.x+=(-this.x-e.x)/this.movementDamping,this.y+=(-this.y-e.y)/this.movementDamping));var f=this._shakeStrength;if(f){Date.now()>this._shakeEndTime?this._shakeStrength=0:(c=this.randomFloat(-f,f),d=this.randomFloat(-f,f))}var g=this.bounds;if(g=null){var h=this.zoom;this.x<=-g.width*h?this.x=-g.width*h:this.x>=-g.x*h&&(this.x=-g.x*h),this.y<=-g.height*h?this.y=-g.height*h:this.y>=-g.y*h&&(this.y=-g.y*h)}for(var i=this.layers.length;--i>-1;){var j=this.layers[i],k=this.focalLength/(this.focalLength-j.pz);j.x=(j.px+this.x+c)*k,j.y=(j.py+this.y+d)*k,j.scale.set(k,k)}var l=0,m=0;if(e){var n=this.getParallaxParent(e.parent);n&&(l=n.x*(1/n.scale.x),m=n.y*(1/n.scale.y))}this.baseContainer.x=this.x-l+c+a,this.baseContainer.y=this.y-m+d+b}},a.prototype.addLayer=function(a){if(null==a.pz)throw Error("Layers needs to be a ParallaxLayer.");-1==this.layers.indexOf(a)&&(this.layers.push(a),this.baseContainer.addChild(a),this.zsort())},a.prototype.removeLayer=function(a){var b=this.layers.indexOf(a);-1!=b&&this.layers.splice(b,1),a.parent===this.baseContainer&&this.baseContainer.removeChild(a)},a.prototype.shake=function(a,b){void 0===b&&(b=1),this._shakeStrength=a,this._shakeEndTime=Date.now()+1e3*b},a.prototype.stopShake=function(){this._shakeStrength=0},a.prototype.setTarget=function(a,b){void 0===b&&(b=!0),this._target=a,a&&b&&(this.x=-a.x,this.y=-a.y)},a.prototype.zsort=function(){this.layers=this.layers.sort(function(a,b){return a.pz-b.pz});for(var a=0;a<this.layers.length;++a)this.baseContainer.addChildAt(this.layers[a],a)},a.prototype.dispose=function(){this.layers=null,this._target=null,this.baseContainer.removeChildren(),this.baseContainer=null},Object.defineProperty(a.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"baseZoom",{get:function(){return this._baseZoom},set:function(a){this._baseZoom=a,this.zoom=this.zoom},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"zoom",{get:function(){return this._zoom},set:function(a){this._zoom=a,this.baseContainer.scale.set(a*this._baseZoom,a*this._baseZoom)},enumerable:!0,configurable:!0}),a.prototype.getParallaxParent=function(a){return null==a?null:a.pz?a:this.getParallaxParent(a.parent)},a.prototype.randomFloat=function(a,b){return Math.random()*(b-a)+a},a}();a.ParallaxCamera=b}(a.pixi||(a.pixi={}))}(bma||(bma={}));var __extends=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},bma;!function(a){!function(a){var b=function(a){function b(b){void 0===b&&(b=0),a.call(this),this.px=0,this.py=0,this.pz=0,this.pz=b}return __extends(b,a),b}(PIXI.Container);a.ParallaxLayer=b}(a.pixi||(a.pixi={}))}(bma||(bma={}));