Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadAssets(["i/g/icon_shop.svg", "i/g/coin.svg", "i/g/s/icon_frvr.svg", "i/g/crown.svg", "i/g/icon_share.svg", "i/g/finger.svg", "i/g/s/sidebar.svg", "i/g/glow.svg", "i/g/icon_sound.svg", "i/g/helper.svg", "i/g/s/icon_tumblr.svg", "i/g/icon_credits.svg", "i/g/s/sliderslider.svg", "i/g/icon_download.svg", "i/g/shopbtn.svg", "i/g/icon_feedback.svg", "i/g/s/icon_facebook.svg", "i/g/icon_frvr.svg", "i/g/s/icon_gplus.svg", "i/g/icon_legal.svg", "i/g/s/menutile.svg", "i/g/icon_music.svg", "i/g/s/sliderbg.svg", "i/g/icon_new.svg", "i/g/star.svg", "i/g/tile.svg", "i/g/btnoutline.png", "i/g/shadow.png"], ["6nml5l5l5l5onm///////////l/o", "ywt88Fn2ot88Fn2o69pEnmlllqoPt88F9nm///////////l/qoP", "yw9pEnmllllllllllllllllllllllllqP", "6nmllllllon2on2on2o", "yw9pEnmlllllP6nmlllllllllo", "t88888888Fnm2lllot88Fnml2lll2lo6nm////o6nm2/2o", "yw9pEnm/l/l/l/lqP6n2o6nm/l/l/l/lot88Fnmlllo", "D888Fnm////////////////////o", "yw6nm///////////////q9opEnm//P9nm//P9nm//P", "ywt88Fnm/l/l/l/l/l/lo6n2on2q9opEnm//Pnm////onm////o", "6nm///////ll//////lllll///////l/lmo", "yw6nmlllmlllmlllmlllmlllmlllmlllmlllmlllmlllmlllo9pEnmlllllllllllllllllllllllqP", "ywt88F9t88GEnm/l/l/l/lqoP", "yw9pEnm///////l///P6nmlllllllllllllo", "D88Fnm////m////ot88Fnm////m////ot88Fnm////ml/llllo6nmll/lllo", "yw9pEnm//ll///qP6nm////mllllonml////l////llm////o", "6nml/l/llllll//ll/llllll/l/o", "yw9pEnmllllllllllllllllllllllllqP", "fnnml/l/l/lC6nm////l////////m//m////mo6rfnnmlllC6nmllllllllllllmor", "yw9pEn2qP6nml////l////llm////o", "6nm2l2l2l2lm2l2l2l2lm2l2l2l2lm2l2l2l2lm2l2l2l2lm2l2l2l2lm2l2l2l2lonm2l2l2l2lo", "6nm//////////////////o", "ywt88888F9pEnm/l/l/l/lqoPp9nmlPp9nmlPp9nmlPp9nmlP", "yw9pEn2qP9nmlP9nmlP", "yw69pEnmlllllllllqoP69nmlllllllllqoP", "ywt88Fnm//////////////////////////////o6fnnm//////////////////////////////q9CpEnmP9nmP9nmP9nmP9nmP9nmP9nmP4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllor6nm//////////////////////////////o6fnnm//////////////////////////////qCp9EnmP9nmP9nmP9nmP9nmP9nmP9nmP4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllo4t88FfnmlllCfAnml5l5l5l5orrbnmllllor"], ["(y(y~<><><>hulS@lSTmS@lSTmS@lSTmS@lSTm(tSTm(tSTm(thul(thul(thul(thulS@lhulS@lhulS@lUZmK+lUZmZ#lMVmV&l(rV&lnRmV&lfNm@+lfNm@+lfNm@+lDJmV&lMHmV&lTFmW&l+Am@+l+Am@+l+Am@+lo.lU&ly-lV&l5&lW&lZ/l@+lZ/l@+lZ/l@+lj7lS&l25lV&l/3lZ&ljzl@+ljzl@+ljzl@+lMvld&lXtlV&l0rlP&lfolf#lfolK+lfolc5l!zl&ul!zl&ulqNm&ulqNm&ulUZmZ5lUZmK+l", ")M)M(yyll(yyTn__<>)$_Gml~_)$)L_Gml(y(yAcm_dtl~(y(H(y)F_~<<<$),~~<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Mfzrg6IaEIXfPlE/xqAOPakgIcqWnHNr9EDxKe7UlTvfxJx62g3rmpXYZnMarul91d4IoxEU3ctHN6nuL9BN7Sjgh4SQVPlr4mEQOisIJFx9DTlIdnlW203kpvhBpNG1c9phw4gD46lFUjOSEtA/fSkIOhITgOi7DQR5iUyZckYt/XfZRowlUkut/U+bXCUkuNiM6StEqOZyq1m2ApAZPOEmq/RxZuZdwIjr2cuIr6cgPBIpJycp9hwROAik1BYEE+QI2nQD50/GuCU+WQJIyE3fRjRm5vrc45MDhhByKZk5xHYbFGi3GVZU7+zlJIlaJcyhbIoei4uPxf5RSRk4g8hGZkfNQ7vc9llIpSf0zcmKVnCRHsoskcji1Hy6JwgEqq8GTwtV5NpJzVJWrPHP7f5XI4SiXQxSUuQmUl5UTfjXni4+6UyWBIzNzN6tcjiyfI76diwlw8Z5GxTOXkUu2NT72csIWyaFYLtlWUSanlJgiEMrKMR3hS8vmz5o26edeVO8vFbh2SRYORyIAAAAASUVORK5CYII=", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAACjCAMAAABBoSd9AAADAFBMVEVHcEz///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9l4+88AAAA/3RSTlMABgX8BAP9Af4CCPoLB/j79RUQ+Qkc8QrfJA/ADQ7MDHvW60TstPenEeX2ixSaNxP0bfJfOOYtFhLzG1EZGPAaLiPv7lIgKyJeH+rnJioh4uNBMRfp7R1sLDonNC8oNR5DJUmKKdzU5DNC6FDd2Nlb0NuZmKzJvnnTNkul4N7KpNXXTeG3P7N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20pm7eUZkdZIeYYHd7yqXYdKUfbX/nOK7t86Y1T102rU3FWb+rq9EbrYNm8p6+201qknBfsn9kc1gBZDZReJXmfqKcYHdhSltRqSJq48upl3Is7CVoXbyTj3LiolXDnxV7fkMM1GKiUjBOgt5iai5IaFMk4DZLHJ97n7+taDfVEq5kYy1Md/C+EnUMIU8re9/s2XMbZsO/4vJQ97bbX7LjgX43UjQC9uv2Ddc1V/J3IpGy4BDkaHaoYHZQ9hkg0TDXa7QVbe2VfaReyxzcFx3dPSLsrm28+LDCoHWSL9CUzE32OaBBV5M/BBpAlKShtKZ5qQwZSchUWKB6o9enruhe2zjqVfWA7DgLIej3Mfb3stDUySgxtkOwywrwF51Xhtj7kyTV8SiGmGqTxAsUH0VQzQ4+Oc11lsdcN7l2I3IqDyDbdZdUy17mYEGZTZyN2ibNT1L5bbuFH0XvdeHS0kUtDmFyU7HS1z/Vly5b5VJ+Wldhes2BZ89sgnWSaIhPtd58fqA3xPimqQ0jrO9VML8vDEqGAma5RUa6ZlRHnLbyy9DAhSBY1l5pIHRMDtWEPhPEu4E81RUhai4ltjPSHQxtiFL2m4HgFZBnqmcUM1zfFU8RaFFXkOQ9h3zMEFg9UkdOJcEB8rLUx1afgSTMzGxszM4qehKoxGFy4raaqYtB/n9tS/oGL3a6JUMyZo8dQVKc+H4R1QpX5wDpZ37WISnLJ6qQhO6rJtMEDZ1K46QgcijedCVX9dPgjgooo/bhplCDRv3FBm/bXadIPcbAD+VAgbBOoUuTBSvdPIyXoYqpx+Koqcub66+hoNsHR1EGELlRBFnKRxVdEY8b7ioI2x2CDOLW2fNQQ66vBicjysDjqrsaP2uaK0mDjjGY+rSCK7wqqxG39GrHWdG1UU5FrDVGkij+5JM3V+LcmgsClUeCNf1vSVyCNTocm/onzKye7S8Pm+fzmkvB/SwH94jS8pv8BJNsm9IJlgp8AAAAASUVORK5CYII="]);
- if (console.timeStamp) console.timeStamp('FRVR Page Load Done');
- ! function() {
- function e() {
- var e = {};
- return e.WEBGL_RENDERER = 0, e.CANVAS_RENDERER = 1, e.VERSION = "v2.2.3FRVR", e.blendModes = {
- NORMAL: 0,
- ADD: 1,
- MULTIPLY: 2,
- SCREEN: 3,
- OVERLAY: 4,
- DARKEN: 5,
- LIGHTEN: 6,
- COLOR_DODGE: 7,
- COLOR_BURN: 8,
- HARD_LIGHT: 9,
- SOFT_LIGHT: 10,
- DIFFERENCE: 11,
- EXCLUSION: 12,
- HUE: 13,
- SATURATION: 14,
- COLOR: 15,
- LUMINOSITY: 16
- }, e.scaleModes = {
- DEFAULT: 0,
- LINEAR: 0,
- NEAREST: 1
- }, e._UID = 0, "undefined" != typeof Float32Array ? (e.Float32Array = Float32Array, e.Uint16Array = Uint16Array, e.Uint32Array = Uint32Array, e.ArrayBuffer = ArrayBuffer) : (e.Float32Array = Array, e.Uint16Array = Array), e.INTERACTION_FREQUENCY = 30, e.AUTO_PREVENT_DEFAULT = !0, e.PI_2 = 2 * Math.PI, e.RAD_TO_DEG = 180 / Math.PI, e.DEG_TO_RAD = Math.PI / 180, e.defaultRenderOptions = {
- view: null,
- transparent: !1,
- antialias: !1,
- preserveDrawingBuffer: !1,
- clearBeforeRender: !0,
- autoResize: !1
- }, e.Point = function(e, t) {
- this.x = e || 0, this.y = t || 0
- }, e.Point.prototype.clone = function() {
- return new e.Point(this.x, this.y)
- }, e.Point.prototype.set = function(e, t) {
- this.x = e || 0, this.y = t || (0 !== t ? this.x : 0)
- }, e.Point.prototype.constructor = e.Point, e.Rectangle = function(e, t, i, n) {
- this.x = e || 0, this.y = t || 0, this.width = i || 0, this.height = n || 0
- }, e.Rectangle.prototype.clone = function() {
- return new e.Rectangle(this.x, this.y, this.width, this.height)
- }, e.Rectangle.prototype.contains = function(e, t) {
- if (this.width <= 0 || this.height <= 0) return !1;
- var i = this.x;
- if (e >= i && e <= i + this.width) {
- var n = this.y;
- if (t >= n && t <= n + this.height) return !0
- }
- return !1
- }, e.Rectangle.prototype.constructor = e.Rectangle, e.EmptyRectangle = new e.Rectangle(0, 0, 0, 0), e.Polygon = function(t) {
- if (t instanceof Array || (t = Array.prototype.slice.call(arguments)), t[0] instanceof e.Point) {
- for (var i = [], n = 0, r = t.length; n < r; n++) i.push(t[n].x, t[n].y);
- t = i
- }
- this.closed = !0, this.points = t
- }, e.Polygon.prototype.clone = function() {
- var t = this.points.slice();
- return new e.Polygon(t)
- }, e.Polygon.prototype.contains = function(e, t) {
- for (var i = !1, n = this.points.length / 2, r = 0, o = n - 1; r < n; o = r++) {
- var a = this.points[2 * r],
- s = this.points[2 * r + 1],
- h = this.points[2 * o],
- l = this.points[2 * o + 1];
- s > t != l > t && e < (h - a) * (t - s) / (l - s) + a && (i = !i)
- }
- return i
- }, e.Polygon.prototype.constructor = e.Polygon, e.Circle = function(e, t, i) {
- this.x = e || 0, this.y = t || 0, this.radius = i || 0
- }, e.Circle.prototype.clone = function() {
- return new e.Circle(this.x, this.y, this.radius)
- }, e.Circle.prototype.contains = function(e, t) {
- if (this.radius <= 0) return !1;
- var i = this.x - e,
- n = this.y - t,
- r = this.radius * this.radius;
- return i *= i, n *= n, i + n <= r
- }, e.Circle.prototype.getBounds = function() {
- return new e.Rectangle(this.x - this.radius, this.y - this.radius, 2 * this.radius, 2 * this.radius)
- }, e.Circle.prototype.constructor = e.Circle, e.Ellipse = function(e, t, i, n) {
- this.x = e || 0, this.y = t || 0, this.width = i || 0, this.height = n || 0
- }, e.Ellipse.prototype.clone = function() {
- return new e.Ellipse(this.x, this.y, this.width, this.height)
- }, e.Ellipse.prototype.contains = function(e, t) {
- if (this.width <= 0 || this.height <= 0) return !1;
- var i = (e - this.x) / this.width,
- n = (t - this.y) / this.height;
- return i *= i, n *= n, i + n <= 1
- }, e.Ellipse.prototype.getBounds = function() {
- return new e.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height)
- }, e.Ellipse.prototype.constructor = e.Ellipse, e.RoundedRectangle = function(e, t, i, n, r) {
- this.x = e || 0, this.y = t || 0, this.width = i || 0, this.height = n || 0, this.radius = r || 20
- }, e.RoundedRectangle.prototype.clone = function() {
- return new e.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius)
- }, e.RoundedRectangle.prototype.contains = function(e, t) {
- if (this.width <= 0 || this.height <= 0) return !1;
- var i = this.x;
- if (e >= i && e <= i + this.width) {
- var n = this.y;
- if (t >= n && t <= n + this.height) return !0
- }
- return !1
- }, e.RoundedRectangle.prototype.constructor = e.RoundedRectangle, e.Matrix = function() {
- this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0
- }, e.Matrix.prototype.fromArray = function(e) {
- this.a = e[0], this.b = e[1], this.c = e[3], this.d = e[4], this.tx = e[2], this.ty = e[5]
- }, e.Matrix.prototype.toArray = function(t) {
- this.array || (this.array = new e.Float32Array(9));
- var i = this.array;
- return t ? (i[0] = this.a, i[1] = this.b, i[2] = 0, i[3] = this.c, i[4] = this.d, i[5] = 0, i[6] = this.tx, i[7] = this.ty, i[8] = 1) : (i[0] = this.a, i[1] = this.c, i[2] = this.tx, i[3] = this.b, i[4] = this.d, i[5] = this.ty, i[6] = 0, i[7] = 0, i[8] = 1), i
- }, e.Matrix.prototype.apply = function(t, i) {
- return i = i || new e.Point, i.x = this.a * t.x + this.c * t.y + this.tx, i.y = this.b * t.x + this.d * t.y + this.ty, i
- }, e.Matrix.prototype.applyInverse = function(t, i) {
- i = i || new e.Point;
- var n = 1 / (this.a * this.d + this.c * -this.b);
- return i.x = this.d * n * t.x + -this.c * n * t.y + (this.ty * this.c - this.tx * this.d) * n, i.y = this.a * n * t.y + -this.b * n * t.x + (-this.ty * this.a + this.tx * this.b) * n, i
- }, e.Matrix.prototype.translate = function(e, t) {
- return this.tx += e, this.ty += t, this
- }, e.Matrix.prototype.scale = function(e, t) {
- return this.a *= e, this.d *= t, this.c *= e, this.b *= t, this.tx *= e, this.ty *= t, this
- }, e.Matrix.prototype.rotate = function(e) {
- var t = Math.cos(e),
- i = Math.sin(e),
- n = this.a,
- r = this.c,
- o = this.tx;
- return this.a = n * t - this.b * i, this.b = n * i + this.b * t, this.c = r * t - this.d * i, this.d = r * i + this.d * t, this.tx = o * t - this.ty * i, this.ty = o * i + this.ty * t, this
- }, e.Matrix.prototype.append = function(e) {
- var t = this.a,
- i = this.b,
- n = this.c,
- r = this.d;
- return this.a = e.a * t + e.b * n, this.b = e.a * i + e.b * r, this.c = e.c * t + e.d * n, this.d = e.c * i + e.d * r, this.tx = e.tx * t + e.ty * n + this.tx, this.ty = e.tx * i + e.ty * r + this.ty, this
- }, e.Matrix.prototype.identity = function() {
- return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0, this
- }, e.identityMatrix = new e.Matrix, e.DisplayObject = function() {
- this.position = new e.Point, this.scale = new e.Point(1, 1), this.pivot = new e.Point(0, 0), this.rotation = 0, this.alpha = 1, this.visible = !0, this.hitArea = null, this.buttonMode = !1, this.renderable = !1, this.parent = null, this.stage = null, this.worldAlpha = 1, this._interactive = !1, this.defaultCursor = "pointer", this.worldTransform = new e.Matrix, this._sr = 0, this._cr = 1, this.filterArea = null, this._bounds = new e.Rectangle(0, 0, 1, 1), this._currentBounds = null, this._mask = null, this._cacheIsDirty = !1
- }, e.DisplayObject.prototype.constructor = e.DisplayObject, Object.defineProperty(e.DisplayObject.prototype, "interactive", {
- get: function() {
- return this._interactive
- },
- set: function(e) {
- this._interactive = e, this.stage && (this.stage.dirty = !0)
- }
- }), Object.defineProperty(e.DisplayObject.prototype, "worldVisible", {
- get: function() {
- var e = this;
- do {
- if (!e.visible) return !1;
- e = e.parent
- } while (e);
- return !0
- }
- }), Object.defineProperty(e.DisplayObject.prototype, "mask", {
- get: function() {
- return this._mask
- },
- set: function(e) {
- this._mask && (this._mask.isMask = !1), this._mask = e, this._mask && (this._mask.isMask = !0)
- }
- }), Object.defineProperty(e.DisplayObject.prototype, "filters", {
- get: function() {
- return this._filters
- },
- set: function(e) {
- if (e) {
- for (var t = [], i = 0; i < e.length; i++)
- for (var n = e[i].passes, r = 0; r < n.length; r++) t.push(n[r]);
- this._filterBlock = {
- target: this,
- filterPasses: t
- }
- }
- this._filters = e
- }
- }), e.DisplayObject.prototype.updateTransform = function() {
- var t, i, n, r, o, a, s = this.parent.worldTransform,
- h = this.worldTransform;
- this.rotation % e.PI_2 ? (this.rotation !== this.rotationCache && (this.rotationCache = this.rotation, this._sr = Math.sin(this.rotation), this._cr = Math.cos(this.rotation)), t = this._cr * this.scale.x, i = this._sr * this.scale.x, n = -this._sr * this.scale.y, r = this._cr * this.scale.y, o = this.position.x, a = this.position.y, (this.pivot.x || this.pivot.y) && (o -= this.pivot.x * t + this.pivot.y * n, a -= this.pivot.x * i + this.pivot.y * r), h.a = t * s.a + i * s.c, h.b = t * s.b + i * s.d, h.c = n * s.a + r * s.c, h.d = n * s.b + r * s.d, h.tx = o * s.a + a * s.c + s.tx, h.ty = o * s.b + a * s.d + s.ty) : (t = this.scale.x, r = this.scale.y, o = this.position.x - this.pivot.x * t, a = this.position.y - this.pivot.y * r, h.a = t * s.a, h.b = t * s.b, h.c = r * s.c, h.d = r * s.d, h.tx = o * s.a + a * s.c + s.tx, h.ty = o * s.b + a * s.d + s.ty), this.worldAlpha = this.alpha * this.parent.worldAlpha
- }, e.DisplayObject.prototype.displayObjectUpdateTransform = e.DisplayObject.prototype.updateTransform, e.DisplayObject.prototype.getBounds = function(t) {
- return t = t, e.EmptyRectangle
- }, e.DisplayObject.prototype.getLocalBounds = function() {
- return this.getBounds(e.identityMatrix)
- }, e.DisplayObject.prototype.setStageReference = function(e) {
- this.stage = e, this._interactive && (this.stage.dirty = !0)
- }, e.DisplayObject.prototype.toGlobal = function(e) {
- return this.displayObjectUpdateTransform(), this.worldTransform.apply(e)
- }, e.DisplayObject.prototype.toLocal = function(e, t) {
- return t && (e = t.toGlobal(e)), this.displayObjectUpdateTransform(), this.worldTransform.applyInverse(e)
- }, e.DisplayObject.prototype._renderWebGL = function(e) {}, e.DisplayObject.prototype._renderCanvas = function(e) {}, e.DisplayObject._tempMatrix = new e.Matrix, Object.defineProperty(e.DisplayObject.prototype, "x", {
- get: function() {
- return this.position.x
- },
- set: function(e) {
- this.position.x = e
- }
- }), Object.defineProperty(e.DisplayObject.prototype, "y", {
- get: function() {
- return this.position.y
- },
- set: function(e) {
- this.position.y = e
- }
- }), e.DisplayObjectContainer = function() {
- e.DisplayObject.call(this), this.children = []
- }, e.DisplayObjectContainer.prototype = Object.create(e.DisplayObject.prototype), e.DisplayObjectContainer.prototype.constructor = e.DisplayObjectContainer, Object.defineProperty(e.DisplayObjectContainer.prototype, "width", {
- get: function() {
- return this.scale.x * this.getLocalBounds().width
- },
- set: function(e) {
- var t = this.getLocalBounds().width;
- 0 !== t ? this.scale.x = e / t : this.scale.x = 1, this._width = e
- }
- }), Object.defineProperty(e.DisplayObjectContainer.prototype, "height", {
- get: function() {
- return this.scale.y * this.getLocalBounds().height
- },
- set: function(e) {
- var t = this.getLocalBounds().height;
- 0 !== t ? this.scale.y = e / t : this.scale.y = 1, this._height = e
- }
- }), e.DisplayObjectContainer.prototype.addChild = function(e) {
- return window.dirtyOnce = !0, this.addChildAt(e, this.children.length)
- }, e.DisplayObjectContainer.prototype.addChildAt = function(e, t) {
- if (t >= 0 && t <= this.children.length) return window.dirtyOnce = !0, window.Host && Host.Localize.UpdateChildren(e), e.parent && e.parent.removeChild(e), e.parent = this, this.children.splice(t, 0, e), this.stage && e.setStageReference(this.stage), e;
- throw new Error(e + "addChildAt: The index " + t + " supplied is out of bounds " + this.children.length)
- }, e.DisplayObjectContainer.prototype.getChildIndex = function(e) {
- var t = this.children.indexOf(e);
- if (t === -1) throw new Error("The supplied DisplayObject must be a child of the caller");
- return t
- }, e.DisplayObjectContainer.prototype.setChildIndex = function(e, t) {
- if (t < 0 || t >= this.children.length) throw new Error("The supplied index is out of bounds");
- window.dirtyOnce = !0;
- var i = this.getChildIndex(e);
- this.children.splice(i, 1), this.children.splice(t, 0, e)
- }, e.DisplayObjectContainer.prototype.getChildAt = function(e) {
- if (e < 0 || e >= this.children.length) throw new Error("getChildAt: Supplied index " + e + " does not exist in the child list, or the supplied DisplayObject must be a child of the caller");
- return this.children[e]
- }, e.DisplayObjectContainer.prototype.removeChild = function(e) {
- var t = this.children.indexOf(e);
- if (t !== -1) return this.removeChildAt(t)
- }, e.DisplayObjectContainer.prototype.removeChildAt = function(e) {
- var t = this.getChildAt(e);
- return this.stage && t.removeStageReference(), window.dirtyOnce = !0, t.parent = void 0, this.children.splice(e, 1), t
- }, e.DisplayObjectContainer.prototype.updateTransform = function() {
- if (this.visible) {
- this.displayObjectUpdateTransform();
- for (var e = 0, t = this.children.length; e < t; e++) this.children[e].updateTransform()
- }
- }, e.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = e.DisplayObjectContainer.prototype.updateTransform, e.DisplayObjectContainer.prototype.getBounds = function() {
- if (0 === this.children.length) return e.EmptyRectangle;
- for (var t, i, n, r = 1 / 0, o = 1 / 0, a = -(1 / 0), s = -(1 / 0), h = !1, l = 0, c = this.children.length; l < c; l++) {
- this.children[l].visible && (h = !0, t = this.children[l].getBounds(), r = r < t.x ? r : t.x, o = o < t.y ? o : t.y, i = t.width + t.x, n = t.height + t.y, a = a > i ? a : i, s = s > n ? s : n)
- }
- if (!h) return e.EmptyRectangle;
- var d = this._bounds;
- return d.x = r, d.y = o, d.width = a - r, d.height = s - o, d
- }, e.DisplayObjectContainer.prototype.getLocalBounds = function() {
- var t = this.worldTransform;
- this.worldTransform = e.identityMatrix;
- for (var i = 0, n = this.children.length; i < n; i++) this.children[i].updateTransform();
- var r = this.getBounds();
- return this.worldTransform = t, r
- }, e.DisplayObjectContainer.prototype.setStageReference = function(e) {
- this.stage = e, this._interactive && (this.stage.dirty = !0);
- for (var t = 0, i = this.children.length; t < i; t++) {
- this.children[t].setStageReference(e)
- }
- }, e.DisplayObjectContainer.prototype.removeStageReference = function() {
- for (var e = 0, t = this.children.length; e < t; e++) {
- this.children[e].removeStageReference()
- }
- this._interactive && (this.stage.dirty = !0), this.stage = null
- }, e.DisplayObjectContainer.prototype._renderWebGL = function(e) {
- if (this.visible && !(this.alpha <= 0)) {
- var t, i;
- if (this._mask || this._filters) {
- for (this._mask && (e.spriteBatch.stop(), e.maskManager.pushMask(this.mask, e), e.spriteBatch.start()), t = 0, i = this.children.length; t < i; t++) this.children[t]._renderWebGL(e);
- e.spriteBatch.stop(), this._mask && e.maskManager.popMask(this._mask, e), e.spriteBatch.start()
- } else
- for (t = 0, i = this.children.length; t < i; t++) this.children[t]._renderWebGL(e)
- }
- }, e.DisplayObjectContainer.prototype._renderCanvas = function(e) {
- if (this.visible !== !1 && 0 !== this.alpha) {
- this._mask && e.maskManager.pushMask(this._mask, e);
- for (var t = 0, i = this.children.length; t < i; t++) {
- this.children[t]._renderCanvas(e)
- }
- this._mask && e.maskManager.popMask(e)
- }
- }, e.Sprite = function(t) {
- e.DisplayObjectContainer.call(this), this.anchor = new e.Point, this.texture = t || e.Texture.emptyTexture, this._width = 0, this._height = 0, this.tint = 16777215, this.blendMode = e.blendModes.NORMAL, this.shader = null, this.texture.baseTexture.hasLoaded ? this.onTextureUpdate() : this.texture.onPixi("update", this.onTextureUpdate.bind(this)), this.renderable = !0
- }, e.Sprite.prototype = Object.create(e.DisplayObjectContainer.prototype), e.Sprite.prototype.constructor = e.Sprite, Object.defineProperty(e.Sprite.prototype, "width", {
- get: function() {
- return this.scale.x * this.texture.frame.width
- },
- set: function(e) {
- this.scale.x = e / this.texture.frame.width, this._width = e
- }
- }), Object.defineProperty(e.Sprite.prototype, "height", {
- get: function() {
- return this.scale.y * this.texture.frame.height
- },
- set: function(e) {
- this.scale.y = e / this.texture.frame.height, this._height = e
- }
- }), e.Sprite.prototype.setTexture = function(e) {
- this.texture = e, this.cachedTint = 16777215
- }, e.Sprite.prototype.onTextureUpdate = function() {
- this._width && (this.scale.x = this._width / this.texture.frame.width), this._height && (this.scale.y = this._height / this.texture.frame.height)
- }, e.Sprite.prototype.getBounds = function(e) {
- var t = this.texture.frame.width,
- i = this.texture.frame.height,
- n = t * (1 - this.anchor.x),
- r = t * -this.anchor.x,
- o = i * (1 - this.anchor.y),
- a = i * -this.anchor.y,
- s = e || this.worldTransform,
- h = s.a,
- l = s.b,
- c = s.c,
- d = s.d,
- u = s.tx,
- f = s.ty,
- p = -(1 / 0),
- g = -(1 / 0),
- v = 1 / 0,
- m = 1 / 0;
- if (0 === l && 0 === c) h < 0 && (h *= -1), d < 0 && (d *= -1), v = h * r + u, p = h * n + u, m = d * a + f, g = d * o + f;
- else {
- var x = h * r + c * a + u,
- w = d * a + l * r + f,
- y = h * n + c * a + u,
- b = d * a + l * n + f,
- T = h * n + c * o + u,
- C = d * o + l * n + f,
- S = h * r + c * o + u,
- M = d * o + l * r + f;
- v = x < v ? x : v, v = y < v ? y : v, v = T < v ? T : v, v = S < v ? S : v, m = w < m ? w : m, m = b < m ? b : m, m = C < m ? C : m, m = M < m ? M : m, p = x > p ? x : p, p = y > p ? y : p, p = T > p ? T : p, p = S > p ? S : p, g = w > g ? w : g, g = b > g ? b : g, g = C > g ? C : g, g = M > g ? M : g
- }
- var R = this._bounds;
- return R.x = v, R.width = p - v, R.y = m, R.height = g - m, this._currentBounds = R, R
- }, e.Sprite.prototype._renderWebGL = function(e) {
- if (this.visible && !(this.alpha <= 0)) {
- var t, i;
- if (this._mask || this._filters) {
- var n = e.spriteBatch;
- for (this._filters && (n.flush(), e.filterManager.pushFilter(this._filterBlock)), this._mask && (n.stop(), e.maskManager.pushMask(this.mask, e), n.start()), n.render(this), t = 0, i = this.children.length; t < i; t++) this.children[t]._renderWebGL(e);
- n.stop(), this._mask && e.maskManager.popMask(this._mask, e), this._filters && e.filterManager.popFilter(), n.start()
- } else
- for (e.spriteBatch.render(this), t = 0, i = this.children.length; t < i; t++) this.children[t]._renderWebGL(e)
- }
- }, e.Sprite.prototype._renderCanvas = function(t) {
- if (!(this.visible === !1 || 0 === this.alpha || this.texture.crop.width <= 0 || this.texture.crop.height <= 0)) {
- if (this.blendMode !== t.currentBlendMode && (t.currentBlendMode = this.blendMode, t.context.globalCompositeOperation = e.blendModesCanvas[t.currentBlendMode]), this._mask && t.maskManager.pushMask(this._mask, t), this.texture.valid) {
- t.context.globalAlpha = this.worldAlpha, t.smoothProperty && t.scaleMode !== this.texture.baseTexture.scaleMode && (t.scaleMode = this.texture.baseTexture.scaleMode, t.context[t.smoothProperty] = t.scaleMode === e.scaleModes.LINEAR);
- var i = this.texture.trim ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width,
- n = this.texture.trim ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
- t.context.setTransform(this.worldTransform.a, this.worldTransform.b, this.worldTransform.c, this.worldTransform.d, 0 | this.worldTransform.tx, 0 | this.worldTransform.ty), i = 0 | i, n = 0 | n, 16777215 !== this.tint ? (this.cachedTint !== this.tint && (this.cachedTint = this.tint, this.tintedTexture = e.CanvasTinter.getTintedTexture(this, this.tint)), t.context.drawImage(this.tintedTexture, 0, 0, this.texture.crop.width, this.texture.crop.height, i, n, this.texture.crop.width, this.texture.crop.height)) : t.context.drawImage(this.texture.baseTexture.source, this.texture.crop.x, this.texture.crop.y, this.texture.crop.width, this.texture.crop.height, i, n, this.texture.crop.width, this.texture.crop.height)
- }
- for (var r = 0, o = this.children.length; r < o; r++) this.children[r]._renderCanvas(t);
- this._mask && t.maskManager.popMask(t)
- }
- }, e.Sprite.fromFrame = function(t) {
- var i = e.TextureCache[t];
- if (!i) throw new Error('The frameId "' + t + '" does not exist in the texture cache' + this);
- return new e.Sprite(i)
- }, e.Sprite.fromImage = function(t, i, n) {
- var r = e.Texture.fromImage(t, i, n);
- return new e.Sprite(r)
- }, e.SpriteBatch = function() {
- e.DisplayObjectContainer.call(this), this.ready = !1
- }, e.SpriteBatch.prototype = Object.create(e.DisplayObjectContainer.prototype), e.SpriteBatch.prototype.constructor = e.SpriteBatch, e.SpriteBatch.prototype.initWebGL = function(t) {
- this.fastSpriteBatch = new e.WebGLFastSpriteBatch(t), this.ready = !0
- }, e.SpriteBatch.prototype.updateTransform = function() {
- this.displayObjectUpdateTransform()
- }, e.SpriteBatch.prototype._renderWebGL = function(e) {
- !this.visible || this.alpha <= 0 || !this.children.length || (this.ready || this.initWebGL(e.gl), e.spriteBatch.stop(), e.shaderManager.setShader(e.shaderManager.fastShader), this.fastSpriteBatch.begin(this, e), this.fastSpriteBatch.render(this), e.spriteBatch.start())
- }, e.SpriteBatch.prototype._renderCanvas = function(e) {
- if (this.visible && !(this.alpha <= 0) && this.children.length) {
- var t = e.context;
- t.globalAlpha = this.worldAlpha, this.displayObjectUpdateTransform();
- for (var i = this.worldTransform, n = !0, r = 0; r < this.children.length; r++) {
- var o = this.children[r];
- if (o.visible) {
- var a = o.texture,
- s = a.frame;
- if (t.globalAlpha = this.worldAlpha * o.alpha, o.rotation % (2 * Math.PI) === 0) n && (t.setTransform(i.a, i.b, i.c, i.d, i.tx, i.ty), n = !1), t.drawImage(a.baseTexture.source, s.x, s.y, s.width, s.height, o.anchor.x * (-s.width * o.scale.x) + o.position.x + .5 | 0, o.anchor.y * (-s.height * o.scale.y) + o.position.y + .5 | 0, s.width * o.scale.x, s.height * o.scale.y);
- else {
- n || (n = !0), o.displayObjectUpdateTransform();
- var h = o.worldTransform;
- t.setTransform(h.a, h.b, h.c, h.d, 0 | h.tx, 0 | h.ty), t.drawImage(a.baseTexture.source, s.x, s.y, s.width, s.height, o.anchor.x * -s.width + .5 | 0, o.anchor.y * -s.height + .5 | 0, s.width, s.height)
- }
- }
- }
- }
- }, e.Text = function(t, i) {
- this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), e.Sprite.call(this, e.Texture.fromCanvas(this.canvas)), this.setText(t), this.setStyle(i)
- }, e.Text.prototype = Object.create(e.Sprite.prototype), e.Text.prototype.constructor = e.Text, Object.defineProperty(e.Text.prototype, "width", {
- get: function() {
- return this.dirty && (this.updateText(), this.dirty = !1), this.scale.x * this.texture.frame.width
- },
- set: function(e) {
- this.scale.x = e / this.texture.frame.width, this._width = e
- }
- }), Object.defineProperty(e.Text.prototype, "height", {
- get: function() {
- return this.dirty && (this.updateText(), this.dirty = !1), this.scale.y * this.texture.frame.height
- },
- set: function(e) {
- this.scale.y = e / this.texture.frame.height, this._height = e
- }
- }), e.Text.prototype.setStyle = function(e) {
- e = e || {}, e.font = e.font || "bold 20pt Arial", e.fill = e.fill || "black", e.align = e.align || "left", e.stroke = e.stroke || "black", e.strokeThickness = e.strokeThickness || 0, e.wordWrap = e.wordWrap || !1, e.wordWrapWidth = e.wordWrapWidth || 100, e.dropShadow = e.dropShadow || !1, e.dropShadowAngle = e.dropShadowAngle || Math.PI / 6, e.dropShadowDistance = e.dropShadowDistance || 4, e.dropShadowColor = e.dropShadowColor || "black", this.style = e, this.dirty = !0
- }, e.Text.prototype.setText = function(e) {
- this.text != e.toString() && (this.text = e.toString() || " ", this.dirty = !0, window.dirtyOnce = !0)
- }, e.Text.prototype.updateText = function() {
- this.context.font = this.style._font || this.style.font;
- var e = this.text.toString();
- this.style.wordWrap && (e = this.wordWrap(this.text));
- for (var t = e ? e.split(/(?:\r\n|\r|\n)/) : [], i = [], n = 0, r = this.determineFontProperties(this.style._font || this.style.font), o = 0; o < t.length; o++) {
- var a = this.context.measureText(t[o]).width;
- i[o] = a, n = Math.max(n, a)
- }
- var s = n + this.style.strokeThickness;
- this.style.dropShadow && (s += this.style.dropShadowDistance), this.canvas.width = s + this.context.lineWidth;
- var h = r.fontSize + this.style.strokeThickness,
- l = h * t.length;
- this.style.dropShadow && (l += this.style.dropShadowDistance), this.canvas.height = l, this.context.scale(1, 1), this.context.font = this.style._font || this.style.font, this.context.strokeStyle = this.style.stroke, this.context.lineWidth = this.style.strokeThickness, this.context.textBaseline = "alphabetic";
- var c, d;
- if (this.style.dropShadow) {
- this.context.fillStyle = this.style.dropShadowColor;
- var u = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance,
- f = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance;
- for (o = 0; o < t.length; o++) c = this.style.strokeThickness / 2, d = this.style.strokeThickness / 2 + o * h + r.ascent, "right" === this.style.align ? c += n - i[o] : "center" === this.style.align && (c += (n - i[o]) / 2), this.style.fill && this.context.fillText(t[o], c + u, d + f)
- }
- for (this.context.fillStyle = this.style.fill, o = 0; o < t.length; o++) c = this.style.strokeThickness / 2, d = this.style.strokeThickness / 2 + o * h + r.ascent, "right" === this.style.align ? c += n - i[o] : "center" === this.style.align && (c += (n - i[o]) / 2), this.style.stroke && this.style.strokeThickness && this.context.strokeText(t[o], c, d), this.style.fill && this.context.fillText(t[o], c, d);
- this.updateTexture()
- }, e.Text.prototype.updateTexture = function() {
- this.texture.baseTexture.width = this.canvas.width, this.texture.baseTexture.height = this.canvas.height, this.texture.crop.width = this.texture.frame.width = this.canvas.width, this.texture.crop.height = this.texture.frame.height = this.canvas.height, this._width = this.canvas.width, this._height = this.canvas.height, this.texture.baseTexture.dirty()
- }, e.Text.prototype._renderWebGL = function(t) {
- this.dirty && (this.updateText(), this.dirty = !1), e.Sprite.prototype._renderWebGL.call(this, t)
- }, e.Text.prototype._renderCanvas = function(t) {
- this.dirty && (this.updateText(), this.dirty = !1), e.Sprite.prototype._renderCanvas.call(this, t)
- }, e.Text.prototype.determineFontProperties = function(t) {
- var i = e.Text.fontPropertiesCache[t];
- if (!i) {
- i = {};
- var n = e.Text.fontPropertiesCanvas,
- r = e.Text.fontPropertiesContext;
- r.font = t;
- var o = Math.ceil(r.measureText("|MÉq").width),
- a = Math.ceil(r.measureText("M").width),
- s = 2 * a;
- a = 1.4 * a | 0, n.width = o, n.height = s, r.fillStyle = "#ffffff", r.fillRect(0, 0, o, s), r.font = t, r.textBaseline = "alphabetic", r.fillStyle = "#888888", r.fillText("|MÉq", 0, a);
- var h, l, c = r.getImageData(0, 0, o, s).data,
- d = c.length,
- u = 4 * o,
- f = 0,
- p = !1;
- for (h = 0; h < a; h++) {
- for (l = 0; l < u; l += 4)
- if (255 !== c[f + l]) {
- p = !0;
- break
- }
- if (p) break;
- f += u
- }
- for (i.ascent = a - h, f = d - u, p = !1, h = s; h > a; h--) {
- for (l = 0; l < u; l += 4)
- if (255 !== c[f + l]) {
- p = !0;
- break
- }
- if (p) break;
- f -= u
- }
- i.descent = h - a, i.fontSize = i.ascent + i.descent, e.Text.fontPropertiesCache[t] = i
- }
- return i
- }, e.Text.prototype.wordWrap = function(e) {
- for (var t = "", i = e.split("\n"), n = 0; n < i.length; n++) {
- for (var r = this.style.wordWrapWidth, o = i[n].split(" "), a = 0; a < o.length; a++) {
- var s = this.context.measureText(o[a]).width,
- h = s + this.context.measureText(" ").width;
- 0 === a || h > r ? (a > 0 && (t += "\n"), t += o[a], r = this.style.wordWrapWidth - s) : (r -= h, t += " " + o[a])
- }
- n < i.length - 1 && (t += "\n")
- }
- return t
- }, e.Text.prototype.getBounds = function(t) {
- return this.dirty && (this.updateText(), this.dirty = !1), e.Sprite.prototype.getBounds.call(this, t)
- }, e.Text.prototype.destroy = function(e) {
- this.context = null, this.canvas = null, this.texture.destroy(void 0 === e || e)
- }, e.Text.fontPropertiesCache = {}, e.Text.fontPropertiesCanvas = document.createElement("canvas"), e.Text.fontPropertiesContext = e.Text.fontPropertiesCanvas.getContext("2d"), e.InteractionData = function() {
- this.global = new e.Point, this.target = null, this.originalEvent = null
- }, e.InteractionData.prototype.getLocalPosition = function(t, i) {
- var n = t.worldTransform,
- r = this.global,
- o = n.a,
- a = n.c,
- s = n.tx,
- h = n.b,
- l = n.d,
- c = n.ty,
- d = 1 / (o * l + a * -h);
- return i = i || new e.Point, i.x = l * d * r.x + -a * d * r.y + (c * a - s * l) * d, i.y = o * d * r.y + -h * d * r.x + (-c * o + s * h) * d, i
- }, e.InteractionData.prototype.constructor = e.InteractionData, e.InteractionManager = function(t) {
- this.stage = t, this.mouse = new e.InteractionData, this.touches = {}, this.tempPoint = new e.Point, this.mouseoverEnabled = !0, this.pool = [], this.interactiveItems = [], this.interactionDOMElement = null, this.onMouseMove = this.onMouseMove.bind(this), this.onMouseDown = this.onMouseDown.bind(this), this.onMouseOut = this.onMouseOut.bind(this), this.onMouseUp = this.onMouseUp.bind(this), this.onTouchStart = this.onTouchStart.bind(this), this.onTouchEnd = this.onTouchEnd.bind(this), this.onTouchMove = this.onTouchMove.bind(this), this.last = 0, this.currentCursorStyle = "inherit", this.mouseOut = !1, this._tempPoint = new e.Point
- }, e.InteractionManager.prototype.constructor = e.InteractionManager, e.InteractionManager.prototype.collectInteractiveSprite = function(e, t) {
- for (var i = e.children, n = i.length, r = n - 1; r >= 0; r--) {
- var o = i[r];
- o._interactive ? (t.interactiveChildren = !0, this.interactiveItems.push(o), o.children.length > 0 && this.collectInteractiveSprite(o, o)) : (o.__iParent = null, o.children.length > 0 && this.collectInteractiveSprite(o, t))
- }
- }, e.InteractionManager.prototype.setTarget = function(e) {
- this.target = e, null === this.interactionDOMElement && this.setTargetDomElement(e.view)
- }, e.InteractionManager.prototype.setTargetDomElement = function(e) {
- this.removeEvents(), window.navigator.msPointerEnabled && (e.style["-ms-content-zooming"] = "none", e.style["-ms-touch-action"] = "none"), this.interactionDOMElement = e, e.addEventListener("mousemove", this.onMouseMove, !0), e.addEventListener("mousedown", this.onMouseDown, !0), e.addEventListener("mouseout", this.onMouseOut, !0), e.addEventListener("touchstart", this.onTouchStart, !0), e.addEventListener("touchend", this.onTouchEnd, !0), e.addEventListener("touchmove", this.onTouchMove, !0), window.addEventListener("mouseup", this.onMouseUp, !0)
- }, e.InteractionManager.prototype.removeEvents = function() {
- this.interactionDOMElement && (this.interactionDOMElement.style["-ms-content-zooming"] = "", this.interactionDOMElement.style["-ms-touch-action"] = "", this.interactionDOMElement.removeEventListener("mousemove", this.onMouseMove, !0), this.interactionDOMElement.removeEventListener("mousedown", this.onMouseDown, !0), this.interactionDOMElement.removeEventListener("mouseout", this.onMouseOut, !0), this.interactionDOMElement.removeEventListener("touchstart", this.onTouchStart, !0), this.interactionDOMElement.removeEventListener("touchend", this.onTouchEnd, !0), this.interactionDOMElement.removeEventListener("touchmove", this.onTouchMove, !0), this.interactionDOMElement = null, window.removeEventListener("mouseup", this.onMouseUp, !0))
- }, e.InteractionManager.prototype.update = function() {
- if (this.target) {
- var t = Date.now(),
- i = t - this.last;
- if (i = i * e.INTERACTION_FREQUENCY / 1e3, !(i < 1)) {
- this.last = t;
- var n = 0;
- this.dirty && this.rebuildInteractiveGraph();
- var r = this.interactiveItems.length,
- o = "inherit",
- s = !1;
- for (n = 0; n < r; n++) {
- var h = this.interactiveItems[n];
- h.__hit = this.hitTest(h, this.mouse), this.mouse.target = h, h.__hit && !s ? (h.buttonMode && (o = h.defaultCursor), h.interactiveChildren || (s = !0), h.__isOver || (h.mouseover && h.mouseover(this.mouse), h.__isOver = !0)) : h.__isOver && (h.mouseout && h.mouseout(this.mouse), h.__isOver = !1)
- }
- this.currentCursorStyle === o || a.ignoreCursorChanges || (this.currentCursorStyle = o, this.interactionDOMElement.style.cursor = o)
- }
- }
- }, e.InteractionManager.prototype.rebuildInteractiveGraph = function() {
- this.dirty = !1;
- for (var e = this.interactiveItems.length, t = 0; t < e; t++) this.interactiveItems[t].interactiveChildren = !1;
- this.interactiveItems = [], this.stage.interactive && this.interactiveItems.push(this.stage), this.collectInteractiveSprite(this.stage, this.stage)
- }, e.InteractionManager.prototype.onMouseMove = function(e) {
- this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = e;
- var t = this.interactionDOMElement.getBoundingClientRect();
- this.mouse.global.x = (e.clientX - t.left) * (this.target.width / t.width), this.mouse.global.y = (e.clientY - t.top) * (this.target.height / t.height);
- for (var i = this.interactiveItems.length, n = 0; n < i; n++) {
- var r = this.interactiveItems[n];
- r.mousemove && r.mousemove(this.mouse)
- }
- }, e.InteractionManager.prototype.onMouseDown = function(t) {
- this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = t, e.AUTO_PREVENT_DEFAULT && this.mouse.originalEvent && this.mouse.originalEvent.preventDefault();
- for (var i = this.interactiveItems.length, n = this.mouse.originalEvent, r = 2 === n.button || 3 === n.which, o = r ? "rightdown" : "mousedown", a = r ? "rightclick" : "click", s = r ? "__rightIsDown" : "__mouseIsDown", h = r ? "__isRightDown" : "__isDown", l = 0; l < i; l++) {
- var c = this.interactiveItems[l];
- if ((c[o] || c[a]) && (c[s] = !0, c.__hit = this.hitTest(c, this.mouse), c.__hit && (c[o] && c[o](this.mouse), c[h] = !0, !c.interactiveChildren))) break
- }
- }, e.InteractionManager.prototype.onMouseOut = function(e) {
- this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = e;
- var t = this.interactiveItems.length;
- this.interactionDOMElement.style.cursor = "inherit";
- for (var i = 0; i < t; i++) {
- var n = this.interactiveItems[i];
- n.__isOver && (this.mouse.target = n, n.mouseout && n.mouseout(this.mouse), n.__isOver = !1)
- }
- this.mouseOut = !0, this.mouse.global.x = -1e4, this.mouse.global.y = -1e4
- }, e.InteractionManager.prototype.onMouseUp = function(e) {
- this.dirty && this.rebuildInteractiveGraph(), this.mouse.originalEvent = e;
- for (var t = this.interactiveItems.length, i = !1, n = this.mouse.originalEvent, r = 2 === n.button || 3 === n.which, o = r ? "rightup" : "mouseup", a = r ? "rightclick" : "click", s = r ? "rightupoutside" : "mouseupoutside", h = r ? "__isRightDown" : "__isDown", l = 0; l < t; l++) {
- var c = this.interactiveItems[l];
- (c[a] || c[o] || c[s]) && (c.__hit = this.hitTest(c, this.mouse), c.__hit && !i ? (c[o] && c[o](this.mouse), c[h] && c[a] && c[a](this.mouse), c.interactiveChildren || (i = !0)) : c[h] && c[s] && c[s](this.mouse), c[h] = !1)
- }
- }, e.InteractionManager.prototype.hitTest = function(t, i) {
- var n = i.global;
- if (!t.worldVisible) return !1;
- t.worldTransform.applyInverse(n, this._tempPoint);
- var r, o = this._tempPoint.x,
- a = this._tempPoint.y;
- if (i.target = t, t.hitArea && t.hitArea.contains) return t.hitArea.contains(o, a);
- if (t instanceof e.Sprite) {
- var s, h = t.texture.frame.width,
- l = t.texture.frame.height,
- c = -h * t.anchor.x;
- if (o > c && o < c + h && (s = -l * t.anchor.y, a > s && a < s + l)) return !0
- } else if (t instanceof e.Graphics) {
- var d = t.graphicsData;
- for (r = 0; r < d.length; r++) {
- var u = d[r];
- if (u.fill && u.shape && u.shape.contains(o, a)) return !0
- }
- }
- var f = t.children.length;
- for (r = 0; r < f; r++) {
- var p = t.children[r];
- if (this.hitTest(p, i)) return i.target = t, !0
- }
- return !1
- }, e.InteractionManager.prototype.onTouchMove = function(e) {
- this.dirty && this.rebuildInteractiveGraph();
- var t, i = this.interactionDOMElement.getBoundingClientRect(),
- n = e.changedTouches,
- r = 0;
- for (r = 0; r < n.length; r++) {
- var o = n[r];
- t = this.touches[o.identifier], t.originalEvent = e, t.global.x = (o.clientX - i.left) * (this.target.width / i.width), t.global.y = (o.clientY - i.top) * (this.target.height / i.height);
- for (var a = 0; a < this.interactiveItems.length; a++) {
- var s = this.interactiveItems[a];
- s.touchmove && s.__touchData && s.__touchData[o.identifier] && s.touchmove(t)
- }
- }
- e.preventDefault()
- }, e.InteractionManager.prototype.onTouchStart = function(t) {
- this.dirty && this.rebuildInteractiveGraph();
- var i = this.interactionDOMElement.getBoundingClientRect();
- e.AUTO_PREVENT_DEFAULT && t.preventDefault();
- for (var n = t.changedTouches, r = 0; r < n.length; r++) {
- var o = n[r],
- a = this.pool.pop();
- a || (a = new e.InteractionData), a.originalEvent = t, this.touches[o.identifier] = a, a.global.x = (o.clientX - i.left) * (this.target.width / i.width), a.global.y = (o.clientY - i.top) * (this.target.height / i.height);
- for (var s = this.interactiveItems.length, h = 0; h < s; h++) {
- var l = this.interactiveItems[h];
- if ((l.touchstart || l.tap) && (l.__hit = this.hitTest(l, a), l.__hit && (l.touchstart && l.touchstart(a), l.__isDown = !0, l.__touchData = l.__touchData || {}, l.__touchData[o.identifier] = a, !l.interactiveChildren))) break
- }
- }
- }, e.InteractionManager.prototype.onTouchEnd = function(e) {
- this.dirty && this.rebuildInteractiveGraph();
- for (var t = this.interactionDOMElement.getBoundingClientRect(), i = e.changedTouches, n = 0; n < i.length; n++) {
- var r = i[n],
- o = this.touches[r.identifier],
- a = !1;
- o.global.x = (r.clientX - t.left) * (this.target.width / t.width),
- o.global.y = (r.clientY - t.top) * (this.target.height / t.height);
- for (var s = this.interactiveItems.length, h = 0; h < s; h++) {
- var l = this.interactiveItems[h];
- l.__touchData && l.__touchData[r.identifier] && (l.__hit = this.hitTest(l, l.__touchData[r.identifier]), o.originalEvent = e, (l.touchend || l.tap) && (l.__hit && !a ? (l.touchend && l.touchend(o), l.__isDown && l.tap && l.tap(o), l.interactiveChildren || (a = !0)) : l.__isDown && l.touchendoutside && l.touchendoutside(o), l.__isDown = !1), l.__touchData[r.identifier] = null)
- }
- this.pool.push(o), this.touches[r.identifier] = null
- }
- }, e.Stage = function(t) {
- e.DisplayObjectContainer.call(this), this.worldTransform = new e.Matrix, this.interactive = !0, this.interactionManager = new e.InteractionManager(this), this.dirty = !0, this.stage = this, this.stage.hitArea = new e.Rectangle(0, 0, 1e5, 1e5), this.setBackgroundColor(t)
- }, e.Stage.prototype = Object.create(e.DisplayObjectContainer.prototype), e.Stage.prototype.constructor = e.Stage, e.Stage.prototype.updateTransform = function() {
- this.worldAlpha = 1;
- for (var e = 0, t = this.children.length; e < t; e++) this.children[e].updateTransform();
- this.dirty && (this.dirty = !1, this.interactionManager.dirty = !0), this.interactive && this.interactionManager.update()
- }, e.Stage.prototype.setBackgroundColor = function(t) {
- this.backgroundColor = t || 0, this.backgroundColorSplit = e.hex2rgb(this.backgroundColor);
- var i = this.backgroundColor.toString(16);
- i = "000000".substr(0, 6 - i.length) + i, this.backgroundColorString = "#" + i
- }, e.Stage.prototype.getMousePosition = function() {
- return this.interactionManager.mouse.global
- }, e.hex2rgb = function(e) {
- return [(e >> 16 & 255) / 255, (e >> 8 & 255) / 255, (255 & e) / 255]
- }, e.rgb2hex = function(e) {
- return (255 * e[0] << 16) + (255 * e[1] << 8) + 255 * e[2]
- }, "function" != typeof Function.prototype.bind && (Function.prototype.bind = function() {
- return function(e) {
- function t() {
- for (var n = arguments.length, o = new Array(n); n--;) o[n] = arguments[n];
- return o = r.concat(o), i.apply(this instanceof t ? this : e, o)
- }
- var i = this,
- n = arguments.length - 1,
- r = [];
- if (n > 0)
- for (r.length = n; n--;) r[n] = arguments[n + 1];
- if ("function" != typeof i) throw new TypeError;
- return t.prototype = function e(t) {
- if (t && (e.prototype = t), !(this instanceof e)) return new e
- }(i.prototype), t
- }
- }()), e.canUseNewCanvasBlendModes = function() {
- if ("undefined" == typeof document) return !1;
- var e = document.createElement("canvas");
- e.width = 1, e.height = 1;
- var t = e.getContext("2d");
- return t.fillStyle = "#000", t.fillRect(0, 0, 1, 1), t.globalCompositeOperation = "multiply", t.fillStyle = "#fff", t.fillRect(0, 0, 1, 1), 0 === t.getImageData(0, 0, 1, 1).data[0]
- }, e.getNextPowerOfTwo = function(e) {
- if (e > 0 && 0 === (e & e - 1)) return e;
- for (var t = 1; t < e;) t <<= 1;
- return t
- }, e.isPowerOfTwo = function(e, t) {
- return e > 0 && 0 === (e & e - 1) && t > 0 && 0 === (t & t - 1)
- }, e.PolyK = {}, e.PolyK.Triangulate = function(t) {
- var i = !0,
- n = t.length >> 1;
- if (n < 3) return [];
- for (var r = [], o = [], a = 0; a < n; a++) o.push(a);
- a = 0;
- for (var s = n; s > 3;) {
- var h = o[(a + 0) % s],
- l = o[(a + 1) % s],
- c = o[(a + 2) % s],
- d = t[2 * h],
- u = t[2 * h + 1],
- f = t[2 * l],
- p = t[2 * l + 1],
- g = t[2 * c],
- v = t[2 * c + 1],
- m = !1;
- if (e.PolyK._convex(d, u, f, p, g, v, i)) {
- m = !0;
- for (var x = 0; x < s; x++) {
- var w = o[x];
- if (w !== h && w !== l && w !== c && e.PolyK._PointInTriangle(t[2 * w], t[2 * w + 1], d, u, f, p, g, v)) {
- m = !1;
- break
- }
- }
- }
- if (m) r.push(h, l, c), o.splice((a + 1) % s, 1), s--, a = 0;
- else if (a++ > 3 * s) {
- if (!i) return null;
- for (r = [], o = [], a = 0; a < n; a++) o.push(a);
- a = 0, s = n, i = !1
- }
- }
- return r.push(o[0], o[1], o[2]), r
- }, e.PolyK._PointInTriangle = function(e, t, i, n, r, o, a, s) {
- var h = a - i,
- l = s - n,
- c = r - i,
- d = o - n,
- u = e - i,
- f = t - n,
- p = h * h + l * l,
- g = h * c + l * d,
- v = h * u + l * f,
- m = c * c + d * d,
- x = c * u + d * f,
- w = 1 / (p * m - g * g),
- y = (m * v - g * x) * w,
- b = (p * x - g * v) * w;
- return y >= 0 && b >= 0 && y + b < 1
- }, e.PolyK._convex = function(e, t, i, n, r, o, a) {
- return (t - n) * (r - i) + (i - e) * (o - n) >= 0 === a
- }, e.EventTarget = {
- call: function(t) {
- t && (t = t.prototype || t, e.EventTarget.mixin(t))
- },
- mixin: function(t) {
- t.listeners = function(e) {
- return this._listeners = this._listeners || {}, this._listeners[e] ? this._listeners[e].slice() : []
- }, t.emitPixi = t.dispatchEvent = function(t, i) {
- if (this._listeners = this._listeners || {}, "object" == typeof t && (i = t, t = t.type), i && i.__isEventObject === !0 || (i = new e.Event(this, t, i)), this._listeners && this._listeners[t]) {
- var n, r = this._listeners[t].slice(0),
- o = r.length,
- a = r[0];
- for (n = 0; n < o; a = r[++n])
- if (a.call(this, i), i.stoppedImmediate) return this;
- if (i.stopped) return this
- }
- return this.parent && this.parent.emit && this.parent.emit.call(this.parent, t, i), this
- }, t.onPixi = t.addEventListener = function(e, t) {
- return this._listeners = this._listeners || {}, (this._listeners[e] = this._listeners[e] || []).push(t), this
- }, t.oncePixi = function(e, t) {
- function i() {
- t.apply(n.offPixi(e, i), arguments)
- }
- this._listeners = this._listeners || {};
- var n = this;
- return i._originalHandler = t, this.onPixi(e, i)
- }, t.offPixi = t.removeEventListener = function(e, t) {
- if (this._listeners = this._listeners || {}, !this._listeners[e]) return this;
- for (var i = this._listeners[e], n = t ? i.length : 0; n-- > 0;) i[n] !== t && i[n]._originalHandler !== t || i.splice(n, 1);
- return 0 === i.length && delete this._listeners[e], this
- }, t.removeAllListeners = function(e) {
- return this._listeners = this._listeners || {}, this._listeners[e] ? (delete this._listeners[e], this) : this
- }
- }
- }, e.Event = function(e, t, i) {
- this.__isEventObject = !0, this.stopped = !1, this.stoppedImmediate = !1, this.target = e, this.type = t, this.data = i, this.content = i, this.timeStamp = Date.now()
- }, e.Event.prototype.stopPropagation = function() {
- this.stopped = !0
- }, e.Event.prototype.stopImmediatePropagation = function() {
- this.stoppedImmediate = !0
- }, e.autoDetectRenderer = function(t, i, n) {
- return t || (t = 800), i || (i = 600),
- function() {
- try {
- var e = document.createElement("canvas");
- return !!window.WebGLRenderingContext && e.getContext("webgl")
- } catch (e) {
- return !1
- }
- }() ? new e.WebGLRenderer(t, i, n) : new e.CanvasRenderer(t, i, n)
- }, e.autoDetectRecommendedRenderer = function(t, i, n) {
- t || (t = 800), i || (i = 600);
- var r = function() {
- try {
- var e = document.createElement("canvas");
- return !!window.WebGLRenderingContext && (e.getContext("webgl") || e.getContext("experimental-webgl"))
- } catch (e) {
- return !1
- }
- }();
- /Android/i.test(navigator.userAgent);
- return r && !android ? new e.WebGLRenderer(t, i, n) : new e.CanvasRenderer(t, i, n)
- }, e.initDefaultShaders = function() {}, e.CompileVertexShader = function(t, i) {
- return e._CompileShader(t, i, t.VERTEX_SHADER)
- }, e.CompileFragmentShader = function(t, i) {
- return e._CompileShader(t, i, t.FRAGMENT_SHADER)
- }, e._CompileShader = function(e, t, i) {
- var n = t.join("\n"),
- r = e.createShader(i);
- return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (window.console.log(e.getShaderInfoLog(r)), null)
- }, e.compileProgram = function(t, i, n) {
- var r = e.CompileFragmentShader(t, n),
- o = e.CompileVertexShader(t, i),
- a = t.createProgram();
- return t.attachShader(a, o), t.attachShader(a, r), t.linkProgram(a), t.getProgramParameter(a, t.LINK_STATUS) || window.console.log("Could not initialise shaders"), a
- }, e.PixiShader = function(t) {
- this._UID = e._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision lowp float;", "varying vec2 vTextureCoord;", "varying vec4 vColor;", "uniform sampler2D uSampler;", "void main(void) {", " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;", "}"], this.textureCount = 0, this.firstRun = !0, this.dirty = !0, this.attributes = [], this.init()
- }, e.PixiShader.prototype.constructor = e.PixiShader, e.PixiShader.prototype.init = function() {
- var t = this.gl,
- i = e.compileProgram(t, this.vertexSrc || e.PixiShader.defaultVertexSrc, this.fragmentSrc);
- t.useProgram(i), this.uSampler = t.getUniformLocation(i, "uSampler"), this.projectionVector = t.getUniformLocation(i, "projectionVector"), this.offsetVector = t.getUniformLocation(i, "offsetVector"), this.dimensions = t.getUniformLocation(i, "dimensions"), this.aVertexPosition = t.getAttribLocation(i, "aVertexPosition"), this.aTextureCoord = t.getAttribLocation(i, "aTextureCoord"), this.colorAttribute = t.getAttribLocation(i, "aColor"), this.colorAttribute === -1 && (this.colorAttribute = 2), this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
- for (var n in this.uniforms) this.uniforms[n].uniformLocation = t.getUniformLocation(i, n);
- this.initUniforms(), this.program = i
- }, e.PixiShader.prototype.initUniforms = function() {
- this.textureCount = 1;
- var e, t = this.gl;
- for (var i in this.uniforms) {
- e = this.uniforms[i];
- var n = e.type;
- "sampler2D" === n ? (e._init = !1, null !== e.value && this.initSampler2D(e)) : "mat2" === n || "mat3" === n || "mat4" === n ? (e.glMatrix = !0, e.glValueLength = 1, "mat2" === n ? e.glFunc = t.uniformMatrix2fv : "mat3" === n ? e.glFunc = t.uniformMatrix3fv : "mat4" === n && (e.glFunc = t.uniformMatrix4fv)) : (e.glFunc = t["uniform" + n], "2f" === n || "2i" === n ? e.glValueLength = 2 : "3f" === n || "3i" === n ? e.glValueLength = 3 : "4f" === n || "4i" === n ? e.glValueLength = 4 : e.glValueLength = 1)
- }
- }, e.PixiShader.prototype.initSampler2D = function(e) {
- if (e.value && e.value.baseTexture && e.value.baseTexture.hasLoaded) {
- var t = this.gl;
- if (t.activeTexture(t["TEXTURE" + this.textureCount]), t.bindTexture(t.TEXTURE_2D, e.value.baseTexture._glTextures[t.id]), e.textureData) {
- var i = e.textureData,
- n = i.magFilter ? i.magFilter : t.LINEAR,
- r = i.minFilter ? i.minFilter : t.LINEAR,
- o = i.wrapS ? i.wrapS : t.CLAMP_TO_EDGE,
- a = i.wrapT ? i.wrapT : t.CLAMP_TO_EDGE,
- s = i.luminance ? t.LUMINANCE : t.RGBA;
- if (i.repeat && (o = t.REPEAT, a = t.REPEAT), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, !!i.flipY), i.width) {
- var h = i.width ? i.width : 512,
- l = i.height ? i.height : 2,
- c = i.border ? i.border : 0;
- t.texImage2D(t.TEXTURE_2D, 0, s, h, l, c, s, t.UNSIGNED_BYTE, null)
- } else t.texImage2D(t.TEXTURE_2D, 0, s, t.RGBA, t.UNSIGNED_BYTE, e.value.baseTexture.source);
- t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, n), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, r), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, o), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, a)
- }
- t.uniform1i(e.uniformLocation, this.textureCount), e._init = !0, this.textureCount++
- }
- }, e.PixiShader.prototype.syncUniforms = function() {
- this.textureCount = 1;
- var t, i = this.gl;
- for (var n in this.uniforms) t = this.uniforms[n], 1 === t.glValueLength ? t.glMatrix === !0 ? t.glFunc.call(i, t.uniformLocation, t.transpose, t.value) : t.glFunc.call(i, t.uniformLocation, t.value) : 2 === t.glValueLength ? t.glFunc.call(i, t.uniformLocation, t.value.x, t.value.y) : 3 === t.glValueLength ? t.glFunc.call(i, t.uniformLocation, t.value.x, t.value.y, t.value.z) : 4 === t.glValueLength ? t.glFunc.call(i, t.uniformLocation, t.value.x, t.value.y, t.value.z, t.value.w) : "sampler2D" === t.type && (t._init ? (i.activeTexture(i["TEXTURE" + this.textureCount]), t.value.baseTexture._dirty[i.id] ? e.instances[i.id].updateTexture(t.value.baseTexture) : i.bindTexture(i.TEXTURE_2D, t.value.baseTexture._glTextures[i.id]), i.uniform1i(t.uniformLocation, this.textureCount), this.textureCount++) : this.initSampler2D(t))
- }, e.PixiShader.prototype.destroy = function() {
- this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attributes = null
- }, e.PixiShader.defaultVertexSrc = ["attribute vec2 aVertexPosition;", "attribute vec2 aTextureCoord;", "attribute vec4 aColor;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "varying vec2 vTextureCoord;", "varying vec4 vColor;", "const vec2 center = vec2(-1.0, 1.0);", "void main(void) {", " gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);", " vTextureCoord = aTextureCoord;", " vColor = vec4(aColor.rgb * aColor.a, aColor.a);", "}"], e.PixiFastShader = function(t) {
- this._UID = e._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision lowp float;", "varying vec2 vTextureCoord;", "varying float vColor;", "uniform sampler2D uSampler;", "void main(void) {", " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;", "}"], this.vertexSrc = ["attribute vec2 aVertexPosition;", "attribute vec2 aPositionCoord;", "attribute vec2 aScale;", "attribute float aRotation;", "attribute vec2 aTextureCoord;", "attribute float aColor;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "uniform mat3 uMatrix;", "varying vec2 vTextureCoord;", "varying float vColor;", "const vec2 center = vec2(-1.0, 1.0);", "void main(void) {", " vec2 v;", " vec2 sv = aVertexPosition * aScale;", " v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);", " v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);", " v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;", " gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);", " vTextureCoord = aTextureCoord;", " vColor = aColor;", "}"], this.textureCount = 0, this.init()
- }, e.PixiFastShader.prototype.constructor = e.PixiFastShader, e.PixiFastShader.prototype.init = function() {
- var t = this.gl,
- i = e.compileProgram(t, this.vertexSrc, this.fragmentSrc);
- t.useProgram(i), this.uSampler = t.getUniformLocation(i, "uSampler"), this.projectionVector = t.getUniformLocation(i, "projectionVector"), this.offsetVector = t.getUniformLocation(i, "offsetVector"), this.dimensions = t.getUniformLocation(i, "dimensions"), this.uMatrix = t.getUniformLocation(i, "uMatrix"), this.aVertexPosition = t.getAttribLocation(i, "aVertexPosition"), this.aPositionCoord = t.getAttribLocation(i, "aPositionCoord"), this.aScale = t.getAttribLocation(i, "aScale"), this.aRotation = t.getAttribLocation(i, "aRotation"), this.aTextureCoord = t.getAttribLocation(i, "aTextureCoord"), this.colorAttribute = t.getAttribLocation(i, "aColor"), this.colorAttribute === -1 && (this.colorAttribute = 2), this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute], this.program = i
- }, e.PixiFastShader.prototype.destroy = function() {
- this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attributes = null
- }, e.PrimitiveShader = function(t) {
- this._UID = e._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision mediump float;", "varying vec4 vColor;", "void main(void) {", " gl_FragColor = vColor;", "}"], this.vertexSrc = ["attribute vec2 aVertexPosition;", "attribute vec4 aColor;", "uniform mat3 translationMatrix;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "uniform float alpha;", "uniform float flipY;", "uniform vec3 tint;", "varying vec4 vColor;", "void main(void) {", " vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);", " v -= offsetVector.xyx;", " gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);", " vColor = aColor * vec4(tint * alpha, alpha);", "}"], this.init()
- }, e.PrimitiveShader.prototype.constructor = e.PrimitiveShader, e.PrimitiveShader.prototype.init = function() {
- var t = this.gl,
- i = e.compileProgram(t, this.vertexSrc, this.fragmentSrc);
- t.useProgram(i), this.projectionVector = t.getUniformLocation(i, "projectionVector"), this.offsetVector = t.getUniformLocation(i, "offsetVector"), this.tintColor = t.getUniformLocation(i, "tint"), this.flipY = t.getUniformLocation(i, "flipY"), this.aVertexPosition = t.getAttribLocation(i, "aVertexPosition"), this.colorAttribute = t.getAttribLocation(i, "aColor"), this.attributes = [this.aVertexPosition, this.colorAttribute], this.translationMatrix = t.getUniformLocation(i, "translationMatrix"), this.alpha = t.getUniformLocation(i, "alpha"), this.program = i
- }, e.PrimitiveShader.prototype.destroy = function() {
- this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attributes = null
- }, e.ComplexPrimitiveShader = function(t) {
- this._UID = e._UID++, this.gl = t, this.program = null, this.fragmentSrc = ["precision mediump float;", "varying vec4 vColor;", "void main(void) {", " gl_FragColor = vColor;", "}"], this.vertexSrc = ["attribute vec2 aVertexPosition;", "uniform mat3 translationMatrix;", "uniform vec2 projectionVector;", "uniform vec2 offsetVector;", "uniform vec3 tint;", "uniform float alpha;", "uniform vec3 color;", "uniform float flipY;", "varying vec4 vColor;", "void main(void) {", " vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);", " v -= offsetVector.xyx;", " gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);", " vColor = vec4(color * alpha * tint, alpha);", "}"], this.init()
- }, e.ComplexPrimitiveShader.prototype.constructor = e.ComplexPrimitiveShader, e.ComplexPrimitiveShader.prototype.init = function() {
- var t = this.gl,
- i = e.compileProgram(t, this.vertexSrc, this.fragmentSrc);
- t.useProgram(i), this.projectionVector = t.getUniformLocation(i, "projectionVector"), this.offsetVector = t.getUniformLocation(i, "offsetVector"), this.tintColor = t.getUniformLocation(i, "tint"), this.color = t.getUniformLocation(i, "color"), this.flipY = t.getUniformLocation(i, "flipY"), this.aVertexPosition = t.getAttribLocation(i, "aVertexPosition"), this.attributes = [this.aVertexPosition, this.colorAttribute], this.translationMatrix = t.getUniformLocation(i, "translationMatrix"), this.alpha = t.getUniformLocation(i, "alpha"), this.program = i
- }, e.ComplexPrimitiveShader.prototype.destroy = function() {
- this.gl.deleteProgram(this.program), this.uniforms = null, this.gl = null, this.attribute = null
- }, e.WebGLGraphics = function() {}, e.WebGLGraphics.renderGraphics = function(t, i) {
- var n, r = i.gl,
- o = i.projection,
- a = i.offset,
- s = i.shaderManager.primitiveShader;
- t.dirty && e.WebGLGraphics.updateGraphics(t, r);
- for (var h = t._webGL[r.id], l = 0; l < h.data.length; l++) 1 === h.data[l].mode ? (n = h.data[l], i.stencilManager.pushStencil(t, n, i), r.drawElements(r.TRIANGLE_FAN, 4, r.UNSIGNED_SHORT, 2 * (n.indices.length - 4)), i.stencilManager.popStencil(t, n, i)) : (n = h.data[l], i.shaderManager.setShader(s), s = i.shaderManager.primitiveShader, r.uniformMatrix3fv(s.translationMatrix, !1, t.worldTransform.toArray(!0)), r.uniform1f(s.flipY, 1), r.uniform2f(s.projectionVector, o.x, -o.y), r.uniform2f(s.offsetVector, -a.x, -a.y), r.uniform3fv(s.tintColor, e.hex2rgb(t.tint)), r.uniform1f(s.alpha, t.worldAlpha), r.bindBuffer(r.ARRAY_BUFFER, n.buffer), r.vertexAttribPointer(s.aVertexPosition, 2, r.FLOAT, !1, 24, 0), r.vertexAttribPointer(s.colorAttribute, 4, r.FLOAT, !1, 24, 8), r.bindBuffer(r.ELEMENT_ARRAY_BUFFER, n.indexBuffer), r.drawElements(r.TRIANGLE_STRIP, n.indices.length, r.UNSIGNED_SHORT, 0))
- }, e.WebGLGraphics.updateGraphics = function(t, i) {
- var n = t._webGL[i.id];
- n || (n = t._webGL[i.id] = {
- lastIndex: 0,
- data: [],
- gl: i
- }), t.dirty = !1;
- var r;
- if (t.clearDirty) {
- for (t.clearDirty = !1, r = 0; r < n.data.length; r++) {
- var o = n.data[r];
- o.reset(), e.WebGLGraphics.graphicsDataPool.push(o)
- }
- n.data = [], n.lastIndex = 0
- }
- var a;
- for (r = n.lastIndex; r < t.graphicsData.length; r++) {
- var s = t.graphicsData[r];
- if (s.type === e.Graphics.POLY) {
- if (s.points = s.shape.points.slice(), s.shape.closed && (s.points[0] === s.points[s.points.length - 2] && s.points[1] === s.points[s.points.length - 1] || s.points.push(s.points[0], s.points[1])), s.fill && s.points.length >= 6)
- if (s.points.length < 12) {
- a = e.WebGLGraphics.switchMode(n, 0);
- var h = e.WebGLGraphics.buildPoly(s, a);
- h || (a = e.WebGLGraphics.switchMode(n, 1), e.WebGLGraphics.buildComplexPoly(s, a))
- } else a = e.WebGLGraphics.switchMode(n, 1), e.WebGLGraphics.buildComplexPoly(s, a);
- s.lineWidth > 0 && (a = e.WebGLGraphics.switchMode(n, 0), e.WebGLGraphics.buildLine(s, a))
- } else a = e.WebGLGraphics.switchMode(n, 0), s.type === e.Graphics.RECT ? e.WebGLGraphics.buildRectangle(s, a) : s.type === e.Graphics.CIRC || s.type === e.Graphics.ELIP ? e.WebGLGraphics.buildCircle(s, a) : s.type === e.Graphics.RREC && e.WebGLGraphics.buildRoundedRectangle(s, a);
- n.lastIndex++
- }
- for (r = 0; r < n.data.length; r++) a = n.data[r], a.dirty && a.upload()
- }, e.WebGLGraphics.switchMode = function(t, i) {
- var n;
- return t.data.length ? (n = t.data[t.data.length - 1], n.mode === i && 1 !== i || (n = e.WebGLGraphics.graphicsDataPool.pop() || new e.WebGLGraphicsData(t.gl), n.mode = i, t.data.push(n))) : (n = e.WebGLGraphics.graphicsDataPool.pop() || new e.WebGLGraphicsData(t.gl), n.mode = i, t.data.push(n)), n.dirty = !0, n
- }, e.WebGLGraphics.buildRectangle = function(t, i) {
- var n = t.shape,
- r = n.x,
- o = n.y,
- a = n.width,
- s = n.height;
- if (t.fill) {
- var h = e.hex2rgb(t.fillColor),
- l = t.fillAlpha,
- c = h[0] * l,
- d = h[1] * l,
- u = h[2] * l,
- f = i.points,
- p = i.indices,
- g = f.length / 6;
- f.push(r, o), f.push(c, d, u, l), f.push(r + a, o), f.push(c, d, u, l), f.push(r, o + s), f.push(c, d, u, l), f.push(r + a, o + s), f.push(c, d, u, l), p.push(g, g, g + 1, g + 2, g + 3, g + 3)
- }
- if (t.lineWidth) {
- var v = t.points;
- t.points = [r, o, r + a, o, r + a, o + s, r, o + s, r, o], e.WebGLGraphics.buildLine(t, i), t.points = v
- }
- }, e.WebGLGraphics.buildRoundedRectangle = function(t, i) {
- var n = t.shape,
- r = n.x,
- o = n.y,
- a = n.width,
- s = n.height,
- h = n.radius,
- l = [];
- if (l.push(r, o + h), l = l.concat(e.WebGLGraphics.quadraticBezierCurve(r, o + s - h, r, o + s, r + h, o + s)), l = l.concat(e.WebGLGraphics.quadraticBezierCurve(r + a - h, o + s, r + a, o + s, r + a, o + s - h)), l = l.concat(e.WebGLGraphics.quadraticBezierCurve(r + a, o + h, r + a, o, r + a - h, o)), l = l.concat(e.WebGLGraphics.quadraticBezierCurve(r + h, o, r, o, r, o + h)), t.fill) {
- var c = e.hex2rgb(t.fillColor),
- d = t.fillAlpha,
- u = c[0] * d,
- f = c[1] * d,
- p = c[2] * d,
- g = i.points,
- v = i.indices,
- m = g.length / 6,
- x = e.PolyK.Triangulate(l);
- if (!x) return t.shape.height++, e.WebGLGraphics.buildRoundedRectangle(t, i), void console.log("SOLVED PIXI RECT ISSUE LIKE CRAP");
- var w = 0;
- for (w = 0; w < x.length; w += 3) v.push(x[w] + m), v.push(x[w] + m), v.push(x[w + 1] + m), v.push(x[w + 2] + m), v.push(x[w + 2] + m);
- for (w = 0; w < l.length; w++) g.push(l[w], l[++w], u, f, p, d)
- }
- if (t.lineWidth) {
- var y = t.points;
- t.points = l, e.WebGLGraphics.buildLine(t, i), t.points = y
- }
- }, e.WebGLGraphics.quadraticBezierCurve = function(e, t, i, n, r, o) {
- function a(e, t, i) {
- return e + (t - e) * i
- }
- for (var s, h, l, c, d, u, f = 20, p = [], g = 0, v = 0; v <= f; v++) g = v / f, s = a(e, i, g), h = a(t, n, g), l = a(i, r, g), c = a(n, o, g), d = a(s, l, g), u = a(h, c, g), p.push(d, u);
- return p
- }, e.WebGLGraphics.buildCircle = function(t, i) {
- var n, r, o = t.shape,
- a = o.x,
- s = o.y;
- t.type === e.Graphics.CIRC ? (n = o.radius, r = o.radius) : (n = o.width, r = o.height);
- var h = 40,
- l = 2 * Math.PI / h,
- c = 0;
- if (t.fill) {
- var d = e.hex2rgb(t.fillColor),
- u = t.fillAlpha,
- f = d[0] * u,
- p = d[1] * u,
- g = d[2] * u,
- v = i.points,
- m = i.indices,
- x = v.length / 6;
- for (m.push(x), c = 0; c < h + 1; c++) v.push(a, s, f, p, g, u), v.push(a + Math.sin(l * c) * n, s + Math.cos(l * c) * r, f, p, g, u), m.push(x++, x++);
- m.push(x - 1)
- }
- if (t.lineWidth) {
- var w = t.points;
- for (t.points = [], c = 0; c < h + 1; c++) t.points.push(a + Math.sin(l * c) * n, s + Math.cos(l * c) * r);
- e.WebGLGraphics.buildLine(t, i), t.points = w
- }
- }, e.WebGLGraphics.buildLine = function(t, i) {
- var n = 0,
- r = t.points;
- if (0 !== r.length) {
- if (t.lineWidth % 2)
- for (n = 0; n < r.length; n++) r[n] += .5;
- var o = new e.Point(r[0], r[1]),
- a = new e.Point(r[r.length - 2], r[r.length - 1]);
- if (o.x === a.x && o.y === a.y) {
- r = r.slice(), r.pop(), r.pop(), a = new e.Point(r[r.length - 2], r[r.length - 1]);
- var s = a.x + .5 * (o.x - a.x),
- h = a.y + .5 * (o.y - a.y);
- r.unshift(s, h), r.push(s, h)
- }
- var l, c, d, u, f, p, g, v, m, x, w, y, b, T, C, S, M, R, _, E, L, A, P, B = i.points,
- I = i.indices,
- F = r.length / 2,
- k = r.length,
- O = B.length / 6,
- G = t.lineWidth / 2,
- D = e.hex2rgb(t.lineColor),
- U = t.lineAlpha,
- H = D[0] * U,
- z = D[1] * U,
- W = D[2] * U;
- for (d = r[0], u = r[1], f = r[2], p = r[3], m = -(u - p), x = d - f, P = Math.sqrt(m * m + x * x), m /= P, x /= P, m *= G, x *= G, B.push(d - m, u - x, H, z, W, U), B.push(d + m, u + x, H, z, W, U), n = 1; n < F - 1; n++) d = r[2 * (n - 1)], u = r[2 * (n - 1) + 1], f = r[2 * n], p = r[2 * n + 1], g = r[2 * (n + 1)], v = r[2 * (n + 1) + 1], m = -(u - p), x = d - f, P = Math.sqrt(m * m + x * x), m /= P, x /= P, m *= G, x *= G, w = -(p - v), y = f - g, P = Math.sqrt(w * w + y * y), w /= P, y /= P, w *= G, y *= G, C = -x + u - (-x + p), S = -m + f - (-m + d), M = (-m + d) * (-x + p) - (-m + f) * (-x + u), R = -y + v - (-y + p), _ = -w + f - (-w + g), E = (-w + g) * (-y + p) - (-w + f) * (-y + v), L = C * _ - R * S, Math.abs(L) < .1 ? (L += 10.1, B.push(f - m, p - x, H, z, W, U), B.push(f + m, p + x, H, z, W, U)) : (l = (S * E - _ * M) / L, c = (R * M - C * E) / L, A = (l - f) * (l - f) + (c - p) + (c - p), A > 19600 ? (b = m - w, T = x - y, P = Math.sqrt(b * b + T * T), b /= P, T /= P, b *= G, T *= G, B.push(f - b, p - T), B.push(H, z, W, U), B.push(f + b, p + T), B.push(H, z, W, U), B.push(f - b, p - T), B.push(H, z, W, U), k++) : (B.push(l, c), B.push(H, z, W, U), B.push(f - (l - f), p - (c - p)), B.push(H, z, W, U)));
- for (d = r[2 * (F - 2)], u = r[2 * (F - 2) + 1], f = r[2 * (F - 1)], p = r[2 * (F - 1) + 1], m = -(u - p), x = d - f, P = Math.sqrt(m * m + x * x), m /= P, x /= P, m *= G, x *= G, B.push(f - m, p - x), B.push(H, z, W, U), B.push(f + m, p + x), B.push(H, z, W, U), I.push(O), n = 0; n < k; n++) I.push(O++);
- I.push(O - 1)
- }
- }, e.WebGLGraphics.buildComplexPoly = function(t, i) {
- var n = t.points.slice();
- if (!(n.length < 6)) {
- var r = i.indices;
- i.points = n, i.alpha = t.fillAlpha, i.color = e.hex2rgb(t.fillColor);
- for (var o, a, s = 1 / 0, h = -(1 / 0), l = 1 / 0, c = -(1 / 0), d = 0; d < n.length; d += 2) o = n[d], a = n[d + 1], s = o < s ? o : s, h = o > h ? o : h, l = a < l ? a : l, c = a > c ? a : c;
- n.push(s, l, h, l, h, c, s, c);
- var u = n.length / 2;
- for (d = 0; d < u; d++) r.push(d)
- }
- }, e.WebGLGraphics.buildPoly = function(t, i) {
- var n = t.points;
- if (!(n.length < 6)) {
- var r = i.points,
- o = i.indices,
- a = n.length / 2,
- s = e.hex2rgb(t.fillColor),
- h = t.fillAlpha,
- l = s[0] * h,
- c = s[1] * h,
- d = s[2] * h,
- u = e.PolyK.Triangulate(n);
- if (!u) return !1;
- var f = r.length / 6,
- p = 0;
- for (p = 0; p < u.length; p += 3) o.push(u[p] + f), o.push(u[p] + f), o.push(u[p + 1] + f), o.push(u[p + 2] + f), o.push(u[p + 2] + f);
- for (p = 0; p < a; p++) r.push(n[2 * p], n[2 * p + 1], l, c, d, h);
- return !0
- }
- }, e.WebGLGraphics.graphicsDataPool = [], e.WebGLGraphicsData = function(e) {
- this.gl = e, this.color = [0, 0, 0], this.points = [], this.indices = [], this.buffer = e.createBuffer(), this.indexBuffer = e.createBuffer(), this.mode = 1, this.alpha = 1, this.dirty = !0
- }, e.WebGLGraphicsData.prototype.reset = function() {
- this.points = [], this.indices = []
- }, e.WebGLGraphicsData.prototype.upload = function() {
- var t = this.gl;
- this.glPoints = new e.Float32Array(this.points), t.bindBuffer(t.ARRAY_BUFFER, this.buffer), t.bufferData(t.ARRAY_BUFFER, this.glPoints, t.STATIC_DRAW), this.glIndicies = new e.Uint16Array(this.indices), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, this.glIndicies, t.STATIC_DRAW), this.dirty = !1
- }, e.glContexts = [], e.instances = [], e.WebGLRenderer = function(t, i, n) {
- if (n)
- for (var r in e.defaultRenderOptions) "undefined" == typeof n[r] && (n[r] = e.defaultRenderOptions[r]);
- else n = e.defaultRenderOptions;
- e.defaultRenderer || (e.defaultRenderer = this), this.type = e.WEBGL_RENDERER, this.transparent = n.transparent, this.autoResize = n.autoResize || !1, this.preserveDrawingBuffer = n.preserveDrawingBuffer, this.clearBeforeRender = n.clearBeforeRender, this.width = t || 800, this.height = i || 600, this.view = n.view || document.createElement("canvas"), this.contextLostBound = this.handleContextLost.bind(this), this.contextRestoredBound = this.handleContextRestored.bind(this), this.view.addEventListener("webglcontextlost", this.contextLostBound, !1), this.view.addEventListener("webglcontextrestored", this.contextRestoredBound, !1), this._contextOptions = {
- alpha: this.transparent,
- antialias: n.antialias,
- premultipliedAlpha: this.transparent && "notMultiplied" !== this.transparent,
- stencil: !0,
- preserveDrawingBuffer: n.preserveDrawingBuffer
- }, this.projection = new e.Point, this.offset = new e.Point(0, 0), this.shaderManager = new e.WebGLShaderManager, this.spriteBatch = new e.WebGLSpriteBatch, this.maskManager = new e.WebGLMaskManager, this.filterManager = new e.WebGLFilterManager, this.stencilManager = new e.WebGLStencilManager, this.blendModeManager = new e.WebGLBlendModeManager, this.renderSession = {}, this.renderSession.gl = this.gl, this.renderSession.drawCount = 0, this.renderSession.shaderManager = this.shaderManager, this.renderSession.maskManager = this.maskManager, this.renderSession.filterManager = this.filterManager, this.renderSession.blendModeManager = this.blendModeManager, this.renderSession.spriteBatch = this.spriteBatch, this.renderSession.stencilManager = this.stencilManager, this.renderSession.renderer = this, this.initContext(), this.mapBlendModes()
- }, e.WebGLRenderer.prototype.constructor = e.WebGLRenderer, e.WebGLRenderer.prototype.initContext = function() {
- var t = this.view.getContext("webgl", this._contextOptions) || this.view.getContext("experimental-webgl", this._contextOptions);
- if (this.gl = t, !t) throw new Error("This browser does not support webGL. Try using the canvas renderer");
- this.glContextId = t.id = e.WebGLRenderer.glContextId++, e.glContexts[this.glContextId] = t, e.instances[this.glContextId] = this, t.disable(t.DEPTH_TEST), t.disable(t.CULL_FACE), t.enable(t.BLEND), this.shaderManager.setContext(t), this.spriteBatch.setContext(t), this.maskManager.setContext(t), this.filterManager.setContext(t), this.blendModeManager.setContext(t), this.stencilManager.setContext(t), this.renderSession.gl = this.gl, this.resize(this.width, this.height)
- }, e.WebGLRenderer.prototype.render = function(e) {
- if (!this.contextLost) {
- this.__stage !== e && (e.interactive && e.interactionManager.removeEvents(), this.__stage = e), e.updateTransform();
- var t = this.gl;
- e._interactiveEventsAdded || (e._interactiveEventsAdded = !0, e.interactionManager.setTarget(this)), t.viewport(0, 0, this.width, this.height), t.bindFramebuffer(t.FRAMEBUFFER, null), t.clearColor(e.backgroundColorSplit[0], e.backgroundColorSplit[1], e.backgroundColorSplit[2], 1), t.clear(t.COLOR_BUFFER_BIT), this.renderDisplayObject(e, this.projection)
- }
- }, e.WebGLRenderer.prototype.renderDisplayObject = function(t, i, n) {
- this.renderSession.blendModeManager.setBlendMode(e.blendModes.NORMAL), this.renderSession.drawCount = 0, this.renderSession.flipY = n ? -1 : 1, this.renderSession.projection = i, this.renderSession.offset = this.offset, this.spriteBatch.begin(this.renderSession), this.filterManager.begin(this.renderSession, n), t._renderWebGL(this.renderSession), this.spriteBatch.end()
- }, e.WebGLRenderer.prototype.resize = function(e, t) {
- this.width = e, this.height = t, this.view.width = this.width, this.view.height = this.height, this.gl.viewport(0, 0, this.width, this.height), this.projection.x = this.width / 2, this.projection.y = -this.height / 2
- }, e.WebGLRenderer.prototype.updateTexture = function(t) {
- if (t.hasLoaded) {
- var i = this.gl;
- return t._glTextures[i.id] || (t._glTextures[i.id] = i.createTexture()), i.bindTexture(i.TEXTURE_2D, t._glTextures[i.id]), i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultipliedAlpha), t.source.getContext ? i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, i.RGBA, i.UNSIGNED_BYTE, t.source.getContext("2d").getImageData(0, 0, t.source.width, t.source.height)) : i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, i.RGBA, i.UNSIGNED_BYTE, t.source), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, t.scaleMode === e.scaleModes.LINEAR ? i.LINEAR : i.NEAREST), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, t.scaleMode === e.scaleModes.LINEAR ? i.LINEAR : i.NEAREST), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_S, i.CLAMP_TO_EDGE), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_T, i.CLAMP_TO_EDGE), t._dirty[i.id] = !1, t._glTextures[i.id]
- }
- }, e.WebGLRenderer.prototype.handleContextLost = function(e) {
- e.preventDefault(), this.contextLost = !0
- }, e.WebGLRenderer.prototype.handleContextRestored = function() {
- this.initContext();
- for (var t in e.TextureCache) {
- e.TextureCache[t].baseTexture._glTextures = []
- }
- this.contextLost = !1
- }, e.WebGLRenderer.prototype.destroy = function() {
- this.view.removeEventListener("webglcontextlost", this.contextLostBound), this.view.removeEventListener("webglcontextrestored", this.contextRestoredBound), e.glContexts[this.glContextId] = null, this.projection = null, this.offset = null, this.shaderManager.destroy(), this.spriteBatch.destroy(), this.maskManager.destroy(), this.filterManager.destroy(), this.shaderManager = null, this.spriteBatch = null, this.maskManager = null, this.filterManager = null, this.gl = null, this.renderSession = null
- }, e.WebGLRenderer.prototype.mapBlendModes = function() {
- var t = this.gl;
- e.blendModesWebGL || (e.blendModesWebGL = [], e.blendModesWebGL[e.blendModes.NORMAL] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.ADD] = [t.SRC_ALPHA, t.DST_ALPHA], e.blendModesWebGL[e.blendModes.MULTIPLY] = [t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.SCREEN] = [t.SRC_ALPHA, t.ONE], e.blendModesWebGL[e.blendModes.OVERLAY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.DARKEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.LIGHTEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.COLOR_DODGE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.COLOR_BURN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.HARD_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.SOFT_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.DIFFERENCE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.EXCLUSION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.HUE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.SATURATION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.COLOR] = [t.ONE, t.ONE_MINUS_SRC_ALPHA], e.blendModesWebGL[e.blendModes.LUMINOSITY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA])
- }, e.WebGLRenderer.glContextId = 0, e.WebGLBlendModeManager = function() {
- this.currentBlendMode = 99999
- }, e.WebGLBlendModeManager.prototype.constructor = e.WebGLBlendModeManager, e.WebGLBlendModeManager.prototype.setContext = function(e) {
- this.gl = e
- }, e.WebGLBlendModeManager.prototype.setBlendMode = function(t) {
- if (this.currentBlendMode === t) return !1;
- this.currentBlendMode = t;
- var i = e.blendModesWebGL[this.currentBlendMode];
- return this.gl.blendFunc(i[0], i[1]), !0
- }, e.WebGLBlendModeManager.prototype.destroy = function() {
- this.gl = null
- }, e.WebGLMaskManager = function() {}, e.WebGLMaskManager.prototype.constructor = e.WebGLMaskManager, e.WebGLMaskManager.prototype.setContext = function(e) {
- this.gl = e
- }, e.WebGLMaskManager.prototype.pushMask = function(t, i) {
- var n = i.gl;
- t.dirty && e.WebGLGraphics.updateGraphics(t, n), t._webGL[n.id].data.length && i.stencilManager.pushStencil(t, t._webGL[n.id].data[0], i)
- }, e.WebGLMaskManager.prototype.popMask = function(e, t) {
- var i = this.gl;
- t.stencilManager.popStencil(e, e._webGL[i.id].data[0], t)
- }, e.WebGLMaskManager.prototype.destroy = function() {
- this.gl = null
- }, e.WebGLStencilManager = function() {
- this.stencilStack = [], this.reverse = !0, this.count = 0
- }, e.WebGLStencilManager.prototype.setContext = function(e) {
- this.gl = e
- }, e.WebGLStencilManager.prototype.pushStencil = function(e, t, i) {
- var n = this.gl;
- this.bindGraphics(e, t, i), 0 === this.stencilStack.length && (n.enable(n.STENCIL_TEST),
- n.clear(n.STENCIL_BUFFER_BIT), this.reverse = !0, this.count = 0), this.stencilStack.push(t);
- var r = this.count;
- n.colorMask(!1, !1, !1, !1), n.stencilFunc(n.ALWAYS, 0, 255), n.stencilOp(n.KEEP, n.KEEP, n.INVERT), 1 === t.mode ? (n.drawElements(n.TRIANGLE_FAN, t.indices.length - 4, n.UNSIGNED_SHORT, 0), this.reverse ? (n.stencilFunc(n.EQUAL, 255 - r, 255), n.stencilOp(n.KEEP, n.KEEP, n.DECR)) : (n.stencilFunc(n.EQUAL, r, 255), n.stencilOp(n.KEEP, n.KEEP, n.INCR)), n.drawElements(n.TRIANGLE_FAN, 4, n.UNSIGNED_SHORT, 2 * (t.indices.length - 4)), this.reverse ? n.stencilFunc(n.EQUAL, 255 - (r + 1), 255) : n.stencilFunc(n.EQUAL, r + 1, 255), this.reverse = !this.reverse) : (this.reverse ? (n.stencilFunc(n.EQUAL, r, 255), n.stencilOp(n.KEEP, n.KEEP, n.INCR)) : (n.stencilFunc(n.EQUAL, 255 - r, 255), n.stencilOp(n.KEEP, n.KEEP, n.DECR)), n.drawElements(n.TRIANGLE_STRIP, t.indices.length, n.UNSIGNED_SHORT, 0), this.reverse ? n.stencilFunc(n.EQUAL, r + 1, 255) : n.stencilFunc(n.EQUAL, 255 - (r + 1), 255)), n.colorMask(!0, !0, !0, !0), n.stencilOp(n.KEEP, n.KEEP, n.KEEP), this.count++
- }, e.WebGLStencilManager.prototype.bindGraphics = function(t, i, n) {
- this._currentGraphics = t;
- var r, o = this.gl,
- a = n.projection,
- s = n.offset;
- 1 === i.mode ? (r = n.shaderManager.complexPrimitiveShader, n.shaderManager.setShader(r), o.uniform1f(r.flipY, n.flipY), o.uniformMatrix3fv(r.translationMatrix, !1, t.worldTransform.toArray(!0)), o.uniform2f(r.projectionVector, a.x, -a.y), o.uniform2f(r.offsetVector, -s.x, -s.y), o.uniform3fv(r.tintColor, e.hex2rgb(t.tint)), o.uniform3fv(r.color, i.color), o.uniform1f(r.alpha, t.worldAlpha * i.alpha), o.bindBuffer(o.ARRAY_BUFFER, i.buffer), o.vertexAttribPointer(r.aVertexPosition, 2, o.FLOAT, !1, 8, 0), o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, i.indexBuffer)) : (r = n.shaderManager.primitiveShader, n.shaderManager.setShader(r), o.uniformMatrix3fv(r.translationMatrix, !1, t.worldTransform.toArray(!0)), o.uniform1f(r.flipY, n.flipY), o.uniform2f(r.projectionVector, a.x, -a.y), o.uniform2f(r.offsetVector, -s.x, -s.y), o.uniform3fv(r.tintColor, e.hex2rgb(t.tint)), o.uniform1f(r.alpha, t.worldAlpha), o.bindBuffer(o.ARRAY_BUFFER, i.buffer), o.vertexAttribPointer(r.aVertexPosition, 2, o.FLOAT, !1, 24, 0), o.vertexAttribPointer(r.colorAttribute, 4, o.FLOAT, !1, 24, 8), o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, i.indexBuffer))
- }, e.WebGLStencilManager.prototype.popStencil = function(e, t, i) {
- var n = this.gl;
- if (this.stencilStack.pop(), this.count--, 0 === this.stencilStack.length) n.disable(n.STENCIL_TEST);
- else {
- var r = this.count;
- this.bindGraphics(e, t, i), n.colorMask(!1, !1, !1, !1), 1 === t.mode ? (this.reverse = !this.reverse, this.reverse ? (n.stencilFunc(n.EQUAL, 255 - (r + 1), 255), n.stencilOp(n.KEEP, n.KEEP, n.INCR)) : (n.stencilFunc(n.EQUAL, r + 1, 255), n.stencilOp(n.KEEP, n.KEEP, n.DECR)), n.drawElements(n.TRIANGLE_FAN, 4, n.UNSIGNED_SHORT, 2 * (t.indices.length - 4)), n.stencilFunc(n.ALWAYS, 0, 255), n.stencilOp(n.KEEP, n.KEEP, n.INVERT), n.drawElements(n.TRIANGLE_FAN, t.indices.length - 4, n.UNSIGNED_SHORT, 0), this.reverse ? n.stencilFunc(n.EQUAL, r, 255) : n.stencilFunc(n.EQUAL, 255 - r, 255)) : (this.reverse ? (n.stencilFunc(n.EQUAL, r + 1, 255), n.stencilOp(n.KEEP, n.KEEP, n.DECR)) : (n.stencilFunc(n.EQUAL, 255 - (r + 1), 255), n.stencilOp(n.KEEP, n.KEEP, n.INCR)), n.drawElements(n.TRIANGLE_STRIP, t.indices.length, n.UNSIGNED_SHORT, 0), this.reverse ? n.stencilFunc(n.EQUAL, r, 255) : n.stencilFunc(n.EQUAL, 255 - r, 255)), n.colorMask(!0, !0, !0, !0), n.stencilOp(n.KEEP, n.KEEP, n.KEEP)
- }
- }, e.WebGLStencilManager.prototype.destroy = function() {
- this.stencilStack = null, this.gl = null
- }, e.WebGLShaderManager = function() {
- this.maxAttibs = 10, this.attribState = [], this.tempAttribState = [];
- for (var e = 0; e < this.maxAttibs; e++) this.attribState[e] = !1;
- this.stack = []
- }, e.WebGLShaderManager.prototype.constructor = e.WebGLShaderManager, e.WebGLShaderManager.prototype.setContext = function(t) {
- this.gl = t, this.primitiveShader = new e.PrimitiveShader(t), this.complexPrimitiveShader = new e.ComplexPrimitiveShader(t), this.defaultShader = new e.PixiShader(t), this.fastShader = new e.PixiFastShader(t), this.setShader(this.defaultShader)
- }, e.WebGLShaderManager.prototype.setAttribs = function(e) {
- var t;
- for (t = 0; t < this.tempAttribState.length; t++) this.tempAttribState[t] = !1;
- for (t = 0; t < e.length; t++) {
- var i = e[t];
- this.tempAttribState[i] = !0
- }
- var n = this.gl;
- for (t = 0; t < this.attribState.length; t++) this.attribState[t] !== this.tempAttribState[t] && (this.attribState[t] = this.tempAttribState[t], this.tempAttribState[t] ? n.enableVertexAttribArray(t) : n.disableVertexAttribArray(t))
- }, e.WebGLShaderManager.prototype.setShader = function(e) {
- return this._currentId !== e._UID && (this._currentId = e._UID, this.currentShader = e, this.gl.useProgram(e.program), this.setAttribs(e.attributes), !0)
- }, e.WebGLShaderManager.prototype.destroy = function() {
- this.attribState = null, this.tempAttribState = null, this.primitiveShader.destroy(), this.complexPrimitiveShader.destroy(), this.defaultShader.destroy(), this.fastShader.destroy(), this.gl = null
- }, e.WebGLSpriteBatch = function() {
- this.vertSize = 5, this.size = 2e3;
- var t = 4 * this.size * 4 * this.vertSize,
- i = 6 * this.size;
- this.vertices = new e.ArrayBuffer(t), this.positions = new e.Float32Array(this.vertices), this.colors = new e.Uint32Array(this.vertices), this.indices = new e.Uint16Array(i), this.lastIndexCount = 0;
- for (var n = 0, r = 0; n < i; n += 6, r += 4) this.indices[n + 0] = r + 0, this.indices[n + 1] = r + 1, this.indices[n + 2] = r + 2, this.indices[n + 3] = r + 0, this.indices[n + 4] = r + 2, this.indices[n + 5] = r + 3;
- this.drawing = !1, this.currentBatchSize = 0, this.currentBaseTexture = null, this.dirty = !0, this.textures = [], this.blendModes = [], this.shaders = [], this.sprites = [], this.defaultShader = new e.AbstractFilter(["precision lowp float;", "varying vec2 vTextureCoord;", "varying vec4 vColor;", "uniform sampler2D uSampler;", "void main(void) {", " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;", "}"])
- }, e.WebGLSpriteBatch.prototype.setContext = function(t) {
- this.gl = t, this.vertexBuffer = t.createBuffer(), this.indexBuffer = t.createBuffer(), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, this.indices, t.STATIC_DRAW), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), t.bufferData(t.ARRAY_BUFFER, this.vertices, t.DYNAMIC_DRAW), this.currentBlendMode = 99999;
- var i = new e.PixiShader(t);
- i.fragmentSrc = this.defaultShader.fragmentSrc, i.uniforms = {}, i.init(), this.defaultShader.shaders[t.id] = i
- }, e.WebGLSpriteBatch.prototype.begin = function(e) {
- this.renderSession = e, this.shader = this.renderSession.shaderManager.defaultShader, this.start()
- }, e.WebGLSpriteBatch.prototype.end = function() {
- this.flush()
- }, e.WebGLSpriteBatch.prototype.render = function(e) {
- var t = e.texture;
- this.currentBatchSize >= this.size && (this.flush(), this.currentBaseTexture = t.baseTexture);
- var i = t._uvs;
- if (i) {
- var n, r, o, a, s = e.anchor.x,
- h = e.anchor.y;
- if (t.trim) {
- var l = t.trim;
- r = l.x - s * l.width, n = r + t.crop.width, a = l.y - h * l.height, o = a + t.crop.height
- } else n = t.frame.width * (1 - s), r = t.frame.width * -s, o = t.frame.height * (1 - h), a = t.frame.height * -h;
- var c = 4 * this.currentBatchSize * this.vertSize,
- d = e.worldTransform,
- u = d.a,
- f = d.b,
- p = d.c,
- g = d.d,
- v = d.tx,
- m = d.ty,
- x = this.colors,
- w = this.positions;
- t.floorCoordinates ? (w[c] = u * r + p * a + v | 0, w[c + 1] = g * a + f * r + m | 0, w[c + 5] = u * n + p * a + v | 0, w[c + 6] = g * a + f * n + m | 0, w[c + 10] = u * n + p * o + v | 0, w[c + 11] = g * o + f * n + m | 0, w[c + 15] = u * r + p * o + v | 0, w[c + 16] = g * o + f * r + m | 0) : (w[c] = u * r + p * a + v, w[c + 1] = g * a + f * r + m, w[c + 5] = u * n + p * a + v, w[c + 6] = g * a + f * n + m, w[c + 10] = u * n + p * o + v, w[c + 11] = g * o + f * n + m, w[c + 15] = u * r + p * o + v, w[c + 16] = g * o + f * r + m), w[c + 2] = i.x0, w[c + 3] = i.y0, w[c + 7] = i.x1, w[c + 8] = i.y1, w[c + 12] = i.x2, w[c + 13] = i.y2, w[c + 17] = i.x3, w[c + 18] = i.y3;
- var y = e.tint;
- x[c + 4] = x[c + 9] = x[c + 14] = x[c + 19] = (y >> 16) + (65280 & y) + ((255 & y) << 16) + (255 * e.worldAlpha << 24), this.sprites[this.currentBatchSize++] = e
- }
- }, e.WebGLSpriteBatch.prototype.renderTilingSprite = function(t) {
- var i = t.tilingTexture;
- this.currentBatchSize >= this.size && (this.flush(), this.currentBaseTexture = i.baseTexture), t._uvs || (t._uvs = new e.TextureUvs);
- var n = t._uvs;
- t.tilePosition.x %= i.baseTexture.width * t.tileScaleOffset.x, t.tilePosition.y %= i.baseTexture.height * t.tileScaleOffset.y;
- var r = t.tilePosition.x / (i.baseTexture.width * t.tileScaleOffset.x),
- o = t.tilePosition.y / (i.baseTexture.height * t.tileScaleOffset.y),
- a = t.width / i.baseTexture.width / (t.tileScale.x * t.tileScaleOffset.x),
- s = t.height / i.baseTexture.height / (t.tileScale.y * t.tileScaleOffset.y);
- n.x0 = 0 - r, n.y0 = 0 - o, n.x1 = 1 * a - r, n.y1 = 0 - o, n.x2 = 1 * a - r, n.y2 = 1 * s - o, n.x3 = 0 - r, n.y3 = 1 * s - o;
- var h = t.tint,
- l = (h >> 16) + (65280 & h) + ((255 & h) << 16) + (255 * t.alpha << 24),
- c = this.positions,
- d = this.colors,
- u = t.width,
- f = t.height,
- p = t.anchor.x,
- g = t.anchor.y,
- v = u * (1 - p),
- m = u * -p,
- x = f * (1 - g),
- w = f * -g,
- y = 4 * this.currentBatchSize * this.vertSize,
- b = t.worldTransform,
- T = b.a,
- C = b.b,
- S = b.c,
- M = b.d,
- R = b.tx,
- _ = b.ty;
- c[y++] = T * m + S * w + R, c[y++] = M * w + C * m + _, c[y++] = n.x0, c[y++] = n.y0, d[y++] = l, c[y++] = T * v + S * w + R, c[y++] = M * w + C * v + _, c[y++] = n.x1, c[y++] = n.y1, d[y++] = l, c[y++] = T * v + S * x + R, c[y++] = M * x + C * v + _, c[y++] = n.x2, c[y++] = n.y2, d[y++] = l, c[y++] = T * m + S * x + R, c[y++] = M * x + C * m + _, c[y++] = n.x3, c[y++] = n.y3, d[y++] = l, this.sprites[this.currentBatchSize++] = t
- }, e.WebGLSpriteBatch.prototype.flush = function() {
- if (0 !== this.currentBatchSize) {
- var t, i = this.gl;
- if (this.dirty) {
- this.dirty = !1, i.activeTexture(i.TEXTURE0), i.bindBuffer(i.ARRAY_BUFFER, this.vertexBuffer), i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t = this.defaultShader.shaders[i.id];
- var n = 4 * this.vertSize;
- i.vertexAttribPointer(t.aVertexPosition, 2, i.FLOAT, !1, n, 0), i.vertexAttribPointer(t.aTextureCoord, 2, i.FLOAT, !1, n, 8), i.vertexAttribPointer(t.colorAttribute, 4, i.UNSIGNED_BYTE, !0, n, 16)
- }
- if (this.currentBatchSize > .5 * this.size) i.bufferSubData(i.ARRAY_BUFFER, 0, this.vertices);
- else {
- var r = this.positions.subarray(0, 4 * this.currentBatchSize * this.vertSize);
- i.bufferSubData(i.ARRAY_BUFFER, 0, r)
- }
- for (var o, a, s, h, l = 0, c = 0, d = null, u = this.renderSession.blendModeManager.currentBlendMode, f = null, p = !1, g = !1, v = 0, m = this.currentBatchSize; v < m; v++) {
- if (h = this.sprites[v], o = h.texture.baseTexture, a = h.blendMode, s = h.shader || this.defaultShader, p = u !== a, g = f !== s, (d !== o || p || g) && (this.renderBatch(d, l, c), c = v, l = 0, d = o, p && (u = a, this.renderSession.blendModeManager.setBlendMode(u)), g)) {
- f = s, t = f.shaders[i.id], t || (t = new e.PixiShader(i), t.fragmentSrc = f.fragmentSrc, t.uniforms = f.uniforms, t.init(), f.shaders[i.id] = t), this.renderSession.shaderManager.setShader(t), t.dirty && t.syncUniforms();
- var x = this.renderSession.projection;
- i.uniform2f(t.projectionVector, x.x, x.y);
- var w = this.renderSession.offset;
- i.uniform2f(t.offsetVector, w.x, w.y)
- }
- l++
- }
- this.renderBatch(d, l, c), this.currentBatchSize = 0
- }
- }, e.WebGLSpriteBatch.prototype.renderBatch = function(e, t, i) {
- if (0 !== t) {
- var n = this.gl;
- e._dirty[n.id] ? this.renderSession.renderer.updateTexture(e) : n.bindTexture(n.TEXTURE_2D, e._glTextures[n.id]), n.drawElements(n.TRIANGLES, 6 * t, n.UNSIGNED_SHORT, 6 * i * 2), this.renderSession.drawCount++
- }
- }, e.WebGLSpriteBatch.prototype.stop = function() {
- this.flush(), this.dirty = !0
- }, e.WebGLSpriteBatch.prototype.start = function() {
- this.dirty = !0
- }, e.WebGLSpriteBatch.prototype.destroy = function() {
- this.vertices = null, this.indices = null, this.gl.deleteBuffer(this.vertexBuffer), this.gl.deleteBuffer(this.indexBuffer), this.currentBaseTexture = null, this.gl = null
- }, e.WebGLFastSpriteBatch = function(t) {
- this.vertSize = 10, this.maxSize = 6e3, this.size = this.maxSize;
- var i = 4 * this.size * this.vertSize,
- n = 6 * this.maxSize;
- this.vertices = new e.Float32Array(i), this.indices = new e.Uint16Array(n), this.vertexBuffer = null, this.indexBuffer = null, this.lastIndexCount = 0;
- for (var r = 0, o = 0; r < n; r += 6, o += 4) this.indices[r + 0] = o + 0, this.indices[r + 1] = o + 1, this.indices[r + 2] = o + 2, this.indices[r + 3] = o + 0, this.indices[r + 4] = o + 2, this.indices[r + 5] = o + 3;
- this.drawing = !1, this.currentBatchSize = 0, this.currentBaseTexture = null, this.currentBlendMode = 0, this.renderSession = null, this.shader = null, this.matrix = null, this.setContext(t)
- }, e.WebGLFastSpriteBatch.prototype.constructor = e.WebGLFastSpriteBatch, e.WebGLFastSpriteBatch.prototype.setContext = function(e) {
- this.gl = e, this.vertexBuffer = e.createBuffer(), this.indexBuffer = e.createBuffer(), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.indexBuffer), e.bufferData(e.ELEMENT_ARRAY_BUFFER, this.indices, e.STATIC_DRAW), e.bindBuffer(e.ARRAY_BUFFER, this.vertexBuffer), e.bufferData(e.ARRAY_BUFFER, this.vertices, e.DYNAMIC_DRAW)
- }, e.WebGLFastSpriteBatch.prototype.begin = function(e, t) {
- this.renderSession = t, this.shader = this.renderSession.shaderManager.fastShader, this.matrix = e.worldTransform.toArray(!0), this.start()
- }, e.WebGLFastSpriteBatch.prototype.end = function() {
- this.flush()
- }, e.WebGLFastSpriteBatch.prototype.render = function(e) {
- var t = e.children,
- i = t[0];
- if (i.texture._uvs) {
- this.currentBaseTexture = i.texture.baseTexture, i.blendMode !== this.renderSession.blendModeManager.currentBlendMode && (this.flush(), this.renderSession.blendModeManager.setBlendMode(i.blendMode));
- for (var n = 0, r = t.length; n < r; n++) this.renderSprite(t[n]);
- this.flush()
- }
- }, e.WebGLFastSpriteBatch.prototype.renderSprite = function(e) {
- if (e.visible && (e.texture.baseTexture === this.currentBaseTexture || (this.flush(), this.currentBaseTexture = e.texture.baseTexture, e.texture._uvs))) {
- var t, i, n, r, o, a, s, h, l = this.vertices;
- if (t = e.texture._uvs, i = e.texture.frame.width, n = e.texture.frame.height, e.texture.trim) {
- var c = e.texture.trim;
- o = c.x - e.anchor.x * c.width, r = o + e.texture.crop.width, s = c.y - e.anchor.y * c.height, a = s + e.texture.crop.height
- } else r = e.texture.frame.width * (1 - e.anchor.x), o = e.texture.frame.width * -e.anchor.x, a = e.texture.frame.height * (1 - e.anchor.y), s = e.texture.frame.height * -e.anchor.y;
- h = 4 * this.currentBatchSize * this.vertSize, l[h++] = o, l[h++] = s, l[h++] = e.position.x, l[h++] = e.position.y, l[h++] = e.scale.x, l[h++] = e.scale.y, l[h++] = e.rotation, l[h++] = t.x0, l[h++] = t.y1, l[h++] = e.alpha, l[h++] = r, l[h++] = s, l[h++] = e.position.x, l[h++] = e.position.y, l[h++] = e.scale.x, l[h++] = e.scale.y, l[h++] = e.rotation, l[h++] = t.x1, l[h++] = t.y1, l[h++] = e.alpha, l[h++] = r, l[h++] = a, l[h++] = e.position.x, l[h++] = e.position.y, l[h++] = e.scale.x, l[h++] = e.scale.y, l[h++] = e.rotation, l[h++] = t.x2, l[h++] = t.y2, l[h++] = e.alpha, l[h++] = o, l[h++] = a, l[h++] = e.position.x, l[h++] = e.position.y, l[h++] = e.scale.x, l[h++] = e.scale.y, l[h++] = e.rotation, l[h++] = t.x3, l[h++] = t.y3, l[h++] = e.alpha, this.currentBatchSize++, this.currentBatchSize >= this.size && this.flush()
- }
- }, e.WebGLFastSpriteBatch.prototype.flush = function() {
- if (0 !== this.currentBatchSize) {
- var e = this.gl;
- if (this.currentBaseTexture._glTextures[e.id] || this.renderSession.renderer.updateTexture(this.currentBaseTexture, e), e.bindTexture(e.TEXTURE_2D, this.currentBaseTexture._glTextures[e.id]), this.currentBatchSize > .5 * this.size) e.bufferSubData(e.ARRAY_BUFFER, 0, this.vertices);
- else {
- var t = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
- e.bufferSubData(e.ARRAY_BUFFER, 0, t)
- }
- e.drawElements(e.TRIANGLES, 6 * this.currentBatchSize, e.UNSIGNED_SHORT, 0), this.currentBatchSize = 0, this.renderSession.drawCount++
- }
- }, e.WebGLFastSpriteBatch.prototype.stop = function() {
- this.flush()
- }, e.WebGLFastSpriteBatch.prototype.start = function() {
- var e = this.gl;
- e.activeTexture(e.TEXTURE0), e.bindBuffer(e.ARRAY_BUFFER, this.vertexBuffer), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
- var t = this.renderSession.projection;
- e.uniform2f(this.shader.projectionVector, t.x, t.y), e.uniformMatrix3fv(this.shader.uMatrix, !1, this.matrix);
- var i = 4 * this.vertSize;
- e.vertexAttribPointer(this.shader.aVertexPosition, 2, e.FLOAT, !1, i, 0), e.vertexAttribPointer(this.shader.aPositionCoord, 2, e.FLOAT, !1, i, 8), e.vertexAttribPointer(this.shader.aScale, 2, e.FLOAT, !1, i, 16), e.vertexAttribPointer(this.shader.aRotation, 1, e.FLOAT, !1, i, 24), e.vertexAttribPointer(this.shader.aTextureCoord, 2, e.FLOAT, !1, i, 28), e.vertexAttribPointer(this.shader.colorAttribute, 1, e.FLOAT, !1, i, 36)
- }, e.WebGLFilterManager = function() {
- this.filterStack = [], this.offsetX = 0, this.offsetY = 0
- }, e.WebGLFilterManager.prototype.constructor = e.WebGLFilterManager, e.WebGLFilterManager.prototype.setContext = function(e) {
- this.gl = e, this.texturePool = [], this.initShaderBuffers()
- }, e.WebGLFilterManager.prototype.begin = function(e, t) {
- this.renderSession = e, this.defaultShader = e.shaderManager.defaultShader;
- var i = this.renderSession.projection;
- this.width = 2 * i.x, this.height = 2 * -i.y, this.buffer = t
- }, e.WebGLFilterManager.prototype.pushFilter = function(t) {
- var i = this.gl,
- n = this.renderSession.projection,
- r = this.renderSession.offset;
- t._filterArea = t.target.filterArea || t.target.getBounds(), this.filterStack.push(t);
- var o = t.filterPasses[0];
- this.offsetX += t._filterArea.x, this.offsetY += t._filterArea.y;
- var a = this.texturePool.pop();
- a ? a.resize(this.width, this.height) : a = new e.FilterTexture(this.gl, this.width, this.height), i.bindTexture(i.TEXTURE_2D, a.texture);
- var s = t._filterArea,
- h = o.padding;
- s.x -= h, s.y -= h, s.width += 2 * h, s.height += 2 * h, s.x < 0 && (s.x = 0), s.width > this.width && (s.width = this.width), s.y < 0 && (s.y = 0), s.height > this.height && (s.height = this.height), i.bindFramebuffer(i.FRAMEBUFFER, a.frameBuffer), i.viewport(0, 0, s.width, s.height), n.x = s.width / 2, n.y = -s.height / 2, r.x = -s.x, r.y = -s.y, i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.clear(i.COLOR_BUFFER_BIT), t._glFilterTexture = a
- }, e.WebGLFilterManager.prototype.popFilter = function() {
- var t = this.gl,
- i = this.filterStack.pop(),
- n = i._filterArea,
- r = i._glFilterTexture,
- o = this.renderSession.projection,
- a = this.renderSession.offset;
- if (i.filterPasses.length > 1) {
- t.viewport(0, 0, n.width, n.height), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), this.vertexArray[0] = 0, this.vertexArray[1] = n.height, this.vertexArray[2] = n.width, this.vertexArray[3] = n.height, this.vertexArray[4] = 0, this.vertexArray[5] = 0, this.vertexArray[6] = n.width, this.vertexArray[7] = 0, t.bufferSubData(t.ARRAY_BUFFER, 0, this.vertexArray), t.bindBuffer(t.ARRAY_BUFFER, this.uvBuffer), this.uvArray[2] = n.width / this.width, this.uvArray[5] = n.height / this.height, this.uvArray[6] = n.width / this.width, this.uvArray[7] = n.height / this.height, t.bufferSubData(t.ARRAY_BUFFER, 0, this.uvArray);
- var s = r,
- h = this.texturePool.pop();
- h || (h = new e.FilterTexture(this.gl, this.width, this.height)), h.resize(this.width, this.height), t.bindFramebuffer(t.FRAMEBUFFER, h.frameBuffer), t.clear(t.COLOR_BUFFER_BIT), t.disable(t.BLEND);
- for (var l = 0; l < i.filterPasses.length - 1; l++) {
- var c = i.filterPasses[l];
- t.bindFramebuffer(t.FRAMEBUFFER, h.frameBuffer), t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, s.texture), this.applyFilterPass(c, n, n.width, n.height);
- var d = s;
- s = h, h = d
- }
- t.enable(t.BLEND), r = s, this.texturePool.push(h)
- }
- var u = i.filterPasses[i.filterPasses.length - 1];
- this.offsetX -= n.x, this.offsetY -= n.y;
- var f = this.width,
- p = this.height,
- g = 0,
- v = 0,
- m = this.buffer;
- if (0 === this.filterStack.length) t.colorMask(!0, !0, !0, !0);
- else {
- var x = this.filterStack[this.filterStack.length - 1];
- n = x._filterArea, f = n.width, p = n.height, g = n.x, v = n.y, m = x._glFilterTexture.frameBuffer
- }
- o.x = f / 2, o.y = -p / 2, a.x = g, a.y = v, n = i._filterArea;
- var w = n.x - g,
- y = n.y - v;
- t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), this.vertexArray[0] = w, this.vertexArray[1] = y + n.height, this.vertexArray[2] = w + n.width, this.vertexArray[3] = y + n.height, this.vertexArray[4] = w, this.vertexArray[5] = y, this.vertexArray[6] = w + n.width, this.vertexArray[7] = y, t.bufferSubData(t.ARRAY_BUFFER, 0, this.vertexArray), t.bindBuffer(t.ARRAY_BUFFER, this.uvBuffer), this.uvArray[2] = n.width / this.width, this.uvArray[5] = n.height / this.height, this.uvArray[6] = n.width / this.width, this.uvArray[7] = n.height / this.height, t.bufferSubData(t.ARRAY_BUFFER, 0, this.uvArray), t.viewport(0, 0, f, p), t.bindFramebuffer(t.FRAMEBUFFER, m), t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, r.texture), this.applyFilterPass(u, n, f, p), this.texturePool.push(r), i._glFilterTexture = null
- }, e.WebGLFilterManager.prototype.applyFilterPass = function(t, i, n, r) {
- var o = this.gl,
- a = t.shaders[o.id];
- a || (a = new e.PixiShader(o), a.fragmentSrc = t.fragmentSrc, a.uniforms = t.uniforms, a.init(), t.shaders[o.id] = a), this.renderSession.shaderManager.setShader(a), o.uniform2f(a.projectionVector, n / 2, -r / 2), o.uniform2f(a.offsetVector, 0, 0), t.uniforms.dimensions && (t.uniforms.dimensions.value[0] = this.width, t.uniforms.dimensions.value[1] = this.height, t.uniforms.dimensions.value[2] = this.vertexArray[0], t.uniforms.dimensions.value[3] = this.vertexArray[5]), a.syncUniforms(), o.bindBuffer(o.ARRAY_BUFFER, this.vertexBuffer), o.vertexAttribPointer(a.aVertexPosition, 2, o.FLOAT, !1, 0, 0), o.bindBuffer(o.ARRAY_BUFFER, this.uvBuffer), o.vertexAttribPointer(a.aTextureCoord, 2, o.FLOAT, !1, 0, 0), o.bindBuffer(o.ARRAY_BUFFER, this.colorBuffer), o.vertexAttribPointer(a.colorAttribute, 2, o.FLOAT, !1, 0, 0), o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, this.indexBuffer), o.drawElements(o.TRIANGLES, 6, o.UNSIGNED_SHORT, 0), this.renderSession.drawCount++
- }, e.WebGLFilterManager.prototype.initShaderBuffers = function() {
- var t = this.gl;
- this.vertexBuffer = t.createBuffer(), this.uvBuffer = t.createBuffer(), this.colorBuffer = t.createBuffer(), this.indexBuffer = t.createBuffer(), this.vertexArray = new e.Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), t.bindBuffer(t.ARRAY_BUFFER, this.vertexBuffer), t.bufferData(t.ARRAY_BUFFER, this.vertexArray, t.STATIC_DRAW), this.uvArray = new e.Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), t.bindBuffer(t.ARRAY_BUFFER, this.uvBuffer), t.bufferData(t.ARRAY_BUFFER, this.uvArray, t.STATIC_DRAW), this.colorArray = new e.Float32Array([1, 16777215, 1, 16777215, 1, 16777215, 1, 16777215]), t.bindBuffer(t.ARRAY_BUFFER, this.colorBuffer), t.bufferData(t.ARRAY_BUFFER, this.colorArray, t.STATIC_DRAW), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.indexBuffer), t.bufferData(t.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), t.STATIC_DRAW)
- }, e.WebGLFilterManager.prototype.destroy = function() {
- var e = this.gl;
- this.filterStack = null, this.offsetX = 0, this.offsetY = 0;
- for (var t = 0; t < this.texturePool.length; t++) this.texturePool[t].destroy();
- this.texturePool = null, e.deleteBuffer(this.vertexBuffer), e.deleteBuffer(this.uvBuffer), e.deleteBuffer(this.colorBuffer), e.deleteBuffer(this.indexBuffer)
- }, e.FilterTexture = function(t, i, n, r) {
- this.gl = t, this.frameBuffer = t.createFramebuffer(), this.texture = t.createTexture(), r = r || e.scaleModes.DEFAULT, t.bindTexture(t.TEXTURE_2D, this.texture), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, r === e.scaleModes.LINEAR ? t.LINEAR : t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, r === e.scaleModes.LINEAR ? t.LINEAR : t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), t.bindFramebuffer(t.FRAMEBUFFER, this.frameBuffer), t.bindFramebuffer(t.FRAMEBUFFER, this.frameBuffer), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, this.texture, 0), this.renderBuffer = t.createRenderbuffer(), t.bindRenderbuffer(t.RENDERBUFFER, this.renderBuffer), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, t.RENDERBUFFER, this.renderBuffer), this.resize(i, n)
- }, e.FilterTexture.prototype.constructor = e.FilterTexture, e.FilterTexture.prototype.clear = function() {
- var e = this.gl;
- e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT)
- }, e.FilterTexture.prototype.resize = function(e, t) {
- if (this.width !== e || this.height !== t) {
- this.width = e, this.height = t;
- var i = this.gl;
- i.bindTexture(i.TEXTURE_2D, this.texture), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, e, t, 0, i.RGBA, i.UNSIGNED_BYTE, null), i.bindRenderbuffer(i.RENDERBUFFER, this.renderBuffer), i.renderbufferStorage(i.RENDERBUFFER, i.DEPTH_STENCIL, e, t)
- }
- }, e.FilterTexture.prototype.destroy = function() {
- var e = this.gl;
- e.deleteFramebuffer(this.frameBuffer), e.deleteTexture(this.texture), this.frameBuffer = null, this.texture = null
- }, e.CanvasBuffer = function(e, t) {
- this.width = e, this.height = t, this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), this.canvas.width = e, this.canvas.height = t
- }, e.CanvasBuffer.prototype.constructor = e.CanvasBuffer, e.CanvasBuffer.prototype.clear = function() {
- this.context.setTransform(1, 0, 0, 1, 0, 0), this.context.clearRect(0, 0, this.width, this.height)
- }, e.CanvasBuffer.prototype.resize = function(e, t) {
- this.width = this.canvas.width = e, this.height = this.canvas.height = t
- }, e.CanvasMaskManager = function() {}, e.CanvasMaskManager.prototype.constructor = e.CanvasMaskManager, e.CanvasMaskManager.prototype.pushMask = function(t, i) {
- var n = i.context;
- n.save();
- var r = t.alpha,
- o = t.worldTransform;
- n.setTransform(o.a, o.b, o.c, o.d, o.tx, o.ty), e.CanvasGraphics.renderGraphicsMask(t, n), n.clip(), t.worldAlpha = r
- }, e.CanvasMaskManager.prototype.popMask = function(e) {
- e.context.restore()
- }, e.CanvasTinter = function() {}, e.CanvasTinter.getTintedTexture = function(t, i) {
- var n = t.texture;
- i = e.CanvasTinter.roundColor(i);
- var r = "#" + ("00000" + (0 | i).toString(16)).substr(-6);
- if (n.tintCache = n.tintCache || {}, n.tintCache[r]) return n.tintCache[r];
- var o = e.CanvasTinter.canvas || document.createElement("canvas");
- if (e.CanvasTinter.tintMethod(n, i, o), e.CanvasTinter.convertTintToImage) {
- var a = new Image;
- a.src = o.toDataURL(), n.tintCache[r] = a
- } else n.tintCache[r] = o, e.CanvasTinter.canvas = null;
- return o
- }, e.CanvasTinter.tintWithMultiply = function(e, t, i) {
- var n = i.getContext("2d"),
- r = e.crop;
- i.width = r.width, i.height = r.height, n.fillStyle = "#" + ("00000" + (0 | t).toString(16)).substr(-6), n.fillRect(0, 0, r.width, r.height), n.globalCompositeOperation = "multiply", n.drawImage(e.baseTexture.source, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height), n.globalCompositeOperation = "destination-atop", n.drawImage(e.baseTexture.source, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height)
- }, e.CanvasTinter.tintWithPerPixel = function(t, i, n) {
- var r = n.getContext("2d"),
- o = t.crop;
- n.width = o.width, n.height = o.height, r.globalCompositeOperation = "copy", r.drawImage(t.baseTexture.source, o.x, o.y, o.width, o.height, 0, 0, o.width, o.height);
- for (var a = e.hex2rgb(i), s = a[0], h = a[1], l = a[2], c = r.getImageData(0, 0, o.width, o.height), d = c.data, u = 0; u < d.length; u += 4) d[u + 0] = d[u + 0] * s >> 0, d[u + 1] = d[u + 1] * h >> 0, d[u + 2] = d[u + 2] * l >> 0;
- r.putImageData(c, 0, 0)
- }, e.CanvasTinter.roundColor = function(t) {
- var i = e.CanvasTinter.cacheStepsPerColorChannel,
- n = e.hex2rgb(t);
- return n[0] = Math.min(255, n[0] / i * i), n[1] = Math.min(255, n[1] / i * i), n[2] = Math.min(255, n[2] / i * i), e.rgb2hex(n)
- }, e.CanvasTinter.cacheStepsPerColorChannel = 8, e.CanvasTinter.convertTintToImage = !1, e.CanvasTinter.canUseMultiply = e.canUseNewCanvasBlendModes(), e.CanvasTinter.tintMethod = e.CanvasTinter.tintWithPerPixel, e.CanvasRenderer = function(t, i, n) {
- if (n)
- for (var r in e.defaultRenderOptions) "undefined" == typeof n[r] && (n[r] = e.defaultRenderOptions[r]);
- else n = e.defaultRenderOptions;
- e.defaultRenderer || (e.defaultRenderer = this), this.type = e.CANVAS_RENDERER, this.clearBeforeRender = n.clearBeforeRender, this.transparent = n.transparent, this.autoResize = n.autoResize || !1, this.width = t || 800, this.height = i || 600, this.view = n.view || document.createElement("canvas"), this.context = this.view.getContext("2d", {
- alpha: this.transparent
- }), this.refresh = !0, this.count = 0, this.maskManager = new e.CanvasMaskManager, this.renderSession = {
- context: this.context,
- maskManager: this.maskManager,
- scaleMode: null,
- smoothProperty: null
- }, this.mapBlendModes(), this.resize(t, i), "imageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "imageSmoothingEnabled" : "webkitImageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "webkitImageSmoothingEnabled" : "mozImageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "mozImageSmoothingEnabled" : "oImageSmoothingEnabled" in this.context ? this.renderSession.smoothProperty = "oImageSmoothingEnabled" : "msImageSmoothingEnabled" in this.context && (this.renderSession.smoothProperty = "msImageSmoothingEnabled")
- }, e.CanvasRenderer.prototype.constructor = e.CanvasRenderer, e.CanvasRenderer.prototype.render = function(t) {
- t.updateTransform(), this.context.setTransform(1, 0, 0, 1, 0, 0), this.context.globalAlpha = 1, this.renderSession.currentBlendMode = e.blendModes.NORMAL, this.context.globalCompositeOperation = e.blendModesCanvas[e.blendModes.NORMAL], this.renderDisplayObject(t), t.interactive && (t._interactiveEventsAdded || (t._interactiveEventsAdded = !0, t.interactionManager.setTarget(this)))
- }, e.CanvasRenderer.prototype.destroy = function(e) {
- "undefined" == typeof e && (e = !0), e && this.view.parent && this.view.parent.removeChild(this.view), this.view = null, this.context = null, this.maskManager = null, this.renderSession = null
- }, e.CanvasRenderer.prototype.resize = function(e, t) {
- this.width = e, this.height = t, this.view.width = this.width, this.view.height = this.height
- }, e.CanvasRenderer.prototype.renderDisplayObject = function(e, t) {
- this.renderSession.context = t || this.context, e._renderCanvas(this.renderSession)
- }, e.CanvasRenderer.prototype.mapBlendModes = function() {
- e.blendModesCanvas || (e.blendModesCanvas = [], e.canUseNewCanvasBlendModes() ? (e.blendModesCanvas[e.blendModes.NORMAL] = "source-over", e.blendModesCanvas[e.blendModes.ADD] = "lighter", e.blendModesCanvas[e.blendModes.MULTIPLY] = "multiply", e.blendModesCanvas[e.blendModes.SCREEN] = "screen", e.blendModesCanvas[e.blendModes.OVERLAY] = "overlay", e.blendModesCanvas[e.blendModes.DARKEN] = "darken", e.blendModesCanvas[e.blendModes.LIGHTEN] = "lighten", e.blendModesCanvas[e.blendModes.COLOR_DODGE] = "color-dodge", e.blendModesCanvas[e.blendModes.COLOR_BURN] = "color-burn", e.blendModesCanvas[e.blendModes.HARD_LIGHT] = "hard-light", e.blendModesCanvas[e.blendModes.SOFT_LIGHT] = "soft-light", e.blendModesCanvas[e.blendModes.DIFFERENCE] = "difference", e.blendModesCanvas[e.blendModes.EXCLUSION] = "exclusion", e.blendModesCanvas[e.blendModes.HUE] = "hue", e.blendModesCanvas[e.blendModes.SATURATION] = "saturation", e.blendModesCanvas[e.blendModes.COLOR] = "color", e.blendModesCanvas[e.blendModes.LUMINOSITY] = "luminosity") : (e.blendModesCanvas[e.blendModes.NORMAL] = "source-over", e.blendModesCanvas[e.blendModes.ADD] = "lighter", e.blendModesCanvas[e.blendModes.MULTIPLY] = "source-over", e.blendModesCanvas[e.blendModes.SCREEN] = "source-over", e.blendModesCanvas[e.blendModes.OVERLAY] = "source-over", e.blendModesCanvas[e.blendModes.DARKEN] = "source-over", e.blendModesCanvas[e.blendModes.LIGHTEN] = "source-over", e.blendModesCanvas[e.blendModes.COLOR_DODGE] = "source-over", e.blendModesCanvas[e.blendModes.COLOR_BURN] = "source-over", e.blendModesCanvas[e.blendModes.HARD_LIGHT] = "source-over", e.blendModesCanvas[e.blendModes.SOFT_LIGHT] = "source-over", e.blendModesCanvas[e.blendModes.DIFFERENCE] = "source-over", e.blendModesCanvas[e.blendModes.EXCLUSION] = "source-over", e.blendModesCanvas[e.blendModes.HUE] = "source-over", e.blendModesCanvas[e.blendModes.SATURATION] = "source-over", e.blendModesCanvas[e.blendModes.COLOR] = "source-over", e.blendModesCanvas[e.blendModes.LUMINOSITY] = "source-over"))
- }, e.CanvasGraphics = function() {}, e.CanvasGraphics.renderGraphics = function(t, i) {
- var n = t.worldAlpha;
- t.dirty && (this.updateGraphicsTint(t), t.dirty = !1);
- for (var r = 0; r < t.graphicsData.length; r++) {
- var o = t.graphicsData[r],
- a = o.shape,
- s = o._fillTint,
- h = o._lineTint;
- if (i.lineWidth = o.lineWidth, o.type === e.Graphics.POLY) {
- i.beginPath();
- var l = a.points;
- i.moveTo(l[0], l[1]);
- for (var c = 1; c < l.length / 2; c++) i.lineTo(l[2 * c], l[2 * c + 1]);
- a.closed && i.lineTo(l[0], l[1]), l[0] === l[l.length - 2] && l[1] === l[l.length - 1] && i.closePath(), o.fill && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), i.fill()), o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke())
- } else if (o.type === e.Graphics.RECT)(o.fillColor || 0 === o.fillColor) && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), i.fillRect(a.x, a.y, a.width, a.height)), o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.strokeRect(a.x, a.y, a.width, a.height));
- else if (o.type === e.Graphics.CIRC) i.beginPath(), i.arc(a.x, a.y, a.radius, 0, 2 * Math.PI), i.closePath(), o.fill && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), i.fill()), o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke());
- else if (o.type === e.Graphics.ELIP) {
- var d = 2 * a.width,
- u = 2 * a.height,
- f = a.x - d / 2,
- p = a.y - u / 2;
- i.beginPath();
- var g = .5522848,
- v = d / 2 * g,
- m = u / 2 * g,
- x = f + d,
- w = p + u,
- y = f + d / 2,
- b = p + u / 2;
- i.moveTo(f, b), i.bezierCurveTo(f, b - m, y - v, p, y, p), i.bezierCurveTo(y + v, p, x, b - m, x, b), i.bezierCurveTo(x, b + m, y + v, w, y, w), i.bezierCurveTo(y - v, w, f, b + m, f, b), i.closePath(), o.fill && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), i.fill()), o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke())
- } else if (o.type === e.Graphics.RREC) {
- var T = a.x,
- C = a.y,
- S = a.width,
- M = a.height,
- R = a.radius,
- _ = Math.min(S, M) / 2 | 0;
- R = R > _ ? _ : R, i.beginPath(), i.moveTo(T, C + R), i.lineTo(T, C + M - R), i.quadraticCurveTo(T, C + M, T + R, C + M), i.lineTo(T + S - R, C + M), i.quadraticCurveTo(T + S, C + M, T + S, C + M - R), i.lineTo(T + S, C + R), i.quadraticCurveTo(T + S, C, T + S - R, C), i.lineTo(T + R, C), i.quadraticCurveTo(T, C, T, C + R), i.closePath(), (o.fillColor || 0 === o.fillColor) && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | s).toString(16)).substr(-6), i.fill()), o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke())
- }
- }
- }, e.CanvasGraphics.renderGraphicsMask = function(t, i) {
- var n = t.graphicsData.length;
- if (0 !== n) {
- n > 1 && (n = 1, window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));
- for (var r = 0; r < 1; r++) {
- var o = t.graphicsData[r],
- a = o.shape;
- if (o.type === e.Graphics.POLY) {
- i.beginPath();
- var s = a.points;
- i.moveTo(s[0], s[1]);
- for (var h = 1; h < s.length / 2; h++) i.lineTo(s[2 * h], s[2 * h + 1]);
- s[0] === s[s.length - 2] && s[1] === s[s.length - 1] && i.closePath()
- } else if (o.type === e.Graphics.RECT) i.beginPath(), i.rect(a.x, a.y, a.width, a.height), i.closePath();
- else if (o.type === e.Graphics.CIRC) i.beginPath(), i.arc(a.x, a.y, a.radius, 0, 2 * Math.PI), i.closePath();
- else if (o.type === e.Graphics.ELIP) {
- var l = 2 * a.width,
- c = 2 * a.height,
- d = a.x - l / 2,
- u = a.y - c / 2;
- i.beginPath();
- var f = .5522848,
- p = l / 2 * f,
- g = c / 2 * f,
- v = d + l,
- m = u + c,
- x = d + l / 2,
- w = u + c / 2;
- i.moveTo(d, w), i.bezierCurveTo(d, w - g, x - p, u, x, u), i.bezierCurveTo(x + p, u, v, w - g, v, w), i.bezierCurveTo(v, w + g, x + p, m, x, m), i.bezierCurveTo(x - p, m, d, w + g, d, w), i.closePath()
- } else if (o.type === e.Graphics.RREC) {
- var y = a.points,
- b = y[0],
- T = y[1],
- C = y[2],
- S = y[3],
- M = y[4],
- R = Math.min(C, S) / 2 | 0;
- M = M > R ? R : M, i.beginPath(), i.moveTo(b, T + M), i.lineTo(b, T + S - M), i.quadraticCurveTo(b, T + S, b + M, T + S), i.lineTo(b + C - M, T + S), i.quadraticCurveTo(b + C, T + S, b + C, T + S - M), i.lineTo(b + C, T + M), i.quadraticCurveTo(b + C, T, b + C - M, T), i.lineTo(b + M, T), i.quadraticCurveTo(b, T, b, T + M), i.closePath()
- }
- }
- }
- }, e.CanvasGraphics.updateGraphicsTint = function(e) {
- if (16777215 !== e.tint)
- for (var t = (e.tint >> 16 & 255) / 255, i = (e.tint >> 8 & 255) / 255, n = (255 & e.tint) / 255, r = 0; r < e.graphicsData.length; r++) {
- var o = e.graphicsData[r],
- a = 0 | o.fillColor,
- s = 0 | o.lineColor;
- o._fillTint = ((a >> 16 & 255) / 255 * t * 255 << 16) + ((a >> 8 & 255) / 255 * i * 255 << 8) + (255 & a) / 255 * n * 255, o._lineTint = ((s >> 16 & 255) / 255 * t * 255 << 16) + ((s >> 8 & 255) / 255 * i * 255 << 8) + (255 & s) / 255 * n * 255
- }
- }, e.Graphics = function() {
- e.DisplayObjectContainer.call(this), this.renderable = !0, this.fillAlpha = 1, this.lineWidth = 0, this.lineColor = 0, this.graphicsData = [], this.tint = 16777215, this.ondTint = 16777215, this.blendMode = e.blendModes.NORMAL, this.currentPath = null, this._webGL = [], this.isMask = !1, this.boundsPadding = 0, this._localBounds = new e.Rectangle(0, 0, 1, 1), this.dirty = !0, this.webGLDirty = !1, this.cachedSpriteDirty = !1
- }, e.Graphics.prototype = Object.create(e.DisplayObjectContainer.prototype), e.Graphics.prototype.constructor = e.Graphics, e.Graphics.prototype.lineStyle = function(t, i, n) {
- if (this.lineWidth = t || 0, this.lineColor = i || 0, this.lineAlpha = arguments.length < 3 ? 1 : n, this.currentPath) {
- if (this.currentPath.shape.points.length) return this.drawShape(new e.Polygon(this.currentPath.shape.points.slice(-2))), this;
- this.currentPath.lineWidth = this.lineWidth, this.currentPath.lineColor = this.lineColor, this.currentPath.lineAlpha = this.lineAlpha
- }
- return this
- }, e.Graphics.prototype.moveTo = function(t, i) {
- return this.drawShape(new e.Polygon([t, i])), this
- }, e.Graphics.prototype.lineTo = function(e, t) {
- return this.currentPath.shape.points.push(e, t), this.dirty = !0, this
- }, e.Graphics.prototype.quadraticCurveTo = function(e, t, i, n) {
- this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
- var r, o, a = 20,
- s = this.currentPath.shape.points;
- 0 === s.length && this.moveTo(0, 0);
- for (var h = s[s.length - 2], l = s[s.length - 1], c = 0, d = 1; d <= a; d++) c = d / a, r = h + (e - h) * c, o = l + (t - l) * c, s.push(r + (e + (i - e) * c - r) * c, o + (t + (n - t) * c - o) * c);
- return this.dirty = !0, this
- }, e.Graphics.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
- this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
- for (var a, s, h, l, c, d = 20, u = this.currentPath.shape.points, f = u[u.length - 2], p = u[u.length - 1], g = 0, v = 1; v <= d; v++) g = v / d, a = 1 - g, s = a * a, h = s * a, l = g * g, c = l * g, u.push(h * f + 3 * s * g * e + 3 * a * l * i + c * r, h * p + 3 * s * g * t + 3 * a * l * n + c * o);
- return this.dirty = !0, this
- }, e.Graphics.prototype.arcTo = function(e, t, i, n, r) {
- this.currentPath ? 0 === this.currentPath.shape.points.length && this.currentPath.shape.points.push(e, t) : this.moveTo(e, t);
- var o = this.currentPath.shape.points,
- a = o[o.length - 2],
- s = o[o.length - 1],
- h = s - t,
- l = a - e,
- c = n - t,
- d = i - e,
- u = Math.abs(h * d - l * c);
- if (u < 1e-8 || 0 === r) o[o.length - 2] === e && o[o.length - 1] === t || o.push(e, t);
- else {
- var f = h * h + l * l,
- p = c * c + d * d,
- g = h * c + l * d,
- v = r * Math.sqrt(f) / u,
- m = r * Math.sqrt(p) / u,
- x = v * g / f,
- w = m * g / p,
- y = v * d + m * l,
- b = v * c + m * h,
- T = l * (m + x),
- C = h * (m + x),
- S = d * (v + w),
- M = c * (v + w),
- R = Math.atan2(C - b, T - y),
- _ = Math.atan2(M - b, S - y);
- this.arc(y + e, b + t, r, R, _, l * c > d * h)
- }
- return this.dirty = !0, this
- }, e.Graphics.prototype.arc = function(e, t, i, n, r, o) {
- var a, s = e + Math.cos(n) * i,
- h = t + Math.sin(n) * i;
- if (this.currentPath ? (a = this.currentPath.shape.points, 0 === a.length ? a.push(s, h) : a[a.length - 2] === s && a[a.length - 1] === h || a.push(s, h)) : (this.moveTo(s, h), a = this.currentPath.shape.points), n === r) return this;
- !o && r <= n ? r += 2 * Math.PI : o && n <= r && (n += 2 * Math.PI);
- var l = o ? (n - r) * -1 : r - n,
- c = Math.abs(l) / (2 * Math.PI) * 40;
- if (0 === l) return this;
- for (var d = l / (2 * c), u = 2 * d, f = Math.cos(d), p = Math.sin(d), g = c - 1, v = g % 1 / g, m = 0; m <= g; m++) {
- var x = m + v * m,
- w = d + n + u * x,
- y = Math.cos(w),
- b = -Math.sin(w);
- a.push((f * y + p * b) * i + e, (f * -b + p * y) * i + t)
- }
- return this.dirty = !0, this
- }, e.Graphics.prototype.beginFill = function(e, t) {
- return this.filling = !0, this.fillColor = e || 0, this.fillAlpha = void 0 === t ? 1 : t, this.currentPath && this.currentPath.shape.points.length <= 2 && (this.currentPath.fill = this.filling, this.currentPath.fillColor = this.fillColor, this.currentPath.fillAlpha = this.fillAlpha), this
- }, e.Graphics.prototype.endFill = function() {
- return this.filling = !1, this.fillColor = null, this.fillAlpha = 1, this
- }, e.Graphics.prototype.drawRect = function(t, i, n, r) {
- return this.drawShape(new e.Rectangle(t, i, n, r)), this
- }, e.Graphics.prototype.drawRoundedRect = function(t, i, n, r, o) {
- return this.drawShape(new e.RoundedRectangle(t, i, n, r, o)), this
- }, e.Graphics.prototype.drawCircle = function(t, i, n) {
- return this.drawShape(new e.Circle(t, i, n)), this
- }, e.Graphics.prototype.drawEllipse = function(t, i, n, r) {
- return this.drawShape(new e.Ellipse(t, i, n, r)), this
- }, e.Graphics.prototype.drawPolygon = function(t) {
- return t instanceof Array || (t = Array.prototype.slice.call(arguments)), this.drawShape(new e.Polygon(t)), this
- }, e.Graphics.prototype.clear = function() {
- return this.lineWidth = 0, this.filling = !1, this.dirty = !0, this.clearDirty = !0, this.graphicsData = [], this
- }, e.Graphics.prototype._renderWebGL = function(t) {
- if (this.visible !== !1 && 0 !== this.alpha && this.isMask !== !0) {
- if (t.spriteBatch.stop(), t.blendModeManager.setBlendMode(this.blendMode), this._mask && t.maskManager.pushMask(this._mask, t), this._filters && t.filterManager.pushFilter(this._filterBlock), this.blendMode !== t.spriteBatch.currentBlendMode) {
- t.spriteBatch.currentBlendMode = this.blendMode;
- var i = e.blendModesWebGL[t.spriteBatch.currentBlendMode];
- t.spriteBatch.gl.blendFunc(i[0], i[1])
- }
- if (this.webGLDirty && (this.dirty = !0, this.webGLDirty = !1), e.WebGLGraphics.renderGraphics(this, t), this.children.length) {
- t.spriteBatch.start();
- for (var n = 0, r = this.children.length; n < r; n++) this.children[n]._renderWebGL(t);
- t.spriteBatch.stop()
- }
- this._filters && t.filterManager.popFilter(), this._mask && t.maskManager.popMask(this.mask, t), t.drawCount++, t.spriteBatch.start()
- }
- }, e.Graphics.prototype._renderCanvas = function(t) {
- if (this.visible !== !1 && 0 !== this.alpha && this.isMask !== !0) {
- var i = t.context,
- n = this.worldTransform;
- this.blendMode !== t.currentBlendMode && (t.currentBlendMode = this.blendMode, i.globalCompositeOperation = e.blendModesCanvas[t.currentBlendMode]), this._mask && t.maskManager.pushMask(this._mask, t), i.setTransform(n.a, n.b, n.c, n.d, n.tx, n.ty), this.tint != this.oldTint && (this.dirty = !0, this.oldTint = this.tint), e.CanvasGraphics.renderGraphics(this, i);
- for (var r = 0, o = this.children.length; r < o; r++) this.children[r]._renderCanvas(t);
- this._mask && t.maskManager.popMask(t)
- }
- }, e.Graphics.prototype.getBounds = function(t) {
- if (this.isMask) return e.EmptyRectangle;
- this.dirty && (this.updateLocalBounds(), this.webGLDirty = !0, this.cachedSpriteDirty = !0, this.dirty = !1);
- var i = this._localBounds,
- n = i.x,
- r = i.width + i.x,
- o = i.y,
- a = i.height + i.y,
- s = t || this.worldTransform,
- h = s.a,
- l = s.b,
- c = s.c,
- d = s.d,
- u = s.tx,
- f = s.ty,
- p = h * r + c * a + u,
- g = d * a + l * r + f,
- v = h * n + c * a + u,
- m = d * a + l * n + f,
- x = h * n + c * o + u,
- w = d * o + l * n + f,
- y = h * r + c * o + u,
- b = d * o + l * r + f,
- T = p,
- C = g,
- S = p,
- M = g;
- return S = v < S ? v : S, S = x < S ? x : S, S = y < S ? y : S, M = m < M ? m : M, M = w < M ? w : M, M = b < M ? b : M, T = v > T ? v : T, T = x > T ? x : T, T = y > T ? y : T, C = m > C ? m : C, C = w > C ? w : C, C = b > C ? b : C, this._bounds.x = S, this._bounds.width = T - S, this._bounds.y = M, this._bounds.height = C - M, this._bounds
- }, e.Graphics.prototype.updateLocalBounds = function() {
- var t = 1 / 0,
- i = -(1 / 0),
- n = 1 / 0,
- r = -(1 / 0);
- if (this.graphicsData.length)
- for (var o, a, s, h, l, c, d = 0; d < this.graphicsData.length; d++) {
- var u = this.graphicsData[d],
- f = u.type,
- p = u.lineWidth;
- if (o = u.shape, f === e.Graphics.RECT || f === e.Graphics.RREC) s = o.x - p / 2, h = o.y - p / 2, l = o.width + p, c = o.height + p, t = s < t ? s : t, i = s + l > i ? s + l : i, n = h < n ? h : n, r = h + c > r ? h + c : r;
- else if (f === e.Graphics.CIRC) s = o.x, h = o.y, l = o.radius + p / 2, c = o.radius + p / 2, t = s - l < t ? s - l : t, i = s + l > i ? s + l : i, n = h - c < n ? h - c : n, r = h + c > r ? h + c : r;
- else if (f === e.Graphics.ELIP) s = o.x, h = o.y, l = o.width + p / 2, c = o.height + p / 2, t = s - l < t ? s - l : t, i = s + l > i ? s + l : i, n = h - c < n ? h - c : n, r = h + c > r ? h + c : r;
- else {
- a = o.points;
- for (var g = 0; g < a.length; g += 2) s = a[g], h = a[g + 1], t = s - p < t ? s - p : t, i = s + p > i ? s + p : i, n = h - p < n ? h - p : n, r = h + p > r ? h + p : r
- }
- } else t = 0, i = 0, n = 0, r = 0;
- var v = this.boundsPadding;
- this._localBounds.x = t - v, this._localBounds.width = i - t + 2 * v, this._localBounds.y = n - v, this._localBounds.height = r - n + 2 * v
- }, e.Graphics.prototype.drawShape = function(t) {
- this.currentPath && this.currentPath.shape.points.length <= 2 && this.graphicsData.pop(), this.currentPath = null;
- var i = new e.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, t);
- return this.graphicsData.push(i), i.type === e.Graphics.POLY && (i.shape.closed = this.filling, this.currentPath = i), this.dirty = !0, i
- }, e.GraphicsData = function(e, t, i, n, r, o, a) {
- this.lineWidth = e, this.lineColor = t, this.lineAlpha = i, this._lineTint = t, this.fillColor = n, this.fillAlpha = r, this._fillTint = n, this.fill = o, this.shape = a, this.type = a.type
- }, e.Graphics.POLY = 0, e.Graphics.RECT = 1, e.Graphics.CIRC = 2, e.Graphics.ELIP = 3, e.Graphics.RREC = 4, e.Polygon.prototype.type = e.Graphics.POLY, e.Rectangle.prototype.type = e.Graphics.RECT, e.Circle.prototype.type = e.Graphics.CIRC, e.Ellipse.prototype.type = e.Graphics.ELIP, e.RoundedRectangle.prototype.type = e.Graphics.RREC, e.BaseTextureCache = {}, e.BaseTextureCacheIdGenerator = 0, e.BaseTexture = function(t, i) {
- if (this.width = 100, this.height = 100, this.scaleMode = i || e.scaleModes.DEFAULT, this.hasLoaded = !1, this.source = t, this._UID = e._UID++, this.premultipliedAlpha = !0, this._glTextures = [], this._dirty = [!0, !0, !0, !0], t) {
- if ((this.source.complete || this.source.getContext) && this.source.width && this.source.height) this.hasLoaded = !0, this.width = this.source.naturalWidth || this.source.width, this.height = this.source.naturalHeight || this.source.height, this.dirty();
- else {
- var n = this;
- this.source.onload = function() {
- n.hasLoaded = !0, n.width = n.source.naturalWidth || n.source.width, n.height = n.source.naturalHeight || n.source.height, n.dirty(), window.dirty = !0, n.dispatchEvent({
- type: "loaded",
- content: n
- })
- }, this.source.onerror = function() {
- n.dispatchEvent({
- type: "error",
- content: n
- })
- }
- }
- this.imageUrl = null
- }
- }, e.BaseTexture.prototype.constructor = e.BaseTexture, e.EventTarget.mixin(e.BaseTexture.prototype), e.BaseTexture.prototype.destroy = function() {
- this.imageUrl && (delete e.BaseTextureCache[this.imageUrl], delete e.TextureCache[this.imageUrl], this.imageUrl = null, this.source.src = ""), this.source = null, this.unloadFromGPU()
- }, e.BaseTexture.prototype.dirty = function() {
- for (var e = 0; e < this._glTextures.length; e++) this._dirty[e] = !0
- }, e.BaseTexture.prototype.unloadFromGPU = function() {
- this.dirty();
- for (var t = this._glTextures.length - 1; t >= 0; t--) {
- var i = this._glTextures[t],
- n = e.glContexts[t];
- n && i && n.deleteTexture(i)
- }
- this._glTextures.length = 0, this.dirty()
- }, e.BaseTexture.fromImage = function(t, i, n) {
- var r = e.BaseTextureCache[t];
- if (void 0 === i && t.indexOf("data:") === -1 && (i = !0), !r) {
- var o = new Image;
- i && (o.crossOrigin = ""), o.src = t, r = new e.BaseTexture(o, n), r.imageUrl = t, e.BaseTextureCache[t] = r
- }
- return r
- }, e.BaseTexture.fromCanvas = function(t, i) {
- return new e.BaseTexture(t, i)
- }, e.TextureCache = {}, e.FrameCache = {}, e.TextureCacheIdGenerator = 0, e.Texture = function(t, i, n, r) {
- this.noFrame = !1, i || (this.noFrame = !0, i = new e.Rectangle(0, 0, 1, 1)), t instanceof e.Texture && (t = t.baseTexture), this.baseTexture = t, this.floorCoordinates = !0, this.frame = i, this.trim = r, this.valid = !1, this.requiresUpdate = !1, this._uvs = null, this.width = 0, this.height = 0, this.crop = n || new e.Rectangle(0, 0, 1, 1), t.hasLoaded ? (this.noFrame && (i = new e.Rectangle(0, 0, t.width, t.height)), this.setFrame(i)) : t.addEventListener("loaded", this.onBaseTextureLoaded.bind(this))
- }, e.Texture.prototype.constructor = e.Texture, e.EventTarget.mixin(e.Texture.prototype), e.Texture.prototype.onBaseTextureLoaded = function() {
- var t = this.baseTexture;
- t.removeEventListener("loaded", this.onLoaded), this.noFrame && (this.frame = new e.Rectangle(0, 0, t.width, t.height)), this.setFrame(this.frame), this.dispatchEvent({
- type: "update",
- content: this
- })
- }, e.Texture.prototype.destroy = function(e) {
- e && this.baseTexture.destroy(), this.valid = !1
- }, e.Texture.prototype.setFrame = function(e) {
- if (this.noFrame = !1, this.frame = e, this.width = e.width, this.height = e.height, this.crop.x = e.x, this.crop.y = e.y, this.crop.width = e.width, this.crop.height = e.height, !this.trim && (e.x + e.width > this.baseTexture.width || e.y + e.height > this.baseTexture.height)) throw new Error("Texture Error: frame does not fit inside the base Texture dimensions " + this);
- this.valid = e && e.width && e.height && this.baseTexture.source && this.baseTexture.hasLoaded, this.trim && (this.width = this.trim.width, this.height = this.trim.height, this.frame.width = this.trim.width, this.frame.height = this.trim.height), this.valid && this._updateUvs()
- }, e.Texture.prototype._updateUvs = function() {
- this._uvs || (this._uvs = new e.TextureUvs);
- var t = this.crop,
- i = this.baseTexture.width,
- n = this.baseTexture.height;
- this._uvs.x0 = t.x / i, this._uvs.y0 = t.y / n, this._uvs.x1 = (t.x + t.width) / i, this._uvs.y1 = t.y / n, this._uvs.x2 = (t.x + t.width) / i, this._uvs.y2 = (t.y + t.height) / n, this._uvs.x3 = t.x / i, this._uvs.y3 = (t.y + t.height) / n
- }, e.Texture.fromImage = function(t, i, n) {
- var r = e.TextureCache[t];
- return r || (r = new e.Texture(e.BaseTexture.fromImage(t, i, n)), e.TextureCache[t] = r), r
- }, e.Texture.fromFrame = function(t) {
- var i = e.TextureCache[t];
- if (!i) throw new Error('The frameId "' + t + '" does not exist in the texture cache ');
- return i
- }, e.Texture.fromCanvas = function(t, i) {
- var n = e.BaseTexture.fromCanvas(t, i);
- return new e.Texture(n)
- }, e.Texture.addTextureToCache = function(t, i) {
- e.TextureCache[i] = t
- }, e.Texture.removeTextureFromCache = function(t) {
- var i = e.TextureCache[t];
- return delete e.TextureCache[t], delete e.BaseTextureCache[t], i
- }, e.TextureUvs = function() {
- this.x0 = 0, this.y0 = 0, this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.x3 = 0, this.y3 = 0
- }, e.Texture.emptyTexture = new e.Texture(new e.BaseTexture), e.RenderTexture = function(t, i, n, r) {
- if (this.width = t || 100, this.height = i || 100, this.frame = new e.Rectangle(0, 0, this.width, this.height), this.crop = new e.Rectangle(0, 0, this.width, this.height), this.baseTexture = new e.BaseTexture, this.baseTexture.width = this.width, this.baseTexture.height = this.height, this.baseTexture._glTextures = [], this.baseTexture.scaleMode = r || e.scaleModes.DEFAULT, this.baseTexture.hasLoaded = !0, e.Texture.call(this, this.baseTexture, new e.Rectangle(0, 0, this.width, this.height)), this.renderer = n || e.defaultRenderer, this.renderer.type === e.WEBGL_RENDERER) {
- var o = this.renderer.gl;
- this.baseTexture._dirty[o.id] = !1, this.textureBuffer = new e.FilterTexture(o, this.width, this.height, this.baseTexture.scaleMode), this.baseTexture._glTextures[o.id] = this.textureBuffer.texture, this.render = this.renderWebGL, this.projection = new e.Point(.5 * this.width, .5 * -this.height)
- } else this.render = this.renderCanvas, this.textureBuffer = new e.CanvasBuffer(this.width, this.height), this.baseTexture.source = this.textureBuffer.canvas;
- this.valid = !0, this._updateUvs()
- }, e.RenderTexture.prototype = Object.create(e.Texture.prototype), e.RenderTexture.prototype.constructor = e.RenderTexture, e.RenderTexture.prototype.resize = function(t, i, n) {
- t === this.width && i === this.height || (this.valid = t > 0 && i > 0, this.width = this.frame.width = this.crop.width = t, this.height = this.frame.height = this.crop.height = i, n && (this.baseTexture.width = this.width, this.baseTexture.height = this.height), this.renderer.type === e.WEBGL_RENDERER && (this.projection.x = this.width / 2, this.projection.y = -this.height / 2), this.valid && this.textureBuffer.resize(this.width, this.height))
- }, e.RenderTexture.prototype.clear = function() {
- this.valid && (this.renderer.type === e.WEBGL_RENDERER && this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer), this.textureBuffer.clear())
- }, e.RenderTexture.prototype.renderWebGL = function(e, t, i) {
- if (this.valid) {
- var n = e.worldTransform;
- n.identity(), n.translate(0, 2 * this.projection.y), t && n.append(t), n.scale(1, -1), e.worldAlpha = 1;
- for (var r = e.children, o = 0, a = r.length; o < a; o++) r[o].updateTransform();
- var s = this.renderer.gl;
- s.viewport(0, 0, this.width, this.height), s.bindFramebuffer(s.FRAMEBUFFER, this.textureBuffer.frameBuffer), i && this.textureBuffer.clear(), this.renderer.spriteBatch.dirty = !0, this.renderer.renderDisplayObject(e, this.projection, this.textureBuffer.frameBuffer), this.renderer.spriteBatch.dirty = !0
- }
- }, e.RenderTexture.prototype.renderCanvas = function(e, t, i) {
- if (this.valid) {
- var n = e.worldTransform;
- n.identity(), t && n.append(t), e.worldAlpha = 1;
- for (var r = e.children, o = 0, a = r.length; o < a; o++) r[o].updateTransform();
- i && this.textureBuffer.clear();
- var s = this.textureBuffer.context;
- this.renderer.renderDisplayObject(e, s)
- }
- }, e.AbstractFilter = function(e, t) {
- this.passes = [this], this.shaders = [], this.dirty = !0, this.padding = 0, this.uniforms = t || {}, this.fragmentSrc = e || []
- }, e.AbstractFilter.prototype.constructor = e.AbstractFilter, e.AbstractFilter.prototype.syncUniforms = function() {
- for (var e = 0, t = this.shaders.length; e < t; e++) this.shaders[e].dirty = !0
- }, e
- }
- function t(e, t) {
- return this.emit("eventAttached", {
- eventName: e
- }), this.__listeners = this.__listeners || {}, (this.__listeners[e] = this.__listeners[e] || []).push(t), this
- }
- function n() {
- window.Social = function() {}
- }
- function r() {
- function e(e) {
- return {
- r: (16711680 & e) >> 16,
- g: (65280 & e) >> 8,
- b: (255 & e) >> 0
- }
- }
- function t(e) {
- return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
- }
- function i() {
- fe.ratio = 1;
- var e = fe.width;
- fe.ratio = fe.parent && fe.parent.ratio || 1;
- var t = a.devicePixelRatio;
- ue.x = width * t / stage.ratio / 2, fe.x = -(e + 80) / 2 + 80, pe.x = -(e + 80) / 2
- }
- function r(e) {
- fe.setText(t(e)), i()
- }
- function o(e, t) {
- var i = Z.highscore.get(),
- n = Math.max(i, e);
- return we = n, r(n), t && (e < 1500 ? a.submitLowscore(e) : a.submitHighscore(e)), c(), e > i && (Z.highscore.set(e), !0)
- }
- function h(e, t) {
- var i = JSON.parse(e),
- n = JSON.parse(t),
- t = {};
- for (var r in i) t[r] = i[r];
- for (var r in n) t[r] = n[r];
- return JSON.stringify(t)
- }
- function c() {
- clearTimeout(xe), xe = setTimeout(function() {
- var e = !1;
- if (J) {
- (parseInt(J.highscore) || 0) < we && (J.highscore = we, e = !0), (parseInt(J.coins) || 0) != Z.coins.get() && (J.coins = Z.coins.get(), e = !0);
- var t = h(J.state || "{}", Z.unlocked.get() || "{}");
- J.state != t && (J.state = t, e = !0), e && FBInstant.player.setDataAsync(J).then(function() {
- console.log("Successfully saved state to Facebook Cloud", J)
- })
- }
- if (s.user) {
- (parseInt(s.user.get("highscore")) || 0) < we && (s.user.set("highscore", we), e = !0), (parseInt(s.user.get("coins")) || 0) != Z.coins.get() && (s.user.set("coins", Z.coins.get()), e = !0);
- var t = h(s.user.get("state") || "{}", Z.unlocked.get() || "{}");
- s.user.get("state") != t && (s.user.set("state", t), e = !0), e && s.save()
- }
- if (e = !1, te) {
- (parseInt(te.get("highscore")) || 0) < we && (te.set("highscore", we), s.user.set("highscore", we), e = !0), (parseInt(te.get("coins")) || 0) != Z.coins.get() && (te.set("coins", Z.coins.get()), s.user.set("coins", Z.coins.get()), e = !0);
- var t = h(te.get("state") || "{}", Z.unlocked.get() || "{}");
- te.get("state") != t && (te.set("state", t), s.user.set("state", t), e = !0), e ? (s.save(), te.save({}, {
- success: function(e) {
- console.log("Successfully saved state", e)
- },
- error: function(e, t) {}
- })) : console.log("No change, do nothing :)")
- }
- }, 1e3)
- }
- function d(e, t, i, n, o, a, s, h) {
- if (ge += i, Tween.clear(ve.scale), Tween.clear(ve), new Tween(ve, {
- score: ge
- }, .4), ge > we && r(ge), be && (h || (n = ye.x, o = ye.y)), Tween.clear(ye), Tween.clear(ye.scale), ye.setText(t), ye.updateStyle({
- size: 2 * (60 + (Math.min(e / 15, 60) >> 0))
- }), ye.anchor.set(.5, .5), ye.alpha = 1, ye.x = n, ye.y = o, Ce.addChild(ye), be = !0, new Tween(ye.scale, {
- x: 1.2,
- y: 1.2
- }, .1).call(function() {
- ye && new Tween(ye.scale, {
- x: 1,
- y: 1
- }, .1).call(function() {})
- }), 0 != s && (se.alpha = Math.min(5 * s, 255) / 255), a) {
- $e = B();
- ye.y;
- new Tween(ye, {
- y: ye.y - 200,
- alpha: 0
- }, .4, Tween.easeIn).call(function() {
- Ce.removeChild(ye), be = !1, I(), 0 != se.alpha && new Tween(se, {
- alpha: 0
- }, .7)
- }).wait(.6), He <= 3 && setTimeout(function() {
- for (var e = 0; e < ke.length; e++)
- for (var t = 0; t < ke[e].length; t++) {
- var i = ke[e][t];
- new Tween(i, {
- alpha: x(i, e, t)
- }, .3)
- }
- D()
- }, 3 == He ? 100 : 800)
- }
- new Tween(ve.scale, {
- x: .7,
- y: .7
- }, .2, Tween.easeIn).call(function() {
- new Tween(ve.scale, {
- x: .5,
- y: .5
- }, .4)
- })
- }
- function u() {
- ge = 0, new Tween(ve, {
- score: ge
- }, .4)
- }
- function f(e) {
- Me.onShow(e), Modal.show(Me)
- }
- function p(e, t, i) {
- return Math.abs(Math.cos(5 * i * Math.PI))
- }
- function g(e, t) {
- var i = Le.shift();
- Le.push(i);
- 2 * Math.PI * Math.random();
- Tween.clear(i), Tween.clear(i.scale), i.clicked = !1, i.x = e, i.y = t, i.scale.set(1.3, 1.3), i.alpha = 1, i.trigger(), Ce.addChild(i);
- var n = 1410 * Math.random(),
- r = 1300 * Math.random();
- "landscape" == stage.orientation ? n = 1300 : r = 1200, new Tween(i.scale, {
- x: 1,
- y: 1
- }, .5, Tween.easeout), new Tween(i, {
- x: n,
- y: r
- }, 1, Tween.easeout).call(function() {
- new Tween(i, {
- alpha: 1
- }, 3, p).wait(7), new Tween(i, {
- alpha: 0
- }, .5).wait(10).call(function() {
- i.parent && i.parent.removeChild(i)
- })
- })
- }
- function v() {
- for (var e = 0; e < Le.length; e++) {
- var t = Le[e];
- Tween.clear(t), t.parent && t.parent.removeChild(t)
- }
- }
- function m(e, t) {
- var i = this;
- this.container = new Container, this.innerContainer = new Container, this.container.addChild(this.innerContainer), this.targetX = 0, this.targetY = 0;
- var n = de[e];
- void 0 === t && (t = Math.random() * n.tiles.length >> 0);
- var r = n.tiles[t];
- this.children = this.innerContainer.children, this.tiles = r, this.color = re.tileColors[e], this.type = e + 1, this.typeOffset = t + 1;
- for (var o = 1e3, a = -1e3, s = 1e3, h = -1e3, l = [], c = [], d = 0; d < r.length; d++)
- for (var u = r[d], f = 0; f < u.length; f++) {
- var p = r[d][f];
- if (1 === p) {
- var g = new Sprite(embed("i/g/shadow.png"));
- g.floorCoordinates = !1, g.anchor.set(.5, .5), g.frame = 2, this.innerContainer.addChildAt(g, 0), g.alpha = 0, g.tint = re.shadowTints[e];
- var v = new Pe(re);
- v.type = e, v.frame = 1, v.tint = re.tileColors[e], g.x = v.x = f * Be - d % 2 * Ie + Be, g.y = v.y = d * Fe + 73.5, this.innerContainer.addChild(v), v.x < o && (o = v.x), v.x > a && (a = v.x), v.y < s && (s = v.y), v.y > h && (h = v.y), l.push(v), c.push(g)
- }
- }
- this.innerContainer.scale.set(.6, .6), this.tw = .6 * (a - o) + 92, this.th = .6 * (h - s) + 92, this.container.setRatio = function(e) {
- var t = 100 * e;
- i.container.hitArea = new Rectangle((o - 67) / 2 * e - t, -t, i.tw * e + 2 * t, i.th * e + 2 * t)
- }, this.container.interactive = !0, this.container.buttonMode = !0, this.minX = o, this.dropped = !1, this.fadeIn = function() {
- new Tween(this.innerContainer.scale, {
- x: 1,
- y: 1
- }, .1);
- for (var e = 0; e < l.length; e++) {
- var t = l[e];
- new Tween(t.scale, {
- x: .8,
- y: .8
- }, .1)
- }
- for (var e = 0; e < c.length; e++) {
- var i = c[e];
- new Tween(i, {
- alpha: 1
- }, .1)
- }
- }, this.fadeDrop = function() {
- this.dropped = !0;
- for (var e = 0; e < l.length; e++) {
- var t = l[e];
- new Tween(t.scale, {
- x: 1,
- y: 1
- }, .1)
- }
- for (var e = 0; e < c.length; e++) {
- var i = c[e];
- new Tween(i, {
- alpha: 0
- }, .1)
- }
- }, this.fadeReset = function() {
- new Tween(this.innerContainer.scale, {
- x: .6,
- y: .6
- }, .1);
- for (var e = 0; e < l.length; e++) {
- var t = l[e];
- new Tween(t.scale, {
- x: 1,
- y: 1
- }, .1)
- }
- for (var e = 0; e < c.length; e++) {
- var i = c[e];
- new Tween(i, {
- alpha: 0
- }, .1)
- }
- }, this.setSkin = function(t, n, r) {
- i.color = n[e];
- for (var o = 0; o < l.length; o++) {
- l[o].updateTileAsset(t.tileTexture, t.highlightTexture, o / 15, 1, r)
- }
- for (var o = 0; o < c.length; o++) c[o].tint = re.shadowTints[e]
- }
- }
- function x(e, t, i) {
- if (0 == He) {
- var n = [
- [0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 1, 0, 0, 0],
- [1, 1, 1, 1, 1, 1],
- [0, 0, 0, 1, 0]
- ];
- return n[t][i] ? e.used ? 1 : $ : .05
- }
- if (1 == He) {
- var n = [
- [1, 1, 1, 1, 1],
- [1, 1, 1, 1, 1, 1],
- [0, 0, 0, 1, 1, 0, 0],
- [0, 0, 0, 0, 0, 1, 0, 0],
- [0, 0, 0, 0, 0, 0, 1, 0, 0],
- [0, 0, 0, 0, 0, 0, 1, 0],
- [0, 0, 0, 0, 0, 0, 1],
- [0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0]
- ];
- return n[t][i] ? e.used ? 1 : $ : .05
- }
- return e.used ? 1 : $
- }
- function w() {
- for (var e = ge + ":", t = [], i = 0; i < et.length; i++) t.push(et[i].type, et[i].typeOffset);
- e += t.join(",") + ":";
- for (var n = [], i = 0; i < ke.length; i++)
- for (var r = ke[i], o = 0; o < r.length; o++) n.push(r[o].type);
- return e += n.join(",")
- }
- function y(e) {
- e ? Z.state.remove() : Z.state.set(w())
- }
- function b(e) {
- var t = Math.round((e.container.y - Ce.y) / Fe),
- i = Math.floor((e.container.x - Ce.x) / Be + .5 + (t + 1) % 2 * .5),
- n = t;
- return {
- x: i - Math.floor(Math.abs(We - n) / 2),
- y: n,
- px: i * Be + (1 - (t + 1) % 2) * Ie + Be / 2,
- py: t * Fe + Fe / 2
- }
- }
- function T(e) {
- return C(e, b(e))
- }
- function C(e, t, i) {
- if ((0 != He || 3 == t.x && 6 == t.y || i) && (1 != He || 2 == t.x && t.y == -0 || i)) {
- for (var n = 0, r = 0; r < e.tiles.length; r++) {
- for (var o = t.y + r, a = 0; a < e.tiles[r].length; a++) {
- if (1 === e.tiles[r][a]) {
- var s = t.x + a + Math.floor(n);
- if (!ke[o] || !ke[o][s]) return !1;
- if (1 == ke[o][s].used) return !1
- }
- }
- n += o < We ? .5 : -.5
- }
- return !0
- }
- }
- function S(e) {
- for (var t = b(e), i = 0, n = 0; n < e.tiles.length; n++) {
- for (var r = t.y + n, o = 0; o < e.tiles[n].length; o++) {
- if (1 === e.tiles[n][o]) {
- var a = t.x + o + Math.floor(i);
- ke[r] && ke[r][a] && (ke[r][a].tint = e.color, ke[r][a].alpha = .6)
- }
- }
- i += r < We ? .5 : -.5
- }
- }
- function M(e, t) {
- function i(e) {
- setTimeout(function() {
- e.alpha = 1
- }, 100)
- }
- He <= 3 && He++;
- for (var n = 0, r = 0; r < e.tiles.length; r++) {
- for (var o = t.y + r, a = 0; a < e.tiles[r].length; a++) {
- var s = e.tiles[r][a];
- if (1 === s) {
- var h = t.x + a + Math.floor(n);
- if (ke[o] && ke[o][h]) {
- var s = ke[o][h];
- s.tint = e.color, s.type = e.type, s.used = !0, s.frame = 1, i(s)
- }
- }
- }
- n += o < We ? .5 : -.5
- }
- }
- function R(e, t) {
- var i = ge * Math.random();
- void 0 === e && (e = i < 1e4 && Math.random() < .4 ? Math.random() * (de.length - 2) >> 0 : i < 1e5 ? Math.random() * (de.length - 1) >> 0 : i < 25e4 ? (Math.random() * (de.length - 2) >> 0) + 1 : (Math.random() * (de.length - 1) >> 0) + 1);
- var n = new m(e, t);
- return n.container.x = 3e3, n.container.y = 3e3, he.addChild(n.container), n.container.on("down", function(e) {
- var t = e.event,
- i = e.isMouseEvent;
- if (!($e || Ze || n.dropped || 0 == He && n != et[1] || 1 == He && n != et[0])) {
- Tween.clear(n.container), he.addChild(n.container);
- var r = (t.getLocalPosition(n.container), n.container.ratio);
- Ze = n, H.play(0), i ? (le = he.x + n.tw, ce = he.y + n.th) : "landscape" == stage.orientation ? (le = 1.5 * n.tw + Be + he.x, ce = n.th + he.y) : (le = n.tw + he.x, ce = 2 * n.th + he.y);
- var o = t.getLocalPosition(stage),
- a = o.x / r - le,
- s = o.y / r - ce;
- Ze.innerContainer.x = Ze.container.x - a, Ze.innerContainer.y = Ze.container.y - s, new Tween(Ze.innerContainer, {
- x: 0,
- y: 0
- }, .1), Ze.container.x = a, Ze.container.y = s, Ze.fadeIn()
- }
- }), n
- }
- function _(e, i) {
- function n(e, i, n, o, a, s) {
- function h() {
- var n = Math.max(Math.pow(i, 1.2), 1),
- h = 0,
- c = re.removeColors[Je % re.removeColors.length];
- Je++;
- for (var u = 0; u < e.length; u++) Tween.clear(e[u]), r += l * n >> 0, h += l * n >> 0, e[u].type = 0, e[u].frame = 0, e[u].alpha = 1, e[u].tint = c, new Tween(e[u], {
- alpha: $,
- r: ae.r,
- g: ae.g,
- b: ae.b
- }, .3).wait(.3);
- for (var f = 0; f < Math.min(Math.ceil(i / 2), 3); f++) g(o, a);
- d(r, t(r), h, o, a, s, i)
- }
- var l = 10 * (n + 1);
- setTimeout(h, 300 * i)
- }
- for (var r = 40, o = [], a = 0; a < Ke.length; a++) {
- for (var s = Ke[a], h = !0, l = 0; l < s.length; l++)
- if (0 == s[l].used) {
- h = !1;
- break
- }
- h && o.push(s)
- }
- o.sort(function(e, t) {
- return e.length == t.length ? 0 : e.length < t.length ? -1 : 1
- });
- var c = i.px,
- u = i.py;
- if (o.length > 0) {
- for (var a = 0; a < o.length; a++) N[Math.min(a, N.length - 1)].play(.3 * a);
- for (var f = 0, p = 0, v = 0, a = 0; a < o.length; a++)
- for (var s = o[a], l = 0; l < s.length; l++) f += s[l].x, p += s[l].y, v++, s[l].used = !1, s[l].type = 0;
- f /= v, p /= v;
- for (var m = o.length > 2, a = 0; a < o.length; a++) {
- var s = o[a];
- n(s, a, o.length, f, p, !m && o.length == a + 1)
- }
- if (m) {
- var x = Math.min(3 * Math.min(o.length - 3, 6) + 3 * Math.random() >> 0, X.length - 1),
- w = X[x];
- w[0].play(.3 * a + .2), setTimeout(function() {
- d(650, w[1], 0, 700, 630, !0, a, !0)
- }, 300 * a + 300)
- }
- c = f, u = p
- }
- return d(40, t(40), 40, c, u, 0 == o.length, 0), o.length
- }
- function E(e) {
- for (var t = 0; t < et.length; t++)
- if (et[t] == e) {
- et.splice(t, 1);
- break
- }
- setTimeout(function() {
- e.container.parent.removeChild(e.container)
- }, 100), et.push(R()), O()
- }
- function L(e, t) {
- var i = [e.tileTexture];
- e.backgroundTexture && i.push(e.backgroundTexture), e.highlightTexture && i.push(e.highlightTexture), i.push(t), preload.apply(window, i)
- }
- function A(t, i) {
- function n() {
- Host.Application.SetStatusbarColor(t.isLight), re = t, oe = embed(t.tileTexture), stage.background.gradient = t.gradient, t.backgroundTexture ? stage.background.texture = embed(t.backgroundTexture) : stage.background.texture = void 0, stage.background.refresh(!0);
- for (var n = 0; n < ke.length; n++)
- for (var r = ke[n], o = 0; o < r.length; o++) r[o].updateTileAsset(t.tileTexture, t.highlightTexture, n / 30 + o / 14, 0, i);
- for (var n = 0; n < et.length; n++) et[n].setSkin(t, t.tileColors, i);
- fe.updateStyle({
- fill: t.textColor
- }), ve.updateStyle({
- fill: t.textColor
- }), Sidebar.icon.tint = t.buttonColor, tileBackgroundTint = t.tileBackgroundTint, ae = e(tileBackgroundTint), pe.tint = t.buttonColor, _e.setStyle(), se.clear(), se.beginFill(t.overlayColor), se.drawRect(0, 0, 200, 200), i || (se.alpha = 1, new Tween(se, {
- alpha: 0
- }, 1.5)), stage.visible = !0
- }
- Z.selectedSkin.set(t.id), L(t, n)
- }
- function P(e) {
- var t = e && e.instant;
- if (at != width || ot != height) {
- at = width, ot = height;
- var n = a.devicePixelRatio;
- se.width = width * n, se.height = height * n, se.y = -a.styles.margins.top * n, ve.x = width * n / stage.ratio / 2, i(t), "landscape" == stage.orientation ? (Ce.x = 150, Ce.y = (1686 - ze * Fe) / 2, he.x = (width * n / stage.ratio - 2048) / 2, he.y = Math.max(.5 * (gameHeight * n / stage.ratio - 1536), 0)) : (Ce.x = (1536 - ze * Be) / 2, Ce.y = 300, he.x = (width * n / stage.ratio - 1536) / 2, he.y = .6 * (gameHeight * n / stage.ratio - 2048)), _e.move(t), O(t)
- }
- }
- function B(e) {
- for (var t = 0; t < et.length; t++)
- for (var i = et[t], n = 0; n < ke.length; n++)
- for (var r = ke[n], o = -1; o < r.length + 1; o++)
- if (C(i, {
- x: o,
- y: n
- }, !0)) return !1;
- return !0
- }
- function I() {
- if (B()) return Sidebar.hideIcon(), Modal.show(new ee, !0), setTimeout(function() {
- Modal.hide(function() {
- showGameOver()
- })
- }, 2e3), !0
- }
- function F() {
- ga("send", "event", "Hex", "New Game")
- }
- function k() {
- Q.stop(0), q.resetGain(), Sidebar.showIcon(), a.hideGameOverAd(), a.showInterstitialAd(), v(), u();
- for (var e = 0; e < 3; e++) E(et[0]);
- for (var e = 0; e < ke.length; e++)
- for (var t = ke[e], i = 0; i < t.length; i++) t[i].frame = 0, t[i].tint = re.tileBackgroundTint, t[i].alpha = $, t[i].used = !1, t[i].type = 0;
- F(), $e = !1
- }
- function O(e) {
- if ("landscape" == stage.orientation)
- for (var t = 0; t < 3; t++) {
- var i = et[t];
- i != Ze && (i.targetX = 1825 - i.tw / 2 - i.minX / 4, i.targetY = 400 * t + 468 + 15 - i.th / 2, e ? (i.container.x = i.targetX, i.container.y = i.targetY) : new Tween(i.container, {
- x: i.targetX,
- y: i.targetY
- }, .3))
- } else
- for (var t = 0; t < 3; t++) {
- var i = et[t];
- if (i != Ze) {
- var i = et[t];
- i.targetX = 500 * t + 268 - et[t].tw / 2 - et[t].minX / 4, i.targetY = 1850 - et[t].th / 2, e ? (i.container.x = i.targetX, i.container.y = i.targetY) : new Tween(i.container, {
- x: i.targetX,
- y: i.targetY
- }, .3)
- }
- }
- }
- function G(e, t) {
- Container.call(this);
- var i = new Graphics;
- this.addChild(i), i.beginFill(16777215, .9), i.drawRoundedRect(0, 0, 1400, 300, 35), this.setRatio = function(e) {
- i.width = 1400 * e, i.height = 300 * e
- };
- var n = new Sprite(embed("i/g/helper.svg"));
- this.addChild(n), n.x = -20, n.y = -20;
- var e = new Text2(e, {
- weight: 400,
- size: 90,
- fill: "#000000",
- align: "center"
- });
- e.anchor.set(.5, 0), this.addChild(e), e.x = 700, e.y = 20;
- var t = new Text2(t, {
- weight: 400,
- size: 60,
- fill: "#000000",
- align: "center"
- });
- t.anchor.set(.5, 0), this.addChild(t), t.x = 700, t.y = 125
- }
- function D(e) {
- if (He > 3) return void(ut && (ut.parent.removeChild(ut), ut = null));
- if (!e && ft != He)
- if (ft = He, ut && 3 != He && (ut.parent.removeChild(ut), ut = null), 0 == He && (et[0].container.alpha = .2, et[2].container.alpha = .2, ut = new G(Host.Localize.Translate("Hi, let's play {game_name}!", {
- game_name: l.shareTitle
- }, "Hex FRVR Tutorial step #1 headline"), Host.Localize.Translate("Drag the middle piece to form\na full line across the bottom.", {}, "Hex FRVR Tutorial step #1 text")), ut.y = 250, ut.x = -35), 1 == He && (new Tween(et[0].container, {
- alpha: 1
- }), new Tween(et[1].container, {
- alpha: .2
- }), new Tween(et[2].container, {
- alpha: .2
- }), ut = new G(Host.Localize.Translate("Perfect!", {}, "Hex FRVR Tutorial step #2 headline"), Host.Localize.Translate("Now let's get a combo bonus by\nmatching several lines at once!", {}, "Hex FRVR Tutorial step #2 text")), ut.y = 950, ut.x = -35), 2 == He && (new Tween(et[0].container, {
- alpha: 1
- }), new Tween(et[1].container, {
- alpha: 1
- }), ut = new G(Host.Localize.Translate("You got it!", {}, "Hex FRVR Tutorial step #2 headline"), Host.Localize.Translate("Now try to get the highest score you can.\nCollect coins to unlock themes!", {}, "Hex FRVR Tutorial step #3 text")), ut.y = 950, ut.x = -35, Z.completedTutorial.set(!0), setTimeout(function() {
- He++, D()
- }, 8e3)), 3 == He) Sidebar.showIcon(), new Tween(ut, {
- alpha: 0,
- y: ut.y + 100
- }, .5).call(function() {
- ut.parent.removeChild(ut), ut = null
- }), a.off("resize", U);
- else {
- ut.alpha = 0;
- var t = ut.y;
- ut.y += 100, new Tween(ut, {
- alpha: 1,
- y: t
- }, .5), Ce.addChild(ut)
- }
- if (dt.parent)
- if (Tween.clear(dt), dt.parent.addChild(dt), 0 == He) {
- dt.x = et[1].targetX + 35, dt.y = et[1].targetY + 35, dt.alpha = 0;
- var i = ke[6][3];
- new Tween(dt, {
- alpha: 1
- }, .3, Tween.easeInOut).call(function() {
- new Tween(dt, {
- x: Ce.x + i.x - 50,
- y: Ce.y + i.y
- }, 2, Tween.easeInOut).call(function() {
- new Tween(dt, {
- alpha: 0
- }, .3, Tween.easeInOut).call(U)
- })
- })
- } else if (1 == He) {
- dt.x = et[0].targetX + 35, dt.y = et[0].targetY + 35, dt.alpha = 0;
- var i = ke[0][2];
- new Tween(dt, {
- alpha: 1
- }, .3, Tween.easeInOut).call(function() {
- new Tween(dt, {
- x: Ce.x + i.x - 50,
- y: Ce.y + i.y
- }, 2, Tween.easeInOut).call(function() {
- new Tween(dt, {
- alpha: 0
- }, .3, Tween.easeInOut).call(U)
- })
- })
- } else he.removeChild(dt)
- }
- function U() {
- D(!0)
- }
- var H = a.Sound.get("i/s/pickup.mp3", 1),
- z = a.Sound.get("i/s/place.mp3", 1),
- W = a.Sound.get("i/s/placewrong.mp3", 1),
- N = [a.Sound.get("i/s/row1.mp3", .8), a.Sound.get("i/s/row2.mp3", .8), a.Sound.get("i/s/row3.mp3", .8), a.Sound.get("i/s/row4.mp3", .8), a.Sound.get("i/s/row5.mp3", .8), a.Sound.get("i/s/row6.mp3", .8), a.Sound.get("i/s/row7.mp3", .8), a.Sound.get("i/s/row8.mp3", .8), a.Sound.get("i/s/row9.mp3", .8), a.Sound.get("i/s/row10.mp3", .8)],
- j = a.Sound.get("i/s/gameover.mp3", .9),
- V = a.Sound.get("i/s/highscore.mp3", 1),
- Y = a.Sound.get("i/s/ding.mp3", .8);
- Sidebar.sounds.show = a.Sound.get("i/s/in.mp3", 1), Sidebar.sounds.hide = a.Sound.get("i/s/out.mp3", 1), Modal.sounds.button = a.Sound.get("i/s/click.mp3", 1);
- var X = [
- [a.Sound.get("i/s/voice_tier1_beautiful.mp3", .8), "Beautiful!"],
- [a.Sound.get("i/s/voice_tier1_goodjob.mp3", .8), "Good Job!"],
- [a.Sound.get("i/s/voice_tier2_gettinggood.mp3", .8), "Getting Good!"],
- [a.Sound.get("i/s/voice_tier2_ohyeah.mp3", .8), "Oh Yeah!"],
- [a.Sound.get("i/s/voice_tier3_gorgeous.mp3", .8), "Gorgeous!"],
- [a.Sound.get("i/s/voice_tier3_terrific.mp3", .8), "Terrific!"],
- [a.Sound.get("i/s/voice_tier4_genius.mp3", .8), "Genius!"],
- [a.Sound.get("i/s/voice_tier4_stunning.mp3", .8), "Stunning!"],
- [a.Sound.get("i/s/voice_tier5_fantastic.mp3", .8), "Fantastic!"],
- [a.Sound.get("i/s/voice_tier5_flabbergasting.mp3", .8), "Flabbergasting!"],
- [a.Sound.get("i/s/voice_tier6_astounding.mp3", .8), "Astounding!"],
- [a.Sound.get("i/s/voice_tier6_explosive.mp3", .8), "Explosive!"],
- [a.Sound.get("i/s/voice_tier7_incredible.mp3", .8), "Incredible!"],
- [a.Sound.get("i/s/voice_tier7_mindblowing.mp3", .8), "Mindblowing!"]
- ],
- K = a.Sound.get("i/s/coin.mp3", .5),
- q = a.Music.get("i/s/music.mp3", 1),
- Q = a.Music.get("i/s/menu.mp3", 1);
- a.backgroundMusic = q;
- var J, Z = {
- highscore: Host.Preferences.QuickInt("score.v1"),
- muteSounds: Host.Preferences.QuickBool("hex.sound.v6"),
- muteMusic: Host.Preferences.QuickBool("hex.music.v6"),
- state: Host.Preferences.QuickString("hex.state.v2"),
- coins: Host.Preferences.QuickInt("hex.coins.v1") || 0,
- unlocked: Host.Preferences.QuickString("hex.unlocked.v1"),
- selectedSkin: Host.Preferences.QuickString("hex.skin.v1"),
- completedTutorial: Host.Preferences.QuickBool("hex.tutorial.v1")
- };
- a.is.facebookInstant ? (console.log("Subscribing to FBInstantComplete"), Host.on("FBInstantComplete", function() {
- console.log("FBInstantComplete called"), Host.Localize.LoadInstantLanguage && Host.Localize.LoadInstantLanguage(), FBInstant.player.getDataAsync(["coins", "state", "highscore"]).then(function(e) {
- console.log("Got data from Facebook cloud", e), J = e;
- var t = h(e.state || "{}", Z.unlocked.get() || "{}"),
- i = t != Z.unlocked.get();
- Z.unlocked.set(t), i ? (console.log("Overwrote coins"), Z.coins.set(Math.max(parseInt(e.coins) || 0))) : (console.log("Merged coins"), Z.coins.set(Math.max(parseInt(e.coins) || 0, Z.coins.get() || 0))), _e.setValue(Z.coins.get()), o(parseInt(e.highscore) || 0)
- })
- })) : (a.loadConfig(l.id), s.login());
- var $ = .2,
- ee = Modal.ModalOverlayContent.expand(function() {
- Modal.ModalOverlayContent.call(this), this.addHeadline(Host.Localize.Translate("Game Over", {}, "Game over modal headline")), this.addLead(Host.Localize.Translate("Ouch, no more valid moves.", {}, "Game over modal text")), this.innerHeight = 250, this.blurClose = !1
- }),
- te = null;
- a.onParseLoginSuccess = function(e) {
- te = e, Z.coins.set(Math.max(parseInt(te.get("coins")) || 0, Z.coins.get() || 0)), _e.setValue(Z.coins.get());
- var t = h(te.get("state") || "{}", Z.unlocked.get() || "{}");
- Z.unlocked.set(t), o(parseInt(te.get("highscore")) || 0)
- };
- var ie = Modal.ModalOverlayContent.expand(function() {
- function e() {
- q.stop(0), q.play(0, !0), Modal.hide(function() {
- k()
- })
- }
- var i = this;
- Modal.ModalOverlayContent.call(i), i.addHeadline(Host.Localize.Translate("Final Score", {}, "Final score modal headline")), i.innerHeight = 570, i.blurClose = !1;
- var n = i.addButton(Host.Localize.Translate("Play Again", {}, "Button text for final score modal, asking users to play again"), e, 7463062),
- r = i.addTextBlock(0, 300, 500);
- r.scale.set(.5, .5), r.y = 135;
- var o = 0;
- Object.defineProperty(r, "score", {
- get: function() {
- return o
- },
- set: function(e) {
- o = e, this.setText(t(e >> 0))
- }
- });
- var a = r.scale.x,
- s = r.scale.x;
- new Tween(r, {
- score: ge
- }, 1, Tween.linary).wait(.3).call(function() {
- r.scale.set(1.1 * a, 1.1 * s), new Tween(r.scale, {
- x: a,
- y: s
- }, .3)
- });
- var h = i.addTextBlock(t(Z.highscore.get()), 60, 200);
- h.y = 310, h.x += 40;
- var l = new Sprite(embed("i/g/crown.svg"));
- l.tint = 0, l.y = 315, l.x = 400 - (h.width + 80) / 2, i.addChild(l), i.addMetaButton(405, {
- autoCallback: e
- }) && (i.innerHeight += 165, n && (n.y += 165))
- }),
- ne = [{
- id: "default",
- coinCost: 0,
- gradient: {
- type: "linear",
- stops: [
- [0, "#252525"],
- [1, "#202020"]
- ]
- },
- tileTexture: "i/g/tile.svg",
- textColor: "#FFFFFF",
- overlayColor: 16777215,
- buttonColor: 16777215,
- tileBackgroundTint: 11184810,
- tileColors: [13628289, 9014527, 7463062, 16746933, 16097903, 16768137, 15560057],
- removeColors: [16777215],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }, {
- id: "defaultbright",
- coinCost: 25,
- isLight: !0,
- gradient: {
- type: "linear",
- stops: [
- [0, "#ffffff"],
- [1, "#fffcf6"]
- ]
- },
- tileTexture: "i/g/lighttile.png",
- highlightTexture: "i/g/lighthighlight.png",
- backgroundTexture: "i/g/noise.png",
- textColor: "#656158",
- overlayColor: 6644056,
- buttonColor: 6644056,
- tileBackgroundTint: 11114096,
- tileColors: [10480225, 7326453, 5956793, 16088464, 16752481, 15980635, 16088558],
- removeColors: [13813423],
- shadowTints: [13694386, 12117498, 11465437, 16433097, 16765106, 16379055, 16433143]
- }, {
- id: "allwhite",
- coinCost: 100,
- gradient: {
- type: "linear",
- stops: [
- [0, "#333333"],
- [1, "#111111"]
- ]
- },
- backgroundTexture: "i/g/noise.png",
- tileTexture: "i/g/whitetile.png",
- textColor: "#EEEEEE",
- overlayColor: 15658734,
- buttonColor: 15658734,
- tileBackgroundTint: 8947848,
- tileColors: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215],
- removeColors: [15269815, 12106495, 11796428, 16758995, 16763819, 16771768, 16755892],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }, {
- id: "allblack",
- isLight: !0,
- coinCost: 100,
- gradient: {
- type: "linear",
- stops: [
- [0, "#EEEEEE"],
- [1, "#FFFFFF"]
- ]
- },
- backgroundTexture: "i/g/noise.png",
- tileTexture: "i/g/2tile.png",
- textColor: "#555555",
- overlayColor: 0,
- buttonColor: 5592405,
- tileBackgroundTint: 5592405,
- tileColors: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215],
- removeColors: [15269815, 12106495, 11796428, 16758995, 16763819, 16771768, 16755892],
- shadowTints: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215]
- }, {
- id: "sunset",
- storeId: "hexthemesunset",
- storeTitle: Host.Localize.Translate("Unlock Sunset Theme", {}, "In App Purcache for Sunset theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Sunset theme", {}, "In App Purcache for Sunset theme description"),
- coinCost: 200,
- gradient: {
- type: "linear",
- stops: [
- [0, "#f98887"],
- [.2, "#ef7e86"],
- [.4, "#d36b83"],
- [.6, "#a56482"],
- [.8, "#705f80"],
- [1, "#545c7d"]
- ]
- },
- backgroundTexture: "i/g/darkdot.png",
- tileTexture: "i/g/whitetile.png",
- textColor: "#EEEEEE",
- overlayColor: 15658734,
- buttonColor: 15658734,
- tileBackgroundTint: 16777215,
- tileColors: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215],
- removeColors: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }, {
- id: "earth",
- isLight: !0,
- storeId: "hexthemeearth",
- storeTitle: Host.Localize.Translate("Unlock Earth Theme", {}, "In App Purcache for Earth theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Earth theme", {}, "In App Purcache for Earth theme description"),
- coinCost: 200,
- gradient: {
- type: "linear",
- stops: [
- [1, "#c9e4b5"],
- [.8, "#aadab2"],
- [.6, "#71c6ac"],
- [.4, "#4aada5"],
- [.2, "#51737a"],
- [0, "#5a646a"]
- ]
- },
- backgroundTexture: "i/g/darkdot.png",
- tileTexture: "i/g/tile.svg",
- highlightTexture: "i/g/lighthighlight.png",
- textColor: "#384032",
- overlayColor: 3686450,
- buttonColor: 3686450,
- tileBackgroundTint: 16777215,
- tileColors: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215],
- removeColors: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }, {
- id: "neon",
- storeId: "hexthemeneon",
- storeTitle: Host.Localize.Translate("Unlock Neon Theme", {}, "In App Purcache for Neon theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Neon theme", {}, "In App Purcache for Neon theme description"),
- coinCost: 500,
- gradient: {
- type: "linear",
- width: 1,
- stops: [
- [0, "#202020"],
- [1, "#000000"]
- ]
- },
- tileTexture: "i/g/3tile.png",
- textColor: "#FFFFFF",
- overlayColor: 16777215,
- buttonColor: 16777215,
- tileBackgroundTint: 11184810,
- tileColors: [12776960, 6120703, 58998, 16734374, 16617244, 16766003, 16266578],
- removeColors: [16777215],
- shadowTints: [15269815, 12106495, 11796428, 16758995, 16763819, 16771768, 16755892]
- }, {
- id: "darkblue",
- storeId: "hexthemedarkblue",
- storeTitle: Host.Localize.Translate("Unlock Dark Blue Theme", {}, "In App Purcache for Dark Blue theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Dark Blue theme", {}, "In App Purcache for Dark Blue theme description"),
- coinCost: 750,
- gradient: {
- type: "linear",
- stops: [
- [0, "#093238"],
- [1, "#093238"]
- ]
- },
- tileTexture: "i/g/twotile.png",
- textColor: "#f5f2ec",
- overlayColor: 16118508,
- buttonColor: 16118508,
- tileBackgroundTint: 16777215,
- tileColors: [13748402, 2535072, 5615970, 15089728, 15050281, 15065897, 13910246],
- removeColors: [16777215],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }, {
- id: "pastel",
- storeId: "hexthemepastel",
- storeTitle: Host.Localize.Translate("Unlock Pastel Theme", {}, "In App Purcache for Pastel theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Pastel theme", {}, "In App Purcache for Pastel theme description"),
- coinCost: 1e3,
- isLight: !0,
- gradient: {
- type: "linear",
- stops: [
- [0, "#ffffff"],
- [1, "#b5f6f6"]
- ]
- },
- tileTexture: "i/g/5tile.png",
- backgroundTexture: "i/g/dots.png",
- highlightTexture: "i/g/5highlight.png",
- textColor: "#67625c",
- overlayColor: 6775388,
- buttonColor: 6775388,
- tileBackgroundTint: 6775388,
- tileColors: [15007655, 11843327, 9568182, 16757968, 16761502, 16771508, 16750753],
- removeColors: [16777215],
- shadowTints: [16777215, 16777215, 16777215, 16777215, 16777215, 16777215, 16777215]
- }, {
- id: "pixel",
- storeId: "hexthemepixel",
- storeTitle: Host.Localize.Translate("Unlock Pixel Theme", {}, "In App Purcache for Pixel theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Pixel theme", {}, "In App Purcache for Pixel theme description"),
- coinCost: 2e3,
- gradient: {
- type: "linear",
- stops: [
- [0, "#000000"],
- [1, "#000000"]
- ]
- },
- tileTexture: "i/g/4tile.png",
- textColor: "#FFFFFF",
- overlayColor: 16777215,
- buttonColor: 16777215,
- tileBackgroundTint: 11184810,
- tileColors: [12713787, 5001215, 1965927, 16731278, 16743726, 16762956, 16721209],
- removeColors: [16777215],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }, {
- id: "flower",
- coinCost: 2e3,
- storeId: "hexthemeflower",
- storeTitle: Host.Localize.Translate("Unlock Flower Theme", {}, "In App Purcache for Flower theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Flower theme", {}, "In App Purcache for Flower theme description"),
- gradient: {
- type: "radial",
- multiplier: 1.2,
- stops: [
- [.5, "#457c28"],
- [1, "#15320b"]
- ]
- },
- tileTexture: "i/g/6tile.png",
- backgroundTexture: "i/g/grass.png",
- highlightTexture: "i/g/6highlight.png",
- textColor: "#ffffff",
- overlayColor: 16777215,
- buttonColor: 16777215,
- tileBackgroundTint: 16777215,
- tileColors: [14286696, 8027903, 4259734, 16751558, 16754273, 16769933, 16741508],
- removeColors: [16777215],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }, {
- id: "gold",
- coinCost: 5e3,
- storeId: "hexthemegold",
- storeExclusive: !0,
- storeTitle: Host.Localize.Translate("Unlock Gold Theme", {}, "In App Purcache for Gold theme headline"),
- storeDescription: Host.Localize.Translate("Permanently unlock the Gold theme", {}, "In App Purcache for Gold theme description"),
- gradient: {
- type: "radial",
- multiplier: 1,
- stops: [
- [0, "#000000"],
- [1, "#000000"]
- ]
- },
- tileTexture: "i/g/7tile.png",
- backgroundTexture: "i/g/7texture.png",
- highlightTexture: "i/g/7highlight.png",
- textColor: "#ffffff",
- overlayColor: 16777215,
- buttonColor: 16777215,
- tileBackgroundTint: 16777215,
- tileColors: [11468544, 1279, 65363, 16711774, 16736256, 16756992, 16711703],
- removeColors: [16777215],
- shadowTints: [0, 0, 0, 0, 0, 0, 0]
- }],
- re = ne[0],
- oe = embed("i/g/tile.svg");
- stage.background.gradient = re.gradient;
- var ae = e(re.tileBackgroundTint),
- se = new Graphics;
- se.beginFill(16777215), se.drawRect(0, 0, 200, 200), stage.addChildAt(se, 1), se.alpha = 0;
- var he = new Container,
- le = 0,
- ce = 0,
- de = [{
- tiles: [
- [
- [1]
- ]
- ]
- }, {
- tiles: [
- [
- [1],
- [1, 1],
- [1]
- ],
- [
- [1, 1],
- [1, 1]
- ],
- [
- [1, 1],
- [, 1, 1]
- ]
- ]
- }, {
- tiles: [
- [
- [1],
- [, 1],
- [, 1],
- [, , 1]
- ],
- [
- [, 1],
- [, 1],
- [1],
- [1]
- ],
- [
- [1, 1, 1, 1]
- ]
- ]
- }, {
- tiles: [
- [
- [1],
- [1, 1],
- [, 1]
- ],
- [
- [1, 1],
- [, 1],
- [1]
- ],
- [
- [, 1],
- [1, 1, 1]
- ],
- [
- [1],
- [, 1, 1],
- [, 1]
- ],
- [
- [, 1],
- [, 1],
- [1, 1]
- ],
- [
- [1, 1, 1],
- [, 1]
- ]
- ]
- }, {
- tiles: [
- [
- [1, 1],
- [, 1],
- [, 1]
- ],
- [
- [, 1],
- [, 1, 1],
- [1]
- ],
- [
- [1, 1, 1],
- [, , 1]
- ],
- [
- [1],
- [, 1],
- [1, 1]
- ],
- [
- [, 1],
- [1, 1],
- [1]
- ],
- [
- [1],
- [1, 1, 1]
- ]
- ]
- }, {
- tiles: [
- [
- [1],
- [1],
- [1, 1]
- ],
- [
- [1, 1],
- [1],
- [1]
- ],
- [
- [1, 1],
- [1, , 1]
- ],
- [
- [1, 1],
- [, , 1],
- [, 1]
- ],
- [
- [, 1],
- [, , 1],
- [1, 1]
- ],
- [
- [1, , 1],
- [, 1, 1]
- ]
- ]
- }, {
- tiles: [
- [
- [1],
- [, 1, 1],
- [1]
- ],
- [
- [, 1],
- [1, 1],
- [, 1]
- ],
- [
- [1],
- [, 1, 1],
- [1]
- ]
- ]
- }],
- ue = new Container;
- ue.y = 155;
- var fe = new Text2("", {
- weight: 500,
- size: 50,
- fill: re.textColor
- });
- ue.addChild(fe);
- var pe = new Sprite(embed("i/g/crown.svg"));
- pe.tint = re.overlayColor, ue.addChild(pe);
- var ge = 0,
- ve = new Text2("0", {
- weight: 500,
- size: 300,
- fill: re.textColor
- });
- ve.scale.set(.5, .5), ve.anchor.set(.5, 0);
- var me = 0;
- Object.defineProperty(ve, "score", {
- get: function() {
- return me
- },
- set: function(e) {
- me = e, this.setText(t(e >> 0))
- }
- });
- var xe, we = 0,
- ye = new Text2("", {
- weight: 500,
- size: 10,
- fill: "#ffffff",
- dropShadow: !0
- }),
- be = !1,
- Te = Modal.ModalOverlayContent.expand(function(e) {
- Modal.ModalOverlayContent.call(this), this.blurClose = !1, this.addButton(Host.Localize.Translate("Close", {}, "Close button text for iAP Loading dialogue."), function() {
- Modal.hide()
- }, 7463062).y = 135, this.addHeadline(e), this.innerHeight = 335
- }),
- Ce = new Container,
- Se = Modal.ModalOverlayContent.expand(function() {
- function e(e) {
- var t = ne[e];
- if (0 == t.coinCost) return !0;
- var i = JSON.parse(Z.unlocked.get() || "{}");
- return 1 == i[t.id] || !(!t.storeId || !l[t.storeId]) && (i[t.id] = !0, Z.unlocked.set(JSON.stringify(i)), c(), !0)
- }
- function t(e, t, i) {
- return e + .05 * (Math.cos(30 * i) * Math.sin(i * Math.PI))
- }
- function i() {
- e(u) ? Modal.hide(function() {
- ne[u].id != re.id && A(ne[u])
- }) : new Tween(m, {
- rotation: 0
- }, 2, t)
- }
- function r() {
- function t() {
- f.save(), f.beginPath(), o(f, 0, 0, 600, 400, 15), f.clip(), f.fillStyle = "#000000", f.fillRect(0, 0, 600, 400), f.restore(), f.save(), f.beginPath(), o(f, 2, 2, 596, 396, 12), f.clip(), f.drawImage(s, 0, 0), f.restore()
- }
- u = Math.min(Math.max(u, 0), ne.length);
- var i = u;
- g.visible = 0 != i, v.visible = i != ne.length - 1, R && R.parent && R.parent.removeChild(R), R = _[i];
- var n = ne[i];
- if (y.setText(n.coinCost), n.coinCost > Z.coins.get() ? w.alpha = y.alpha = .4 : w.alpha = y.alpha = 1, b.visible = !1, e(i)) m.visible = !1, S.setColor(7463062);
- else if (m.visible = !0, S.setColor(14540253), b.x = 400, m.x = 400, n.storeId) {
- var r = h[n.storeId];
- r && (b.visible = !0, C.setText(r.priceLocaleString), n.storeExclusive ? m.visible = !1 : (b.x = 560, m.x = 240))
- }
- if (R) d.addChild(R);
- else {
- var s = document.createElement("canvas"),
- l = s.getContext("2d");
- s.width = 600, s.height = 400;
- var c = document.createElement("canvas"),
- f = c.getContext("2d");
- c.width = 600, c.height = 400, stage.background.drawBackground(l, 600, 400, n.gradient), t();
- var p = R = new Sprite(c);
- _[i] = R, R.anchor.set(.5, 0), d.addChild(R), L(n, function() {
- function e(e, t) {
- l.globalAlpha = .2, l.drawImage(a.getTintedTexture(o, n.tileBackgroundTint), 0, 0, 140, 155, e, t, 140, 155)
- }
- function r(e, t, i) {
- l.globalAlpha = 1, l.drawImage(a.getTintedTexture(o, i), 140, 0, 140, 155, e, t, 140, 155), n.highlightTexture && l.drawImage(embed(n.highlightTexture), 0, 0, 140, 155, e, t, 140, 155)
- }
- l.clearRect(0, 0, 600, 400), f.clearRect(0, 0, 600, 400), stage.background.drawBackground(l, 600, 400, n.gradient, n.backgroundTexture && embed(n.backgroundTexture));
- for (var o = new Sprite(embed(n.tileTexture)), s = [
- [6, 0, 3, 5, 0],
- [6, 3, 0, 5, 0],
- [6, 3, 2, 5, 5],
- [3, 2, 2, 0, 0]
- ], h = 0; h < 4; h++)
- for (var u = 0; u < 5; u++) {
- var g = s[h][u],
- v = -70 + 150 * u + h % 2 * 75,
- m = -77 + 130 * h;
- 0 == g ? e(v, m) : r(v, m, n.tileColors[g - 1])
- }
- t(), c.path = void 0;
- var x = new Sprite(c);
- x.anchor.set(.5, 0), R == p && (p.parent && p.parent.removeChild(p), d.addChild(x)), _[i] = p, p.texture.destroy()
- })
- }
- }
- function o(e, t, i, n, r, o) {
- n < 2 * o && (o = n / 2), r < 2 * o && (o = r / 2), e.beginPath(), e.moveTo(t + o, i), e.arcTo(t + n, i, t + n, i + r, o), e.arcTo(t + n, i + r, t, i + r, o), e.arcTo(t, i + r, t, i, o), e.arcTo(t, i, t + n, i, o), e.closePath()
- }
- var s = this,
- h = {},
- l = {};
- Modal.ModalOverlayContent.call(s), s.addHeadline(Host.Localize.Translate("Select theme", {}, "Hadline for Hex FRVR theme shop"));
- var d = new Container;
- s.addChild(d), d.x = 400, d.y = 160;
- var u = 0,
- p = 310,
- g = new Sprite(embed("i/g/shopbtn.svg"));
- g.anchor.set(.5, .5), s.addChild(g), g.x = 100, g.y = 360, g.on("down", function() {
- u--, r()
- });
- var v = new Sprite(embed("i/g/shopbtn.svg"));
- v.anchor.set(.5, .5), v.scale.set(-1, 1), s.addChild(v), v.x = 700, v.y = 360, v.on("down", function() {
- u++, r()
- });
- var m = new Container;
- m.x = 400, m.y = 560;
- var x = new Graphics;
- x.beginFill(13541206, 1), x.drawRoundedRect(0, 0, p, 100, 20), x.x = 0, x.y = 0, m.addChild(x);
- var w = new Sprite(embed("i/g/coin.svg"));
- w.x = 8 - p / 2, w.y = -42, w.scale.set(.8, .8), m.addChild(w);
- var y = new Text2("1000", {
- weight: 400,
- fill: "#FFFFFF",
- size: 70,
- maxWidth: 210,
- dropShadow: !0
- });
- y.anchor.set(.5, .5), m.addChild(y), y.x = 35, y.y = 0;
- var b = new Container;
- b.y = 560, b.visible = !1;
- var T = new Graphics;
- T.beginFill(6213499, 1), T.drawRoundedRect(0, 0, p, 100, 20), T.x = 0, T.y = 0, b.addChild(T);
- var C = new Text2("$14.99", {
- weight: 400,
- fill: "#FFFFFF",
- size: 70,
- maxWidth: 230
- });
- C.anchor.set(.5, .5), b.addChild(C), C.x = 0, C.y = 0;
- var S = s.addButton(Host.Localize.Translate("Select", {}, "Theme shop button text"), i, 7463062);
- S.y = 590, s.innerHeight -= 10, d.on("down", i), m.on("down", function() {
- var e = ne[u],
- t = e.coinCost,
- i = Z.coins.get();
- if (t <= i) {
- var n = JSON.parse(Z.unlocked.get() || "{}");
- n[e.id] = !0, Z.unlocked.set(JSON.stringify(n)), r(u), i -= t, _e.setValue(i), c()
- }
- });
- var M = function() {};
- b.on("down", function() {
- var e = ne[u];
- Modal.show(new Te(Host.Localize.Translate("Loading...", {}, "Loading overlay shown when buying in app items."))), n.iAPbuy(e.storeId), M = function(t) {
- t == e.storeId && f(e), M = function() {}
- }
- }), s.onShow = function(e) {
- if (e)
- for (var t = 0; t < ne.length; t++)
- if (ne[t] == e) {
- u = t;
- break
- }
- r()
- };
- var R, _ = [];
- if (r(u), s.setRatio = function(e) {
- T.width = x.width = e * p, T.x = x.x = -T.width / 2, T.y = x.y = -50 * e, T.height = x.height = 100 * e
- }, s.addChild(m), s.addChild(b), n.iAPGetProductInfo && n.iAPPaymentWrapper) {
- for (var E = [], P = 0; P < ne.length; P++) {
- var B = ne[P].storeId;
- B && (E.push(B), n.iAPPaymentWrapper(B, function(e, t) {
- l[e] = t, M(e)
- }))
- }
- E.length && n.iAPGetProductInfo(E, function(e) {
- h = e
- })
- }
- }),
- Me = new Se,
- Re = Container.expand(function() {
- var e = this;
- Container.call(e);
- var t = new Sprite(embed("i/g/btnoutline.png"));
- t.anchor.set(1, 0), t.tint = re.buttonColor, e.addChild(t);
- var i = new Sprite(embed("i/g/coin.svg"));
- i.anchor.set(1, 1), i.x = -20, e.addChild(i);
- var n = new Text2("", {
- weight: 300,
- fill: re.textColor,
- size: 80,
- maxWidth: 300
- });
- n.anchor.set(1, .5), n.x = -170, n.y = 77 - (a.devicePixelRatio > 1 ? 7 : 0), e.addChild(n), this.setValue = function(e) {
- Z.coins.set(e), n.setText(e.toString())
- }, this.getParticleData = function() {
- var e = Math.min(a.devicePixelRatio, 2) / 2;
- return {
- x: this.x - 18 / stage.ratio * a.devicePixelRatio,
- y: this.y + 17 / stage.ratio * a.devicePixelRatio,
- scale: e
- }
- }, this.setStyle = function() {
- t.tint = re.buttonColor, n.updateStyle({
- fill: re.textColor
- })
- };
- var r = this.forceSetRatio;
- this.forceSetRatio = function(e) {
- r.call(this, .25 * a.devicePixelRatio), this.move()
- }, this.move = function() {
- _e.y = 8 / stage.ratio * a.devicePixelRatio, _e.x = (width - 8) / stage.ratio * a.devicePixelRatio, i.y = 125 + (a.devicePixelRatio > 1 ? 0 : 10)
- }
- }),
- _e = new Re;
- stage.addChild(_e), _e.setValue(Z.coins.get()), _e.on("up", f);
- for (var Ee = Container.expand(function() {
- var e = this;
- Container.call(e);
- var i = new Sprite(embed("i/g/coin.svg"));
- i.anchor.set(.5, .5);
- var n = new Sprite(embed("i/g/glow.svg"));
- n.anchor.set(.5, .5), e.addChild(i), e.on("down", function() {
- if (!this.clicked && !$e) {
- K.play(), d(10, t(10), 10, e.x, e.y, !0, 0, !0), e.clicked = !0, e.y += he.y + Ce.y, e.x += he.x + Ce.x, stage.addChild(e), Tween.clear(n), n.parent && n.parent.removeChild(n), Tween.clear(e);
- var i = _e.getParticleData();
- new Tween(e.scale, {
- x: i.scale,
- y: i.scale
- }, .5), new Tween(e, {
- x: i.x,
- y: i.y,
- alpha: .8
- }).call(function() {
- new Tween(e, {
- alpha: 0
- }, .5), new Tween(e.scale, {
- x: 2 * i.scale,
- y: 2 * i.scale
- }, .5).call(function() {
- e.parent && e.parent.removeChild(e)
- }), _e.setValue(Z.coins.get() + 1), c()
- })
- }
- }), e.trigger = function() {
- e.addChildAt(n, 0), n.rotation = 0, new Tween(n, {
- rotation: 30
- }, 20)
- }
- }), Le = [], Ae = 0; Ae < 20; Ae++) Le[Ae] = new Ee;
- window.particleButton = _e;
- var Pe = Container.expand(function(e) {
- function t(e) {
- r = new Sprite(embed(e)), r.anchor.set(.5, .5), i.addChild(r), r.visible = 1 == n.frame
- }
- var i = this;
- Container.call(i);
- var n = new Sheet(oe, 140, 155);
- n.floorCoordinates = !1, i.addChild(n), n.anchor.set(.5, .5);
- var r;
- re.highlightTexture && t(re.highlightTexture), Object.defineProperty(i, "frame", {
- get: function() {
- return n.frame
- },
- set: function(e) {
- r && (r.visible = 1 == e), n.frame = e
- }
- }), Object.defineProperty(i, "tint", {
- get: function() {
- return n.tint
- },
- set: function(e) {
- n.tint = e
- }
- }), Object.defineProperty(i, "r", {
- get: function() {
- return (16711680 & n.tint) >> 16
- },
- set: function(e) {
- n.tint = 65535 & n.tint | e << 16
- }
- }), Object.defineProperty(i, "g", {
- get: function() {
- return (65280 & n.tint) >> 8
- },
- set: function(e) {
- n.tint = 16711935 & n.tint | e << 8
- }
- }), Object.defineProperty(i, "b", {
- get: function() {
- return 255 & n.tint
- },
- set: function(e) {
- n.tint = 16776960 & n.tint | e << 0
- }
- }), i.updateTileAsset = function(e, o, a, s, h) {
- function l() {
- i.removeChild(n), 0 == i.type && 0 == s ? c.tint = re.tileBackgroundTint : c.tint = re.tileColors[i.type - 1 + s], h || c.scale.set(0, 1), i.addChild(c), n = c, r && r.parent && r.parent.removeChild(r), o ? (t(o), h || r.scale.set(0, 1)) : r = void 0
- }
- var c = new Sheet(embed(e), 140, 155);
- c.tint = n.tint, c.frame = n.frame, c.tint = n.tint, c.anchor.set(.5, .5), c.floorCoordinates = !1, h ? l() : (r && new Tween(r.scale, {
- x: 0
- }, .25, Tween.easein).wait(a), new Tween(n.scale, {
- x: 0
- }, .25, Tween.easein).wait(a).call(function() {
- l(), new Tween(c.scale, {
- x: 1
- }, .25, Tween.easeout), r && new Tween(r.scale, {
- x: 1
- }, .25, Tween.easeout)
- }))
- }
- }),
- Be = 150,
- Ie = Be / 2,
- Fe = 133,
- ke = [];
- a.is.facebookInstant && Z.state.set(""), o(Z.highscore.get());
- var Oe = Z.state.get().split(":"),
- Ge = parseInt(Oe[0]) || 0;
- ge = Ge, ve.score = Ge;
- var De = (Oe[2] || "").split(","),
- Ue = (Oe[1] || "").split(","),
- He = 5;
- 0 != we || 0 != ge || Z.completedTutorial.get() || (He = 0, De = [4, 4, 0, 2, 2, 1, 1, 0, 0, 5, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 0, 0, 4, 4, 0, 0, 0, 0, 0], Ue = [2, 1, 4, 1, 3, 1]);
- for (var ze = 9, We = 4, Ne = 0, Ae = 0; Ae < ze; Ae++) {
- ke[Ae] = [];
- for (var je = Math.abs(We - Ae), Ve = 0; Ve < ze - je; Ve++) {
- var Ye = new Pe;
- Ye.x = je * Ie + Ve * Be + Ie, Ye.y = Ae * Fe + 73.5, Ye.tint = re.tileBackgroundTint, ke[Ae][Ve] = Ye, Ye.gridX = Ve, Ye.gridY = Ae, Ye.used = !1, Ye.type = 0, Ce.addChild(Ye);
- var Xe = parseInt(De[Ne++]) || 0;
- 0 !== Xe ? (Ye.type = Xe, Ye.used = !0, Ye.tint = re.tileColors[Xe - 1], Ye.frame = 1) : Ye.tint = re.tileBackgroundTint, Ye.alpha = x(Ye, Ae, Ve)
- }
- }
- for (var Ke = ke.concat([]), Ae = 0; Ae < ze; Ae++) {
- var qe = [],
- Qe = ke[We][Ae];
- for (qe.push(Qe); ke[Qe.gridY + 1] && ke[Qe.gridY + 1][Qe.gridX];) {
- var Qe = ke[Qe.gridY + 1][Qe.gridX];
- qe.push(Qe)
- }
- for (var Qe = ke[We][Ae]; ke[Qe.gridY - 1] && ke[Qe.gridY - 1][Qe.gridX - 1];) {
- var Qe = ke[Qe.gridY - 1][Qe.gridX - 1];
- qe.push(Qe)
- }
- Ke.push(qe)
- }
- for (var Ae = 0; Ae < ze; Ae++) {
- var qe = [],
- Qe = ke[We][Ae];
- for (qe.push(Qe); ke[Qe.gridY + 1] && ke[Qe.gridY + 1][Qe.gridX - 1];) {
- var Qe = ke[Qe.gridY + 1][Qe.gridX - 1];
- qe.push(Qe)
- }
- for (var Qe = ke[We][Ae]; ke[Qe.gridY - 1] && ke[Qe.gridY - 1][Qe.gridX];) {
- var Qe = ke[Qe.gridY - 1][Qe.gridX];
- qe.push(Qe)
- }
- Ke.push(qe)
- }
- var Je = 0,
- Ze = void 0;
- stage.on("move", function(e) {
- var t = e.event;
- if (void 0 !== Ze) {
- var i = t.getLocalPosition(stage);
- Ze.container.x = i.x / Ze.container.ratio - le, Ze.container.y = i.y / Ze.container.ratio - ce;
- for (var n = 0; n < ke.length; n++)
- for (var r = 0; r < ke[n].length; r++) {
- var o = ke[n][r];
- 0 == o.used && (o.tint = re.tileBackgroundTint), o.alpha = x(o, n, r)
- }
- T(Ze) && S(Ze)
- }
- });
- var $e = !1;
- stage.on("up", function(e) {
- e.event;
- if (Ze) {
- var t = Ze;
- if (T(t)) {
- z.play(0);
- var i = b(t);
- Ce.addChild(t.container), t.container.x -= Ce.x, t.container.y -= Ce.y, $e = !0, M(t, i), E(t);
- var n = Math.max(_(t, i), 1),
- r = n > 2;
- if (B()) {
- y(!0), Sidebar.hideIcon(), setTimeout(function() {
- q.setGain(0)
- }, .3 * n * 1e3), j.play(.3 * n);
- var s = .3 * n + .5 + .3 + (r ? .6 : 0);
- a.is.facebookInstant || (V.play(s + 2.7), Y.play(s + 2.7 + 1)), Q.play(s, !0), Q.setGain(0), setTimeout(function() {
- Q.setGain(1)
- }, 1e3 * s + 5e3), o(ge, !0)
- } else y();
- new Tween(t.container, {
- x: i.px - Be,
- y: i.py - Fe / 2
- }, .1), t.fadeDrop()
- } else t.fadeReset(), W.play(0), Ze = void 0, O()
- }
- Ze = void 0
- });
- for (var et = [], Ae = 0; Ae < 3; Ae++) Ue[2 * Ae] ? et[Ae] = R(parseInt(Ue[2 * Ae]) - 1, parseInt(Ue[2 * Ae + 1]) - 1) : et[Ae] = R(), he.addChild(et[Ae].container);
- if (Sidebar.addMenuHeader(l.shareTitle), !a.is.facebookInstant) var tt = Sidebar.addMenuItem(new Sprite(embed("i/g/icon_new.svg")), Host.Localize.Translate("New Game", {}, "New game sidebar text"), function() {
- Sidebar.hide(), y(!0), k()
- });
- var tt = Sidebar.addMenuItem(new Sprite(embed("i/g/icon_shop.svg")), Host.Localize.Translate("Select theme", {}, "Sidebar text for theme shop"), function() {
- Sidebar.hide(), f()
- });
- a.is.facebookInstant || a.is.wildTangent || Sidebar.addMenuItem(new Sprite(embed("i/g/icon_share.svg")), Host.Localize.Translate("Share Hex FRVR", {}, "Sidebar text for triggering sharing of Hex FRVR"), function() {
- window.shareDialogueCallback()
- }), Sidebar.addMenu, window.insertButton = function(e, t, i) {
- if (!(e instanceof Sprite)) throw "Please update your code to use the new SVG icons: " + t;
- return Sidebar.addMenuItemAfter(tt, e, t, i)
- };
- var it = void 0;
- a.insertRemoveAdsButton = function(e, t, i) {
- it = insertButton(e, t, i)
- }, a.removeAdsButton = function() {
- it && (Sidebar.removeMenuItem(it), Sidebar.reAlignItems(), it = void 0)
- }, Sidebar.addMenuHeader(Host.Localize.Translate("Settings", {}, "Sidebar settings headline")), a.Sound.setMuted(Z.muteSounds.get()), Sidebar.addMenuToggle(new Sprite(embed("i/g/icon_sound.svg")), Host.Localize.Translate("Sound Effects", {}, "Sidebar sound effects toggle text"), !a.Sound.muted, function(e) {
- a.Sound.setMuted(!e), Z.muteSounds.set(!e)
- }), a.Music.setMuted(Z.muteMusic.get());
- var nt = Sidebar.addMenuToggle(new Sprite(embed("i/g/icon_music.svg")), Host.Localize.Translate("Music", {}, "Sidebar music effects toggle text"), !a.Music.muted, function(e) {
- a.Music.setMuted(!e), e ? q.play(0, !0) : (Q.stop(0), q.stop(0)), Z.muteMusic.set(!e)
- }, 235);
- if (a.is.iOS || a.is.safari) {
- var rt = Sprite.fromSheet(new Sprite(embed("i/g/icon_download.svg")), 18);
- rt.x = 320, rt.y = 15, rt.on("down", function(e) {
- Sidebar.content.callback = void 0, Sidebar.content.clean(), a.navigate("https://itun.es/us/7Iy7-")
- }), nt.addChild(rt)
- }! function() {
- var e = Z.selectedSkin.get();
- if ("" != e) {
- stage.visible = !1;
- for (var t = 0; t < ne.length; t++) {
- var i = ne[t];
- if (i.id == e) return void A(i, !0)
- }
- A(ne[0], !0)
- }
- }(), a.is.facebookInstant || (Sidebar.addMenuHeader(Host.Localize.Translate("More", {}, "Sidebar headline text for more FRVR related content")), a.is.wildTangent || (Sidebar.addMenuItem(new Sprite(embed("i/g/icon_frvr.svg")), Host.Localize.Translate("FRVR Games", {}, "Sidebar text for FRVR Games link"), function() {
- a.is.iOS ? a.navigate("https://itunes.apple.com/developer/frvr/id911820974") : a.navigate("https://frvr.com")
- }), Sidebar.addMenuItem(new Sprite(embed("i/g/icon_feedback.svg")), Host.Localize.Translate("Send Feedback", {}, "Sidebar text for sending games feedback"), function() {
- a.navigate(l.feedbackURL)
- })), Sidebar.addMenuItem(new Sprite(embed("i/g/icon_legal.svg")), Host.Localize.Translate("Legal", {}, "Sidebar link for more legal information"), function() {
- a.navigate("https://frvr.com/legal/")
- }), Sidebar.addMenuItem(new Sprite(embed("i/g/icon_credits.svg")), Host.Localize.Translate("Credits", {}, "Sidebar link for game credits link"), function() {
- a.navigate(l.creditsUrl)
- }), a.is.wildTangent || Sidebar.addSocialBar()), stage.addChild(ve), stage.addChild(ue), he.addChild(Ce), stage.addChild(he);
- var ot = 0,
- at = 0,
- st = null;
- if (a.is.facebookInstant && window.FBInstant) {
- var ht = new Image;
- ht.onload = function() {
- st = ht
- }, ht.src = "./i/g/instantoverlay.png"
- }
- var lt = !1;
- window.showGameOver = function() {
- if (a.is.facebookInstant && window.FBInstant) {
- if (lt) return;
- lt = !0;
- var e = width / height,
- i = 1480,
- n = e > 0 ? i : i / e,
- r = e > 0 ? i / e : i,
- o = document.createElement("canvas");
- o.style.width = (o.width = n) + "px", o.style.height = (o.height = r) + "px";
- var s = o.getContext("2d");
- stage.background.drawBackground(s, o.width, o.height, stage.background.gradient, stage.background.texture, stage.background.callback);
- var h = Ce.ratio;
- Ce.ratio = 1;
- var l = -Ce.y - 20 + (r - i) / 2;
- s.save(), s.translate(-Ce.x - 70 + (n - i) / 2, l), Ce.cacheRender(s), Ce.ratio = h, s.restore();
- var c = t(ge),
- d = 500 - 50 * Math.max(c.length - 5, 0);
- s.globalAlpha = 1, s.textAlign = "center", s.textBaseline = "middle", s.font = "500 " + d + 'px "Helvetica Neue","Trebuchet MS", Helvetica, sans-serif';
- for (var u = 0; u < 5; u++) s.lineWidth = 50 - 3 * u, s.strokeStyle = "rgba(0,0,0,.3)", s.strokeText(c, o.width / 2, l + 1e3);
- if (s.fillStyle = "#FFFFFF", s.fillText(c, o.width / 2, l + 1e3), st) {
- var e = Math.min(1, (r / 2 - 600) / st.height);
- e > .5 && s.drawImage(st, 75 + st.width * (1 - e) / 2, 0, st.width * e, st.height * e)
- }
- if (r > 1550) {
- var h = ue.ratio;
- ue.ratio = 2, s.save(), s.translate(-ue.x + n / 2 - ue.width / 2, -ue.y + r - ue.height - 20), ue.cacheRender(s), ue.ratio = h, s.restore()
- }
- var f = document.createElement("canvas");
- f.style.width = (f.width = width) + "px", f.style.height = (f.height = height) + "px";
- f.getContext("2d").drawImage(o, 0, 0, width, height), FBInstant.setScore(ge), FBInstant.sendScreenshot(f.toDataURL());
- FBInstant.endGameAsync().then(function() {
- lt = !1, q.stop(0), q.play(0, !0), Modal.hide(function() {
- k()
- })
- }, function(e) {})
- } else Modal.show(new ie, !(!a.is.facebookInstant || !window.FBInstant)), a.showGameOverAd(600), a.emit("wiggle", {
- delay: 1e3
- })
- }, a.showRateGame = function() {
- Modal.show(new Modal.RateGameModal(embed("i/g/star.svg"), 9014527))
- };
- var ct = Modal.ModalOverlayContent.expand(function(e, t) {
- function i(e) {
- o.visible = !0;
- var t = 0;
- o.y = 430 + t, a.visible = !0, r.innerHeight = 760 + t, Modal.setHeight(r.innerHeight), Modal.handleResize(), a.y = 560 + t, r.addChildAt(a, 0)
- }
- function n(t) {
- var n = new Sheet(e, 136, 130);
- return n.y = 270, n.x = 150 * h + 30, n.on("down", function() {
- for (var e = 0; e < 5; e++) s[e].frame = e <= t ? 1 : 0;
- i(t)
- }), n.buttonMode = !0, n
- }
- Modal.ModalOverlayContent.call(this), this.addHeadline(Host.Localize.Translate("Having Fun?")), this.addLead(Host.Localize.Translate("Help us improve the game!\nHow would you rate {game_name}?", {
- game_name: l.shareTitle
- }), 10);
- var r = this,
- o = r.addMiddleButton(Host.Localize.Translate("Share {game_name}", {
- game_name: l.shareTitle
- }), Host.Localize.Translate("Invite your friends?"), function() {
- window.shareDialogueCallback(), Modal.hide()
- }, 6208638);
- o.y = 580, o.visible = !1;
- var a = r.addButton(Host.Localize.Translate("No thanks"), function() {
- Modal.hide()
- }, t);
- a.visible = !1;
- for (var s = [], h = 0; h < 5; h++) s.push(this.addChild(n(h)));
- this.innerHeight = 450, this.blurClose = !1
- });
- if (a.showRateTwitter = function() {
- Modal.show(new ct(embed("i/g/star.svg"), 9014527))
- }, window.reset = k, a.on("resize", P), 0 == He) {
- G.prototype = Object.create(Container.prototype), G.prototype.constructor = G, Sidebar.hideIcon();
- var dt = new Sprite(embed("i/g/finger.svg"));
- he.addChild(dt);
- var ut, ft = -1;
- a.on("resize", U), D()
- }
- window.Social && window.Social(), ga("send", "event", "Hex", "Loaded", "Load Time", 1 * new Date - initTime), F()
- }
- Host = function() {
- function e(e, t, i) {
- var n = this;
- n.translated = t, n.replacements = i, n.original = e, n.toString = function() {
- return n.translated
- }
- }
- var t = {},
- n = window.Host || {};
- n.call = function(e, i, r) {
- null != r && (callbackId = "cb" + Math.round(99999 * Math.random()) + (new Date).getTime(), t[callbackId] = r, i._callback = callbackId), i._method = e, n.sendToHost("json1:" + JSON.stringify(i))
- }, n.callResult = function(e) {
- var i = e.indexOf(":");
- if (i > 0) {
- var n = e.substring(0, i),
- r = e.substring(i + 1);
- switch (n) {
- case "json1":
- var o = JSON.parse(r),
- a = t[o._callback];
- a && (delete o._callback, a(o))
- }
- }
- }, n.Application = {}, n.Application.SetStatusbarColor = function(e) {}, n.Preferences = {}, n.Preferences.cache = {}, n.Preferences.QuickBool = function(e) {
- return {
- get: function() {
- return n.Preferences.cache[e] || !1
- },
- set: function(t) {
- n.Preferences.SetBool(e, t)
- },
- remove: function() {
- n.Preferences.Remove(e)
- }
- }
- }, n.Preferences.QuickInt = function(e) {
- return {
- get: function() {
- return parseInt(n.Preferences.cache[e]) || 0
- },
- set: function(t) {
- n.Preferences.SetInt(e, t)
- },
- remove: function() {
- n.Preferences.Remove(e)
- }
- }
- }, n.Preferences.QuickFloat = function(e) {
- return {
- get: function() {
- return parseFloat(n.Preferences.cache[e]) || 0
- },
- set: function(t) {
- n.Preferences.SetFloat(e, t)
- },
- remove: function() {
- n.Preferences.Remove(e)
- }
- }
- }, n.Preferences.QuickString = function(e) {
- return {
- get: function() {
- return n.Preferences.cache[e] || ""
- },
- set: function(t) {
- n.Preferences.SetString(e, t)
- },
- remove: function() {
- n.Preferences.Remove(e)
- }
- }
- }, n.Tools = {}, n.Tools.LoadJSON = function(e, t, i) {
- var n = new XMLHttpRequest;
- n.crossOrigin = "anonymous", n.overrideMimeType && n.overrideMimeType("application/json");
- try {
- n.open("GET", e, !0), n.onreadystatechange = function() {
- 4 == n.readyState && ("200" == n.status ? t(JSON.parse(n.responseText)) : (n = n.onreadystatechange = null, i && i()))
- }, n.send(null)
- } catch (e) {}
- }, n.Web = {}, n.Web.GetQueryString = function(e) {
- var t = window.location.href;
- e = e.replace(/[\[\]]/g, "\\$&");
- var i = new RegExp("[?&]" + e + "(=([^&#]*)|&|#|$)", "i"),
- n = i.exec(t);
- return n ? n[2] ? decodeURIComponent(n[2].replace(/\+/g, " ")) : "" : null
- }, n.Localize = n.Localize || {}, n.Localize.Translations = {
- en: {}
- };
- var r = {},
- o = !1;
- return n.Localize.UpdateChildren = function(e) {
- if (o)
- for (var t in e.children) {
- var i = e.children[t];
- i instanceof Text2 ? i.onLanguageChange() : i instanceof Container && n.Localize.UpdateChildren(i)
- }
- }, n.Localize.Load = function(e, t) {
- return o = !0, n.Localize.Translations[e] ? (r = n.Localize.Translations[e], Text2.onLanguageChange(), a.emit("pre-screenshot"), t && t(e, !0), !0) : (n.Tools.LoadJSON("./languages/" + e + ".json", function(i) {
- r = n.Localize.Translations[e] = i;
- for (key in i) {
- var o = i[key],
- s = key.replace(/\\n/g, "\n");
- s != key && (delete i[key], o.translation = o.translation.replace("\\n", "\n"), i[s] = o)
- }
- Text2.onLanguageChange(), a.emit("pre-screenshot"), t && t(e, !0)
- }, function() {
- console.log("failed to load language")
- }), !1)
- }, n.Localize.languages = n.Localize.languages || [], n.Localize.Test = function() {
- var e = 0,
- t = window.onkeydown;
- window.onkeydown = function(i) {
- var r = i.keyCode;
- 37 == r && (e -= 1), 39 == r && (e += 1), e += n.Localize.languages.length, e %= n.Localize.languages.length, n.Localize.Load(n.Localize.languages[e]), t && t(i)
- }
- }, n.Localize.Translate = function(t, i) {
- var n = t;
- if (t instanceof e) {
- n = t.original;
- var o = {};
- for (var a in t.replacements) o[a] = t.replacements[a];
- for (var a in i) o[a] = i[a];
- i = o
- }
- t = r[n] ? r[n].translation : n;
- for (var a in i) t = t.replace("{" + a + "}", i[a]);
- return new e(n, t, i)
- }, n.Localize.GetLanguage = function() {
- var e = window.navigator;
- if (Array.isArray(e.languages))
- for (i = 0; i < e.languages.length; i++)
- if (language = e.languages[i], language && language.length) return language;
- var t = ["language", "browserLanguage", "systemLanguage", "userLanguage"];
- for (i = 0; i < t.length; i++)
- if (language = e[t[i]], language && language.length) return language;
- return "en"
- }, n.Type = "undefined", n
- }(),
- function(e) {
- e.Host = e.Host || {}, Host.Type = "instant", Host.Log = function(e) {
- console.log(e)
- }, Host.sendToHost = function() {};
- var t = function() {
- var e = {};
- return function() {
- try {
- return "localStorage" in window && null !== window.localStorage
- } catch (e) {
- return !1
- }
- }() ? {
- set: function(t, i) {
- e[t] = i;
- try {
- localStorage.setItem(t, i)
- } catch (e) {}
- },
- get: function(t) {
- return e[t] || localStorage.getItem(t)
- },
- remove: function(t) {
- delete e[t], localStorage.removeItem(t)
- }
- } : {
- set: function(t, i) {
- e[t] = i
- },
- get: function(t) {
- return e[t]
- },
- remove: function() {
- delete e[name]
- }
- }
- }();
- Host.Preferences = Host.Preferences || {}, Host.Preferences.SetBool = function(e, i) {
- Host.Preferences.cache[e] = i ? "true" : "false", t.set(e, i ? "true" : "false")
- }, Host.Preferences.SetInt = function(e, i) {
- Host.Preferences.cache[e] = i, t.set(e, i)
- }, Host.Preferences.SetFloat = function(e, i) {
- Host.Preferences.cache[e] = i, t.set(e, i)
- }, Host.Preferences.SetString = function(e, i) {
- Host.Preferences.cache[e] = i, t.set(e, i)
- }, Host.Preferences.Remove = function(e) {
- delete Host.Preferences.cache[e], t.remove(e)
- }, Host.Preferences.GetBool = function(e, i) {
- i(Host.Preferences.cache[e] = "true" == t.get(e))
- }, Host.Preferences.GetInt = function(e, i) {
- i(Host.Preferences.cache[e] = parseInt(t.get(e)))
- }, Host.Preferences.GetFloat = function(e, i) {
- i(Host.Preferences.cache[e] = parseFloat(t.get(e)))
- }, Host.Preferences.GetString = function(e, i) {
- i(Host.Preferences.cache[e] = t.get(e))
- }, Host.Localize.Translate = Host.Localize.Translate || {}, Host.Localize.Translate.GetString = function(e) {
- return Lang[e] || "!!No translation found!!"
- }, Host.Localize.LoadInstantLanguage = function() {
- var e = Host.Localize.facebook_language_map || [],
- t = e[FBInstant.locale];
- t && "en-US" != t && (console.log("Found language!", t), Host.Localize.Load(t))
- }
- }(this), window.vpath = window.vpath || "./", document.body.addEventListener("MSHoldVisual", function(e) {
- e.preventDefault()
- }, !1), document.body.addEventListener("contextmenu", function(e) {
- e.preventDefault()
- }, !1),
- function(e) {
- var t = escape;
- e.escape = function(e) {
- return console.warn("escape is deprecated, please update to encodeURI"), t(e)
- }, window.encodeURI = window.encodeURI || t
- }(window);
- var o = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function(e) {
- return setTimeout(e, 10)
- };
- window.ga || (window.ga = function() {}), Math.seed = function(e) {
- var t = e,
- i = 426381559378,
- n = 4294967295;
- return function() {
- i = 18e3 * (65535 & i) + (i >> 16) & n, t = 36969 * (65535 & t) + (t >> 16) & n;
- var e = (i << 16) + t & n;
- return e /= 4294967296, e + .5
- }
- }, Object.defineProperty(Object.prototype, "on", {
- enumerable: !1,
- get: function() {
- return this._on || t
- },
- set: function(e) {
- this._on = e
- }
- }), Object.defineProperty(Object.prototype, "emit", {
- enumerable: !1,
- value: function(e, t) {
- for (var i = (this.__listeners || {})[e] || [], n = 0; n < i.length; n++) i[n].call(this, t);
- return this
- }
- }), Object.defineProperty(Object.prototype, "off", {
- enumerable: !1,
- value: function(e, t) {
- for (var i = (this.__listeners || {})[e] || [], n = 0; n < i.length; n++) i[n] !== t && void 0 !== t || i.splice(n--, 1);
- return i.length || delete(this.__listeners || {})[e], this.emit("eventRemoved", {
- eventName: e
- }), this
- }
- }), Object.defineProperty(Object.prototype, "once", {
- enumerable: !1,
- value: function(e, t) {
- function i(n) {
- t.call(this, n), this.off(e, i)
- }
- return this.on(e, i), this
- }
- }), Object.defineProperty(Function.prototype, "expand", {
- enumerable: !1,
- value: function(e) {
- return e.prototype = Object.create(this.prototype), e.prototype.constructor = e, e
- }
- });
- var a = {};
- ! function(t) {
- function i(e, t, i) {
- window.dirty = !0, e.emit("down", {
- event: t,
- isMouseEvent: i
- })
- }
- function n(e) {
- P = !0, this.mousedown = void 0, i(this, e, !1)
- }
- function r(e) {
- P || i(this, e, !0)
- }
- function s(e) {
- e.interactive = !0, e.__touchStartEnabled || (e.__touchStartEnabled = !0, e.touchstart = n, e.mousedown = r)
- }
- function h(e, t, i) {
- window.dirty = !1, e.emit("up", {
- event: t,
- isMouseEvent: i
- }), a.backgroundMusic && a.backgroundMusic.play(0, !0)
- }
- function c(e) {
- P = !0, this.mouseup = void 0, h(this, e, !1)
- }
- function d(e) {
- P || h(this, e, !0)
- }
- function u(e) {
- e.interactive = !0, e.__touchEndEnabled || (e.__touchEndEnabled = !0, e.mousedown = e.mousedown || function() {}, e.touchstart = e.touchstart || function() {}, e.touchendoutside = e.touchend = c, e.mouseupoutside = e.mouseup = d)
- }
- function f(e, t, i) {
- e.emit("move", {
- event: t,
- isMouseEvent: i
- })
- }
- function p(e) {
- P = !0, this.mouseup = void 0, f(this, e, !1)
- }
- function g(e) {
- P || f(this, e, !0)
- }
- function v(e) {
- e.interactive = !0, e.__touchMoveEneabled || (e.__touchMoveEneabled = !0, e.touchmove = p, e.mousemove = g)
- }
- function m(e) {
- e.on("eventAttached", function(t) {
- switch (t.eventName) {
- case "down":
- s(e);
- break;
- case "up":
- u(e);
- break;
- case "move":
- v(e)
- }
- })
- }
- function x(e, t) {
- for (; t < .5;) e = x(e, .5), t /= .5;
- I *= t, I += 2, scaleCanvas = B[F++ % 2];
- var i = Math.ceil(e.width * t),
- n = Math.ceil(e.height * t);
- return scaleCanvas.width = i + 4, scaleCanvas.height = n + 4, scaleCanvas.ctx.clearRect(0, 0, scaleCanvas.width, scaleCanvas.height), scaleCanvas.ctx.drawImage(e, 0, 0, e.width, e.height, 2, 2, i, n), scaleCanvas
- }
- function w(e, t, i) {
- if (I = 2, 1 === t) return e;
- var n = Math.round(e.width * t) + 4,
- r = Math.round(e.height * t) + 4,
- o = x(e, t);
- return I = Math.round(I) - 2, i || (i = document.createElement("canvas")), i.width = n, i.height = r, i.getContext("2d").clearRect(0, 0, n, r), i.getContext("2d").drawImage(o, 0, 0, o.width, o.height, -I, -I, o.width, o.height), i
- }
- function y(e) {
- e.prototype._x = 0, e.prototype._y = 0, Object.defineProperty(e.prototype, "x", {
- get: function() {
- return this._x
- },
- set: function(e) {
- this._x = e, this.position.x = e * (this.parent ? this.parent.ratio || 1 : 1)
- }
- }), Object.defineProperty(e.prototype, "y", {
- get: function() {
- return this._y
- },
- set: function(e) {
- this._y = e, this.position.y = e * (this.parent ? this.parent.ratio || 1 : 1)
- }
- }), e.prototype._ratio = void 0, e.prototype.lockRatio = !1, e.prototype.forceSetRatio = function(e) {
- if (this._ratio !== e)
- if (!isNaN(e) && (e > 0 || e == -1)) {
- this._ratio = e, this.x = this.x, this.y = this.y;
- for (var t = 0; t < this.children.length; t++) this.children[t].ratio = e;
- this.setRatio && this.setRatio(e)
- } else console.warn("Invalid value passed to Container forceSetRatio " + e)
- }, e.prototype.inside = function(e, t, i) {
- return !1
- }, e.prototype._addChildAt = e.prototype.addChildAt, e.prototype.addChildAt = function(e, t) {
- var i = this._addChildAt(e, t);
- return void 0 != this.ratio && (e.ratio = this.ratio), i
- }, e.prototype._removeChildAt = e.prototype.removeChildAt, e.prototype.removeChildAt = function(e) {
- var t = this._removeChildAt(e);
- return t && this.ratio && (t.ratio = -1), t
- }, Object.defineProperty(e.prototype, "ratio", {
- get: function() {
- return this._ratio
- },
- set: function(e) {
- this._ratio === e || this.lockRatio || this.forceSetRatio(e)
- }
- })
- }
- function b(e) {
- return "//" != e.substring(0, 2) && "http" != e.substring(0, 4) && (e = vpath + e), e
- }
- function T() {
- var e = (new Date).getTime();
- if (Z) {
- var t = e - Q;
- J[t] = (J[t] || 0) + 1, Q = e
- }
- for (e - q > 5e3 && (q = e); q < e; q += K) Y.tick();
- (window.dirty || window.dirtyOnce || 0 !== Y.tweens.length) && (window.dirtyOnce = !1, a.renderer.render(a.stageContainer)), o(T)
- }
- function C(e, t, i) {
- return void 0 === e ? e : e.toString() === e && "%" == e[e.length - 1] ? t * (parseInt(e.substring(0, e.length - 1)) / 100) : e * i
- }
- function S(e) {
- stage.background.disabled ? stage.removeChild(te) : (e || ie != width || ne != height) && a.initComplete && (ie = width, ne = height, $.width = width * a.devicePixelRatio + 5, $.height = height * a.devicePixelRatio + 5, stage.background.drawBackground(ee, $.width, $.height, stage.background.gradient, stage.background.texture, stage.background.callback), te.texture.destroy(!0), te.setTexture(new Texture.fromCanvas($)), te.y = -a.styles.margins.top * a.devicePixelRatio, window.dirtyOnce = !0)
- }
- function M() {
- var e = document.documentElement.clientHeight;
- return a.is.iOS && !a.is.facebookInstant && (e = window.innerHeight || e), Math.max(e, 100)
- }
- function R(e) {
- function i() {
- window.scrollTo(0, 0), a.renderer.resize(h, l), a.renderer.view.style.width = (h / s >> 0) + "px", a.renderer.view.style.height = (l / s >> 0) + "px", window.dirtyOnce = !0, window.scrollTo(0, 0)
- }
- clearTimeout(oe);
- var n = e.instant,
- r = e.forced_width,
- o = e.forced_height,
- s = a.devicePixelRatio;
- t.width = Math.max(document.documentElement.clientWidth, 100), t.height = M(), void 0 !== r && (t.width = r), void 0 !== o && (t.height = o), window.scrollTo(0, 1);
- var h = 2 * Math.ceil(t.width / 2) * s >> 0,
- l = 2 * Math.ceil(t.height / 2) * s >> 0;
- a.is.iOS && !n && (a.renderer.view.style.height = (l / s >> 0) + 1 + "px"), n ? i() : oe = setTimeout(i, a.is.iOS ? 250 : 25);
- var c = Math.max(t.height - a.styles.margins.top - a.styles.margins.bottom, 10),
- d = targetWidth,
- u = targetHeight,
- f = stage.orientation;
- "dynamic" == stage.orientationMode && (f = t.width <= c ? "portrait" : "landscape"), "portrait" == f && (u = targetWidth, d = targetHeight);
- var p = window.forceRatio ? 1 : Math.min(Math.min(t.width * s / d, c * s / u), 1);
- e.forced && (stage.ratio = -1), stage.ratio == p && stage.orientation == f || (stage.ratio = p), t.gameHeight = c, a.resizeAd(), stage.y = a.styles.margins.top * s, stage.orientation = f, document.title = document.title
- }
- var _ = e();
- e = void 0, t.width = 150, t.height = 150, a.modulesToPreload = [], a.ignoreCursorChanges = !1, a.is = new function(e, t, i, n) {
- var r = this;
- r.android = /(android)/i.test(i) && !/(Windows)/i.test(i), r.iOS = /(ipod|iphone|ipad)/i.test(i), r.firefoxMobile = /(Mobile)/i.test(i) && /(Firefox)/i.test(i), r.windowsMobile = /(IEMobile)/i.test(i), r.silk = /(silk)/i.test(i), r.clay = /(clay\.io)/i.test(n), r.facebookApp = /(fb_canvas)/i.test(n), r.facebookAppWeb = /(fb_canvas_web)/i.test(n), r.iframed = e.top !== e.self, r.standalone = "standalone" in t && t.standalone, r.mobileiOSDevice = i.match(/iPhone/i) || i.match(/iPod/i), r.kongregate = /(kongregateiframe)/i.test(n), r.kik = /(kik_canvas)/i.test(n), r.twitter = /(twitter)/gi.test(i), r.chrome = /Chrome\//.test(i), r.wildTangent = !1, r.safari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/), r.secureConnection = 0 == window.location.protocol.indexOf("https"), r.facebookInstant = window.Host && "instant" == window.Host.Type, r.mobile = r.android || r.windowsMobile || r.iOS || r.silk || r.firefoxMobile, r.iOSWrapper = e.iOSWrapper || !1, r.androidWrapper = e.androidWrapper || !1, r.chromeWrapper = e.isChromeWrapper || !1, r.appWrapper = e.iOSWrapper || e.androidWrapper
- }(window, navigator, navigator.userAgent, document.location), window.insertButton = function(e, t, i) {
- console.warn("window.insertButton needs to be overwritten before releasing this game.")
- }, a.canvas = document.getElementById("gameCanvas"), a.stageContainer = new _.Stage(2105376), m(a.stageContainer), a.stageContainer.on("up", function(e) {
- a.stageContainer.emit("stageup", e)
- }), window.inScreenshotMode ? a.renderer = new _.CanvasRenderer(width, height, {
- view: a.canvas,
- antialiasing: !1,
- transparent: !1,
- clearBeforeRender: !0
- }) : a.renderer = _.autoDetectRenderer(width, height, {
- view: a.canvas,
- antialiasing: !1,
- transparent: !1,
- clearBeforeRender: !0
- }), a.httpPrefix = 0 == window.location.protocol.indexOf("http") ? "//" : "https://", a.devicePixelRatio = Math.min(window.devicePixelRatio || 1, a.is.iOS ? 3 : 2), a.styles = {
- margins: {
- top: (a.is.iOSWrapper || a.is.standalone) && a.is.iOS ? 20 : 0,
- bottom: 0
- }
- }, a.onParseLoginSuccess = function(e) {}, a.showGameOverAd = function() {}, a.hideGameOverAd = function() {}, a.showInterstitialAd = function() {}, a.resizeAd = function() {}, a.showRateGame = function() {}, a.submitHighscore = function(e) {}, a.submitLowscore = function(e) {}, a.configLoadCallback = function() {}, a.insertRemoveAdsButton = function() {}, a.removeAdsButton = function() {}, window.onresize = function(e) {
- a.emit("resize", {
- event: e
- })
- }, window.onfocus = function(e) {
- a.emit("focus", {
- event: e
- })
- }, window.onblur = function(e) {
- a.emit("blur", {
- event: e
- })
- }, document.addEventListener("visibilitychange", function(e) {
- "hidden" == document.visibilityState && a.emit("blur", {
- event: e
- }), "visible" == document.visibilityState && a.emit("focus", {
- event: e
- })
- });
- var E = function() {
- return window.Host && window.Host.Sound ? (Host.Log("Using SoundPlayer!"), function(e) {
- function t(e, t) {
- return n[e] = new i(e, t)
- }
- function i(t, i) {
- var n = this;
- n.playing = !1;
- var o = i;
- this.resetGain = function() {
- this.setGain(i)
- }, this.setGain = function(e) {
- o = e, Host.Sound.SetVolume(t, e)
- }, this.play = function(i, a) {
- function s() {
- Host.Sound.Play(t, t, a, o, e)
- }
- r.muted || e && n.playing || (n.playing = !0, i ? setTimeout(s, 1e3 * i) : s())
- }, this.stop = function(e) {
- e = e || 0, n.playing = !1, Host.Sound.Stop(t)
- }
- }
- e = !!e;
- var n = [],
- r = this;
- this.muted = !1, this.setMuted = function(e) {
- r.muted = e
- }, this.get = function(i, r) {
- return Host.Sound.Preload(i, i, e), n[i] || t(i, r)
- }
- }) : function(e) {
- function t() {
- l = !0, h.length && h.shift().send()
- }
- function i(i, n) {
- function s(e, t) {
- if (!o.muted && d.loaded) {
- v = {
- stop: function() {}
- };
- try {
- d.playing = !0, v = r.createBufferSource(), v.buffer = c, v.loop = t || !1, d.resetGain(), v.connect(u), u.connect(r.destination), v.start(r.currentTime + (e || 0))
- } catch (e) {}
- return v
- }
- }
- var c, d = this;
- d.targetGain = n, d.loaded = !1, d.playing = !1;
- var u = {
- gain: {
- value: 0
- }
- };
- if (r) {
- var f = new XMLHttpRequest;
- f.open("GET", vpath + i, !0), f.responseType = "arraybuffer", f.onload = function() {
- t(), r.decodeAudioData(f.response, function(e) {
- c = e, d.loaded = !0
- })
- }, h.push(f), l || (t(), e || t()), u = r.createGain ? r.createGain() : {
- gain: {
- value: 1
- }
- }
- }
- this.gain = u.gain;
- var p = !1,
- g = 0;
- this.setGain = function(e) {
- return p ? void(g = e) : void(this.gain.value = e)
- }, this.updateGain = function(e) {
- return p ? void(g = n = e) : void(this.gain.value = n = e)
- }, this.resetGain = function() {
- return p ? void(g = n) : void(this.gain.value = n)
- }, this.pause = function() {
- p || (g = this.gain.value, this.setGain(0), p = !0)
- }, this.resume = function() {
- p && (p = !1, this.setGain(g))
- };
- var v = void 0;
- this.play = function(t, i) {
- if (d.loaded) {
- if (e) {
- if (d.playing) return
- } else d.stop(0);
- s(t, i)
- }
- }, this.stop = function(e) {
- if (e = e || 0, v && d.playing) try {
- v.stop(e)
- } catch (e) {}
- d.playing = !1
- }, e && (a.on("blur", function() {
- d.pause()
- }), a.on("focus", function() {
- d.resume()
- }), stage.on("down", function() {
- d.resume()
- }))
- }
- function n(e, t) {
- return s[e] = new i(e, t)
- }
- var r, o = this;
- (window.AudioContext || window.webkitAudioContext) && (E.context = r = E.context || new(window.AudioContext || window.webkitAudioContext));
- var s = [];
- this.muted = !1, this.setMuted = function(e) {
- o.muted = e
- }, this.get = function(e, t) {
- var i = s[e] || n(e, t);
- return i.updateGain(t), i
- };
- var h = [],
- l = !1;
- this.currentTrack = null
- }
- }();
- a.Sound = new E, a.Music = new E(!0), a.backgroundMusic = null, a.loadScript = function(e, t) {
- ! function(i, n) {
- var r, o = i.getElementsByTagName(n)[0];
- t = t || {}, r = i.createElement(n), r.src = e, r.async = "async", r.defer = "defer", t.charset && (r.charset = t.charset), o.parentNode.insertBefore(r, o)
- }(document, "script")
- }, a.remoteConfig = {}, a.loadConfig = function(e) {
- var t = l.remoteConfigVersion;
- a.is.wildTangent ? t += ".wildtangent" : a.is.iOS ? t += ".ios" : a.is.android && !a.is.silk ? t += ".android" : a.is.chromeWrapper && (t += ".chrome"), "undefined" != typeof l && l.stage && "live" != l.stage || Host.Tools.LoadJSON(a.httpPrefix + "cdn.frvr.com/config/" + e + "." + t + ".json?r=" + (new Date).getTime(), function(e) {
- for (var t in e) a.remoteConfig[t] = e[t];
- a.configLoadCallback()
- }, function() {
- setTimeout(function() {
- a.loadConfig(e)
- }, 6e4)
- })
- }, a.navigate = function(e, t) {
- window.Host && window.Host.IOS && window.Host.IOS.OpenURL && Host.IOS.OpenURL(e), window.Host && window.Host.Android && window.Host.Android.OpenURL ? window.Host.Android.OpenURL(e) : a.is.clay ? (window.open(e, t || "_blank"), navigator.app && navigator.app.loadUrl && navigator.app.loadUrl(e, {
- openExternal: !0
- })) : window.open(e, t || "_blank")
- };
- var L = {};
- a.utils = {};
- var A = 0;
- a.utils.clipImage = function(e, t, i, n, r, o, a) {
- o = o || n, a = a || r, e.path = e.path || e.src || "Unknown Canvas Object " + ++A;
- var s = [e.path, t, i, n, r, o, a].join(","),
- h = L[s];
- return void 0 === h && (h = document.createElement("canvas"), h.width = n, h.height = r, h.path = s, h.getContext("2d").drawImage(e, t, i, n, r, 0, 0, o, a), L[s] = h), h
- }, a.utils.asynchLoadImageFromPath = function(e) {
- var t = _.Sprite.fromImage(e);
- return m(t), t
- };
- var P = !1,
- B = [document.createElement("canvas"), document.createElement("canvas")];
- B[0].ctx = B[0].getContext("2d"), B[1].ctx = B[1].getContext("2d");
- var I = 0,
- F = 0,
- O = _.DisplayObjectContainer.expand(function() {
- return _.DisplayObjectContainer.call(this), m(this), this
- });
- O.prototype.cacheRender = function(e) {
- var t = this.getLocalBounds(),
- i = new _.Sprite(_.Texture.emptyTexture);
- i.worldTransform = this.worldTransform, i.anchor.x = -(t.x / t.width), i.anchor.y = -(t.y / t.height), e.save(), e.translate(-t.x + this.x, -t.y + this.y), e.globalAlpha = this.alpha;
- for (var n = 0, r = this.children.length; n < r; n++) {
- var o = this.children[n];
- o.cacheRender && o.visible && o.cacheRender(e)
- }
- e.restore()
- }, y(O), t.Container = O;
- var G = [],
- D = {};
- _.Texture.getScaled = function(e, t, i) {
- var n = e.path + ":" + t,
- r = D[n];
- if (!r) {
- var o = w(e, t, G.pop()),
- a = _.Texture.fromCanvas(o);
- a.floorCoordinates = i.floorCoordinates, r = {
- canvas: o,
- texture: a,
- count: 0,
- ratio: t
- }, D[n] = r
- }
- return r.count++, i._textureCache[n] = r, r.texture
- };
- var U = 0,
- H = _.Sprite.expand(function(e) {
- this._ratio = -1, this.image = e, this._textureCache = {}, void 0 === e.path && (e.path = "DynamicSprite:" + U++), _.Sprite.call(this, this.getTexture(e, 1)), m(this)
- });
- H.prototype.getTexture = function(e, t) {
- return _.Texture.getScaled(e, t, this)
- }, H.prototype.cacheRender = function(e) {
- e.globalAlpha = e.globalAlpha * this.alpha, 16777215 !== this.tint ? e.drawImage(_.CanvasTinter.getTintedTexture(this, this.tint), this.position.x, this.position.y) : e.drawImage(this.texture.baseTexture.source, this.position.x, this.position.y)
- }, H.prototype.floorCoordinates = !0, H.prototype.cleanTextureCache = function() {
- var e = this._textureCache;
- setTimeout(function() {
- for (var t in e) {
- var i = e[t];
- i.count--, 0 == i.count && 1 != i.ratio && (G.push(i.canvas), i.texture.destroy(), delete D[t])
- }
- }, 1), this._textureCache = {}
- }, H.prototype._y = 0, Object.defineProperty(H.prototype, "y", {
- get: function() {
- return this._y
- },
- set: function(e) {
- this._y = e, this.position.y = e * this._ratio
- }
- }), H.prototype._x = 0, Object.defineProperty(H.prototype, "x", {
- get: function() {
- return this._x
- },
- set: function(e) {
- this._x = e, this.position.x = e * this._ratio
- }
- }), H.prototype.lockRatio = !1, H.prototype.forceSetRatio = function(e) {
- if (this._ratio !== e)
- if (!isNaN(e) && (e > 0 || e == -1)) {
- this._ratio = e, e != -1 && (this.cleanTextureCache(), this.setTexture(this.getTexture(this.image, e)), this.x = this.x, this.y = this.y), this.setRatio && this.setRatio(e);
- for (var t = 0; t < this.children.length; t++) this.children[t].ratio = this._ratio
- } else console.warn("Invalid value passed to Sprite forceSetRatio " + e)
- }, Object.defineProperty(H.prototype, "ratio", {
- get: function() {
- return this._ratio
- },
- set: function(e) {
- this.lockRatio || this.forceSetRatio(e)
- }
- }), H.fromSheet = function(e, t) {
- return e.frame = t, new H(e.image)
- }, t.Sprite = H;
- var z = H.expand(function(e, t, i) {
- t = t || e.height, i = i || e.height;
- var n = e.width / t >> 0,
- r = e.height / i >> 0;
- this.length = n * r, this.images = [];
- for (var o = 0; o < this.length; o++) {
- var s = o % n >> 0,
- h = o / n >> 0;
- this.images.push(a.utils.clipImage(e, s * t, h * i, t, i, 0, 0, t, i))
- }
- H.call(this, this.images[0])
- });
- z.prototype._frame = 0, z.prototype.images = [], Object.defineProperty(z.prototype, "frame", {
- get: function() {
- return this._frame
- },
- set: function(e) {
- e !== this.frame && (this._frame = e % this.length, this.image = this.images[this._frame], this.ratio != -1 && this.setTexture(this.getTexture(this.image, this.ratio)), window.dirtyOnce = !0)
- }
- }), t.Sheet = z;
- var W = _.Sprite.expand(function(e) {
- _.Sprite.call(this, e)
- }),
- N = W.prototype._renderWebGL;
- W.prototype._renderWebGL = function(e) {
- this._dirtyTexture && (this._dirtyTexture = !1, _.updateWebGLTexture(this.texture.baseTexture, e.gl)), N.call(this, e)
- }, t.TextureSprite = W;
- var j = {},
- V = [];
- t.Text2 = _.Sprite.expand(function(e, t) {
- function i() {
- var i = (e.translated || e) + ":" + t.size * c + ":" + s + ":" + JSON.stringify(t);
- if (i != a) {
- var n = j[i],
- h = j[a];
- if (h && (h.count--, 0 == h.count && (V.push(h.text), delete j[a])), !n) {
- var l = V.pop(),
- d = l ? l.style : {};
- for (var u in t) d[u] = t[u];
- t.dropShadow && (d.dropShadowDistance = (t.dropShadowDistance || 6) * c), d._font = (t.italic ? "italic " : "") + t.weight + " " + (t.size - s) * c + "px " + (t.font || '"Helvetica Neue","Trebuchet MS", Helvetica, sans-serif'), n = j[i] = {
- text: l || new _.Text(e.toString(), d),
- localizedString: e,
- count: 0,
- ratio: c
- }, l && (l.text = e.toString() || " ")
- }
- n.count++, a = i, n.text.updateText(), o = n.text, r.setTexture(o.texture), window.dirtyOnce = !0
- }
- }
- function n() {
- if (s = 0, r.ratio != -1 && (i(), t.maxWidth))
- for (; o.texture.frame.width > t.maxWidth * r.ratio && t.size + s > 10;) s += 2, i()
- }
- var r = this;
- t = t || {}, t.weight = t.weight || "300", t.size = t.size || 30, t.fill = t.fill || "#000000";
- var o, a, s = 0,
- h = 0,
- l = 0,
- c = 1;
- r.getContent = function() {
- return i(), o
- }, _.Sprite.call(r, Texture.emptyTexture), r.setText = function(t) {
- e != t && (e = t, n())
- }, r.onLanguageChange = function() {
- e = Host.Localize.Translate(e), n()
- }, r.updateStyle = function(e) {
- var i = !1;
- for (var r in e) t[r] != e[r] && (i = !0, t[r] = e[r]);
- i && n()
- }, r.setStyle = function(e) {
- r.updateStyle(e)
- };
- var h = 0,
- l = 0,
- c = 1;
- Object.defineProperty(r, "ratio", {
- get: function() {
- return c
- },
- set: function(e) {
- c === e && o || (c = e, r.position.x = h * c >> 0, r.position.y = l * c >> 0, n())
- }
- }), Object.defineProperty(r, "x", {
- get: function() {
- return h
- },
- set: function(e) {
- h = e, r.position.x = e * c >> 0
- }
- }), Object.defineProperty(r, "y", {
- get: function() {
- return l
- },
- set: function(e) {
- l = e, r.position.y = e * c >> 0
- }
- }), Object.defineProperty(r, "width", {
- get: function() {
- return o || n(), r.scale.x * o.texture.frame.width
- },
- set: function(e) {
- o || n(), r.scale.x = e / o.texture.frame.width, o._width = e
- }
- }), Object.defineProperty(r, "height", {
- get: function() {
- return o || n(), r.scale.y * o.texture.frame.height
- },
- set: function(e) {
- o || n(), r.scale.y = e / o.texture.frame.height, o._height = e
- }
- }), r.cacheRender = function(e) {
- e.drawImage(o.texture.baseTexture.source, r.position.x, r.position.y)
- }
- }), t.Text2.onLanguageChange = function() {
- for (k in j) {
- j[k].text.setText(Host.Localize.Translate(j[k].localizedString))
- }
- Host.Localize.UpdateChildren(a.stageContainer), window.Sidebar && Sidebar.translateIcon()
- }, t.Graphics = _.Graphics.expand(function() {
- m(this), _.Graphics.call(this)
- }), t.Rectangle = _.Rectangle, t.Texture = _.Texture, t.Point = _.Point;
- var Y = function(e, t, i, n) {
- i = void 0 == i ? 1 : i, 1 != Y.multiplier && (i *= Y.multiplier), this.tweens = {}, this.offset = 1, this.method = n || Y.easeout, this.length = 1e3 * i / (1e3 / 60), this.target = e;
- for (var r in t) this.tweens[r] = {
- start: e[r],
- end: t[r]
- };
- Y.tweens.push(this)
- };
- Y.multiplier = 1, Y.prototype.call = function(e, t) {
- return this.callback = e, this.callbackParams = t, this
- }, Y.prototype.wait = function(e) {
- return this.delay = 1e3 * (e || 0) / (1e3 / 60), this
- }, Y.prototype.tick = function() {
- if (this.delay > 0) return void this.delay--;
- this.target.dirty = !0;
- for (var e in this.tweens) {
- var t = this.tweens[e];
- this.target[e] = this.method(t.start, t.end, this.offset / this.length)
- }
- return this.offset++, this.offset > this.length || void 0
- }, Y.prototype.complete = function() {
- for (var e in this.tweens) this.target[e] = this.tweens[e].end;
- if (this.callback) {
- var t = this;
- setTimeout(function() {
- t.callbackParams ? t.callback.apply(t.target, t.callbackParams) : t.callback.apply(t.target, null)
- }, 1)
- }
- }, Y.tweens = [], Y.linear = Y.linary = function(e, t, i) {
- return e + (t - e) * i
- }, Y.easein = function(e, t, i) {
- return e + (t - e) * (1 - Math.sin(i * Math.PI / 2 + Math.PI / 2))
- }, Y.easeout = function(e, t, i) {
- return e + (t - e) * Math.sin(i * Math.PI / 2)
- }, Y.easeinout = function(e, t, i) {
- return e + (t - e) * ((Math.sin(i * Math.PI + Math.PI / 2) + 1) / 2)
- }, Y.bounce = function(e, t, i) {
- return e + (t - e) * Math.sin(i * Math.PI)
- }, Y.tick = function() {
- for (var e = 0; e < Y.tweens.length; e++) {
- var t = Y.tweens[e];
- t.tick() && (window.dirtyOnce = !0, Y.tweens.splice(e--, 1), t.complete())
- }
- }, Y.complete = function() {
- for (var e = 0; e < arguments.length; e++)
- for (var t = arguments[e], i = 0; i < Y.tweens.length; i++) {
- var n = Y.tweens[i];
- n.target == t && (window.dirtyOnce = !0, Y.tweens.splice(i--, 1), n.complete())
- }
- }, Y.clear = function() {
- for (var e = 0; e < arguments.length; e++)
- for (var t = arguments[e], i = 0; i < Y.tweens.length; i++) {
- var n = Y.tweens[i];
- n.target == t && (n.callback = void 0, Y.tweens.splice(i--, 1))
- }
- }, t.Tween = Y;
- var X = {};
- t.embed = function(e) {
- if (e = b(e), void 0 === X[e]) throw "You can only use the embed method in conjuction with preload for > (" + e + ")";
- return X[e]
- }, t.preload = function() {
- function e() {
- for (var e = 0; e < h.length; e++) h[e]()
- }
- function t() {
- o--;
- for (var t = 0; t < s.length; t++) s[t](a, o);
- 0 == o && e()
- }
- function i(e) {
- var i = b(e);
- if (void 0 === X[i]) {
- o++, a++;
- var n = embeddedAssets[e];
- if (n)
- if (n instanceof Array) {
- var r = X[i] = getCanvasFromFRVRVector.apply(this, n);
- r.path = i, t()
- } else {
- var s = X[i] = new Image;
- s.onload = function() {
- X[i] = s, t()
- }, s.src = embeddedAssets[e], s.path = i
- }
- else switch (i.substring(i.lastIndexOf("."))) {
- case ".wav":
- case ".mp3":
- throw "You should not preload sounds";
- default:
- var s = new Image;
- s.crossOrigin = "anonymous", s.onload = function() {
- X[i] = s, t()
- }, s.src = i, s.path = i
- }
- }
- }
- function n(e, i) {
- o++, a++, Host.Preferences["Get" + e](i, function(e) {
- t()
- })
- }
- function r(e) {
- var t = e.toString(),
- r = t.match(/[^A-Za-z]embed\(\s*[\"|\'][^\)]+[\"|\']\s*\)/g);
- if (r)
- for (var o = 0; o < r.length; o++) i(r[o].replace(/[^A-Za-z]embed\(\s*[\"|\'](.+)[\"|\']\s*\)/g, "$1"));
- var a = t.match(/[^A-Za-z]Host.Preferences.Quick([A-Za-z]+)\([\"|\'][^\)]+[\"|\']\)/g);
- if (a)
- for (var o = 0; o < a.length; o++) {
- var s = /[^A-Za-z]Host.Preferences.Quick([A-Za-z]+)\([\"|\'](.+)[\"|\']\)/g;
- n(a[o].replace(s, "$1"), a[o].replace(s, "$2"))
- }
- }
- var o = 0,
- a = 0,
- s = [],
- h = [];
- a = 0, o++;
- for (var l = 0; l < arguments.length; l++) {
- var c = arguments[l];
- void 0 !== c && (c instanceof Function ? (h.push(c), r(c)) : i(c))
- }
- return t(),
- function(e) {
- s.push(e)
- }
- }, document.body.appendChild(a.canvas);
- var K = 1e3 / 60,
- q = (new Date).getTime();
- window.dirty = !1, window.dirtyOnce = !1;
- var Q = (new Date).getTime(),
- J = {},
- Z = !1;
- T(), setTimeout(function() {
- Q = (new Date).getTime(), Z = !0
- }, 2e3), setTimeout(function() {
- Z = !1;
- var e = 0,
- t = 0;
- for (var i in J) e += i * J[i], t += J[i];
- var n = Math.round(1e3 / (e / t));
- ga("send", "event", l.niceId, "Performance", "Avg Framerate", n), n < 30 && ga("send", "event", l.niceId, "Performance", "Below 30 Framerate", n), n < 15 && ga("send", "event", l.niceId, "Performance", "Below 15 Framerate", n), n < 10 && ga("send", "event", l.niceId, "Performance", "Below 10 Framerate", n)
- }, 62e3), t.gameHeight = height, t.stage = new O, m(stage), stage.hitArea = new _.Rectangle(0, -1e4, 1e5, 1e5), stage.interactive = !0, stage.touchstart = function() {}, a.stageContainer.addChild(stage), stage.orientation = "landscape", stage.orientationMode = "dynamic";
- var $ = document.createElement("canvas"),
- ee = $.getContext("2d"),
- te = new W(Texture.emptyTexture);
- stage.addChild(te);
- var ie = 0,
- ne = 0;
- stage.background = {
- color: "#000000",
- gradient: void 0,
- texture: void 0,
- callback: void 0,
- disabled: !1
- };
- var re = {};
- stage.background.embellish = function(e) {
- function i() {
- for (var t = 0; t < e.length; t++) e[t].image = embed(e[t].path);
- stage.background.callback = function(t, i) {
- for (var n = 0; n < e.length; n++) {
- var r = e[n],
- o = height / targetWidth * a.devicePixelRatio,
- s = r.image.width * o,
- h = r.image.height * o,
- l = 0,
- c = 0,
- d = C(r.left, t.width, o),
- u = C(r.right, t.width, o),
- f = C(r.top, t.width, o),
- p = C(r.bottom, t.width, o);
- void 0 !== d && void 0 !== u && (s = t.width - 5 - d - u), void 0 !== d && (l = d), void 0 !== u && (l = t.width - u - s), void 0 !== f && void 0 !== p && (h = t.height - 5 - f - p), void 0 !== f && (c = f), void 0 !== p && (c = t.height - 5 - p - h), l += C(r.offsetX, s) || 0, c += C(r.offsetY, h) || 0, i.drawImage(r.image, l, c, s, h)
- }
- }, S(!0)
- }
- if (re != e) {
- re = e;
- for (var n = [], r = 0; r < e.length; r++) n.push(e[r].path);
- n.push(i), preload.apply(t, n)
- }
- }, a.getTintedTexture = _.CanvasTinter.getTintedTexture, stage.background.drawBackground = function(e, t, i, n, r, o) {
- if (e.fillStyle = stage.background.color, e.fillRect(0, 0, t, i), n) {
- var s;
- switch (n.type) {
- case "radial":
- var h = void 0 == n.multiplier ? 1 : n.multiplier,
- l = void 0 == n.verticalOffset ? .5 : n.verticalOffset;
- s = e.createRadialGradient(t / 2, i * l, 0, t / 2, i * l, Math.max(t / 2, i / 2) * h);
- break;
- case "linear":
- s = e.createLinearGradient(t * (n.width || 0), i, 0, 0);
- break;
- default:
- throw "Unsupported radial format"
- }
- for (var c = 0; c < n.stops.length; c++) s.addColorStop.apply(s, n.stops[c]);
- e.fillStyle = s, e.fillRect(0, 0, t, i)
- }
- if (o && o($, e), r) {
- if (!r.scaled) {
- var d = r.scaled = document.createElement("canvas");
- d.width = Math.ceil(r.width * a.devicePixelRatio / 2), d.height = Math.ceil(r.height * a.devicePixelRatio / 2), d.getContext("2d").drawImage(r, 0, 0, r.width, r.height, 0, 0, d.width, d.height)
- }
- var u = e.createPattern(r.scaled, "repeat");
- e.fillStyle = u, e.fillRect(0, 0, t, i)
- }
- }, stage.background.refresh = S, window.targetWidth = 2732, window.targetHeight = 2048, window.forceRatio = !1;
- var oe = 0;
- if (a.initComplete = !1, a.on("resize", R), a.on("resize", function() {
- S()
- }), !window.inScreenshotMode) {
- window.onunload && (window.onunload = function() {
- setTimeout(function() {
- window.onresize()
- }, 1)
- });
- var ae = 0;
- a.on("focus", function() {
- clearTimeout(ae), ae = setTimeout(function() {
- window.onresize()
- }, a.is.iOS ? 500 : 1)
- }), setInterval(function() {
- height == M() && width == Math.max(document.documentElement.clientWidth, 100) || window.onresize()
- }, 250)
- }
- }(this);
- var s = {};
- s.server = "https://frvr-backend.appspot.com/", s.c = function() {
- for (var e = [], t = 0; 64 > t;) e[t] = 0 | 4294967296 * Math.abs(Math.sin(++t));
- return function(t) {
- var i, n, r, o, a = [];
- t = unescape(encodeURI(t));
- for (var s = t.length, h = [i = 1732584193, n = -271733879, ~i, ~n], l = 0; l <= s;) a[l >> 2] |= (t.charCodeAt(l) || 128) << 8 * (l++ % 4);
- for (a[t = 16 * (s + 8 >> 6) + 14] = 8 * s, l = 0; l < t; l += 16) {
- for (s = h, o = 0; 64 > o;) s = [r = s[3], (i = 0 | s[1]) + ((r = s[0] + [i & (n = s[2]) | ~i & r, r & i | ~r & n, i ^ n ^ r, n ^ (i | ~r)][s = o >> 4] + (e[o] + (0 | a[[o, 5 * o + 1, 3 * o + 5, 7 * o][s] % 16 + l]))) << (s = [7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21][4 * s + o++ % 4]) | r >>> 32 - s), i, n];
- for (o = 4; o;) h[--o] = h[o] + s[o]
- }
- for (t = ""; 32 > o;) t += (h[o >> 3] >> 4 * (1 ^ 7 & o++) & 15).toString(16);
- return t
- }
- }(), s.slt = "I think you'll enjoy playing FRVR Games!", s.send = function(e, t) {
- var i = t.data || {},
- n = t.load || function() {},
- r = t.error || function(e) {
- console.error("XSB.error: ", e)
- },
- o = new XMLHttpRequest;
- o.addEventListener("load", function(e) {
- n(e.target.responseText)
- }), o.addEventListener("error", function(e) {
- r(e.target.responseText)
- });
- var a = function(t) {
- console.log("uid: " + t);
- var n = new FormData,
- r = JSON.stringify(i),
- a = t || "";
- n.append("id", a), n.append("c", s.c(s.slt + a + r)), n.append("data", r), n.append("game", l.id), o.open("POST", e), o.send(n)
- };
- s.user && s.user.id ? a(s.user.id) : Host.Preferences.GetString("frvr.uid", a)
- }, s.login = function() {
- s.send(s.server + "login", {
- load: function(e) {
- var t = JSON.parse(e);
- s.user = new s.User(t), Host.Preferences.SetString("frvr.uid", s.user.id), a.emit("login", s.user)
- },
- error: function(e) {
- console.log("Login Error: ", e), a.emit("login-error", e)
- }
- })
- }, s.save = function() {
- if (!s.user) throw "Tried to XSB.save without being logged in";
- s.send(s.server, {
- load: function(e) {
- var t = JSON.parse(e);
- console.log("User saved!", t), a.emit("save", s.user)
- },
- data: s.user.data
- })
- }, s.logout = function() {
- s.user = null, a.emit("logout")
- }, s.User = function(e) {
- var t = this;
- t.data = e.data || {}, t.id = e.id || null, t.get = function(e) {
- return t.data[e]
- }, t.set = function(e, i) {
- t.data[e] = i
- }
- }, a.modulesToPreload.push(n), a.modulesToPreload.push(function() {
- var e = {
- complexity: Host.Preferences.QuickInt("modal.slider.complexity.v1")
- };
- 0 == e.complexity.get() && e.complexity.set(2),
- function() {
- var e = Container.expand(function() {
- function e() {
- var e = a.devicePixelRatio;
- return ((height - a.styles.margins.top - a.styles.margins.bottom) / i.ratio * e - h) / 2 + a.styles.margins.top / i.ratio * e
- }
- function t() {
- i.isShowing = !1, c && c.destroy && c.destroy(), r.removeChild(c), a.stageContainer.removeChild(i)
- }
- Container.call(this);
- var i = this;
- this.backgroundColor = 16777215, this.isShowing = !1;
- var n = new Graphics;
- n.beginFill(0, .6), n.drawRect(0, 0, 200, 200), this.addChild(n), i.sounds = {
- button: void 0
- }, n.interactive = !0, n.defaultCursor = "pointer";
- var r = new Container;
- this.addChild(r);
- var o = new Graphics;
- r.addChild(o);
- var s = 800,
- h = 800,
- i = this;
- this.setHeight = function(e) {
- h = e, o.clear(), o.beginFill(i.backgroundColor, 1), o.drawRoundedRect(0, 0, s, h, 35), this.ratio && this.setRatio && this.setRatio(this.ratio)
- }, this.setHeight(800), this.redraw = function() {
- var e = a.devicePixelRatio;
- n.width = width * e, n.height = (height + 100) * e, r.x = (width / i.ratio * e - s) / 2
- }, this.handleResize = function() {
- var t = a.devicePixelRatio;
- Tween.complete(r);
- var n = Math.min(Math.min(width * t / 900, (height - a.styles.margins.top - a.styles.margins.bottom) * t / (h + 50)), t / 2);
- i.ratio = n, o.scale.set(n, n), r.x = (width / i.ratio * t - s) / 2, r.y = e(), i.redraw()
- }, a.on("resize", this.handleResize);
- var l = !1,
- c = null;
- this.show = function(o, s) {
- var h = a.devicePixelRatio;
- l = !1, a.emit("toggleoverlay", {
- visible: !0
- }), t(), i.isShowing = !0, c = o, c.off("down"), c.on("down", function() {
- l = !0
- }), this.setHeight(c.innerHeight), r.addChild(c), this.handleResize(), r.y = height * h / stage.ratio, n.alpha = 0, new Tween(r, {
- y: e()
- }, .3), s !== !0 && new Tween(n, {
- alpha: 1
- }, .3), a.stageContainer.addChild(i)
- }, this.hide = function(e) {
- a.hideGameOverAd(), i.isShowing ? new Tween(r, {
- y: -h
- }, .3).call(function() {
- t(), a.emit("toggleoverlay", {
- visible: !1
- }), e instanceof Function && e()
- }) : e instanceof Function && e()
- }, o.on("down", function() {
- l = !0
- }), n.on("up", function() {
- l || (c.blurClose ? i.hide() : c.blurCallback instanceof Function && c.blurCallback()), l = !1
- }, !0)
- });
- window.Modal = new e
- }();
- var t = Container.expand(function(t) {
- function i(e, t, i) {
- var n = new Sprite(e),
- r = 50 / n.height;
- n.scale.set(r, r), n.y = 39, n.anchor.set(0, .5);
- var a = new Text2(t, {
- weight: 400,
- size: 34,
- maxWidth: 190,
- dropShadowDistance: 2
- });
- a.anchor.set(0, .5);
- var s = i + (255 - (a.width + 55)) / 2;
- return a.y = 41, n.x = s, a.x = s + 55, o.addChild(n), o.addChild(a), a
- }
- function n() {
- v = void 0, a.stageContainer.off("stageup", n), a.stageContainer.off("move", r), o.setSelected(p, !0)
- }
- function r(e) {
- var t = e.event.getLocalPosition(stage),
- i = t.x - v.x;
- h.x = Math.min(Math.max(m + i / o.ratio, f[0]), f[2]);
- for (var n = 0; n < f.length; n++) {
- var r = f[n];
- Math.abs(h.x - r) < 30 ? o.setSelected(n, !1) : Math.abs(h.x - r) < 100 && o.setSelected(n, !1, !0)
- }
- }
- var o = Container.call(this),
- s = new Sprite(embed("i/g/s/sliderbg.svg"));
- s.anchor.set(.5, 0), s.x = 400, this.addChild(s);
- var h = new Sprite(embed("i/g/s/sliderslider.svg"));
- h.anchor.set(.5, 0), h.y = -8, this.addChild(h);
- var l = i(t.challengingStar, t.challenging, 527),
- c = i(t.normalStar, t.normal, 273),
- d = i(t.casualStar, t.casual, 19),
- u = [d, c, l],
- f = [148, 400, 655],
- p = -1;
- o.setSelected = function(t, i, n) {
- var r = f[t];
- if (n || (Tween.clear(h), i ? new Tween(h, {
- x: r
- }, .3) : h.x = r), t != p) {
- p = t, e.complexity.set(p + 1);
- for (var o = 0; o < 3; o++) {
- var a = u[o],
- s = o == t;
- a.updateStyle({
- fill: s ? "#FFFFFF" : "#000000",
- dropShadow: s
- })
- }
- }
- };
- var g = void 0 != t.selected ? t.selected : e.complexity.get() - 1;
- o.setSelected(g, !1), s.on("down", function(e) {
- var t = e.event.getLocalPosition(s),
- i = Math.max(0, Math.min(2, (t.x / o.ratio + 127 + 260) / 258 >> 0));
- o.setSelected(i, !0)
- });
- var v = void 0,
- m = 0;
- h.on("down", function(e) {
- v = e.event.getLocalPosition(stage), m = h.x, a.stageContainer.on("stageup", n), a.stageContainer.on("move", r)
- }), o.getComplexity = function() {
- return p
- }
- });
- window.Modal.ModelButton = Container.expand(function(e, t, i, n, r, o) {
- function s() {
- r ? (h.drawRoundedRect(0, 0, 800, 200, r), l.clear(), l.beginFill(16777215, 1), l.drawRect(0, 0, 800, r), d.addChild(l)) : h.drawRect(0, 0, 800, u)
- }
- Container.call(this);
- var h, l, c, d = this;
- n = void 0 === n ? 15748651 : n, h = new Graphics, d.addChild(h);
- var u = 165 + r;
- if (l = new Graphics, t) {
- var f = new Text2(t, {
- width: 400,
- size: 40,
- fill: "#ffffff"
- });
- f.anchor.set(.5, 0), f.x = 400, f.y = 30 + r + 60, d.addChild(f)
- }
- c = new Text2(e, {
- width: 400,
- size: o,
- fill: "#ffffff"
- }), c.anchor.set(.5, 0), c.x = 400, c.y = 30 + r, d.addChild(c), c.interactive = !0, c.buttonMode = !0, i && h.on("down", function() {
- Modal.sounds.button && Modal.sounds.button.play(0), a.stageContainer.off("stageup"), a.stageContainer.once("stageup", i)
- }), d.setRatio = function(e) {
- h.width = 800 * e, h.height = u * e, l && (l.width = 800 * e, l.height = 35 * e)
- }, d.setColor = function(e) {
- h.beginFill(e), s()
- }, d.setColor(void 0 === n ? 16711680 : n, 1)
- }), window.Modal.PictureButton = Container.expand(function(e, t) {
- Container.call(this);
- var i = this;
- preload(e, function() {
- var n = new Sprite(embed(e));
- n.anchor.set(.5, 0), n.x = 400, i.addChild(n), t && (n.buttonMode = !0, n.on("down", t))
- })
- });
- var i = 1337 * Math.random() >> 0;
- window.Modal.ModalOverlayContent = Container.expand(function() {
- var e = this;
- Container.call(this), this.innerHeight = 800, this.blurClose = !0, this.addHeadline = function(e) {
- var t = new Text2(e, {
- weight: 200,
- size: 90,
- fill: "#2c2c2c",
- maxWidth: 780
- });
- return t.anchor.set(.5, 0), t.x = 400, t.y = 40, this.addChild(t), t
- }, this.addTextBlock = function(e, t, i) {
- var n = new Text2(e, {
- weight: i || 200,
- size: t || 90,
- fill: "#2c2c2c",
- maxWidth: 780
- });
- return n.anchor.set(.5, 0), n.x = 400, n.y = 50, this.addChild(n), n
- }, this.addLead = function(e, t) {
- var i = new Text2(e, {
- width: 200,
- size: 45,
- fill: "#2c2c2c",
- maxWidth: 800,
- align: "center"
- });
- return i.anchor.set(.5, 0), i.x = 400, i.y = 140 + (t || 0), this.addChild(i), i
- };
- this.addButton = function(e, t, i) {
- var n = new Modal.ModelButton(e, "", t, i, 35, 90);
- return n.y = 370, this.addChild(n)
- }, this.addMiddleButton = function(e, t, i, n, r) {
- var o = new Modal.ModelButton(e, t, i, n, 0, r || 60);
- return o.y = 370, this.addChild(o)
- }, this.addSocialButton = function(e, t, i, n, r) {
- var o = this.addMiddleButton(e, t, i, n);
- return o.y = 405 + (r || 0), this.addChild(o)
- }, this.addPictureButton = function(e, t, i) {
- var n = new Modal.PictureButton(e, t);
- return n.y = 405 + (i || 0), this.addChild(n)
- }, this.addSlider = function(e) {
- return this.addChild(new t(e))
- }, this.addMetaButton = function(t, n) {
- var r = [];
- return a.remoteConfig && a.remoteConfig.crosspromoteConfig && a.remoteConfig.crosspromoteConfig.length && !a.is.twitter && r.push(function(e) {
- var i = a.remoteConfig.crosspromoteConfig[a.remoteConfig.crosspromoteConfig.length * Math.random() >> 0];
- a.is.android && !a.is.silk && i.androidUrl && i.androidImage ? e.addPictureButton(a.httpPrefix + i.androidImage, function() {
- a.navigate(i.androidUrl)
- }, t).y = t : a.is.iOS && i.iOSUrl && i.iOSImage ? e.addPictureButton(a.httpPrefix + i.iOSImage, function() {
- a.navigate(i.iOSUrl, "_top")
- }, t).y = t : a.is.facebookApp && i.facebookUrl && i.facebookImage ? e.addPictureButton(a.httpPrefix + i.facebookImage, function() {
- a.navigate(i.facebookUrl, "_top")
- }, t).y = t : a.is.chromeWrapper && i.chromeUrl && i.chromeImage ? e.addPictureButton(i.chromeImage, function() {
- a.navigate(i.chromeUrl, "_blank")
- }, t).y = t : !a.is.chromeWrapper && i.webUrl && i.webImage && (e.addPictureButton(a.httpPrefix + i.webImage, function() {
- a.navigate(i.webUrl, "_top")
- }, t).y = t)
- }), window.requestFacebookLogin && window.facebookAuthed === !1 && r.push(function(e) {
- e.addSocialButton(Host.Localize.Translate("Login with Facebook"), Host.Localize.Translate("Save your score!"), function() {
- window.requestFacebookLogin(function() {
- Modal.hide(), n.mainActionCallback && n.mainActionCallback(), n.autoCallback && n.autoCallback()
- })
- }, 4675430, t).y = t
- }), window.shareDialogueCallback && r.push(function(e) {
- e.addSocialButton(Host.Localize.Translate(l.buttonShareTitle, {
- game_name: l.shareTitle
- }), Host.Localize.Translate(l.buttonShareDescription, {
- game_name: l.shareTitle
- }), function() {
- window.shareDialogueCallback(""), n.mainActionCallback && n.mainActionCallback()
- }, 4675430, t).y = t
- }), !!r.length && (i++, r[i % r.length](e), !0)
- }
- }), window.Modal.RateGameModal = Modal.ModalOverlayContent.expand(function(e, t) {
- function i(e) {
- var t = 4 != e;
- o.visible = t, s.visible = !0;
- var i = t ? 150 : 0;
- s.y = 430 + i, s.setColor(t ? 12303291 : 6208638), h.visible = !0, r.innerHeight = 760 + i, Modal.setHeight(r.innerHeight), Modal.handleResize(), h.y = 560 + i, r.addChildAt(h, 0)
- }
- function n(t) {
- var n = new Sheet(e, 136, 130);
- return n.y = 270, n.x = 150 * d + 30, n.on("down", function() {
- for (var e = 0; e < 5; e++) c[e].frame = e <= t ? 1 : 0;
- i(t)
- }), n.buttonMode = !0, n
- }
- Modal.ModalOverlayContent.call(this), this.addHeadline(Host.Localize.Translate("Having Fun?")), this.addLead(Host.Localize.Translate("Help us improve the game!\nHow would you rate {game_name}?", {
- game_name: l.shareTitle
- }), 10);
- var r = this,
- o = r.addMiddleButton(Host.Localize.Translate("Send Feedback"), Host.Localize.Translate("Help us improve {game_name}", {
- game_name: l.shareTitle
- }, "We are asking the user to provide feedback for the game"), function() {
- a.navigate(l.feedbackURL), Modal.hide()
- }, 6208638);
- o.y = 430, o.visible = !1;
- var s = r.addMiddleButton(Host.Localize.Translate("Write Review"), Host.Localize.Translate("Help us by writing a review!"), function() {
- a.is.chromeWrapper ? a.navigate(l.chromeReviewUrl) : a.is.android ? a.navigate(l.androidReviewURL) : a.navigate(l.iOSReviewURL), Modal.hide()
- }, 12303291);
- s.y = 580, s.visible = !1;
- var h = r.addButton(Host.Localize.Translate("No thanks"), function() {
- Modal.hide()
- }, t);
- h.visible = !1;
- for (var c = [], d = 0; d < 5; d++) c.push(this.addChild(n(d)));
- this.innerHeight = 450, this.blurClose = !1
- }), window.Modal.BuyItemModal = Modal.ModalOverlayContent.expand(function(e, t, i, n, r, o, s) {
- Modal.ModalOverlayContent.call(this), this.addHeadline(e);
- var h = this.addLead(t, 10);
- h.updateStyle({
- wordWrapWidth: 790 * a.devicePixelRatio
- });
- var l = this.addButton(i, n, 7463062),
- c = new Sheet(embed("i/g/s/menutile.svg"), 68, 45);
- c.frame = 1, c.x = 722, c.y = 15, this.addChild(c), c.interactive = !0, c.buttonMode = !0, l.y = 200;
- var d = 0;
- if (r) {
- this.addMiddleButton(r, o, s, 8026746).y = 255, d += 200, l.y += 185, this.innerHeight = 579
- } else l.y += 20, this.innerHeight = 420;
- this.addChild(h)
- }), window.Modal.InstallGameModal = Modal.ModalOverlayContent.expand(function(e, t, i, n) {
- Modal.ModalOverlayContent.call(this), this.addHeadline(Host.Localize.Translate("Install {game_name}?", {
- game_name: l.shortTitle
- })), this.addButton(Host.Localize.Translate("Install Now"), function() {
- t && a.navigate(t, "_top"), n && n()
- }, 6274174).y = 640, this.innerHeight += 40;
- var r = a.utils.asynchLoadImageFromPath(vpath + e);
- r.anchor.set(0, 0), this.addChild(r), r.buttonMode = !0, r.on("down", function() {
- t && a.navigate(t, "_top"), n && n()
- }), this.setRatio = function(e) {
- r.scale.set(1.465 * e, 1.465 * e), r.y = 160 * e
- }, this.blurClose = !1, this.blurCallback = function() {
- Modal.hide(i)
- }
- }), window.Modal.NewWinModal = Modal.ModalOverlayContent.expand(function(e) {
- function t(e) {
- return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
- }
- var i = this;
- Modal.ModalOverlayContent.call(i), i.addHeadline([Host.Localize.Translate("Amazing!"), Host.Localize.Translate("Impressive!"), Host.Localize.Translate("Breathtaking!")][3 * Math.random() >> 0]), i.blurClose = e.allowBlurClose || !1;
- var n = 190;
- if (window.CalenderView) throw "You need to update to CalendarView!";
- var r = CalendarView.getCalendarViewDay({
- currentDate: CalendarView.getDateFromOffset(e.seed),
- isToday: CalendarView.isToday(e.seed),
- isLarge: !0,
- dateOffset: e.seed,
- stars: [e.bronze, e.silver, e.gold],
- animate: !0
- });
- if (i.addChild(r), r.x = 400, r.y = 400, e.lead) {
- i.addTextBlock(e.lead, 50, 300).y = n + 400, n += 61
- }
- if (void 0 !== e.score) {
- n += 130;
- var o = i.addTextBlock(0, 150, 400);
- o.y = 420, i.addChild(o);
- var a = 0;
- Object.defineProperty(o, "score", {
- get: function() {
- return a
- },
- set: function(e) {
- a = e, this.setText(t(e >> 0))
- }
- });
- var s = o.scale.x,
- h = o.scale.x;
- new Tween(o, {
- score: e.score
- }, 1, Tween.linary).wait(.3).call(function() {
- e.sounds && e.sounds.ding && e.sounds.ding.play(), o.scale.set(1.1 * s, 1.1 * h), new Tween(o.scale, {
- x: s,
- y: h
- }, .3)
- }), e.sounds && e.sounds.count && e.sounds.count.play(.4)
- }
- if (i.addMetaButton(n + 405, e) && (n += 165), e.secondActionText && e.secondActionCallback) {
- i.addSocialButton(e.secondActionText, e.secondActionLead, e.secondActionCallback, e.secondActionColor || 7445472).y = n + 405, n += 165
- }
- var l = i.addButton(e.mainActionText, e.mainActionCallback, e.mainActionColor || 7463062);
- i.addChildAt(l, 1), l.y += n, i.innerHeight = 570 + n
- }), window.Modal.GameOverModal = Container.expand(function(e, t) {
- Modal.ModalOverlayContent.call(this);
- var i = this;
- i.addHeadline(Host.Localize.Translate("Game Over")), i.addLead(Host.Localize.Translate("No more valid moves")), i.blurClose = !1;
- var n = i.addButton(Host.Localize.Translate("Start over"), e, 7463062),
- r = 250;
- if (i.addMetaButton(r, {
- mainActionCallback: t
- }) && (r += 165), t) {
- i.addMiddleButton(Host.Localize.Translate("Return to Calendar"), Host.Localize.Translate("Play another level?"), t, 7445472).y = r, r += 165
- }
- n.y = r - 35, i.innerHeight = r + 165
- }), window.Modal.NewGameModal = Container.expand(function(e, t) {
- var i = this;
- Modal.ModalOverlayContent.call(i);
- var n = -170,
- r = i.addButton(Host.Localize.Translate("Start"), function() {
- e()
- }, 7463062);
- if (t) {
- var o = i.addSlider({
- casual: Host.Localize.Translate("Casual"),
- normal: Host.Localize.Translate("Normal"),
- challenging: Host.Localize.Translate("Challenging"),
- casualStar: t.casualStar,
- normalStar: t.normalStar,
- challengingStar: t.challengingStar,
- selected: t.complexity
- });
- o.y = 595;
- var a = e;
- e = function() {
- a(o.getComplexity())
- }, n = 290, i.innerHeight = 570 + n
- }
- r.y += n, i.innerHeight = 570 + n
- })
- });
- var h = function(e, t) {
- Container.call(this), this.scrollWidth = e, this.scrollHeight = t, this.allowScrollX = !0, this.allowScrollY = !0, this.content = new Container, this.addChild(this.content), this.addChild = function(e) {
- return this.content.addChild(e)
- }, this.addChildAt = function(e, t) {
- return this.content.addChildAt(e, t)
- }, this.removeChild = function(e) {
- return this.content.removeChild(e)
- }, this.resize = function(e, t) {
- this.scrollWidth = e, this.scrollHeight = t
- }, this.getChildren = function() {
- return this.content.children
- }, this.moved = !1;
- var i = this,
- n = null,
- r = 0,
- o = 0;
- a.stageContainer.on("down", function(e) {
- var t = e.event;
- Tween.clear(i.content);
- var a = t.getLocalPosition(i),
- s = a.x / i.ratio,
- h = a.y / i.ratio;
- r = i.content.x, o = i.content.y, s >= 0 && h >= 0 && s <= i.scrollWidth && h <= i.scrollHeight && (n = a), i.moved = !1
- });
- var s = null,
- h = 0,
- l = 0;
- a.stageContainer.on("move", function(e) {
- var t = e.event;
- if (null !== n) {
- var c = a.devicePixelRatio,
- d = t.getLocalPosition(i);
- if (i.moved || Math.abs(n.y - d.y) > 5 * c || Math.abs(n.x - d.x) > 5 * c) {
- if (i.moved = !0, s && (h = d.y - s.y, l = (new Date).getTime()), s = d, i.allowScrollX) {
- var u = r - (n.x - d.x) / i.ratio,
- f = i.scrollWidth - Math.max(i.content.width / i.content.ratio, i.scrollWidth);
- if (u > 0) u = Math.min(u, 7 * Math.sqrt(u));
- else if (u < f) {
- var p = -u + f;
- u = f - Math.min(p, 7 * Math.sqrt(p))
- }
- i.content.x = u
- }
- if (i.allowScrollY) {
- var g = o - (n.y - d.y) / i.ratio,
- v = i.scrollHeight - Math.max(i.content.height / i.content.ratio, i.scrollHeight);
- if (g > 0) g = Math.min(g, 7 * Math.sqrt(g));
- else if (g < v) {
- var p = -g + v;
- g = v - Math.min(p, 7 * Math.sqrt(p))
- }
- i.content.y = g
- }
- }
- }
- }), a.stageContainer.on("up", function(e) {
- n && (!i.moved && i.callback && i.callback(), i.callback = null, i.clean())
- }), window.onmousewheel = function(e) {
- var t = window.event || e,
- n = t.detail ? t.detail * -10 : t.wheelDelta;
- i.content.y += n;
- var r = (i.scrollWidth - Math.max(i.content.width / i.content.ratio, i.scrollWidth), i.scrollHeight - Math.max(i.content.height / i.content.ratio, i.scrollHeight));
- i.content.y >= 0 ? i.content.y = 0 : i.content.y < r && (i.content.y = r), window.dirtyOnce = !0
- }, window.addEventListener("DOMMouseScroll", window.onmousewheel), this.clean = function() {
- s = null;
- var e = i.scrollWidth - Math.max(i.content.width / i.content.ratio, i.scrollWidth),
- t = i.scrollHeight - Math.max(i.content.height / i.content.ratio, i.scrollHeight);
- i.content.x >= 0 ? new Tween(i.content, {
- x: 0
- }, .2) : i.content.x < e && new Tween(i.content, {
- x: e
- }, .2), i.content.y >= 0 ? new Tween(i.content, {
- y: 0
- }, .2) : i.content.y < t ? new Tween(i.content, {
- y: t
- }, .2) : (new Date).getTime() - l < 250 && Math.abs(h) > 5 && new Tween(i.content, {
- y: Math.max(Math.min(i.content.y + 20 * h, 0), t)
- }, .4), h = 0, n = null, i.moved = !1
- }
- };
- h.prototype = Object.create(Container.prototype), h.prototype.constructor = h, a.modulesToPreload.push(function() {
- window.Sidebar = function() {
- function e() {
- var e = document.createElement("canvas");
- e.style.width = 136, e.style.height = 75;
- var t = e.getContext("2d");
- t.drawImage(o, 0, 0);
- var i = new Text2(Host.Localize.Translate("Menu"), {
- fill: "#FFFFFF",
- size: 80,
- weight: 400
- }),
- n = i.getContent().canvas,
- r = Math.min(35 / n.height, 68 / n.width),
- a = (68 - r * n.width) / 2;
- t.drawImage(n, a, 47, r * n.width, r * n.height);
- var s = new Text2(Host.Localize.Translate("Close"), {
- fill: "#FFFFFF",
- size: 80,
- weight: 400
- }),
- h = s.getContent().canvas,
- l = Math.min(35 / h.height, 68 / h.width),
- c = (68 - l * h.width) / 2;
- return t.drawImage(h, c + 68, 47, l * h.width, l * n.height), e
- }
- function t() {
- var t = new Sheet(e(), 68, 75);
- return t.x = 25, t.y = a.styles.margins.top ? (a.styles.margins.top + 5) / .5 : 25, t.buttonMode = !0, t.interactive = !0, t.ratio = .5 * a.devicePixelRatio, t.buttonMode = !0, t.on("down", function() {
- r.showing ? r.hide() : r.show()
- }), t
- }
- function i() {
- r.icon.ratio = .5 * a.devicePixelRatio, height != p && (p = height, d.width = 25, d.height = height * a.devicePixelRatio, u.fillStyle = f, u.fillRect(0, 0, d.width, d.height), c.texture.destroy(!0), c.setTexture(new Texture.fromCanvas(d)), s.height = height * a.devicePixelRatio, r.content.resize(500 * a.devicePixelRatio, 2 * (height - a.styles.margins.top)))
- }
- function n(e, t, i, n) {
- return e.ratio = a.devicePixelRatio / 2, e.x = t, e.y = i, e.hitArea = new Rectangle(0, 0, 50 * a.devicePixelRatio, 50 * a.devicePixelRatio), void 0 !== n && (e.interactive = !0, e.buttonMode = !0, e.defaultCursor = "pointer", e.on("down", function() {
- r.content.callback = function() {
- a.navigate(n), Sidebar.hide()
- }
- })), e
- }
- var r = this,
- o = embed("i/g/s/menutile.svg");
- r.translateIcon = function() {
- var e = t();
- e.alpha = r.icon.alpha, e.visible = r.icon.visible, e.x = r.icon.x, e.y = r.icon.y, e.frame = r.icon.frame, e.anchor.set(r.icon.anchor.x, r.icon.anchor.y);
- var i = r.icon.parent;
- i.removeChild(r.icon), i.addChild(e), r.icon = e
- }, Container.call(r), r.icon = t(), r.showing = !1;
- var s = new Graphics;
- r.addChild(s), r.interactive = !0, s.beginFill(3355443), s.drawRect(0, 0, 200, 200), s.width = 250 * a.devicePixelRatio;
- var c = new TextureSprite(Texture.emptyTexture);
- a.stageContainer.addChildAt(c, 0), r.sounds = {
- show: void 0,
- hide: void 0
- };
- var d = document.createElement("canvas"),
- u = d.getContext("2d"),
- f = u.createPattern(a.utils.clipImage(embed("i/g/s/sidebar.svg"), 268, 0, 25, 25), "repeat");
- a.stageContainer.addChild(r.icon), c.x = -24, r.content = new h(500, 500), r.content.allowScrollX = !1, r.content.ratio = .5 * a.devicePixelRatio, r.content.y = a.styles.margins.top * a.devicePixelRatio, r.addChild(r.content);
- var p;
- r.show = function() {
- r.showing || (a.stageContainer.addChildAt(window.Sidebar, 0), window.Sidebar.content.content.y = 0, Tween.clear(stage), Tween.clear(c), Tween.clear(r.icon), r.showing = !0, new Tween(stage, {
- x: 250 * a.devicePixelRatio
- }, .3), new Tween(c, {
- x: 250 * a.devicePixelRatio - 24
- }, .3), new Tween(r.icon, {
- x: 510
- }, .3), new Tween(r.icon, {
- alpha: 0
- }, .15).call(function() {
- r.icon.frame = 1, new Tween(r.icon, {
- alpha: 1
- }, .15)
- }), r.sounds.show && r.sounds.show.play(), a.emit("toggleoverlay", {
- visible: !0
- }))
- }, r.hide = function() {
- r.showing && (Tween.clear(stage), Tween.clear(c), Tween.clear(r.icon), r.showing = !1, new Tween(stage, {
- x: 0
- }, .3).call(function() {
- window.Sidebar.parent && window.Sidebar.parent.removeChild(window.Sidebar)
- }), new Tween(c, {
- x: -24
- }, .3), new Tween(r.icon, {
- x: 25
- }, .3), new Tween(r.icon, {
- alpha: 0
- }, .15).call(function() {
- r.icon.frame = 0, new Tween(r.icon, {
- alpha: 1
- }, .15)
- }), r.sounds.hide && r.sounds.hide.play(), a.emit("toggleoverlay", {
- visible: !1
- }))
- };
- var g = 0;
- r.addMenuHeader = function(e) {
- var t = new Container,
- i = new Graphics;
- i.beginFill(2236962), i.drawRect(0, -2, 250 * a.devicePixelRatio, 34 * a.devicePixelRatio), t.addChild(i);
- var e = new Text2(e, {
- weight: a.is.safari || a.is.iOS ? 300 : 200,
- size: 35,
- fill: "#FFFFFF"
- });
- t.addChild(e), e.x = 22, e.y = 12, t.addChild(e), t.y = g, r.content.addChild(t), t.scrollHeight = 64, g += 64
- };
- r.addMenuToggle = function(e, t, i, o, s) {
- function h(e) {
- p = e, p ? (new Tween(f, {
- x: 427
- }, .2), new Tween(d, {
- alpha: 1
- }, .2)) : (new Tween(f, {
- x: 389
- }, .2), new Tween(d, {
- alpha: 0
- }, .2))
- }
- var l = new Container;
- e.x = 15, e.y = 15, l.addChild(e);
- var c = new Graphics;
- l.addChild(c);
- var c = new Graphics;
- l.addChild(c), c.lineStyle(1, 0, .2), c.moveTo(0, 40 * a.devicePixelRatio), c.lineTo(250 * a.devicePixelRatio, 40 * a.devicePixelRatio), c.lineStyle(1, 16777215, .2), c.moveTo(0, 41 * a.devicePixelRatio), c.lineTo(250 * a.devicePixelRatio, 41 * a.devicePixelRatio), l.y = g;
- var d = n(new Sprite(a.utils.clipImage(embed("i/g/s/sidebar.svg"), 167, 0, 100, 60)), 388, 10);
- l.addChild(d), d.interactive = !0, d.buttonMode = !0, d.defaultCursor = "pointer";
- var u = n(new Sprite(a.utils.clipImage(embed("i/g/s/sidebar.svg"), 0, 0, 104, 64)), 386, 8);
- l.addChild(u);
- var f = n(new Sprite(a.utils.clipImage(embed("i/g/s/sidebar.svg"), 105, 0, 61, 59)), 427, 12);
- l.addChild(f);
- var t = new Text2(t, {
- weight: a.is.safari || a.is.iOS ? 300 : 200,
- size: 35,
- fill: "#ffffff",
- maxWidth: s
- });
- l.addChild(t), t.x = 80, t.y = 22;
- var p = !0;
- return l.hitArea = new Rectangle(0, 0, 250 * a.devicePixelRatio, 35 * a.devicePixelRatio), l.on("down", function() {
- r.content.callback = function() {
- h(!p), o(p)
- }
- }), h(i), r.content.addChild(l), l.scrollHeight = 84, g += 84, l
- }, r.hideIcon = function() {
- r.icon.visible = !1, window.dirtyOnce = !0
- }, r.showIcon = function() {
- r.icon.visible = !0, window.dirtyOnce = !0
- }, r.addMenuItem = function(e, t, i) {
- var n = new Container;
- e.x = 15, e.y = 15, n.addChild(e);
- var o = new Graphics;
- n.addChild(o), o.lineStyle(1, 0, .2), o.moveTo(0, 40 * a.devicePixelRatio), o.lineTo(250 * a.devicePixelRatio, 40 * a.devicePixelRatio), o.lineStyle(1, 16777215, .2), o.moveTo(0, 41 * a.devicePixelRatio), o.lineTo(250 * a.devicePixelRatio, 41 * a.devicePixelRatio), n.interactive = !0, n.buttonMode = !0, n.defaultCursor = "pointer", n.y = g, n.hitArea = new Rectangle(0, 0, 250 * a.devicePixelRatio, 35 * a.devicePixelRatio);
- var t = new Text2(t, {
- weight: a.is.safari || a.is.iOS ? 300 : 200,
- size: 35,
- fill: "#ffffff"
- });
- return n.addChild(t), t.x = 80, t.y = 22, r.content.addChild(n), n.scrollHeight = 84, g += 84, n.on("down", function() {
- r.content.callback = function() {
- i && i()
- }
- }), n
- }, r.addMenuItemAfter = function(e, t, i, n) {
- for (var o = r.addMenuItem(t, i, n), a = r.content.getChildren(), s = 0; s < a.length && a[s] != e; s++);
- return r.content.addChildAt(o, s + 1), r.reAlignItems(), o
- }, r.removeMenuItem = function(e) {
- r.content.removeChild(e) && (g -= 84)
- }, r.reAlignItems = function() {
- g = 0;
- for (var e = r.content.getChildren(), t = 0; t < e.length; t++) {
- var i = e[t];
- i.y = g, g += i.scrollHeight
- }
- }, r.addSocialBar = function() {
- var e = new Container;
- e.addChild(n(new Sprite(embed("i/g/s/icon_frvr.svg")), 20, 15, "http://news.frvr.com")), e.addChild(n(new Sprite(embed("i/g/s/icon_tumblr.svg")), 150, 15, "https://twitter.com/frvrgames")), e.addChild(n(new Sprite(embed("i/g/s/icon_facebook.svg")), 280, 15, l.facebookPageUrl)), e.addChild(n(new Sprite(embed("i/g/s/icon_gplus.svg")), 410, 15, "https://plus.google.com/+Frvrgames")), e.y = g, r.content.addChild(e), e.scrollHeight = 82, g += 82
- }, stage.on("down", function() {
- r.showing && r.hide()
- }), a.on("resize", i)
- }, Sidebar.prototype = Object.create(Container.prototype), Sidebar.prototype.constructor = Sidebar, window.Sidebar = new Sidebar
- });
- var l = {
- version: "3.1.5",
- build: 300014,
- stage: "live",
- id: "hex",
- niceId: "Hex",
- domain: "hex.frvr.com",
- facebookAppId: "883249178389083",
- facebookPageUrl: "https://www.facebook.com/hexfrvr/",
- parseId: "WSbpkS8PrSklteMXGKsUxk3QUYUrGJioM6VTxR84",
- parseKey: "z9qCUrq7mVJXOBz8v2j7yMxTVRwRTJYrqVn0rT8U",
- iosAppId: "1036010745",
- twitterDescription: "Hex FRVR is an easy to understand yet fun to master puzzle game. The unique hexagon puzzle board is a fun challenge for even the advanced puzzle addict.",
- adMobInterstitialIdiOS: "ca-app-pub-6389174903462367/4068307733",
- adMobBannerIdiOS: "ca-app-pub-6389174903462367/5545040939",
- adMobInterstitialIdAndroid: "ca-app-pub-6389174903462367/8498507333",
- adMobBannerIdAndroid: "ca-app-pub-6389174903462367/9975240532",
- facebookInterstitialIdiOS: "883249178389083_912538678793466",
- facebookInterstitialIdAndroid: "883249178389083_918163058231028",
- genre: Host.Localize.Translate("Puzzle Game / Hexagon / Puzzle"),
- creditsUrl: "https://frvr.com/credits/hex.html",
- shareTitle: Host.Localize.Translate("Hex FRVR"),
- shareUrl: "https://hex.frvr.com",
- shareText: Host.Localize.Translate("I think you will like Hex FRVR", {}, "Hex FRVR share text"),
- shareTitle: Host.Localize.Translate("Hex FRVR", {}, "Hex FRVR full share name"),
- shortTitle: Host.Localize.Translate("Hex", {}, "Hex FRVR short share name"),
- playTitle: Host.Localize.Translate("Play Hex FRVR"),
- tagLine: Host.Localize.Translate("Free Hexagon Puzzle"),
- tagLineFree: Host.Localize.Translate("Free Hexagon Puzzle"),
- oneliner: Host.Localize.Translate("Hex FRVR is an easy to understand yet fun to master puzzle game."),
- buttonShareTitle: Host.Localize.Translate("Share {game_name}!", {}, "Share button text"),
- buttonShareDescription: Host.Localize.Translate("Invite your friends?", {}, "Share button description"),
- iOSRemoveAdsProductIdentifier: "hexremoveads",
- androidRemoveAdsProductIdentifier: "hexremoveads",
- gameCenterEnabled: !0,
- feedbackURL: "https://frvr.useresponse.com/topics/all/status/all/category/2/sort/new/page/1",
- iOSReviewURL: "https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=1036010745&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8",
- androidReviewURL: "market://details?id=com.frvr.hex",
- androidInstallBannerURL: "i/web/android.png",
- androidInstallURL: "market://details?id=com.frvr.hex",
- androidInstallURLWeb: "https://play.google.com/store/apps/details?id=com.frvr.hex",
- iOSInstallBannerURL: "i/web/ios.png",
- iOSInstallURL: "http://itunes.apple.com/app/id1036010745",
- gaId: "UA-54081731-1",
- chromeAppEnabled: !0,
- chromeAppId: "kibjffjfmagcmicpmogpieelngkcfggn",
- chromeReviewUrl: "https://chrome.google.com/webstore/detail/hex-frvr/kibjffjfmagcmicpmogpieelngkcfggn/reviews",
- chromeInstallUrl: "https://chrome.google.com/webstore/detail/hex-frvr/kibjffjfmagcmicpmogpieelngkcfggn/",
- chromeInstallBannerURL: "i/web/chrome.png",
- chromeAdUrl: "http://hex.frvr.com/ad/chromeLSM/",
- kikImage: "https://cdn.frvr.com/kik/hex.png",
- kikIcon: "https://cdn.frvr.com/kik/hex300x300.png",
- wildTangentInterstitialIdAndroid: "/4337/Mobile/Interstitial",
- twitterTexts: [Host.Localize.Translate("Check out {game_name}, a crazy addictive puzzle game!", {}, ""), Host.Localize.Translate("Check out {game_name}. Who needs sleep anyway?", {}, ""), Host.Localize.Translate("Check out {game_name}. Simply addicting", {}, "")],
- twitterHashTags: "Gaming,Hex,FRVR",
- twitterRelated: "frvrgames,benjaminsen,puzzle,gaming,hex,hexagon,puzzle",
- twitterHTML: '<div style="padding-right:10px"><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://hex.frvr.com" data-text="{{TEXT}}" data-via="FRVRGames" data-hashtags="hex,frvr,gaming" data-related="frvrgames,benjaminsen,puzzle,gaming,hex,frvr" target="_new"></a></div>',
- twitterMobileHTML: '<a class="twitter-share-button" href="https://twitter.com/intent/tweet?text={{TEXT}}" data-size="large" data-hashtags="hex,frvr,gaming" data-related="frvrgames,benjaminsen,puzzle,gaming,hex,frvr" data-url="http://hex.frvr.com/alc/">Tweet</a>',
- twitterNewMode: !0,
- facebookHTML2: '<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fhexfrvr%2F&width=120&layout=button_count&action=like&size=small&show_faces=false&share=false&height=21&appId=183790561698885" width="120" height="21" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>',
- gplusHTML: '<div class="g-plusone" data-size="medium" data-href="http://hex.frvr.com"></div>',
- sinaHTML: '<wb:share-button addition="number" type="button" default_text="{{TEXT}}" url="{{shareUrl}}"></wb:share-button>',
- remoteConfigVersion: "v6",
- plugins: "modal.js,scrollcontainer.js,sidebar.js"
- };
- a.stageContainer.setBackgroundColor(2105376), targetWidth = 2048, targetHeight = 1536, a.on("login", function(e) {
- console.log("Logged in!", e)
- }),
- function() {
- function e() {
- preload.apply(this, a.modulesToPreload.concat([window.onresize, r, function() {
- a.initComplete = !0
- }, window.onresize, function() {
- setTimeout(function() {
- htmlclean()
- }, a.is.iOS ? 300 : 1)
- }]))(function(e, t) {
- htmlprogress(e, e - t)
- })
- }
- setTimeout(e, 1)
- }()
- }();
Add Comment
Please, Sign In to add comment