39099 lines
1.8 MiB
Plaintext
39099 lines
1.8 MiB
Plaintext
parcelRequire = function (t, e, i, n) {
|
|
var r,
|
|
o = "function" == typeof parcelRequire && parcelRequire,
|
|
s = "function" == typeof require && require;
|
|
function a(i, n) {
|
|
if (!e[i]) {
|
|
if (!t[i]) {
|
|
var r = "function" == typeof parcelRequire && parcelRequire;
|
|
if (!n && r)
|
|
return r(i, !0);
|
|
if (o)
|
|
return o(i, !0);
|
|
if (s && "string" == typeof i)
|
|
return s(i);
|
|
var h = new Error("Cannot find module '" + i + "'");
|
|
throw h.code = "MODULE_NOT_FOUND",
|
|
h
|
|
}
|
|
u.resolve = function (e) {
|
|
return t[i][1][e] || e
|
|
},
|
|
u.cache = {};
|
|
var l = e[i] = new a.Module(i);
|
|
t[i][0].call(l.exports, u, l, l.exports, this)
|
|
}
|
|
return e[i].exports;
|
|
function u(t) {
|
|
return a(u.resolve(t))
|
|
}
|
|
}
|
|
a.isParcelRequire = !0,
|
|
a.Module = function (t) {
|
|
this.id = t,
|
|
this.bundle = a,
|
|
this.exports = {}
|
|
},
|
|
a.modules = t,
|
|
a.cache = e,
|
|
a.parent = o,
|
|
a.register = function (e, i) {
|
|
t[e] = [function (t, e) {
|
|
e.exports = i
|
|
}, {}
|
|
]
|
|
};
|
|
for (var h = 0; h < i.length; h++)
|
|
try {
|
|
a(i[h])
|
|
} catch (t) {
|
|
r || (r = t)
|
|
}
|
|
if (i.length) {
|
|
var l = a(i[i.length - 1]);
|
|
"object" == typeof exports && "undefined" != typeof module ? module.exports = l : "function" == typeof define && define.amd && define((function () {
|
|
return l
|
|
}))
|
|
}
|
|
if (parcelRequire = a, r)
|
|
throw r;
|
|
return a
|
|
}
|
|
({
|
|
Mc2P: [function (t, e, i) {
|
|
var n,
|
|
r = arguments[3];
|
|
!function (t) {
|
|
var e = t.Promise,
|
|
r = e && "resolve" in e && "reject" in e && "all" in e && "race" in e && function () {
|
|
var t;
|
|
return new e((function (e) {
|
|
t = e
|
|
})),
|
|
"function" == typeof t
|
|
}
|
|
();
|
|
void 0 !== i && i ? (i.Promise = r ? e : w, i.Polyfill = w) : "function" == typeof n && n.amd ? n((function () {
|
|
return r ? e : w
|
|
})) : r || (t.Promise = w);
|
|
var o = function () {};
|
|
function s(t) {
|
|
return "[object Array]" === Object.prototype.toString.call(t)
|
|
}
|
|
var a,
|
|
h = "undefined" != typeof setImmediate ? setImmediate : setTimeout,
|
|
l = [];
|
|
function u() {
|
|
for (var t = 0; t < l.length; t++)
|
|
l[t][0](l[t][1]);
|
|
l = [],
|
|
a = !1
|
|
}
|
|
function c(t, e) {
|
|
l.push([t, e]),
|
|
a || (a = !0, h(u, 0))
|
|
}
|
|
function p(t) {
|
|
var e = t.owner,
|
|
i = e.state_,
|
|
n = e.data_,
|
|
r = t[i],
|
|
o = t.then;
|
|
if ("function" == typeof r) {
|
|
i = "fulfilled";
|
|
try {
|
|
n = r(n)
|
|
} catch (t) {
|
|
m(o, t)
|
|
}
|
|
}
|
|
d(o, n) || ("fulfilled" === i && f(o, n), "rejected" === i && m(o, n))
|
|
}
|
|
function d(t, e) {
|
|
var i;
|
|
try {
|
|
if (t === e)
|
|
throw new TypeError("A promises callback cannot return that same promise.");
|
|
if (e && ("function" == typeof e || "object" == typeof e)) {
|
|
var n = e.then;
|
|
if ("function" == typeof n)
|
|
return n.call(e, (function (n) {
|
|
i || (i = !0, e !== n ? f(t, n) : _(t, n))
|
|
}), (function (e) {
|
|
i || (i = !0, m(t, e))
|
|
})), !0
|
|
}
|
|
} catch (e) {
|
|
return i || m(t, e),
|
|
!0
|
|
}
|
|
return !1
|
|
}
|
|
function f(t, e) {
|
|
t !== e && d(t, e) || _(t, e)
|
|
}
|
|
function _(t, e) {
|
|
"pending" === t.state_ && (t.state_ = "sealed", t.data_ = e, c(g, t))
|
|
}
|
|
function m(t, e) {
|
|
"pending" === t.state_ && (t.state_ = "sealed", t.data_ = e, c(v, t))
|
|
}
|
|
function y(t) {
|
|
var e = t.then_;
|
|
t.then_ = void 0;
|
|
for (var i = 0; i < e.length; i++)
|
|
p(e[i])
|
|
}
|
|
function g(t) {
|
|
t.state_ = "fulfilled",
|
|
y(t)
|
|
}
|
|
function v(t) {
|
|
t.state_ = "rejected",
|
|
y(t)
|
|
}
|
|
function w(t) {
|
|
if ("function" != typeof t)
|
|
throw new TypeError("Promise constructor takes a function argument");
|
|
if (this instanceof w == !1)
|
|
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
|
|
this.then_ = [],
|
|
function (t, e) {
|
|
function i(t) {
|
|
m(e, t)
|
|
}
|
|
try {
|
|
t((function (t) {
|
|
f(e, t)
|
|
}), i)
|
|
} catch (t) {
|
|
i(t)
|
|
}
|
|
}
|
|
(t, this)
|
|
}
|
|
w.prototype = {
|
|
constructor: w,
|
|
state_: "pending",
|
|
then_: null,
|
|
data_: void 0,
|
|
then: function (t, e) {
|
|
var i = {
|
|
owner: this,
|
|
then: new this.constructor(o),
|
|
fulfilled: t,
|
|
rejected: e
|
|
};
|
|
return "fulfilled" === this.state_ || "rejected" === this.state_ ? c(p, i) : this.then_.push(i),
|
|
i.then
|
|
},
|
|
catch : function (t) {
|
|
return this.then(null, t)
|
|
}
|
|
},
|
|
w.all = function (t) {
|
|
if (!s(t))
|
|
throw new TypeError("You must pass an array to Promise.all().");
|
|
return new this((function (e, i) {
|
|
var n = [],
|
|
r = 0;
|
|
function o(t) {
|
|
return r++,
|
|
function (i) {
|
|
n[t] = i,
|
|
--r || e(n)
|
|
}
|
|
}
|
|
for (var s, a = 0; a < t.length; a++)
|
|
(s = t[a]) && "function" == typeof s.then ? s.then(o(a), i) : n[a] = s;
|
|
r || e(n)
|
|
}))
|
|
},
|
|
w.race = function (t) {
|
|
if (!s(t))
|
|
throw new TypeError("You must pass an array to Promise.race().");
|
|
return new this((function (e, i) {
|
|
for (var n, r = 0; r < t.length; r++)
|
|
(n = t[r]) && "function" == typeof n.then ? n.then(e, i) : e(n)
|
|
}))
|
|
},
|
|
w.resolve = function (t) {
|
|
return t && "object" == typeof t && t.constructor === this ? t : new this((function (e) {
|
|
e(t)
|
|
}))
|
|
},
|
|
w.reject = function (t) {
|
|
return new this((function (e, i) {
|
|
i(t)
|
|
}))
|
|
}
|
|
}
|
|
("undefined" != typeof window ? window : void 0 !== r ? r : "undefined" != typeof self ? self : this)
|
|
}, {}
|
|
],
|
|
tLxU: [function (t, e, i) {
|
|
/*
|
|
object-assign
|
|
(c) Sindre Sorhus
|
|
@license MIT
|
|
*/
|
|
"use strict";
|
|
var n = Object.getOwnPropertySymbols,
|
|
r = Object.prototype.hasOwnProperty,
|
|
o = Object.prototype.propertyIsEnumerable;
|
|
function s(t) {
|
|
if (null == t)
|
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
return Object(t)
|
|
}
|
|
e.exports = function () {
|
|
try {
|
|
if (!Object.assign)
|
|
return !1;
|
|
var t = new String("abc");
|
|
if (t[5] = "de", "5" === Object.getOwnPropertyNames(t)[0])
|
|
return !1;
|
|
for (var e = {}, i = 0; i < 10; i++)
|
|
e["_" + String.fromCharCode(i)] = i;
|
|
if ("0123456789" !== Object.getOwnPropertyNames(e).map((function (t) {
|
|
return e[t]
|
|
})).join(""))
|
|
return !1;
|
|
var n = {};
|
|
return "abcdefghijklmnopqrst".split("").forEach((function (t) {
|
|
n[t] = t
|
|
})),
|
|
"abcdefghijklmnopqrst" === Object.keys(Object.assign({}, n)).join("")
|
|
} catch (t) {
|
|
return !1
|
|
}
|
|
}
|
|
() ? Object.assign : function (t, e) {
|
|
for (var i, a, h = s(t), l = 1; l < arguments.length; l++) {
|
|
for (var u in i = Object(arguments[l]))
|
|
r.call(i, u) && (h[u] = i[u]);
|
|
if (n) {
|
|
a = n(i);
|
|
for (var c = 0; c < a.length; c++)
|
|
o.call(i, a[c]) && (h[a[c]] = i[a[c]])
|
|
}
|
|
}
|
|
return h
|
|
}
|
|
}, {}
|
|
],
|
|
AWY2: [function (t, e, i) {
|
|
var n = arguments[3],
|
|
r = t("es6-promise-polyfill"),
|
|
o = s(t("object-assign"));
|
|
function s(t) {
|
|
return t && t.__esModule ? t : {
|
|
default:
|
|
t
|
|
}
|
|
}
|
|
/*!
|
|
* @pixi/polyfill - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/polyfill is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
window.Promise || (window.Promise = r.Polyfill),
|
|
Object.assign || (Object.assign = o.default);
|
|
var a = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== n ? n : "undefined" != typeof self ? self : {},
|
|
h = 16;
|
|
if (Date.now && Date.prototype.getTime || (Date.now = function () {
|
|
return (new Date).getTime()
|
|
}), !a.performance || !a.performance.now) {
|
|
var l = Date.now();
|
|
a.performance || (a.performance = {}),
|
|
a.performance.now = function () {
|
|
return Date.now() - l
|
|
}
|
|
}
|
|
for (var u = Date.now(), c = ["ms", "moz", "webkit", "o"], p = 0; p < c.length && !a.requestAnimationFrame; ++p) {
|
|
var d = c[p];
|
|
a.requestAnimationFrame = a[d + "RequestAnimationFrame"],
|
|
a.cancelAnimationFrame = a[d + "CancelAnimationFrame"] || a[d + "CancelRequestAnimationFrame"]
|
|
}
|
|
a.requestAnimationFrame || (a.requestAnimationFrame = function (t) {
|
|
if ("function" != typeof t)
|
|
throw new TypeError(t + "is not a function");
|
|
var e = Date.now(),
|
|
i = h + u - e;
|
|
return i < 0 && (i = 0),
|
|
u = e,
|
|
setTimeout((function () {
|
|
u = Date.now(),
|
|
t(performance.now())
|
|
}), i)
|
|
}),
|
|
a.cancelAnimationFrame || (a.cancelAnimationFrame = function (t) {
|
|
return clearTimeout(t)
|
|
}),
|
|
Math.sign || (Math.sign = function (t) {
|
|
return 0 === (t = Number(t)) || isNaN(t) ? t : t > 0 ? 1 : -1
|
|
}),
|
|
Number.isInteger || (Number.isInteger = function (t) {
|
|
return "number" == typeof t && isFinite(t) && Math.floor(t) === t
|
|
}),
|
|
window.ArrayBuffer || (window.ArrayBuffer = Array),
|
|
window.Float32Array || (window.Float32Array = Array),
|
|
window.Uint32Array || (window.Uint32Array = Array),
|
|
window.Uint16Array || (window.Uint16Array = Array),
|
|
window.Uint8Array || (window.Uint8Array = Array),
|
|
window.Int32Array || (window.Int32Array = Array)
|
|
}, {
|
|
"es6-promise-polyfill": "Mc2P",
|
|
"object-assign": "tLxU"
|
|
}
|
|
],
|
|
ZeGp: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.default = function (t) {
|
|
var e = {
|
|
userAgent: "",
|
|
platform: "",
|
|
maxTouchPoints: 0
|
|
};
|
|
t || "undefined" == typeof navigator ? "string" == typeof t ? e.userAgent = t : t && t.userAgent && (e = {
|
|
userAgent: t.userAgent,
|
|
platform: t.platform,
|
|
maxTouchPoints: t.maxTouchPoints || 0
|
|
}) : e = {
|
|
userAgent: navigator.userAgent,
|
|
platform: navigator.platform,
|
|
maxTouchPoints: navigator.maxTouchPoints || 0
|
|
};
|
|
var i = e.userAgent,
|
|
v = i.split("[FBAN");
|
|
void 0 !== v[1] && (i = v[0]);
|
|
void 0 !== (v = i.split("Twitter"))[1] && (i = v[0]);
|
|
var w = function (t) {
|
|
return function (e) {
|
|
return e.test(t)
|
|
}
|
|
}
|
|
(i),
|
|
x = {
|
|
apple: {
|
|
phone: w(n) && !w(c),
|
|
ipod: w(r),
|
|
tablet: !w(n) && (w(o) || g(e)) && !w(c),
|
|
universal: w(s),
|
|
device: (w(n) || w(r) || w(o) || w(s) || g(e)) && !w(c)
|
|
},
|
|
amazon: {
|
|
phone: w(l),
|
|
tablet: !w(l) && w(u),
|
|
device: w(l) || w(u)
|
|
},
|
|
android: {
|
|
phone: !w(c) && w(l) || !w(c) && w(a),
|
|
tablet: !w(c) && !w(l) && !w(a) && (w(u) || w(h)),
|
|
device: !w(c) && (w(l) || w(u) || w(a) || w(h)) || w(/\bokhttp\b/i)
|
|
},
|
|
windows: {
|
|
phone: w(c),
|
|
tablet: w(p),
|
|
device: w(c) || w(p)
|
|
},
|
|
other: {
|
|
blackberry: w(d),
|
|
blackberry10: w(f),
|
|
opera: w(_),
|
|
firefox: w(y),
|
|
chrome: w(m),
|
|
device: w(d) || w(f) || w(_) || w(y) || w(m)
|
|
},
|
|
any: !1,
|
|
phone: !1,
|
|
tablet: !1
|
|
};
|
|
return x.any = x.apple.device || x.android.device || x.windows.device || x.other.device,
|
|
x.phone = x.apple.phone || x.android.phone || x.windows.phone,
|
|
x.tablet = x.apple.tablet || x.android.tablet || x.windows.tablet,
|
|
x
|
|
};
|
|
var n = /iPhone/i,
|
|
r = /iPod/i,
|
|
o = /iPad/i,
|
|
s = /\biOS-universal(?:.+)Mac\b/i,
|
|
a = /\bAndroid(?:.+)Mobile\b/i,
|
|
h = /Android/i,
|
|
l = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,
|
|
u = /Silk/i,
|
|
c = /Windows Phone/i,
|
|
p = /\bWindows(?:.+)ARM\b/i,
|
|
d = /BlackBerry/i,
|
|
f = /BB10/i,
|
|
_ = /Opera Mini/i,
|
|
m = /\b(CriOS|Chrome)(?:.+)Mobile/i,
|
|
y = /Mobile(?:.+)Firefox\b/i,
|
|
g = function (t) {
|
|
return void 0 !== t && "MacIntel" === t.platform && "number" == typeof t.maxTouchPoints && t.maxTouchPoints > 1 && "undefined" == typeof MSStream
|
|
}
|
|
}, {}
|
|
],
|
|
S82H: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
});
|
|
var n = {};
|
|
Object.defineProperty(i, "default", {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return r.default
|
|
}
|
|
});
|
|
var r = function (t) {
|
|
if (t && t.__esModule)
|
|
return t;
|
|
if (null === t || "object" != typeof t && "function" != typeof t)
|
|
return {
|
|
default:
|
|
t
|
|
};
|
|
var e = o();
|
|
if (e && e.has(t))
|
|
return e.get(t);
|
|
var i = {},
|
|
n = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var r in t)
|
|
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
var s = n ? Object.getOwnPropertyDescriptor(t, r) : null;
|
|
s && (s.get || s.set) ? Object.defineProperty(i, r, s) : i[r] = t[r]
|
|
}
|
|
i.default = t,
|
|
e && e.set(t, i);
|
|
return i
|
|
}
|
|
(t("./isMobile"));
|
|
function o() {
|
|
if ("function" != typeof WeakMap)
|
|
return null;
|
|
var t = new WeakMap;
|
|
return o = function () {
|
|
return t
|
|
},
|
|
t
|
|
}
|
|
Object.keys(r).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return r[t]
|
|
}
|
|
}))
|
|
}))
|
|
}, {
|
|
"./isMobile": "ZeGp"
|
|
}
|
|
],
|
|
v11T: [function (t, e, i) {
|
|
"use strict";
|
|
var n;
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.settings = i.isMobile = void 0;
|
|
/*!
|
|
* @pixi/settings - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/settings is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
var r = (0, ((n = t("ismobilejs")) && n.__esModule ? n : {
|
|
default:
|
|
n
|
|
}).default)();
|
|
i.isMobile = r;
|
|
var o = {
|
|
MIPMAP_TEXTURES: 1,
|
|
ANISOTROPIC_LEVEL: 0,
|
|
RESOLUTION: 1,
|
|
FILTER_RESOLUTION: 1,
|
|
SPRITE_MAX_TEXTURES: function (t) {
|
|
var e = !0;
|
|
if (r.tablet || r.phone) {
|
|
if (e = !1, r.apple.device) {
|
|
var i = navigator.userAgent.match(/OS (\d+)_(\d+)?/);
|
|
if (i)
|
|
parseInt(i[1], 10) >= 11 && (e = !0)
|
|
}
|
|
if (r.android.device) {
|
|
var n = navigator.userAgent.match(/Android\s([0-9.]*)/);
|
|
if (n)
|
|
parseInt(n[1], 10) >= 7 && (e = !0)
|
|
}
|
|
}
|
|
return e ? t : 4
|
|
}
|
|
(32),
|
|
SPRITE_BATCH_SIZE: 4096,
|
|
RENDER_OPTIONS: {
|
|
view: null,
|
|
antialias: !1,
|
|
forceFXAA: !1,
|
|
autoDensity: !1,
|
|
transparent: !1,
|
|
backgroundColor: 0,
|
|
clearBeforeRender: !0,
|
|
preserveDrawingBuffer: !1,
|
|
width: 800,
|
|
height: 600,
|
|
legacy: !1
|
|
},
|
|
GC_MODE: 0,
|
|
GC_MAX_IDLE: 3600,
|
|
GC_MAX_CHECK_COUNT: 600,
|
|
WRAP_MODE: 33071,
|
|
SCALE_MODE: 1,
|
|
PRECISION_VERTEX: "highp",
|
|
PRECISION_FRAGMENT: r.apple.device ? "highp" : "mediump",
|
|
CAN_UPLOAD_SAME_BUFFER: !r.apple.device,
|
|
CREATE_IMAGE_BITMAP: !1,
|
|
ROUND_PIXELS: !1
|
|
};
|
|
i.settings = o
|
|
}, {
|
|
ismobilejs: "S82H"
|
|
}
|
|
],
|
|
Clm3: [function (t, e, i) {
|
|
"use strict";
|
|
var n = Object.prototype.hasOwnProperty,
|
|
r = "~";
|
|
function o() {}
|
|
function s(t, e, i) {
|
|
this.fn = t,
|
|
this.context = e,
|
|
this.once = i || !1
|
|
}
|
|
function a(t, e, i, n, o) {
|
|
if ("function" != typeof i)
|
|
throw new TypeError("The listener must be a function");
|
|
var a = new s(i, n || t, o),
|
|
h = r ? r + e : e;
|
|
return t._events[h] ? t._events[h].fn ? t._events[h] = [t._events[h], a] : t._events[h].push(a) : (t._events[h] = a, t._eventsCount++),
|
|
t
|
|
}
|
|
function h(t, e) {
|
|
0 == --t._eventsCount ? t._events = new o : delete t._events[e]
|
|
}
|
|
function l() {
|
|
this._events = new o,
|
|
this._eventsCount = 0
|
|
}
|
|
Object.create && (o.prototype = Object.create(null), (new o).__proto__ || (r = !1)),
|
|
l.prototype.eventNames = function () {
|
|
var t,
|
|
e,
|
|
i = [];
|
|
if (0 === this._eventsCount)
|
|
return i;
|
|
for (e in t = this._events)
|
|
n.call(t, e) && i.push(r ? e.slice(1) : e);
|
|
return Object.getOwnPropertySymbols ? i.concat(Object.getOwnPropertySymbols(t)) : i
|
|
},
|
|
l.prototype.listeners = function (t) {
|
|
var e = r ? r + t : t,
|
|
i = this._events[e];
|
|
if (!i)
|
|
return [];
|
|
if (i.fn)
|
|
return [i.fn];
|
|
for (var n = 0, o = i.length, s = new Array(o); n < o; n++)
|
|
s[n] = i[n].fn;
|
|
return s
|
|
},
|
|
l.prototype.listenerCount = function (t) {
|
|
var e = r ? r + t : t,
|
|
i = this._events[e];
|
|
return i ? i.fn ? 1 : i.length : 0
|
|
},
|
|
l.prototype.emit = function (t, e, i, n, o, s) {
|
|
var a = r ? r + t : t;
|
|
if (!this._events[a])
|
|
return !1;
|
|
var h,
|
|
l,
|
|
u = this._events[a],
|
|
c = arguments.length;
|
|
if (u.fn) {
|
|
switch (u.once && this.removeListener(t, u.fn, void 0, !0), c) {
|
|
case 1:
|
|
return u.fn.call(u.context),
|
|
!0;
|
|
case 2:
|
|
return u.fn.call(u.context, e),
|
|
!0;
|
|
case 3:
|
|
return u.fn.call(u.context, e, i),
|
|
!0;
|
|
case 4:
|
|
return u.fn.call(u.context, e, i, n),
|
|
!0;
|
|
case 5:
|
|
return u.fn.call(u.context, e, i, n, o),
|
|
!0;
|
|
case 6:
|
|
return u.fn.call(u.context, e, i, n, o, s),
|
|
!0
|
|
}
|
|
for (l = 1, h = new Array(c - 1); l < c; l++)
|
|
h[l - 1] = arguments[l];
|
|
u.fn.apply(u.context, h)
|
|
} else {
|
|
var p,
|
|
d = u.length;
|
|
for (l = 0; l < d; l++)
|
|
switch (u[l].once && this.removeListener(t, u[l].fn, void 0, !0), c) {
|
|
case 1:
|
|
u[l].fn.call(u[l].context);
|
|
break;
|
|
case 2:
|
|
u[l].fn.call(u[l].context, e);
|
|
break;
|
|
case 3:
|
|
u[l].fn.call(u[l].context, e, i);
|
|
break;
|
|
case 4:
|
|
u[l].fn.call(u[l].context, e, i, n);
|
|
break;
|
|
default:
|
|
if (!h)
|
|
for (p = 1, h = new Array(c - 1); p < c; p++)
|
|
h[p - 1] = arguments[p];
|
|
u[l].fn.apply(u[l].context, h)
|
|
}
|
|
}
|
|
return !0
|
|
},
|
|
l.prototype.on = function (t, e, i) {
|
|
return a(this, t, e, i, !1)
|
|
},
|
|
l.prototype.once = function (t, e, i) {
|
|
return a(this, t, e, i, !0)
|
|
},
|
|
l.prototype.removeListener = function (t, e, i, n) {
|
|
var o = r ? r + t : t;
|
|
if (!this._events[o])
|
|
return this;
|
|
if (!e)
|
|
return h(this, o), this;
|
|
var s = this._events[o];
|
|
if (s.fn)
|
|
s.fn !== e || n && !s.once || i && s.context !== i || h(this, o);
|
|
else {
|
|
for (var a = 0, l = [], u = s.length; a < u; a++)
|
|
(s[a].fn !== e || n && !s[a].once || i && s[a].context !== i) && l.push(s[a]);
|
|
l.length ? this._events[o] = 1 === l.length ? l[0] : l : h(this, o)
|
|
}
|
|
return this
|
|
},
|
|
l.prototype.removeAllListeners = function (t) {
|
|
var e;
|
|
return t ? (e = r ? r + t : t, this._events[e] && h(this, e)) : (this._events = new o, this._eventsCount = 0),
|
|
this
|
|
},
|
|
l.prototype.off = l.prototype.removeListener,
|
|
l.prototype.addListener = l.prototype.on,
|
|
l.prefixed = r,
|
|
l.EventEmitter = l,
|
|
void 0 !== e && (e.exports = l)
|
|
}, {}
|
|
],
|
|
Ic8v: [function (t, e, i) {
|
|
"use strict";
|
|
function n(t, e, i) {
|
|
i = i || 2;
|
|
var n,
|
|
a,
|
|
h,
|
|
l,
|
|
u,
|
|
d,
|
|
f,
|
|
m = e && e.length,
|
|
y = m ? e[0] * i : t.length,
|
|
g = r(t, 0, y, i, !0),
|
|
v = [];
|
|
if (!g || g.next === g.prev)
|
|
return v;
|
|
if (m && (g = function (t, e, i, n) {
|
|
var s,
|
|
a,
|
|
h,
|
|
l,
|
|
u,
|
|
d = [];
|
|
for (s = 0, a = e.length; s < a; s++)
|
|
h = e[s] * n, l = s < a - 1 ? e[s + 1] * n : t.length, (u = r(t, h, l, n, !1))
|
|
=== u.next && (u.steiner = !0), d.push(_(u));
|
|
for (d.sort(c), s = 0; s < d.length; s++)
|
|
p(d[s], i), i = o(i, i.next);
|
|
return i
|
|
}
|
|
(t, e, g, i)), t.length > 80 * i) {
|
|
n = h = t[0],
|
|
a = l = t[1];
|
|
for (var w = i; w < y; w += i)
|
|
(u = t[w]) < n && (n = u), (d = t[w + 1]) < a && (a = d), u > h && (h = u), d > l && (l = d);
|
|
f = 0 !== (f = Math.max(h - n, l - a)) ? 1 / f : 0
|
|
}
|
|
return s(g, v, i, n, a, f),
|
|
v
|
|
}
|
|
function r(t, e, i, n, r) {
|
|
var o,
|
|
s;
|
|
if (r === C(t, e, i, n) > 0)
|
|
for (o = e; o < i; o += n)
|
|
s = A(o, t[o], t[o + 1], s);
|
|
else
|
|
for (o = i - n; o >= e; o -= n)
|
|
s = A(o, t[o], t[o + 1], s);
|
|
return s && v(s, s.next) && (S(s), s = s.next),
|
|
s
|
|
}
|
|
function o(t, e) {
|
|
if (!t)
|
|
return t;
|
|
e || (e = t);
|
|
var i,
|
|
n = t;
|
|
do {
|
|
if (i = !1, n.steiner || !v(n, n.next) && 0 !== g(n.prev, n, n.next))
|
|
n = n.next;
|
|
else {
|
|
if (S(n), (n = e = n.prev) === n.next)
|
|
break;
|
|
i = !0
|
|
}
|
|
} while (i || n !== e);
|
|
return e
|
|
}
|
|
function s(t, e, i, n, r, c, p) {
|
|
if (t) {
|
|
!p && c && function (t, e, i, n) {
|
|
var r = t;
|
|
do {
|
|
null === r.z && (r.z = f(r.x, r.y, e, i, n)),
|
|
r.prevZ = r.prev,
|
|
r.nextZ = r.next,
|
|
r = r.next
|
|
} while (r !== t);
|
|
r.prevZ.nextZ = null,
|
|
r.prevZ = null,
|
|
function (t) {
|
|
var e,
|
|
i,
|
|
n,
|
|
r,
|
|
o,
|
|
s,
|
|
a,
|
|
h,
|
|
l = 1;
|
|
do {
|
|
for (i = t, t = null, o = null, s = 0; i; ) {
|
|
for (s++, n = i, a = 0, e = 0; e < l && (a++, n = n.nextZ); e++);
|
|
for (h = l; a > 0 || h > 0 && n; )
|
|
0 !== a && (0 === h || !n || i.z <= n.z) ? (r = i, i = i.nextZ, a--) : (r = n, n = n.nextZ, h--), o ? o.nextZ = r : t = r, r.prevZ = o, o = r;
|
|
i = n
|
|
}
|
|
o.nextZ = null,
|
|
l *= 2
|
|
} while (s > 1)
|
|
}
|
|
(r)
|
|
}
|
|
(t, n, r, c);
|
|
for (var d, _, m = t; t.prev !== t.next; )
|
|
if (d = t.prev, _ = t.next, c ? h(t, n, r, c) : a(t))
|
|
e.push(d.i / i), e.push(t.i / i), e.push(_.i / i), S(t), t = _.next, m = _.next;
|
|
else if ((t = _) === m) {
|
|
p ? 1 === p ? s(t = l(o(t), e, i), e, i, n, r, c, 2) : 2 === p && u(t, e, i, n, r, c) : s(o(t), e, i, n, r, c, 1);
|
|
break
|
|
}
|
|
}
|
|
}
|
|
function a(t) {
|
|
var e = t.prev,
|
|
i = t,
|
|
n = t.next;
|
|
if (g(e, i, n) >= 0)
|
|
return !1;
|
|
for (var r = t.next.next; r !== t.prev; ) {
|
|
if (m(e.x, e.y, i.x, i.y, n.x, n.y, r.x, r.y) && g(r.prev, r, r.next) >= 0)
|
|
return !1;
|
|
r = r.next
|
|
}
|
|
return !0
|
|
}
|
|
function h(t, e, i, n) {
|
|
var r = t.prev,
|
|
o = t,
|
|
s = t.next;
|
|
if (g(r, o, s) >= 0)
|
|
return !1;
|
|
for (var a = r.x < o.x ? r.x < s.x ? r.x : s.x : o.x < s.x ? o.x : s.x, h = r.y < o.y ? r.y < s.y ? r.y : s.y : o.y < s.y ? o.y : s.y, l = r.x > o.x ? r.x > s.x ? r.x : s.x : o.x > s.x ? o.x : s.x, u = r.y > o.y ? r.y > s.y ? r.y : s.y : o.y > s.y ? o.y : s.y, c = f(a, h, e, i, n), p = f(l, u, e, i, n), d = t.prevZ, _ = t.nextZ; d && d.z >= c && _ && _.z <= p; ) {
|
|
if (d !== t.prev && d !== t.next && m(r.x, r.y, o.x, o.y, s.x, s.y, d.x, d.y) && g(d.prev, d, d.next) >= 0)
|
|
return !1;
|
|
if (d = d.prevZ, _ !== t.prev && _ !== t.next && m(r.x, r.y, o.x, o.y, s.x, s.y, _.x, _.y) && g(_.prev, _, _.next) >= 0)
|
|
return !1;
|
|
_ = _.nextZ
|
|
}
|
|
for (; d && d.z >= c; ) {
|
|
if (d !== t.prev && d !== t.next && m(r.x, r.y, o.x, o.y, s.x, s.y, d.x, d.y) && g(d.prev, d, d.next) >= 0)
|
|
return !1;
|
|
d = d.prevZ
|
|
}
|
|
for (; _ && _.z <= p; ) {
|
|
if (_ !== t.prev && _ !== t.next && m(r.x, r.y, o.x, o.y, s.x, s.y, _.x, _.y) && g(_.prev, _, _.next) >= 0)
|
|
return !1;
|
|
_ = _.nextZ
|
|
}
|
|
return !0
|
|
}
|
|
function l(t, e, i) {
|
|
var n = t;
|
|
do {
|
|
var r = n.prev,
|
|
s = n.next.next;
|
|
!v(r, s) && w(r, n, n.next, s) && E(r, s) && E(s, r) && (e.push(r.i / i), e.push(n.i / i), e.push(s.i / i), S(n), S(n.next), n = t = s),
|
|
n = n.next
|
|
} while (n !== t);
|
|
return o(n)
|
|
}
|
|
function u(t, e, i, n, r, a) {
|
|
var h = t;
|
|
do {
|
|
for (var l = h.next.next; l !== h.prev; ) {
|
|
if (h.i !== l.i && y(h, l)) {
|
|
var u = $(h, l);
|
|
return h = o(h, h.next),
|
|
u = o(u, u.next),
|
|
s(h, e, i, n, r, a),
|
|
void s(u, e, i, n, r, a)
|
|
}
|
|
l = l.next
|
|
}
|
|
h = h.next
|
|
} while (h !== t)
|
|
}
|
|
function c(t, e) {
|
|
return t.x - e.x
|
|
}
|
|
function p(t, e) {
|
|
if (e = function (t, e) {
|
|
var i,
|
|
n = e,
|
|
r = t.x,
|
|
o = t.y,
|
|
s = -1 / 0;
|
|
do {
|
|
if (o <= n.y && o >= n.next.y && n.next.y !== n.y) {
|
|
var a = n.x + (o - n.y) * (n.next.x - n.x) / (n.next.y - n.y);
|
|
if (a <= r && a > s) {
|
|
if (s = a, a === r) {
|
|
if (o === n.y)
|
|
return n;
|
|
if (o === n.next.y)
|
|
return n.next
|
|
}
|
|
i = n.x < n.next.x ? n : n.next
|
|
}
|
|
}
|
|
n = n.next
|
|
} while (n !== e);
|
|
if (!i)
|
|
return null;
|
|
if (r === s)
|
|
return i;
|
|
var h,
|
|
l = i,
|
|
u = i.x,
|
|
c = i.y,
|
|
p = 1 / 0;
|
|
n = i;
|
|
do {
|
|
r >= n.x && n.x >= u && r !== n.x && m(o < c ? r : s, o, u, c, o < c ? s : r, o, n.x, n.y) && (h = Math.abs(o - n.y) / (r - n.x), E(n, t) && (h < p || h === p && (n.x > i.x || n.x === i.x && d(i, n))) && (i = n, p = h)),
|
|
n = n.next
|
|
} while (n !== l);
|
|
return i
|
|
}
|
|
(t, e)) {
|
|
var i = $(e, t);
|
|
o(e, e.next),
|
|
o(i, i.next)
|
|
}
|
|
}
|
|
function d(t, e) {
|
|
return g(t.prev, t, e.prev) < 0 && g(e.next, t, t.next) < 0
|
|
}
|
|
function f(t, e, i, n, r) {
|
|
return (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * r) | t << 8)) | t << 4)) | t << 2)) | t << 1)) | (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = 32767 * (e - n) * r) | e << 8)) | e << 4)) | e << 2)) | e << 1)) << 1
|
|
}
|
|
function _(t) {
|
|
var e = t,
|
|
i = t;
|
|
do {
|
|
(e.x < i.x || e.x === i.x && e.y < i.y) && (i = e),
|
|
e = e.next
|
|
} while (e !== t);
|
|
return i
|
|
}
|
|
function m(t, e, i, n, r, o, s, a) {
|
|
return (r - s) * (e - a) - (t - s) * (o - a) >= 0 && (t - s) * (n - a) - (i - s) * (e - a) >= 0 && (i - s) * (o - a) - (r - s) * (n - a) >= 0
|
|
}
|
|
function y(t, e) {
|
|
return t.next.i !== e.i && t.prev.i !== e.i && !function (t, e) {
|
|
var i = t;
|
|
do {
|
|
if (i.i !== t.i && i.next.i !== t.i && i.i !== e.i && i.next.i !== e.i && w(i, i.next, t, e))
|
|
return !0;
|
|
i = i.next
|
|
} while (i !== t);
|
|
return !1
|
|
}
|
|
(t, e) && (E(t, e) && E(e, t) && function (t, e) {
|
|
var i = t,
|
|
n = !1,
|
|
r = (t.x + e.x) / 2,
|
|
o = (t.y + e.y) / 2;
|
|
do {
|
|
i.y > o != i.next.y > o && i.next.y !== i.y && r < (i.next.x - i.x) * (o - i.y) / (i.next.y - i.y) + i.x && (n = !n),
|
|
i = i.next
|
|
} while (i !== t);
|
|
return n
|
|
}
|
|
(t, e) && (g(t.prev, t, e.prev) || g(t, e.prev, e)) || v(t, e) && g(t.prev, t, t.next) > 0 && g(e.prev, e, e.next) > 0)
|
|
}
|
|
function g(t, e, i) {
|
|
return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y)
|
|
}
|
|
function v(t, e) {
|
|
return t.x === e.x && t.y === e.y
|
|
}
|
|
function w(t, e, i, n) {
|
|
var r = b(g(t, e, i)),
|
|
o = b(g(t, e, n)),
|
|
s = b(g(i, n, t)),
|
|
a = b(g(i, n, e));
|
|
return r !== o && s !== a || (!(0 !== r || !x(t, i, e)) || (!(0 !== o || !x(t, n, e)) || (!(0 !== s || !x(i, t, n)) || !(0 !== a || !x(i, e, n)))))
|
|
}
|
|
function x(t, e, i) {
|
|
return e.x <= Math.max(t.x, i.x) && e.x >= Math.min(t.x, i.x) && e.y <= Math.max(t.y, i.y) && e.y >= Math.min(t.y, i.y)
|
|
}
|
|
function b(t) {
|
|
return t > 0 ? 1 : t < 0 ? -1 : 0
|
|
}
|
|
function E(t, e) {
|
|
return g(t.prev, t, t.next) < 0 ? g(t, e, t.next) >= 0 && g(t, t.prev, e) >= 0 : g(t, e, t.prev) < 0 || g(t, t.next, e) < 0
|
|
}
|
|
function $(t, e) {
|
|
var i = new T(t.i, t.x, t.y),
|
|
n = new T(e.i, e.x, e.y),
|
|
r = t.next,
|
|
o = e.prev;
|
|
return t.next = e,
|
|
e.prev = t,
|
|
i.next = r,
|
|
r.prev = i,
|
|
n.next = i,
|
|
i.prev = n,
|
|
o.next = n,
|
|
n.prev = o,
|
|
n
|
|
}
|
|
function A(t, e, i, n) {
|
|
var r = new T(t, e, i);
|
|
return n ? (r.next = n.next, r.prev = n, n.next.prev = r, n.next = r) : (r.prev = r, r.next = r),
|
|
r
|
|
}
|
|
function S(t) {
|
|
t.next.prev = t.prev,
|
|
t.prev.next = t.next,
|
|
t.prevZ && (t.prevZ.nextZ = t.nextZ),
|
|
t.nextZ && (t.nextZ.prevZ = t.prevZ)
|
|
}
|
|
function T(t, e, i) {
|
|
this.i = t,
|
|
this.x = e,
|
|
this.y = i,
|
|
this.prev = null,
|
|
this.next = null,
|
|
this.z = null,
|
|
this.prevZ = null,
|
|
this.nextZ = null,
|
|
this.steiner = !1
|
|
}
|
|
function C(t, e, i, n) {
|
|
for (var r = 0, o = e, s = i - n; o < i; o += n)
|
|
r += (t[s] - t[o]) * (t[o + 1] + t[s + 1]), s = o;
|
|
return r
|
|
}
|
|
e.exports = n,
|
|
e.exports.default = n,
|
|
n.deviation = function (t, e, i, n) {
|
|
var r = e && e.length,
|
|
o = r ? e[0] * i : t.length,
|
|
s = Math.abs(C(t, 0, o, i));
|
|
if (r)
|
|
for (var a = 0, h = e.length; a < h; a++) {
|
|
var l = e[a] * i,
|
|
u = a < h - 1 ? e[a + 1] * i : t.length;
|
|
s -= Math.abs(C(t, l, u, i))
|
|
}
|
|
var c = 0;
|
|
for (a = 0; a < n.length; a += 3) {
|
|
var p = n[a] * i,
|
|
d = n[a + 1] * i,
|
|
f = n[a + 2] * i;
|
|
c += Math.abs((t[p] - t[f]) * (t[d + 1] - t[p + 1]) - (t[p] - t[d]) * (t[f + 1] - t[p + 1]))
|
|
}
|
|
return 0 === s && 0 === c ? 0 : Math.abs((c - s) / s)
|
|
},
|
|
n.flatten = function (t) {
|
|
for (var e = t[0][0].length, i = {
|
|
vertices: [],
|
|
holes: [],
|
|
dimensions: e
|
|
}, n = 0, r = 0; r < t.length; r++) {
|
|
for (var o = 0; o < t[r].length; o++)
|
|
for (var s = 0; s < e; s++)
|
|
i.vertices.push(t[r][o][s]);
|
|
r > 0 && (n += t[r - 1].length, i.holes.push(n))
|
|
}
|
|
return i
|
|
}
|
|
}, {}
|
|
],
|
|
PT1R: [function (t, e, i) {
|
|
var n,
|
|
r = arguments[3];
|
|
!function (t) {
|
|
var o = "object" == typeof i && i && !i.nodeType && i,
|
|
s = "object" == typeof e && e && !e.nodeType && e,
|
|
a = "object" == typeof r && r;
|
|
a.global !== a && a.window !== a && a.self !== a || (t = a);
|
|
var h,
|
|
l,
|
|
u = 2147483647,
|
|
c = /^xn--/,
|
|
p = /[^\x20-\x7E]/,
|
|
d = /[\x2E\u3002\uFF0E\uFF61]/g,
|
|
f = {
|
|
overflow: "Overflow: input needs wider integers to process",
|
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
"invalid-input": "Invalid input"
|
|
},
|
|
_ = Math.floor,
|
|
m = String.fromCharCode;
|
|
function y(t) {
|
|
throw new RangeError(f[t])
|
|
}
|
|
function g(t, e) {
|
|
for (var i = t.length, n = []; i--; )
|
|
n[i] = e(t[i]);
|
|
return n
|
|
}
|
|
function v(t, e) {
|
|
var i = t.split("@"),
|
|
n = "";
|
|
return i.length > 1 && (n = i[0] + "@", t = i[1]),
|
|
n + g((t = t.replace(d, ".")).split("."), e).join(".")
|
|
}
|
|
function w(t) {
|
|
for (var e, i, n = [], r = 0, o = t.length; r < o; )
|
|
(e = t.charCodeAt(r++)) >= 55296 && e <= 56319 && r < o ? 56320 == (64512 & (i = t.charCodeAt(r++))) ? n.push(((1023 & e) << 10) + (1023 & i) + 65536) : (n.push(e), r--) : n.push(e);
|
|
return n
|
|
}
|
|
function x(t) {
|
|
return g(t, (function (t) {
|
|
var e = "";
|
|
return t > 65535 && (e += m((t -= 65536) >>> 10 & 1023 | 55296), t = 56320 | 1023 & t),
|
|
e += m(t)
|
|
})).join("")
|
|
}
|
|
function b(t, e) {
|
|
return t + 22 + 75 * (t < 26) - ((0 != e) << 5)
|
|
}
|
|
function E(t, e, i) {
|
|
var n = 0;
|
|
for (t = i ? _(t / 700) : t >> 1, t += _(t / e); t > 455; n += 36)
|
|
t = _(t / 35);
|
|
return _(n + 36 * t / (t + 38))
|
|
}
|
|
function $(t) {
|
|
var e,
|
|
i,
|
|
n,
|
|
r,
|
|
o,
|
|
s,
|
|
a,
|
|
h,
|
|
l,
|
|
c,
|
|
p,
|
|
d = [],
|
|
f = t.length,
|
|
m = 0,
|
|
g = 128,
|
|
v = 72;
|
|
for ((i = t.lastIndexOf("-")) < 0 && (i = 0), n = 0; n < i; ++n)
|
|
t.charCodeAt(n) >= 128 && y("not-basic"), d.push(t.charCodeAt(n));
|
|
for (r = i > 0 ? i + 1 : 0; r < f; ) {
|
|
for (o = m, s = 1, a = 36; r >= f && y("invalid-input"), ((h = (p = t.charCodeAt(r++)) - 48 < 10 ? p - 22 : p - 65 < 26 ? p - 65 : p - 97 < 26 ? p - 97 : 36) >= 36 || h > _((u - m) / s)) && y("overflow"), m += h * s, !(h < (l = a <= v ? 1 : a >= v + 26 ? 26 : a - v)); a += 36)
|
|
s > _(u / (c = 36 - l)) && y("overflow"), s *= c;
|
|
v = E(m - o, e = d.length + 1, 0 == o),
|
|
_(m / e) > u - g && y("overflow"),
|
|
g += _(m / e),
|
|
m %= e,
|
|
d.splice(m++, 0, g)
|
|
}
|
|
return x(d)
|
|
}
|
|
function A(t) {
|
|
var e,
|
|
i,
|
|
n,
|
|
r,
|
|
o,
|
|
s,
|
|
a,
|
|
h,
|
|
l,
|
|
c,
|
|
p,
|
|
d,
|
|
f,
|
|
g,
|
|
v,
|
|
x = [];
|
|
for (d = (t = w(t)).length, e = 128, i = 0, o = 72, s = 0; s < d; ++s)
|
|
(p = t[s]) < 128 && x.push(m(p));
|
|
for (n = r = x.length, r && x.push("-"); n < d; ) {
|
|
for (a = u, s = 0; s < d; ++s)
|
|
(p = t[s]) >= e && p < a && (a = p);
|
|
for (a - e > _((u - i) / (f = n + 1)) && y("overflow"), i += (a - e) * f, e = a, s = 0; s < d; ++s)
|
|
if ((p = t[s]) < e && ++i > u && y("overflow"), p == e) {
|
|
for (h = i, l = 36; !(h < (c = l <= o ? 1 : l >= o + 26 ? 26 : l - o)); l += 36)
|
|
v = h - c, g = 36 - c, x.push(m(b(c + v % g, 0))), h = _(v / g);
|
|
x.push(m(b(h, 0))),
|
|
o = E(i, f, n == r),
|
|
i = 0,
|
|
++n
|
|
}
|
|
++i,
|
|
++e
|
|
}
|
|
return x.join("")
|
|
}
|
|
if (h = {
|
|
version: "1.4.1",
|
|
ucs2: {
|
|
decode: w,
|
|
encode: x
|
|
},
|
|
decode: $,
|
|
encode: A,
|
|
toASCII: function (t) {
|
|
return v(t, (function (t) {
|
|
return p.test(t) ? "xn--" + A(t) : t
|
|
}))
|
|
},
|
|
toUnicode: function (t) {
|
|
return v(t, (function (t) {
|
|
return c.test(t) ? $(t.slice(4).toLowerCase()) : t
|
|
}))
|
|
}
|
|
}, "function" == typeof n && "object" == typeof n.amd && n.amd)
|
|
n("punycode", (function () {
|
|
return h
|
|
}));
|
|
else if (o && s)
|
|
if (e.exports == o)
|
|
s.exports = h;
|
|
else
|
|
for (l in h)
|
|
h.hasOwnProperty(l) && (o[l] = h[l]);
|
|
else
|
|
t.punycode = h
|
|
}
|
|
(this)
|
|
}, {}
|
|
],
|
|
rm6D: [function (t, e, i) {
|
|
"use strict";
|
|
e.exports = {
|
|
isString: function (t) {
|
|
return "string" == typeof t
|
|
},
|
|
isObject: function (t) {
|
|
return "object" == typeof t && null !== t
|
|
},
|
|
isNull: function (t) {
|
|
return null === t
|
|
},
|
|
isNullOrUndefined: function (t) {
|
|
return null == t
|
|
}
|
|
}
|
|
}, {}
|
|
],
|
|
DdMC: [function (t, e, i) {
|
|
"use strict";
|
|
function n(t, e) {
|
|
return Object.prototype.hasOwnProperty.call(t, e)
|
|
}
|
|
e.exports = function (t, e, i, o) {
|
|
e = e || "&",
|
|
i = i || "=";
|
|
var s = {};
|
|
if ("string" != typeof t || 0 === t.length)
|
|
return s;
|
|
var a = /\+/g;
|
|
t = t.split(e);
|
|
var h = 1e3;
|
|
o && "number" == typeof o.maxKeys && (h = o.maxKeys);
|
|
var l = t.length;
|
|
h > 0 && l > h && (l = h);
|
|
for (var u = 0; u < l; ++u) {
|
|
var c,
|
|
p,
|
|
d,
|
|
f,
|
|
_ = t[u].replace(a, "%20"),
|
|
m = _.indexOf(i);
|
|
m >= 0 ? (c = _.substr(0, m), p = _.substr(m + 1)) : (c = _, p = ""),
|
|
d = decodeURIComponent(c),
|
|
f = decodeURIComponent(p),
|
|
n(s, d) ? r(s[d]) ? s[d].push(f) : s[d] = [s[d], f] : s[d] = f
|
|
}
|
|
return s
|
|
};
|
|
var r = Array.isArray || function (t) {
|
|
return "[object Array]" === Object.prototype.toString.call(t)
|
|
}
|
|
}, {}
|
|
],
|
|
ipy0: [function (t, e, i) {
|
|
"use strict";
|
|
var n = function (t) {
|
|
switch (typeof t) {
|
|
case "string":
|
|
return t;
|
|
case "boolean":
|
|
return t ? "true" : "false";
|
|
case "number":
|
|
return isFinite(t) ? t : "";
|
|
default:
|
|
return ""
|
|
}
|
|
};
|
|
e.exports = function (t, e, i, a) {
|
|
return e = e || "&",
|
|
i = i || "=",
|
|
null === t && (t = void 0),
|
|
"object" == typeof t ? o(s(t), (function (s) {
|
|
var a = encodeURIComponent(n(s)) + i;
|
|
return r(t[s]) ? o(t[s], (function (t) {
|
|
return a + encodeURIComponent(n(t))
|
|
})).join(e) : a + encodeURIComponent(n(t[s]))
|
|
})).join(e) : a ? encodeURIComponent(n(a)) + i + encodeURIComponent(n(t)) : ""
|
|
};
|
|
var r = Array.isArray || function (t) {
|
|
return "[object Array]" === Object.prototype.toString.call(t)
|
|
};
|
|
function o(t, e) {
|
|
if (t.map)
|
|
return t.map(e);
|
|
for (var i = [], n = 0; n < t.length; n++)
|
|
i.push(e(t[n], n));
|
|
return i
|
|
}
|
|
var s = Object.keys || function (t) {
|
|
var e = [];
|
|
for (var i in t)
|
|
Object.prototype.hasOwnProperty.call(t, i) && e.push(i);
|
|
return e
|
|
}
|
|
}, {}
|
|
],
|
|
njjI: [function (t, e, i) {
|
|
"use strict";
|
|
i.decode = i.parse = t("./decode"),
|
|
i.encode = i.stringify = t("./encode")
|
|
}, {
|
|
"./decode": "DdMC",
|
|
"./encode": "ipy0"
|
|
}
|
|
],
|
|
s956: [function (t, e, i) {
|
|
"use strict";
|
|
var n = t("punycode"),
|
|
r = t("./util");
|
|
function o() {
|
|
this.protocol = null,
|
|
this.slashes = null,
|
|
this.auth = null,
|
|
this.host = null,
|
|
this.port = null,
|
|
this.hostname = null,
|
|
this.hash = null,
|
|
this.search = null,
|
|
this.query = null,
|
|
this.pathname = null,
|
|
this.path = null,
|
|
this.href = null
|
|
}
|
|
i.parse = v,
|
|
i.resolve = function (t, e) {
|
|
return v(t, !1, !0).resolve(e)
|
|
},
|
|
i.resolveObject = function (t, e) {
|
|
return t ? v(t, !1, !0).resolveObject(e) : e
|
|
},
|
|
i.format = function (t) {
|
|
r.isString(t) && (t = v(t));
|
|
return t instanceof o ? t.format() : o.prototype.format.call(t)
|
|
},
|
|
i.Url = o;
|
|
var s = /^([a-z0-9.+-]+:)/i,
|
|
a = /:[0-9]*$/,
|
|
h = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
|
l = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"]),
|
|
u = ["'"].concat(l),
|
|
c = ["%", "/", "?", ";", "#"].concat(u),
|
|
p = ["/", "?", "#"],
|
|
d = /^[+a-z0-9A-Z_-]{0,63}$/,
|
|
f = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
|
_ = {
|
|
javascript: !0,
|
|
"javascript:": !0
|
|
},
|
|
m = {
|
|
javascript: !0,
|
|
"javascript:": !0
|
|
},
|
|
y = {
|
|
http: !0,
|
|
https: !0,
|
|
ftp: !0,
|
|
gopher: !0,
|
|
file: !0,
|
|
"http:": !0,
|
|
"https:": !0,
|
|
"ftp:": !0,
|
|
"gopher:": !0,
|
|
"file:": !0
|
|
},
|
|
g = t("querystring");
|
|
function v(t, e, i) {
|
|
if (t && r.isObject(t) && t instanceof o)
|
|
return t;
|
|
var n = new o;
|
|
return n.parse(t, e, i),
|
|
n
|
|
}
|
|
o.prototype.parse = function (t, e, i) {
|
|
if (!r.isString(t))
|
|
throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
|
|
var o = t.indexOf("?"),
|
|
a = -1 !== o && o < t.indexOf("#") ? "?" : "#",
|
|
l = t.split(a);
|
|
l[0] = l[0].replace(/\\/g, "/");
|
|
var v = t = l.join(a);
|
|
if (v = v.trim(), !i && 1 === t.split("#").length) {
|
|
var w = h.exec(v);
|
|
if (w)
|
|
return this.path = v, this.href = v, this.pathname = w[1], w[2] ? (this.search = w[2], this.query = e ? g.parse(this.search.substr(1)) : this.search.substr(1)) : e && (this.search = "", this.query = {}), this
|
|
}
|
|
var x = s.exec(v);
|
|
if (x) {
|
|
var b = (x = x[0]).toLowerCase();
|
|
this.protocol = b,
|
|
v = v.substr(x.length)
|
|
}
|
|
if (i || x || v.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
|
var E = "//" === v.substr(0, 2);
|
|
!E || x && m[x] || (v = v.substr(2), this.slashes = !0)
|
|
}
|
|
if (!m[x] && (E || x && !y[x])) {
|
|
for (var $, A, S = -1, T = 0; T < p.length; T++) {
|
|
-1 !== (C = v.indexOf(p[T])) && (-1 === S || C < S) && (S = C)
|
|
}
|
|
-1 !== (A = -1 === S ? v.lastIndexOf("@") : v.lastIndexOf("@", S)) && ($ = v.slice(0, A), v = v.slice(A + 1), this.auth = decodeURIComponent($)),
|
|
S = -1;
|
|
for (T = 0; T < c.length; T++) {
|
|
var C;
|
|
-1 !== (C = v.indexOf(c[T])) && (-1 === S || C < S) && (S = C)
|
|
}
|
|
-1 === S && (S = v.length),
|
|
this.host = v.slice(0, S),
|
|
v = v.slice(S),
|
|
this.parseHost(),
|
|
this.hostname = this.hostname || "";
|
|
var M = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
|
|
if (!M)
|
|
for (var I = this.hostname.split(/\./), P = (T = 0, I.length); T < P; T++) {
|
|
var O = I[T];
|
|
if (O && !O.match(d)) {
|
|
for (var R = "", D = 0, L = O.length; D < L; D++)
|
|
O.charCodeAt(D) > 127 ? R += "x" : R += O[D];
|
|
if (!R.match(d)) {
|
|
var k = I.slice(0, T),
|
|
F = I.slice(T + 1),
|
|
N = O.match(f);
|
|
N && (k.push(N[1]), F.unshift(N[2])),
|
|
F.length && (v = "/" + F.join(".") + v),
|
|
this.hostname = k.join(".");
|
|
break
|
|
}
|
|
}
|
|
}
|
|
this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
|
|
M || (this.hostname = n.toASCII(this.hostname));
|
|
var B = this.port ? ":" + this.port : "",
|
|
U = this.hostname || "";
|
|
this.host = U + B,
|
|
this.href += this.host,
|
|
M && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== v[0] && (v = "/" + v))
|
|
}
|
|
if (!_[b])
|
|
for (T = 0, P = u.length; T < P; T++) {
|
|
var X = u[T];
|
|
if (-1 !== v.indexOf(X)) {
|
|
var j = encodeURIComponent(X);
|
|
j === X && (j = escape(X)),
|
|
v = v.split(X).join(j)
|
|
}
|
|
}
|
|
var V = v.indexOf("#");
|
|
-1 !== V && (this.hash = v.substr(V), v = v.slice(0, V));
|
|
var H = v.indexOf("?");
|
|
if (-1 !== H ? (this.search = v.substr(H), this.query = v.substr(H + 1), e && (this.query = g.parse(this.query)), v = v.slice(0, H)) : e && (this.search = "", this.query = {}), v && (this.pathname = v), y[b] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
|
B = this.pathname || "";
|
|
var G = this.search || "";
|
|
this.path = B + G
|
|
}
|
|
return this.href = this.format(),
|
|
this
|
|
},
|
|
o.prototype.format = function () {
|
|
var t = this.auth || "";
|
|
t && (t = (t = encodeURIComponent(t)).replace(/%3A/i, ":"), t += "@");
|
|
var e = this.protocol || "",
|
|
i = this.pathname || "",
|
|
n = this.hash || "",
|
|
o = !1,
|
|
s = "";
|
|
this.host ? o = t + this.host : this.hostname && (o = t + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (o += ":" + this.port)),
|
|
this.query && r.isObject(this.query) && Object.keys(this.query).length && (s = g.stringify(this.query));
|
|
var a = this.search || s && "?" + s || "";
|
|
return e && ":" !== e.substr(-1) && (e += ":"),
|
|
this.slashes || (!e || y[e]) && !1 !== o ? (o = "//" + (o || ""), i && "/" !== i.charAt(0) && (i = "/" + i)) : o || (o = ""),
|
|
n && "#" !== n.charAt(0) && (n = "#" + n),
|
|
a && "?" !== a.charAt(0) && (a = "?" + a),
|
|
e + o + (i = i.replace(/[?#]/g, (function (t) {
|
|
return encodeURIComponent(t)
|
|
}))) + (a = a.replace("#", "%23")) + n
|
|
},
|
|
o.prototype.resolve = function (t) {
|
|
return this.resolveObject(v(t, !1, !0)).format()
|
|
},
|
|
o.prototype.resolveObject = function (t) {
|
|
if (r.isString(t)) {
|
|
var e = new o;
|
|
e.parse(t, !1, !0),
|
|
t = e
|
|
}
|
|
for (var i = new o, n = Object.keys(this), s = 0; s < n.length; s++) {
|
|
var a = n[s];
|
|
i[a] = this[a]
|
|
}
|
|
if (i.hash = t.hash, "" === t.href)
|
|
return i.href = i.format(), i;
|
|
if (t.slashes && !t.protocol) {
|
|
for (var h = Object.keys(t), l = 0; l < h.length; l++) {
|
|
var u = h[l];
|
|
"protocol" !== u && (i[u] = t[u])
|
|
}
|
|
return y[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
|
|
i.href = i.format(),
|
|
i
|
|
}
|
|
if (t.protocol && t.protocol !== i.protocol) {
|
|
if (!y[t.protocol]) {
|
|
for (var c = Object.keys(t), p = 0; p < c.length; p++) {
|
|
var d = c[p];
|
|
i[d] = t[d]
|
|
}
|
|
return i.href = i.format(),
|
|
i
|
|
}
|
|
if (i.protocol = t.protocol, t.host || m[t.protocol])
|
|
i.pathname = t.pathname;
|
|
else {
|
|
for (var f = (t.pathname || "").split("/"); f.length && !(t.host = f.shift()); );
|
|
t.host || (t.host = ""),
|
|
t.hostname || (t.hostname = ""),
|
|
"" !== f[0] && f.unshift(""),
|
|
f.length < 2 && f.unshift(""),
|
|
i.pathname = f.join("/")
|
|
}
|
|
if (i.search = t.search, i.query = t.query, i.host = t.host || "", i.auth = t.auth, i.hostname = t.hostname || t.host, i.port = t.port, i.pathname || i.search) {
|
|
var _ = i.pathname || "",
|
|
g = i.search || "";
|
|
i.path = _ + g
|
|
}
|
|
return i.slashes = i.slashes || t.slashes,
|
|
i.href = i.format(),
|
|
i
|
|
}
|
|
var v = i.pathname && "/" === i.pathname.charAt(0),
|
|
w = t.host || t.pathname && "/" === t.pathname.charAt(0),
|
|
x = w || v || i.host && t.pathname,
|
|
b = x,
|
|
E = i.pathname && i.pathname.split("/") || [],
|
|
$ = (f = t.pathname && t.pathname.split("/") || [], i.protocol && !y[i.protocol]);
|
|
if ($ && (i.hostname = "", i.port = null, i.host && ("" === E[0] ? E[0] = i.host : E.unshift(i.host)), i.host = "", t.protocol && (t.hostname = null, t.port = null, t.host && ("" === f[0] ? f[0] = t.host : f.unshift(t.host)), t.host = null), x = x && ("" === f[0] || "" === E[0])), w)
|
|
i.host = t.host || "" === t.host ? t.host : i.host, i.hostname = t.hostname || "" === t.hostname ? t.hostname : i.hostname, i.search = t.search, i.query = t.query, E = f;
|
|
else if (f.length)
|
|
E || (E = []), E.pop(), E = E.concat(f), i.search = t.search, i.query = t.query;
|
|
else if (!r.isNullOrUndefined(t.search)) {
|
|
if ($)
|
|
i.hostname = i.host = E.shift(), (M = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@")) && (i.auth = M.shift(), i.host = i.hostname = M.shift());
|
|
return i.search = t.search,
|
|
i.query = t.query,
|
|
r.isNull(i.pathname) && r.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
|
|
i.href = i.format(),
|
|
i
|
|
}
|
|
if (!E.length)
|
|
return i.pathname = null, i.search ? i.path = "/" + i.search : i.path = null, i.href = i.format(), i;
|
|
for (var A = E.slice(-1)[0], S = (i.host || t.host || E.length > 1) && ("." === A || ".." === A) || "" === A, T = 0, C = E.length; C >= 0; C--)
|
|
"." === (A = E[C]) ? E.splice(C, 1) : ".." === A ? (E.splice(C, 1), T++) : T && (E.splice(C, 1), T--);
|
|
if (!x && !b)
|
|
for (; T--; T)
|
|
E.unshift("..");
|
|
!x || "" === E[0] || E[0] && "/" === E[0].charAt(0) || E.unshift(""),
|
|
S && "/" !== E.join("/").substr(-1) && E.push("");
|
|
var M,
|
|
I = "" === E[0] || E[0] && "/" === E[0].charAt(0);
|
|
$ && (i.hostname = i.host = I ? "" : E.length ? E.shift() : "", (M = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@")) && (i.auth = M.shift(), i.host = i.hostname = M.shift()));
|
|
return (x = x || i.host && E.length) && !I && E.unshift(""),
|
|
E.length ? i.pathname = E.join("/") : (i.pathname = null, i.path = null),
|
|
r.isNull(i.pathname) && r.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
|
|
i.auth = t.auth || i.auth,
|
|
i.slashes = i.slashes || t.slashes,
|
|
i.href = i.format(),
|
|
i
|
|
},
|
|
o.prototype.parseHost = function () {
|
|
var t = this.host,
|
|
e = a.exec(t);
|
|
e && (":" !== (e = e[0]) && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)),
|
|
t && (this.hostname = t)
|
|
}
|
|
}, {
|
|
punycode: "PT1R",
|
|
"./util": "rm6D",
|
|
querystring: "njjI"
|
|
}
|
|
],
|
|
R76a: [function (t, e, i) {
|
|
"use strict";
|
|
/*!
|
|
* @pixi/constants - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/constants is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
var n,
|
|
r,
|
|
o,
|
|
s,
|
|
a,
|
|
h,
|
|
l,
|
|
u,
|
|
c,
|
|
p,
|
|
d,
|
|
f,
|
|
_,
|
|
m;
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.WRAP_MODES = i.TYPES = i.TARGETS = i.SCALE_MODES = i.RENDERER_TYPE = i.PRECISION = i.MIPMAP_MODES = i.MASK_TYPES = i.GC_MODES = i.FORMATS = i.ENV = i.DRAW_MODES = i.BLEND_MODES = i.ALPHA_MODES = void 0,
|
|
i.ENV = n,
|
|
function (t) {
|
|
t[t.WEBGL_LEGACY = 0] = "WEBGL_LEGACY",
|
|
t[t.WEBGL = 1] = "WEBGL",
|
|
t[t.WEBGL2 = 2] = "WEBGL2"
|
|
}
|
|
(n || (i.ENV = n = {})),
|
|
i.RENDERER_TYPE = r,
|
|
function (t) {
|
|
t[t.UNKNOWN = 0] = "UNKNOWN",
|
|
t[t.WEBGL = 1] = "WEBGL",
|
|
t[t.CANVAS = 2] = "CANVAS"
|
|
}
|
|
(r || (i.RENDERER_TYPE = r = {})),
|
|
i.BLEND_MODES = o,
|
|
function (t) {
|
|
t[t.NORMAL = 0] = "NORMAL",
|
|
t[t.ADD = 1] = "ADD",
|
|
t[t.MULTIPLY = 2] = "MULTIPLY",
|
|
t[t.SCREEN = 3] = "SCREEN",
|
|
t[t.OVERLAY = 4] = "OVERLAY",
|
|
t[t.DARKEN = 5] = "DARKEN",
|
|
t[t.LIGHTEN = 6] = "LIGHTEN",
|
|
t[t.COLOR_DODGE = 7] = "COLOR_DODGE",
|
|
t[t.COLOR_BURN = 8] = "COLOR_BURN",
|
|
t[t.HARD_LIGHT = 9] = "HARD_LIGHT",
|
|
t[t.SOFT_LIGHT = 10] = "SOFT_LIGHT",
|
|
t[t.DIFFERENCE = 11] = "DIFFERENCE",
|
|
t[t.EXCLUSION = 12] = "EXCLUSION",
|
|
t[t.HUE = 13] = "HUE",
|
|
t[t.SATURATION = 14] = "SATURATION",
|
|
t[t.COLOR = 15] = "COLOR",
|
|
t[t.LUMINOSITY = 16] = "LUMINOSITY",
|
|
t[t.NORMAL_NPM = 17] = "NORMAL_NPM",
|
|
t[t.ADD_NPM = 18] = "ADD_NPM",
|
|
t[t.SCREEN_NPM = 19] = "SCREEN_NPM",
|
|
t[t.NONE = 20] = "NONE",
|
|
t[t.SRC_OVER = 0] = "SRC_OVER",
|
|
t[t.SRC_IN = 21] = "SRC_IN",
|
|
t[t.SRC_OUT = 22] = "SRC_OUT",
|
|
t[t.SRC_ATOP = 23] = "SRC_ATOP",
|
|
t[t.DST_OVER = 24] = "DST_OVER",
|
|
t[t.DST_IN = 25] = "DST_IN",
|
|
t[t.DST_OUT = 26] = "DST_OUT",
|
|
t[t.DST_ATOP = 27] = "DST_ATOP",
|
|
t[t.ERASE = 26] = "ERASE",
|
|
t[t.SUBTRACT = 28] = "SUBTRACT",
|
|
t[t.XOR = 29] = "XOR"
|
|
}
|
|
(o || (i.BLEND_MODES = o = {})),
|
|
i.DRAW_MODES = s,
|
|
function (t) {
|
|
t[t.POINTS = 0] = "POINTS",
|
|
t[t.LINES = 1] = "LINES",
|
|
t[t.LINE_LOOP = 2] = "LINE_LOOP",
|
|
t[t.LINE_STRIP = 3] = "LINE_STRIP",
|
|
t[t.TRIANGLES = 4] = "TRIANGLES",
|
|
t[t.TRIANGLE_STRIP = 5] = "TRIANGLE_STRIP",
|
|
t[t.TRIANGLE_FAN = 6] = "TRIANGLE_FAN"
|
|
}
|
|
(s || (i.DRAW_MODES = s = {})),
|
|
i.FORMATS = a,
|
|
function (t) {
|
|
t[t.RGBA = 6408] = "RGBA",
|
|
t[t.RGB = 6407] = "RGB",
|
|
t[t.ALPHA = 6406] = "ALPHA",
|
|
t[t.LUMINANCE = 6409] = "LUMINANCE",
|
|
t[t.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA",
|
|
t[t.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT",
|
|
t[t.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL"
|
|
}
|
|
(a || (i.FORMATS = a = {})),
|
|
i.TARGETS = h,
|
|
function (t) {
|
|
t[t.TEXTURE_2D = 3553] = "TEXTURE_2D",
|
|
t[t.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP",
|
|
t[t.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY",
|
|
t[t.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X",
|
|
t[t.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X",
|
|
t[t.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y",
|
|
t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y",
|
|
t[t.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z",
|
|
t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z"
|
|
}
|
|
(h || (i.TARGETS = h = {})),
|
|
i.TYPES = l,
|
|
function (t) {
|
|
t[t.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE",
|
|
t[t.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT",
|
|
t[t.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5",
|
|
t[t.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4",
|
|
t[t.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1",
|
|
t[t.FLOAT = 5126] = "FLOAT",
|
|
t[t.HALF_FLOAT = 36193] = "HALF_FLOAT"
|
|
}
|
|
(l || (i.TYPES = l = {})),
|
|
i.SCALE_MODES = u,
|
|
function (t) {
|
|
t[t.NEAREST = 0] = "NEAREST",
|
|
t[t.LINEAR = 1] = "LINEAR"
|
|
}
|
|
(u || (i.SCALE_MODES = u = {})),
|
|
i.WRAP_MODES = c,
|
|
function (t) {
|
|
t[t.CLAMP = 33071] = "CLAMP",
|
|
t[t.REPEAT = 10497] = "REPEAT",
|
|
t[t.MIRRORED_REPEAT = 33648] = "MIRRORED_REPEAT"
|
|
}
|
|
(c || (i.WRAP_MODES = c = {})),
|
|
i.MIPMAP_MODES = p,
|
|
function (t) {
|
|
t[t.OFF = 0] = "OFF",
|
|
t[t.POW2 = 1] = "POW2",
|
|
t[t.ON = 2] = "ON"
|
|
}
|
|
(p || (i.MIPMAP_MODES = p = {})),
|
|
i.ALPHA_MODES = d,
|
|
function (t) {
|
|
t[t.NPM = 0] = "NPM",
|
|
t[t.UNPACK = 1] = "UNPACK",
|
|
t[t.PMA = 2] = "PMA",
|
|
t[t.NO_PREMULTIPLIED_ALPHA = 0] = "NO_PREMULTIPLIED_ALPHA",
|
|
t[t.PREMULTIPLY_ON_UPLOAD = 1] = "PREMULTIPLY_ON_UPLOAD",
|
|
t[t.PREMULTIPLY_ALPHA = 2] = "PREMULTIPLY_ALPHA"
|
|
}
|
|
(d || (i.ALPHA_MODES = d = {})),
|
|
i.GC_MODES = f,
|
|
function (t) {
|
|
t[t.AUTO = 0] = "AUTO",
|
|
t[t.MANUAL = 1] = "MANUAL"
|
|
}
|
|
(f || (i.GC_MODES = f = {})),
|
|
i.PRECISION = _,
|
|
function (t) {
|
|
t.LOW = "lowp",
|
|
t.MEDIUM = "mediump",
|
|
t.HIGH = "highp"
|
|
}
|
|
(_ || (i.PRECISION = _ = {})),
|
|
i.MASK_TYPES = m,
|
|
function (t) {
|
|
t[t.NONE = 0] = "NONE",
|
|
t[t.SCISSOR = 1] = "SCISSOR",
|
|
t[t.STENCIL = 2] = "STENCIL",
|
|
t[t.SPRITE = 3] = "SPRITE"
|
|
}
|
|
(m || (i.MASK_TYPES = m = {}))
|
|
}, {}
|
|
],
|
|
x5Ec: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.clearTextureCache = function () {
|
|
var t;
|
|
for (t in y)
|
|
delete y[t];
|
|
for (t in g)
|
|
delete g[t]
|
|
},
|
|
i.correctBlendMode = function (t, e) {
|
|
return p[e ? 1 : 0][t]
|
|
},
|
|
i.createIndicesForQuads = function (t, e) {
|
|
void 0 === e && (e = null);
|
|
var i = 6 * t;
|
|
if ((e = e || new Uint16Array(i)).length !== i)
|
|
throw new Error("Out buffer length is incorrect, got " + e.length + " and expected " + i);
|
|
for (var n = 0, r = 0; n < i; n += 6, r += 4)
|
|
e[n + 0] = r + 0, e[n + 1] = r + 1, e[n + 2] = r + 2, e[n + 3] = r + 0, e[n + 4] = r + 2, e[n + 5] = r + 3;
|
|
return e
|
|
},
|
|
i.decomposeDataUri = function (t) {
|
|
var e = x.exec(t);
|
|
if (e)
|
|
return {
|
|
mediaType: e[1] ? e[1].toLowerCase() : void 0,
|
|
subType: e[2] ? e[2].toLowerCase() : void 0,
|
|
charset: e[3] ? e[3].toLowerCase() : void 0,
|
|
encoding: e[4] ? e[4].toLowerCase() : void 0,
|
|
data: e[5]
|
|
};
|
|
return
|
|
},
|
|
i.deprecation = function (t, e, i) {
|
|
void 0 === i && (i = 3);
|
|
if (m[e])
|
|
return;
|
|
var n = (new Error).stack;
|
|
void 0 === n ? console.warn("PixiJS Deprecation Warning: ", e + "\nDeprecated since v" + t) : (n = n.split("\n").splice(i).join("\n"), console.groupCollapsed ? (console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s", "color:#614108;background:#fffbe6", "font-weight:normal;color:#614108;background:#fffbe6", e + "\nDeprecated since v" + t), console.warn(n), console.groupEnd()) : (console.warn("PixiJS Deprecation Warning: ", e + "\nDeprecated since v" + t), console.warn(n)));
|
|
m[e] = !0
|
|
},
|
|
i.destroyTextureCache = function () {
|
|
var t;
|
|
for (t in y)
|
|
y[t].destroy();
|
|
for (t in g)
|
|
g[t].destroy()
|
|
},
|
|
i.determineCrossOrigin = function (t, e) {
|
|
void 0 === e && (e = window.location);
|
|
if (0 === t.indexOf("data:"))
|
|
return "";
|
|
e = e || window.location,
|
|
w || (w = document.createElement("a"));
|
|
w.href = t;
|
|
var i = (0, s.parse)(w.href),
|
|
n = !i.port && "" === e.port || i.port === e.port;
|
|
if (i.hostname !== e.hostname || !n || i.protocol !== e.protocol)
|
|
return "anonymous";
|
|
return ""
|
|
},
|
|
i.getBufferType = d,
|
|
i.getResolutionOfUrl = function (t, e) {
|
|
var i = n.settings.RETINA_PREFIX.exec(t);
|
|
if (i)
|
|
return parseFloat(i[1]);
|
|
return void 0 !== e ? e : 1
|
|
},
|
|
i.hex2rgb = function (t, e) {
|
|
return (e = e || [])[0] = (t >> 16 & 255) / 255,
|
|
e[1] = (t >> 8 & 255) / 255,
|
|
e[2] = (255 & t) / 255,
|
|
e
|
|
},
|
|
i.hex2string = function (t) {
|
|
var e = t.toString(16);
|
|
return "#" + (e = "000000".substr(0, 6 - e.length) + e)
|
|
},
|
|
i.interleaveTypedArrays = function (t, e) {
|
|
for (var i = 0, n = 0, r = {}, o = 0; o < t.length; o++)
|
|
n += e[o], i += t[o].length;
|
|
var s = new ArrayBuffer(4 * i),
|
|
a = null,
|
|
h = 0;
|
|
for (o = 0; o < t.length; o++) {
|
|
var l = e[o],
|
|
u = t[o],
|
|
c = d(u);
|
|
r[c] || (r[c] = new f[c](s)),
|
|
a = r[c];
|
|
for (var p = 0; p < u.length; p++) {
|
|
a[(p / l | 0) * n + h + p % l] = u[p]
|
|
}
|
|
h += l
|
|
}
|
|
return new Float32Array(s)
|
|
},
|
|
i.isPow2 = function (t) {
|
|
return !(t & t - 1 || !t)
|
|
},
|
|
i.isWebGLSupported = function () {
|
|
void 0 === u && (u = function () {
|
|
var t = {
|
|
stencil: !0,
|
|
failIfMajorPerformanceCaveat: n.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT
|
|
};
|
|
try {
|
|
if (!window.WebGLRenderingContext)
|
|
return !1;
|
|
var e = document.createElement("canvas"),
|
|
i = e.getContext("webgl", t) || e.getContext("experimental-webgl", t),
|
|
r = !(!i || !i.getContextAttributes().stencil);
|
|
if (i) {
|
|
var o = i.getExtension("WEBGL_lose_context");
|
|
o && o.loseContext()
|
|
}
|
|
return i = null,
|
|
r
|
|
} catch (t) {
|
|
return !1
|
|
}
|
|
}
|
|
());
|
|
return u
|
|
},
|
|
i.log2 = function (t) {
|
|
var e = (t > 65535 ? 1 : 0) << 4,
|
|
i = ((t >>>= e) > 255 ? 1 : 0) << 3;
|
|
return e |= i,
|
|
e |= i = ((t >>>= i) > 15 ? 1 : 0) << 2,
|
|
(e |= i = ((t >>>= i) > 3 ? 1 : 0) << 1) | (t >>>= i) >> 1
|
|
},
|
|
i.nextPow2 = function (t) {
|
|
return t += 0 === t ? 1 : 0,
|
|
--t,
|
|
t |= t >>> 1,
|
|
t |= t >>> 2,
|
|
t |= t >>> 4,
|
|
t |= t >>> 8,
|
|
(t |= t >>> 16) + 1
|
|
},
|
|
i.premultiplyRgba = function (t, e, i, n) {
|
|
i = i || new Float32Array(4),
|
|
n || void 0 === n ? (i[0] = t[0] * e, i[1] = t[1] * e, i[2] = t[2] * e) : (i[0] = t[0], i[1] = t[1], i[2] = t[2]);
|
|
return i[3] = e,
|
|
i
|
|
},
|
|
i.premultiplyTint = function (t, e) {
|
|
if (1 === e)
|
|
return (255 * e << 24) + t;
|
|
if (0 === e)
|
|
return 0;
|
|
var i = t >> 16 & 255,
|
|
n = t >> 8 & 255,
|
|
r = 255 & t;
|
|
return (255 * e << 24) + ((i = i * e + .5 | 0) << 16) + ((n = n * e + .5 | 0) << 8) + (r = r * e + .5 | 0)
|
|
},
|
|
i.premultiplyTintToRgba = function (t, e, i, n) {
|
|
(i = i || new Float32Array(4))[0] = (t >> 16 & 255) / 255,
|
|
i[1] = (t >> 8 & 255) / 255,
|
|
i[2] = (255 & t) / 255,
|
|
(n || void 0 === n) && (i[0] *= e, i[1] *= e, i[2] *= e);
|
|
return i[3] = e,
|
|
i
|
|
},
|
|
i.removeItems = function (t, e, i) {
|
|
var n,
|
|
r = t.length;
|
|
if (e >= r || 0 === i)
|
|
return;
|
|
var o = r - (i = e + i > r ? r - e : i);
|
|
for (n = e; n < o; ++n)
|
|
t[n] = t[n + i];
|
|
t.length = o
|
|
},
|
|
i.rgb2hex = function (t) {
|
|
return (255 * t[0] << 16) + (255 * t[1] << 8) + (255 * t[2] | 0)
|
|
},
|
|
i.sayHello = function (t) {
|
|
var e;
|
|
if (c)
|
|
return;
|
|
if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
|
|
var i = ["\n %c %c %c PixiJS 5.2.1 - ✰ " + t + " ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n", "background: #ff66a5; padding:5px 0;", "background: #ff66a5; padding:5px 0;", "color: #ff66a5; background: #030307; padding:5px 0;", "background: #ff66a5; padding:5px 0;", "background: #ffc3dc; padding:5px 0;", "background: #ff66a5; padding:5px 0;", "color: #ff2424; background: #fff; padding:5px 0;", "color: #ff2424; background: #fff; padding:5px 0;", "color: #ff2424; background: #fff; padding:5px 0;"];
|
|
(e = window.console).log.apply(e, i)
|
|
} else
|
|
window.console && window.console.log("PixiJS 5.2.1 - " + t + " - http://www.pixijs.com/");
|
|
c = !0
|
|
},
|
|
i.sign = function (t) {
|
|
if (0 === t)
|
|
return 0;
|
|
return t < 0 ? -1 : 1
|
|
},
|
|
i.skipHello = function () {
|
|
c = !0
|
|
},
|
|
i.string2hex = function (t) {
|
|
"string" == typeof t && "#" === t[0] && (t = t.substr(1));
|
|
return parseInt(t, 16)
|
|
},
|
|
i.trimCanvas = function (t) {
|
|
var e,
|
|
i,
|
|
n,
|
|
r = t.width,
|
|
o = t.height,
|
|
s = t.getContext("2d"),
|
|
a = s.getImageData(0, 0, r, o).data,
|
|
h = a.length,
|
|
l = {
|
|
top: null,
|
|
left: null,
|
|
right: null,
|
|
bottom: null
|
|
},
|
|
u = null;
|
|
for (e = 0; e < h; e += 4)
|
|
0 !== a[e + 3] && (i = e / 4 % r, n = ~~(e / 4 / r), null === l.top && (l.top = n), (null === l.left || i < l.left) && (l.left = i), (null === l.right || l.right < i) && (l.right = i + 1), (null === l.bottom || l.bottom < n) && (l.bottom = n));
|
|
null !== l.top && (r = l.right - l.left, o = l.bottom - l.top + 1, u = s.getImageData(l.left, l.top, r, o));
|
|
return {
|
|
height: o,
|
|
width: r,
|
|
data: u
|
|
}
|
|
},
|
|
i.uid = function () {
|
|
return ++_
|
|
},
|
|
Object.defineProperty(i, "isMobile", {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return n.isMobile
|
|
}
|
|
}),
|
|
Object.defineProperty(i, "EventEmitter", {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return r.default
|
|
}
|
|
}),
|
|
Object.defineProperty(i, "earcut", {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return o.default
|
|
}
|
|
}),
|
|
Object.defineProperty(i, "url", {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return s.default
|
|
}
|
|
}),
|
|
i.premultiplyBlendMode = i.TextureCache = i.ProgramCache = i.DATA_URI = i.CanvasRenderTarget = i.BaseTextureCache = void 0;
|
|
var n = t("@pixi/settings"),
|
|
r = l(t("eventemitter3")),
|
|
o = l(t("earcut")),
|
|
s = function (t) {
|
|
if (t && t.__esModule)
|
|
return t;
|
|
if (null === t || "object" != typeof t && "function" != typeof t)
|
|
return {
|
|
default:
|
|
t
|
|
};
|
|
var e = h();
|
|
if (e && e.has(t))
|
|
return e.get(t);
|
|
var i = {},
|
|
n = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var r in t)
|
|
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
var o = n ? Object.getOwnPropertyDescriptor(t, r) : null;
|
|
o && (o.get || o.set) ? Object.defineProperty(i, r, o) : i[r] = t[r]
|
|
}
|
|
i.default = t,
|
|
e && e.set(t, i);
|
|
return i
|
|
}
|
|
(t("url")),
|
|
a = t("@pixi/constants");
|
|
function h() {
|
|
if ("function" != typeof WeakMap)
|
|
return null;
|
|
var t = new WeakMap;
|
|
return h = function () {
|
|
return t
|
|
},
|
|
t
|
|
}
|
|
function l(t) {
|
|
return t && t.__esModule ? t : {
|
|
default:
|
|
t
|
|
}
|
|
}
|
|
/*!
|
|
* @pixi/utils - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/utils is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
n.settings.RETINA_PREFIX = /@([0-9\.]+)x/,
|
|
n.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = !0;
|
|
var u,
|
|
c = !1;
|
|
var p = function () {
|
|
for (var t = [], e = [], i = 0; i < 32; i++)
|
|
t[i] = i, e[i] = i;
|
|
t[a.BLEND_MODES.NORMAL_NPM] = a.BLEND_MODES.NORMAL,
|
|
t[a.BLEND_MODES.ADD_NPM] = a.BLEND_MODES.ADD,
|
|
t[a.BLEND_MODES.SCREEN_NPM] = a.BLEND_MODES.SCREEN,
|
|
e[a.BLEND_MODES.NORMAL] = a.BLEND_MODES.NORMAL_NPM,
|
|
e[a.BLEND_MODES.ADD] = a.BLEND_MODES.ADD_NPM,
|
|
e[a.BLEND_MODES.SCREEN] = a.BLEND_MODES.SCREEN_NPM;
|
|
var n = [];
|
|
return n.push(e),
|
|
n.push(t),
|
|
n
|
|
}
|
|
();
|
|
function d(t) {
|
|
if (4 === t.BYTES_PER_ELEMENT)
|
|
return t instanceof Float32Array ? "Float32Array" : t instanceof Uint32Array ? "Uint32Array" : "Int32Array";
|
|
if (2 === t.BYTES_PER_ELEMENT) {
|
|
if (t instanceof Uint16Array)
|
|
return "Uint16Array"
|
|
} else if (1 === t.BYTES_PER_ELEMENT && t instanceof Uint8Array)
|
|
return "Uint8Array";
|
|
return null
|
|
}
|
|
i.premultiplyBlendMode = p;
|
|
var f = {
|
|
Float32Array: Float32Array,
|
|
Uint32Array: Uint32Array,
|
|
Int32Array: Int32Array,
|
|
Uint8Array: Uint8Array
|
|
};
|
|
var _ = 0;
|
|
var m = {};
|
|
i.ProgramCache = {};
|
|
var y = Object.create(null);
|
|
i.TextureCache = y;
|
|
var g = Object.create(null);
|
|
i.BaseTextureCache = g;
|
|
var v = function () {
|
|
function t(t, e, i) {
|
|
this.canvas = document.createElement("canvas"),
|
|
this.context = this.canvas.getContext("2d"),
|
|
this.resolution = i || n.settings.RESOLUTION,
|
|
this.resize(t, e)
|
|
}
|
|
return t.prototype.clear = function () {
|
|
this.context.setTransform(1, 0, 0, 1, 0, 0),
|
|
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height)
|
|
},
|
|
t.prototype.resize = function (t, e) {
|
|
this.canvas.width = t * this.resolution,
|
|
this.canvas.height = e * this.resolution
|
|
},
|
|
t.prototype.destroy = function () {
|
|
this.context = null,
|
|
this.canvas = null
|
|
},
|
|
Object.defineProperty(t.prototype, "width", {
|
|
get: function () {
|
|
return this.canvas.width
|
|
},
|
|
set: function (t) {
|
|
this.canvas.width = t
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "height", {
|
|
get: function () {
|
|
return this.canvas.height
|
|
},
|
|
set: function (t) {
|
|
this.canvas.height = t
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t
|
|
}
|
|
();
|
|
i.CanvasRenderTarget = v;
|
|
var w,
|
|
x = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;
|
|
i.DATA_URI = x
|
|
}, {
|
|
"@pixi/settings": "v11T",
|
|
eventemitter3: "Clm3",
|
|
earcut: "Ic8v",
|
|
url: "s956",
|
|
"@pixi/constants": "R76a"
|
|
}
|
|
],
|
|
GTL5: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.groupD8 = i.Transform = i.SHAPES = i.RoundedRectangle = i.Rectangle = i.RAD_TO_DEG = i.Polygon = i.Point = i.PI_2 = i.ObservablePoint = i.Matrix = i.Ellipse = i.DEG_TO_RAD = i.Circle = void 0;
|
|
/*!
|
|
* @pixi/math - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/math is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
var n = function () {
|
|
function t(t, e) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
this.x = t,
|
|
this.y = e
|
|
}
|
|
return t.prototype.clone = function () {
|
|
return new t(this.x, this.y)
|
|
},
|
|
t.prototype.copyFrom = function (t) {
|
|
return this.set(t.x, t.y),
|
|
this
|
|
},
|
|
t.prototype.copyTo = function (t) {
|
|
return t.set(this.x, this.y),
|
|
t
|
|
},
|
|
t.prototype.equals = function (t) {
|
|
return t.x === this.x && t.y === this.y
|
|
},
|
|
t.prototype.set = function (t, e) {
|
|
return void 0 === t && (t = 0),
|
|
void 0 === e && (e = t),
|
|
this.x = t,
|
|
this.y = e,
|
|
this
|
|
},
|
|
t
|
|
}
|
|
();
|
|
i.Point = n;
|
|
var r = function () {
|
|
function t(t, e, i, n) {
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = 0),
|
|
this._x = i,
|
|
this._y = n,
|
|
this.cb = t,
|
|
this.scope = e
|
|
}
|
|
return t.prototype.clone = function (e, i) {
|
|
return void 0 === e && (e = this.cb),
|
|
void 0 === i && (i = this.scope),
|
|
new t(e, i, this._x, this._y)
|
|
},
|
|
t.prototype.set = function (t, e) {
|
|
return void 0 === t && (t = 0),
|
|
void 0 === e && (e = t),
|
|
this._x === t && this._y === e || (this._x = t, this._y = e, this.cb.call(this.scope)),
|
|
this
|
|
},
|
|
t.prototype.copyFrom = function (t) {
|
|
return this._x === t.x && this._y === t.y || (this._x = t.x, this._y = t.y, this.cb.call(this.scope)),
|
|
this
|
|
},
|
|
t.prototype.copyTo = function (t) {
|
|
return t.set(this._x, this._y),
|
|
t
|
|
},
|
|
t.prototype.equals = function (t) {
|
|
return t.x === this._x && t.y === this._y
|
|
},
|
|
Object.defineProperty(t.prototype, "x", {
|
|
get: function () {
|
|
return this._x
|
|
},
|
|
set: function (t) {
|
|
this._x !== t && (this._x = t, this.cb.call(this.scope))
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "y", {
|
|
get: function () {
|
|
return this._y
|
|
},
|
|
set: function (t) {
|
|
this._y !== t && (this._y = t, this.cb.call(this.scope))
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t
|
|
}
|
|
();
|
|
i.ObservablePoint = r;
|
|
var o = 2 * Math.PI;
|
|
i.PI_2 = o;
|
|
var s = 180 / Math.PI;
|
|
i.RAD_TO_DEG = s;
|
|
var a,
|
|
h = Math.PI / 180;
|
|
i.DEG_TO_RAD = h,
|
|
i.SHAPES = a,
|
|
function (t) {
|
|
t[t.POLY = 0] = "POLY",
|
|
t[t.RECT = 1] = "RECT",
|
|
t[t.CIRC = 2] = "CIRC",
|
|
t[t.ELIP = 3] = "ELIP",
|
|
t[t.RREC = 4] = "RREC"
|
|
}
|
|
(a || (i.SHAPES = a = {}));
|
|
var l = function () {
|
|
function t(t, e, i, n, r, o) {
|
|
void 0 === t && (t = 1),
|
|
void 0 === e && (e = 0),
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = 1),
|
|
void 0 === r && (r = 0),
|
|
void 0 === o && (o = 0),
|
|
this.array = null,
|
|
this.a = t,
|
|
this.b = e,
|
|
this.c = i,
|
|
this.d = n,
|
|
this.tx = r,
|
|
this.ty = o
|
|
}
|
|
return t.prototype.fromArray = function (t) {
|
|
this.a = t[0],
|
|
this.b = t[1],
|
|
this.c = t[3],
|
|
this.d = t[4],
|
|
this.tx = t[2],
|
|
this.ty = t[5]
|
|
},
|
|
t.prototype.set = function (t, e, i, n, r, o) {
|
|
return this.a = t,
|
|
this.b = e,
|
|
this.c = i,
|
|
this.d = n,
|
|
this.tx = r,
|
|
this.ty = o,
|
|
this
|
|
},
|
|
t.prototype.toArray = function (t, e) {
|
|
this.array || (this.array = new Float32Array(9));
|
|
var i = e || 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
|
|
},
|
|
t.prototype.apply = function (t, e) {
|
|
e = e || new n;
|
|
var i = t.x,
|
|
r = t.y;
|
|
return e.x = this.a * i + this.c * r + this.tx,
|
|
e.y = this.b * i + this.d * r + this.ty,
|
|
e
|
|
},
|
|
t.prototype.applyInverse = function (t, e) {
|
|
e = e || new n;
|
|
var i = 1 / (this.a * this.d + this.c * -this.b),
|
|
r = t.x,
|
|
o = t.y;
|
|
return e.x = this.d * i * r + -this.c * i * o + (this.ty * this.c - this.tx * this.d) * i,
|
|
e.y = this.a * i * o + -this.b * i * r + (-this.ty * this.a + this.tx * this.b) * i,
|
|
e
|
|
},
|
|
t.prototype.translate = function (t, e) {
|
|
return this.tx += t,
|
|
this.ty += e,
|
|
this
|
|
},
|
|
t.prototype.scale = function (t, e) {
|
|
return this.a *= t,
|
|
this.d *= e,
|
|
this.c *= t,
|
|
this.b *= e,
|
|
this.tx *= t,
|
|
this.ty *= e,
|
|
this
|
|
},
|
|
t.prototype.rotate = function (t) {
|
|
var e = Math.cos(t),
|
|
i = Math.sin(t),
|
|
n = this.a,
|
|
r = this.c,
|
|
o = this.tx;
|
|
return this.a = n * e - this.b * i,
|
|
this.b = n * i + this.b * e,
|
|
this.c = r * e - this.d * i,
|
|
this.d = r * i + this.d * e,
|
|
this.tx = o * e - this.ty * i,
|
|
this.ty = o * i + this.ty * e,
|
|
this
|
|
},
|
|
t.prototype.append = function (t) {
|
|
var e = this.a,
|
|
i = this.b,
|
|
n = this.c,
|
|
r = this.d;
|
|
return this.a = t.a * e + t.b * n,
|
|
this.b = t.a * i + t.b * r,
|
|
this.c = t.c * e + t.d * n,
|
|
this.d = t.c * i + t.d * r,
|
|
this.tx = t.tx * e + t.ty * n + this.tx,
|
|
this.ty = t.tx * i + t.ty * r + this.ty,
|
|
this
|
|
},
|
|
t.prototype.setTransform = function (t, e, i, n, r, o, s, a, h) {
|
|
return this.a = Math.cos(s + h) * r,
|
|
this.b = Math.sin(s + h) * r,
|
|
this.c = -Math.sin(s - a) * o,
|
|
this.d = Math.cos(s - a) * o,
|
|
this.tx = t - (i * this.a + n * this.c),
|
|
this.ty = e - (i * this.b + n * this.d),
|
|
this
|
|
},
|
|
t.prototype.prepend = function (t) {
|
|
var e = this.tx;
|
|
if (1 !== t.a || 0 !== t.b || 0 !== t.c || 1 !== t.d) {
|
|
var i = this.a,
|
|
n = this.c;
|
|
this.a = i * t.a + this.b * t.c,
|
|
this.b = i * t.b + this.b * t.d,
|
|
this.c = n * t.a + this.d * t.c,
|
|
this.d = n * t.b + this.d * t.d
|
|
}
|
|
return this.tx = e * t.a + this.ty * t.c + t.tx,
|
|
this.ty = e * t.b + this.ty * t.d + t.ty,
|
|
this
|
|
},
|
|
t.prototype.decompose = function (t) {
|
|
var e = this.a,
|
|
i = this.b,
|
|
n = this.c,
|
|
r = this.d,
|
|
s = -Math.atan2(-n, r),
|
|
a = Math.atan2(i, e),
|
|
h = Math.abs(s + a);
|
|
return h < 1e-5 || Math.abs(o - h) < 1e-5 ? (t.rotation = a, t.skew.x = t.skew.y = 0) : (t.rotation = 0, t.skew.x = s, t.skew.y = a),
|
|
t.scale.x = Math.sqrt(e * e + i * i),
|
|
t.scale.y = Math.sqrt(n * n + r * r),
|
|
t.position.x = this.tx,
|
|
t.position.y = this.ty,
|
|
t
|
|
},
|
|
t.prototype.invert = function () {
|
|
var t = this.a,
|
|
e = this.b,
|
|
i = this.c,
|
|
n = this.d,
|
|
r = this.tx,
|
|
o = t * n - e * i;
|
|
return this.a = n / o,
|
|
this.b = -e / o,
|
|
this.c = -i / o,
|
|
this.d = t / o,
|
|
this.tx = (i * this.ty - n * r) / o,
|
|
this.ty = - (t * this.ty - e * r) / o,
|
|
this
|
|
},
|
|
t.prototype.identity = function () {
|
|
return this.a = 1,
|
|
this.b = 0,
|
|
this.c = 0,
|
|
this.d = 1,
|
|
this.tx = 0,
|
|
this.ty = 0,
|
|
this
|
|
},
|
|
t.prototype.clone = function () {
|
|
var e = new t;
|
|
return e.a = this.a,
|
|
e.b = this.b,
|
|
e.c = this.c,
|
|
e.d = this.d,
|
|
e.tx = this.tx,
|
|
e.ty = this.ty,
|
|
e
|
|
},
|
|
t.prototype.copyTo = function (t) {
|
|
return t.a = this.a,
|
|
t.b = this.b,
|
|
t.c = this.c,
|
|
t.d = this.d,
|
|
t.tx = this.tx,
|
|
t.ty = this.ty,
|
|
t
|
|
},
|
|
t.prototype.copyFrom = function (t) {
|
|
return this.a = t.a,
|
|
this.b = t.b,
|
|
this.c = t.c,
|
|
this.d = t.d,
|
|
this.tx = t.tx,
|
|
this.ty = t.ty,
|
|
this
|
|
},
|
|
Object.defineProperty(t, "IDENTITY", {
|
|
get: function () {
|
|
return new t
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t, "TEMP_MATRIX", {
|
|
get: function () {
|
|
return new t
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t
|
|
}
|
|
();
|
|
i.Matrix = l;
|
|
var u = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1],
|
|
c = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1],
|
|
p = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1],
|
|
d = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1],
|
|
f = [],
|
|
_ = [],
|
|
m = Math.sign;
|
|
!function () {
|
|
for (var t = 0; t < 16; t++) {
|
|
var e = [];
|
|
f.push(e);
|
|
for (var i = 0; i < 16; i++)
|
|
for (var n = m(u[t] * u[i] + p[t] * c[i]), r = m(c[t] * u[i] + d[t] * c[i]), o = m(u[t] * p[i] + p[t] * d[i]), s = m(c[t] * p[i] + d[t] * d[i]), a = 0; a < 16; a++)
|
|
if (u[a] === n && c[a] === r && p[a] === o && d[a] === s) {
|
|
e.push(a);
|
|
break
|
|
}
|
|
}
|
|
for (t = 0; t < 16; t++) {
|
|
var h = new l;
|
|
h.set(u[t], c[t], p[t], d[t], 0, 0),
|
|
_.push(h)
|
|
}
|
|
}
|
|
();
|
|
var y = {
|
|
E: 0,
|
|
SE: 1,
|
|
S: 2,
|
|
SW: 3,
|
|
W: 4,
|
|
NW: 5,
|
|
N: 6,
|
|
NE: 7,
|
|
MIRROR_VERTICAL: 8,
|
|
MAIN_DIAGONAL: 10,
|
|
MIRROR_HORIZONTAL: 12,
|
|
REVERSE_DIAGONAL: 14,
|
|
uX: function (t) {
|
|
return u[t]
|
|
},
|
|
uY: function (t) {
|
|
return c[t]
|
|
},
|
|
vX: function (t) {
|
|
return p[t]
|
|
},
|
|
vY: function (t) {
|
|
return d[t]
|
|
},
|
|
inv: function (t) {
|
|
return 8 & t ? 15 & t : 7 & -t
|
|
},
|
|
add: function (t, e) {
|
|
return f[t][e]
|
|
},
|
|
sub: function (t, e) {
|
|
return f[t][y.inv(e)]
|
|
},
|
|
rotate180: function (t) {
|
|
return 4 ^ t
|
|
},
|
|
isVertical: function (t) {
|
|
return 2 == (3 & t)
|
|
},
|
|
byDirection: function (t, e) {
|
|
return 2 * Math.abs(t) <= Math.abs(e) ? e >= 0 ? y.S : y.N : 2 * Math.abs(e) <= Math.abs(t) ? t > 0 ? y.E : y.W : e > 0 ? t > 0 ? y.SE : y.SW : t > 0 ? y.NE : y.NW
|
|
},
|
|
matrixAppendRotationInv: function (t, e, i, n) {
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = 0);
|
|
var r = _[y.inv(e)];
|
|
r.tx = i,
|
|
r.ty = n,
|
|
t.append(r)
|
|
}
|
|
};
|
|
i.groupD8 = y;
|
|
var g = function () {
|
|
function t() {
|
|
this.worldTransform = new l,
|
|
this.localTransform = new l,
|
|
this.position = new r(this.onChange, this, 0, 0),
|
|
this.scale = new r(this.onChange, this, 1, 1),
|
|
this.pivot = new r(this.onChange, this, 0, 0),
|
|
this.skew = new r(this.updateSkew, this, 0, 0),
|
|
this._rotation = 0,
|
|
this._cx = 1,
|
|
this._sx = 0,
|
|
this._cy = 0,
|
|
this._sy = 1,
|
|
this._localID = 0,
|
|
this._currentLocalID = 0,
|
|
this._worldID = 0,
|
|
this._parentID = 0
|
|
}
|
|
return t.prototype.onChange = function () {
|
|
this._localID++
|
|
},
|
|
t.prototype.updateSkew = function () {
|
|
this._cx = Math.cos(this._rotation + this.skew.y),
|
|
this._sx = Math.sin(this._rotation + this.skew.y),
|
|
this._cy = -Math.sin(this._rotation - this.skew.x),
|
|
this._sy = Math.cos(this._rotation - this.skew.x),
|
|
this._localID++
|
|
},
|
|
t.prototype.updateLocalTransform = function () {
|
|
var t = this.localTransform;
|
|
this._localID !== this._currentLocalID && (t.a = this._cx * this.scale.x, t.b = this._sx * this.scale.x, t.c = this._cy * this.scale.y, t.d = this._sy * this.scale.y, t.tx = this.position.x - (this.pivot.x * t.a + this.pivot.y * t.c), t.ty = this.position.y - (this.pivot.x * t.b + this.pivot.y * t.d), this._currentLocalID = this._localID, this._parentID = -1)
|
|
},
|
|
t.prototype.updateTransform = function (t) {
|
|
var e = this.localTransform;
|
|
if (this._localID !== this._currentLocalID && (e.a = this._cx * this.scale.x, e.b = this._sx * this.scale.x, e.c = this._cy * this.scale.y, e.d = this._sy * this.scale.y, e.tx = this.position.x - (this.pivot.x * e.a + this.pivot.y * e.c), e.ty = this.position.y - (this.pivot.x * e.b + this.pivot.y * e.d), this._currentLocalID = this._localID, this._parentID = -1), this._parentID !== t._worldID) {
|
|
var i = t.worldTransform,
|
|
n = this.worldTransform;
|
|
n.a = e.a * i.a + e.b * i.c,
|
|
n.b = e.a * i.b + e.b * i.d,
|
|
n.c = e.c * i.a + e.d * i.c,
|
|
n.d = e.c * i.b + e.d * i.d,
|
|
n.tx = e.tx * i.a + e.ty * i.c + i.tx,
|
|
n.ty = e.tx * i.b + e.ty * i.d + i.ty,
|
|
this._parentID = t._worldID,
|
|
this._worldID++
|
|
}
|
|
},
|
|
t.prototype.setFromMatrix = function (t) {
|
|
t.decompose(this),
|
|
this._localID++
|
|
},
|
|
Object.defineProperty(t.prototype, "rotation", {
|
|
get: function () {
|
|
return this._rotation
|
|
},
|
|
set: function (t) {
|
|
this._rotation !== t && (this._rotation = t, this.updateSkew())
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t.IDENTITY = new t,
|
|
t
|
|
}
|
|
();
|
|
i.Transform = g;
|
|
var v = function () {
|
|
function t(t, e, i, n) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = 0),
|
|
this.x = Number(t),
|
|
this.y = Number(e),
|
|
this.width = Number(i),
|
|
this.height = Number(n),
|
|
this.type = a.RECT
|
|
}
|
|
return Object.defineProperty(t.prototype, "left", {
|
|
get: function () {
|
|
return this.x
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "right", {
|
|
get: function () {
|
|
return this.x + this.width
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "top", {
|
|
get: function () {
|
|
return this.y
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "bottom", {
|
|
get: function () {
|
|
return this.y + this.height
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t, "EMPTY", {
|
|
get: function () {
|
|
return new t(0, 0, 0, 0)
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t.prototype.clone = function () {
|
|
return new t(this.x, this.y, this.width, this.height)
|
|
},
|
|
t.prototype.copyFrom = function (t) {
|
|
return this.x = t.x,
|
|
this.y = t.y,
|
|
this.width = t.width,
|
|
this.height = t.height,
|
|
this
|
|
},
|
|
t.prototype.copyTo = function (t) {
|
|
return t.x = this.x,
|
|
t.y = this.y,
|
|
t.width = this.width,
|
|
t.height = this.height,
|
|
t
|
|
},
|
|
t.prototype.contains = function (t, e) {
|
|
return !(this.width <= 0 || this.height <= 0) && (t >= this.x && t < this.x + this.width && e >= this.y && e < this.y + this.height)
|
|
},
|
|
t.prototype.pad = function (t, e) {
|
|
return void 0 === t && (t = 0),
|
|
void 0 === e && (e = t),
|
|
this.x -= t,
|
|
this.y -= e,
|
|
this.width += 2 * t,
|
|
this.height += 2 * e,
|
|
this
|
|
},
|
|
t.prototype.fit = function (t) {
|
|
var e = Math.max(this.x, t.x),
|
|
i = Math.min(this.x + this.width, t.x + t.width),
|
|
n = Math.max(this.y, t.y),
|
|
r = Math.min(this.y + this.height, t.y + t.height);
|
|
return this.x = e,
|
|
this.width = Math.max(i - e, 0),
|
|
this.y = n,
|
|
this.height = Math.max(r - n, 0),
|
|
this
|
|
},
|
|
t.prototype.ceil = function (t, e) {
|
|
void 0 === t && (t = 1),
|
|
void 0 === e && (e = .001);
|
|
var i = Math.ceil((this.x + this.width - e) * t) / t,
|
|
n = Math.ceil((this.y + this.height - e) * t) / t;
|
|
return this.x = Math.floor((this.x + e) * t) / t,
|
|
this.y = Math.floor((this.y + e) * t) / t,
|
|
this.width = i - this.x,
|
|
this.height = n - this.y,
|
|
this
|
|
},
|
|
t.prototype.enlarge = function (t) {
|
|
var e = Math.min(this.x, t.x),
|
|
i = Math.max(this.x + this.width, t.x + t.width),
|
|
n = Math.min(this.y, t.y),
|
|
r = Math.max(this.y + this.height, t.y + t.height);
|
|
return this.x = e,
|
|
this.width = i - e,
|
|
this.y = n,
|
|
this.height = r - n,
|
|
this
|
|
},
|
|
t
|
|
}
|
|
();
|
|
i.Rectangle = v;
|
|
var w = function () {
|
|
function t(t, e, i) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
void 0 === i && (i = 0),
|
|
this.x = t,
|
|
this.y = e,
|
|
this.radius = i,
|
|
this.type = a.CIRC
|
|
}
|
|
return t.prototype.clone = function () {
|
|
return new t(this.x, this.y, this.radius)
|
|
},
|
|
t.prototype.contains = function (t, e) {
|
|
if (this.radius <= 0)
|
|
return !1;
|
|
var i = this.radius * this.radius,
|
|
n = this.x - t,
|
|
r = this.y - e;
|
|
return (n *= n) + (r *= r) <= i
|
|
},
|
|
t.prototype.getBounds = function () {
|
|
return new v(this.x - this.radius, this.y - this.radius, 2 * this.radius, 2 * this.radius)
|
|
},
|
|
t
|
|
}
|
|
();
|
|
i.Circle = w;
|
|
var x = function () {
|
|
function t(t, e, i, n) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = 0),
|
|
this.x = t,
|
|
this.y = e,
|
|
this.width = i,
|
|
this.height = n,
|
|
this.type = a.ELIP
|
|
}
|
|
return t.prototype.clone = function () {
|
|
return new t(this.x, this.y, this.width, this.height)
|
|
},
|
|
t.prototype.contains = function (t, e) {
|
|
if (this.width <= 0 || this.height <= 0)
|
|
return !1;
|
|
var i = (t - this.x) / this.width,
|
|
n = (e - this.y) / this.height;
|
|
return (i *= i) + (n *= n) <= 1
|
|
},
|
|
t.prototype.getBounds = function () {
|
|
return new v(this.x - this.width, this.y - this.height, this.width, this.height)
|
|
},
|
|
t
|
|
}
|
|
();
|
|
i.Ellipse = x;
|
|
var b = function () {
|
|
function t() {
|
|
for (var t = arguments, e = [], i = 0; i < arguments.length; i++)
|
|
e[i] = t[i];
|
|
if (Array.isArray(e[0]) && (e = e[0]), e[0]instanceof n) {
|
|
for (var r = [], o = 0, s = (e = e).length; o < s; o++)
|
|
r.push(e[o].x, e[o].y);
|
|
e = r
|
|
}
|
|
this.points = e,
|
|
this.type = a.POLY,
|
|
this.closeStroke = !0
|
|
}
|
|
return t.prototype.clone = function () {
|
|
var e = new t(this.points.slice());
|
|
return e.closeStroke = this.closeStroke,
|
|
e
|
|
},
|
|
t.prototype.contains = function (t, e) {
|
|
for (var i = !1, n = this.points.length / 2, r = 0, o = n - 1; r < n; o = r++) {
|
|
var s = this.points[2 * r],
|
|
a = this.points[2 * r + 1],
|
|
h = this.points[2 * o],
|
|
l = this.points[2 * o + 1];
|
|
a > e != l > e && t < (e - a) / (l - a) * (h - s) + s && (i = !i)
|
|
}
|
|
return i
|
|
},
|
|
t
|
|
}
|
|
();
|
|
i.Polygon = b;
|
|
var E = function () {
|
|
function t(t, e, i, n, r) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = 0),
|
|
void 0 === r && (r = 20),
|
|
this.x = t,
|
|
this.y = e,
|
|
this.width = i,
|
|
this.height = n,
|
|
this.radius = r,
|
|
this.type = a.RREC
|
|
}
|
|
return t.prototype.clone = function () {
|
|
return new t(this.x, this.y, this.width, this.height, this.radius)
|
|
},
|
|
t.prototype.contains = function (t, e) {
|
|
if (this.width <= 0 || this.height <= 0)
|
|
return !1;
|
|
if (t >= this.x && t <= this.x + this.width && e >= this.y && e <= this.y + this.height) {
|
|
if (e >= this.y + this.radius && e <= this.y + this.height - this.radius || t >= this.x + this.radius && t <= this.x + this.width - this.radius)
|
|
return !0;
|
|
var i = t - (this.x + this.radius),
|
|
n = e - (this.y + this.radius),
|
|
r = this.radius * this.radius;
|
|
if (i * i + n * n <= r)
|
|
return !0;
|
|
if ((i = t - (this.x + this.width - this.radius)) * i + n * n <= r)
|
|
return !0;
|
|
if (i * i + (n = e - (this.y + this.height - this.radius)) * n <= r)
|
|
return !0;
|
|
if ((i = t - (this.x + this.radius)) * i + n * n <= r)
|
|
return !0
|
|
}
|
|
return !1
|
|
},
|
|
t
|
|
}
|
|
();
|
|
i.RoundedRectangle = E
|
|
}, {}
|
|
],
|
|
LJAM: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.DisplayObject = i.Container = i.Bounds = void 0;
|
|
var n = t("@pixi/settings"),
|
|
r = t("@pixi/math"),
|
|
o = t("@pixi/utils");
|
|
/*!
|
|
* @pixi/display - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/display is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
n.settings.SORTABLE_CHILDREN = !1;
|
|
var s = function () {
|
|
this.minX = 1 / 0,
|
|
this.minY = 1 / 0,
|
|
this.maxX = -1 / 0,
|
|
this.maxY = -1 / 0,
|
|
this.rect = null
|
|
};
|
|
i.Bounds = s,
|
|
s.prototype.isEmpty = function () {
|
|
return this.minX > this.maxX || this.minY > this.maxY
|
|
},
|
|
s.prototype.clear = function () {
|
|
this.minX = 1 / 0,
|
|
this.minY = 1 / 0,
|
|
this.maxX = -1 / 0,
|
|
this.maxY = -1 / 0
|
|
},
|
|
s.prototype.getRectangle = function (t) {
|
|
return this.minX > this.maxX || this.minY > this.maxY ? r.Rectangle.EMPTY : ((t = t || new r.Rectangle(0, 0, 1, 1)).x = this.minX, t.y = this.minY, t.width = this.maxX - this.minX, t.height = this.maxY - this.minY, t)
|
|
},
|
|
s.prototype.addPoint = function (t) {
|
|
this.minX = Math.min(this.minX, t.x),
|
|
this.maxX = Math.max(this.maxX, t.x),
|
|
this.minY = Math.min(this.minY, t.y),
|
|
this.maxY = Math.max(this.maxY, t.y)
|
|
},
|
|
s.prototype.addQuad = function (t) {
|
|
var e = this.minX,
|
|
i = this.minY,
|
|
n = this.maxX,
|
|
r = this.maxY,
|
|
o = t[0],
|
|
s = t[1];
|
|
e = o < e ? o : e,
|
|
i = s < i ? s : i,
|
|
n = o > n ? o : n,
|
|
r = s > r ? s : r,
|
|
e = (o = t[2]) < e ? o : e,
|
|
i = (s = t[3]) < i ? s : i,
|
|
n = o > n ? o : n,
|
|
r = s > r ? s : r,
|
|
e = (o = t[4]) < e ? o : e,
|
|
i = (s = t[5]) < i ? s : i,
|
|
n = o > n ? o : n,
|
|
r = s > r ? s : r,
|
|
e = (o = t[6]) < e ? o : e,
|
|
i = (s = t[7]) < i ? s : i,
|
|
n = o > n ? o : n,
|
|
r = s > r ? s : r,
|
|
this.minX = e,
|
|
this.minY = i,
|
|
this.maxX = n,
|
|
this.maxY = r
|
|
},
|
|
s.prototype.addFrame = function (t, e, i, n, r) {
|
|
this.addFrameMatrix(t.worldTransform, e, i, n, r)
|
|
},
|
|
s.prototype.addFrameMatrix = function (t, e, i, n, r) {
|
|
var o = t.a,
|
|
s = t.b,
|
|
a = t.c,
|
|
h = t.d,
|
|
l = t.tx,
|
|
u = t.ty,
|
|
c = this.minX,
|
|
p = this.minY,
|
|
d = this.maxX,
|
|
f = this.maxY,
|
|
_ = o * e + a * i + l,
|
|
m = s * e + h * i + u;
|
|
c = _ < c ? _ : c,
|
|
p = m < p ? m : p,
|
|
d = _ > d ? _ : d,
|
|
f = m > f ? m : f,
|
|
c = (_ = o * n + a * i + l) < c ? _ : c,
|
|
p = (m = s * n + h * i + u) < p ? m : p,
|
|
d = _ > d ? _ : d,
|
|
f = m > f ? m : f,
|
|
c = (_ = o * e + a * r + l) < c ? _ : c,
|
|
p = (m = s * e + h * r + u) < p ? m : p,
|
|
d = _ > d ? _ : d,
|
|
f = m > f ? m : f,
|
|
c = (_ = o * n + a * r + l) < c ? _ : c,
|
|
p = (m = s * n + h * r + u) < p ? m : p,
|
|
d = _ > d ? _ : d,
|
|
f = m > f ? m : f,
|
|
this.minX = c,
|
|
this.minY = p,
|
|
this.maxX = d,
|
|
this.maxY = f
|
|
},
|
|
s.prototype.addVertexData = function (t, e, i) {
|
|
for (var n = this.minX, r = this.minY, o = this.maxX, s = this.maxY, a = e; a < i; a += 2) {
|
|
var h = t[a],
|
|
l = t[a + 1];
|
|
n = h < n ? h : n,
|
|
r = l < r ? l : r,
|
|
o = h > o ? h : o,
|
|
s = l > s ? l : s
|
|
}
|
|
this.minX = n,
|
|
this.minY = r,
|
|
this.maxX = o,
|
|
this.maxY = s
|
|
},
|
|
s.prototype.addVertices = function (t, e, i, n) {
|
|
this.addVerticesMatrix(t.worldTransform, e, i, n)
|
|
},
|
|
s.prototype.addVerticesMatrix = function (t, e, i, n, r, o) {
|
|
var s = t.a,
|
|
a = t.b,
|
|
h = t.c,
|
|
l = t.d,
|
|
u = t.tx,
|
|
c = t.ty;
|
|
r = r || 0,
|
|
o = o || 0;
|
|
for (var p = this.minX, d = this.minY, f = this.maxX, _ = this.maxY, m = i; m < n; m += 2) {
|
|
var y = e[m],
|
|
g = e[m + 1],
|
|
v = s * y + h * g + u,
|
|
w = l * g + a * y + c;
|
|
p = Math.min(p, v - r),
|
|
f = Math.max(f, v + r),
|
|
d = Math.min(d, w - o),
|
|
_ = Math.max(_, w + o)
|
|
}
|
|
this.minX = p,
|
|
this.minY = d,
|
|
this.maxX = f,
|
|
this.maxY = _
|
|
},
|
|
s.prototype.addBounds = function (t) {
|
|
var e = this.minX,
|
|
i = this.minY,
|
|
n = this.maxX,
|
|
r = this.maxY;
|
|
this.minX = t.minX < e ? t.minX : e,
|
|
this.minY = t.minY < i ? t.minY : i,
|
|
this.maxX = t.maxX > n ? t.maxX : n,
|
|
this.maxY = t.maxY > r ? t.maxY : r
|
|
},
|
|
s.prototype.addBoundsMask = function (t, e) {
|
|
var i = t.minX > e.minX ? t.minX : e.minX,
|
|
n = t.minY > e.minY ? t.minY : e.minY,
|
|
r = t.maxX < e.maxX ? t.maxX : e.maxX,
|
|
o = t.maxY < e.maxY ? t.maxY : e.maxY;
|
|
if (i <= r && n <= o) {
|
|
var s = this.minX,
|
|
a = this.minY,
|
|
h = this.maxX,
|
|
l = this.maxY;
|
|
this.minX = i < s ? i : s,
|
|
this.minY = n < a ? n : a,
|
|
this.maxX = r > h ? r : h,
|
|
this.maxY = o > l ? o : l
|
|
}
|
|
},
|
|
s.prototype.addBoundsMatrix = function (t, e) {
|
|
this.addFrameMatrix(e, t.minX, t.minY, t.maxX, t.maxY)
|
|
},
|
|
s.prototype.addBoundsArea = function (t, e) {
|
|
var i = t.minX > e.x ? t.minX : e.x,
|
|
n = t.minY > e.y ? t.minY : e.y,
|
|
r = t.maxX < e.x + e.width ? t.maxX : e.x + e.width,
|
|
o = t.maxY < e.y + e.height ? t.maxY : e.y + e.height;
|
|
if (i <= r && n <= o) {
|
|
var s = this.minX,
|
|
a = this.minY,
|
|
h = this.maxX,
|
|
l = this.maxY;
|
|
this.minX = i < s ? i : s,
|
|
this.minY = n < a ? n : a,
|
|
this.maxX = r > h ? r : h,
|
|
this.maxY = o > l ? o : l
|
|
}
|
|
},
|
|
s.prototype.pad = function (t, e) {
|
|
t = t || 0,
|
|
e = e || (0 !== e ? t : 0),
|
|
this.isEmpty() || (this.minX -= t, this.maxX += t, this.minY -= e, this.maxY += e)
|
|
},
|
|
s.prototype.addFramePad = function (t, e, i, n, r, o) {
|
|
t -= r,
|
|
e -= o,
|
|
i += r,
|
|
n += o,
|
|
this.minX = this.minX < t ? this.minX : t,
|
|
this.maxX = this.maxX > i ? this.maxX : i,
|
|
this.minY = this.minY < e ? this.minY : e,
|
|
this.maxY = this.maxY > n ? this.maxY : n
|
|
};
|
|
var a = function (t) {
|
|
function e() {
|
|
t.call(this),
|
|
this.tempDisplayObjectParent = null,
|
|
this.transform = new r.Transform,
|
|
this.alpha = 1,
|
|
this.visible = !0,
|
|
this.renderable = !0,
|
|
this.parent = null,
|
|
this.worldAlpha = 1,
|
|
this._lastSortedIndex = 0,
|
|
this._zIndex = 0,
|
|
this.filterArea = null,
|
|
this.filters = null,
|
|
this._enabledFilters = null,
|
|
this._bounds = new s,
|
|
this._boundsID = 0,
|
|
this._lastBoundsID = -1,
|
|
this._boundsRect = null,
|
|
this._localBoundsRect = null,
|
|
this._mask = null,
|
|
this._destroyed = !1,
|
|
this.isSprite = !1,
|
|
this.isMask = !1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
_tempDisplayObjectParent: {
|
|
configurable: !0
|
|
},
|
|
x: {
|
|
configurable: !0
|
|
},
|
|
y: {
|
|
configurable: !0
|
|
},
|
|
worldTransform: {
|
|
configurable: !0
|
|
},
|
|
localTransform: {
|
|
configurable: !0
|
|
},
|
|
position: {
|
|
configurable: !0
|
|
},
|
|
scale: {
|
|
configurable: !0
|
|
},
|
|
pivot: {
|
|
configurable: !0
|
|
},
|
|
skew: {
|
|
configurable: !0
|
|
},
|
|
rotation: {
|
|
configurable: !0
|
|
},
|
|
angle: {
|
|
configurable: !0
|
|
},
|
|
zIndex: {
|
|
configurable: !0
|
|
},
|
|
worldVisible: {
|
|
configurable: !0
|
|
},
|
|
mask: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.mixin = function (t) {
|
|
for (var i = Object.keys(t), n = 0; n < i.length; ++n) {
|
|
var r = i[n];
|
|
Object.defineProperty(e.prototype, r, Object.getOwnPropertyDescriptor(t, r))
|
|
}
|
|
},
|
|
i._tempDisplayObjectParent.get = function () {
|
|
return null === this.tempDisplayObjectParent && (this.tempDisplayObjectParent = new e),
|
|
this.tempDisplayObjectParent
|
|
},
|
|
e.prototype.updateTransform = function () {
|
|
this._boundsID++,
|
|
this.transform.updateTransform(this.parent.transform),
|
|
this.worldAlpha = this.alpha * this.parent.worldAlpha
|
|
},
|
|
e.prototype.calculateBounds = function () {},
|
|
e.prototype._recursivePostUpdateTransform = function () {
|
|
this.parent ? (this.parent._recursivePostUpdateTransform(), this.transform.updateTransform(this.parent.transform)) : this.transform.updateTransform(this._tempDisplayObjectParent.transform)
|
|
},
|
|
e.prototype.getBounds = function (t, e) {
|
|
return t || (this.parent ? (this._recursivePostUpdateTransform(), this.updateTransform()) : (this.parent = this._tempDisplayObjectParent, this.updateTransform(), this.parent = null)),
|
|
this._boundsID !== this._lastBoundsID && (this.calculateBounds(), this._lastBoundsID = this._boundsID),
|
|
e || (this._boundsRect || (this._boundsRect = new r.Rectangle), e = this._boundsRect),
|
|
this._bounds.getRectangle(e)
|
|
},
|
|
e.prototype.getLocalBounds = function (t) {
|
|
var e = this.transform,
|
|
i = this.parent;
|
|
this.parent = null,
|
|
this.transform = this._tempDisplayObjectParent.transform,
|
|
t || (this._localBoundsRect || (this._localBoundsRect = new r.Rectangle), t = this._localBoundsRect);
|
|
var n = this.getBounds(!1, t);
|
|
return this.parent = i,
|
|
this.transform = e,
|
|
n
|
|
},
|
|
e.prototype.toGlobal = function (t, e, i) {
|
|
return void 0 === i && (i = !1),
|
|
i || (this._recursivePostUpdateTransform(), this.parent ? this.displayObjectUpdateTransform() : (this.parent = this._tempDisplayObjectParent, this.displayObjectUpdateTransform(), this.parent = null)),
|
|
this.worldTransform.apply(t, e)
|
|
},
|
|
e.prototype.toLocal = function (t, e, i, n) {
|
|
return e && (t = e.toGlobal(t, i, n)),
|
|
n || (this._recursivePostUpdateTransform(), this.parent ? this.displayObjectUpdateTransform() : (this.parent = this._tempDisplayObjectParent, this.displayObjectUpdateTransform(), this.parent = null)),
|
|
this.worldTransform.applyInverse(t, i)
|
|
},
|
|
e.prototype.render = function (t) {},
|
|
e.prototype.setParent = function (t) {
|
|
if (!t || !t.addChild)
|
|
throw new Error("setParent: Argument must be a Container");
|
|
return t.addChild(this),
|
|
t
|
|
},
|
|
e.prototype.setTransform = function (t, e, i, n, r, o, s, a, h) {
|
|
return void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
void 0 === i && (i = 1),
|
|
void 0 === n && (n = 1),
|
|
void 0 === r && (r = 0),
|
|
void 0 === o && (o = 0),
|
|
void 0 === s && (s = 0),
|
|
void 0 === a && (a = 0),
|
|
void 0 === h && (h = 0),
|
|
this.position.x = t,
|
|
this.position.y = e,
|
|
this.scale.x = i || 1,
|
|
this.scale.y = n || 1,
|
|
this.rotation = r,
|
|
this.skew.x = o,
|
|
this.skew.y = s,
|
|
this.pivot.x = a,
|
|
this.pivot.y = h,
|
|
this
|
|
},
|
|
e.prototype.destroy = function () {
|
|
this.parent && this.parent.removeChild(this),
|
|
this.removeAllListeners(),
|
|
this.transform = null,
|
|
this.parent = null,
|
|
this._bounds = null,
|
|
this._currentBounds = null,
|
|
this._mask = null,
|
|
this.filters = null,
|
|
this.filterArea = null,
|
|
this.hitArea = null,
|
|
this.interactive = !1,
|
|
this.interactiveChildren = !1,
|
|
this._destroyed = !0
|
|
},
|
|
i.x.get = function () {
|
|
return this.position.x
|
|
},
|
|
i.x.set = function (t) {
|
|
this.transform.position.x = t
|
|
},
|
|
i.y.get = function () {
|
|
return this.position.y
|
|
},
|
|
i.y.set = function (t) {
|
|
this.transform.position.y = t
|
|
},
|
|
i.worldTransform.get = function () {
|
|
return this.transform.worldTransform
|
|
},
|
|
i.localTransform.get = function () {
|
|
return this.transform.localTransform
|
|
},
|
|
i.position.get = function () {
|
|
return this.transform.position
|
|
},
|
|
i.position.set = function (t) {
|
|
this.transform.position.copyFrom(t)
|
|
},
|
|
i.scale.get = function () {
|
|
return this.transform.scale
|
|
},
|
|
i.scale.set = function (t) {
|
|
this.transform.scale.copyFrom(t)
|
|
},
|
|
i.pivot.get = function () {
|
|
return this.transform.pivot
|
|
},
|
|
i.pivot.set = function (t) {
|
|
this.transform.pivot.copyFrom(t)
|
|
},
|
|
i.skew.get = function () {
|
|
return this.transform.skew
|
|
},
|
|
i.skew.set = function (t) {
|
|
this.transform.skew.copyFrom(t)
|
|
},
|
|
i.rotation.get = function () {
|
|
return this.transform.rotation
|
|
},
|
|
i.rotation.set = function (t) {
|
|
this.transform.rotation = t
|
|
},
|
|
i.angle.get = function () {
|
|
return this.transform.rotation * r.RAD_TO_DEG
|
|
},
|
|
i.angle.set = function (t) {
|
|
this.transform.rotation = t * r.DEG_TO_RAD
|
|
},
|
|
i.zIndex.get = function () {
|
|
return this._zIndex
|
|
},
|
|
i.zIndex.set = function (t) {
|
|
this._zIndex = t,
|
|
this.parent && (this.parent.sortDirty = !0)
|
|
},
|
|
i.worldVisible.get = function () {
|
|
var t = this;
|
|
do {
|
|
if (!t.visible)
|
|
return !1;
|
|
t = t.parent
|
|
} while (t);
|
|
return !0
|
|
},
|
|
i.mask.get = function () {
|
|
return this._mask
|
|
},
|
|
i.mask.set = function (t) {
|
|
if (this._mask) {
|
|
var e = this._mask.maskObject || this._mask;
|
|
e.renderable = !0,
|
|
e.isMask = !1
|
|
}
|
|
if (this._mask = t, this._mask) {
|
|
var i = this._mask.maskObject || this._mask;
|
|
i.renderable = !1,
|
|
i.isMask = !0
|
|
}
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(o.EventEmitter);
|
|
function h(t, e) {
|
|
return t.zIndex === e.zIndex ? t._lastSortedIndex - e._lastSortedIndex : t.zIndex - e.zIndex
|
|
}
|
|
i.DisplayObject = a,
|
|
a.prototype.displayObjectUpdateTransform = a.prototype.updateTransform;
|
|
var l = function (t) {
|
|
function e() {
|
|
t.call(this),
|
|
this.children = [],
|
|
this.sortableChildren = n.settings.SORTABLE_CHILDREN,
|
|
this.sortDirty = !1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.onChildrenChange = function () {},
|
|
e.prototype.addChild = function (t) {
|
|
var e = arguments,
|
|
i = arguments.length;
|
|
if (i > 1)
|
|
for (var n = 0; n < i; n++)
|
|
this.addChild(e[n]);
|
|
else
|
|
t.parent && t.parent.removeChild(t), t.parent = this, this.sortDirty = !0, t.transform._parentID = -1, this.children.push(t), this._boundsID++, this.onChildrenChange(this.children.length - 1), this.emit("childAdded", t, this, this.children.length - 1), t.emit("added", this);
|
|
return t
|
|
},
|
|
e.prototype.addChildAt = function (t, e) {
|
|
if (e < 0 || e > this.children.length)
|
|
throw new Error(t + "addChildAt: The index " + e + " supplied is out of bounds " + this.children.length);
|
|
return t.parent && t.parent.removeChild(t),
|
|
t.parent = this,
|
|
this.sortDirty = !0,
|
|
t.transform._parentID = -1,
|
|
this.children.splice(e, 0, t),
|
|
this._boundsID++,
|
|
this.onChildrenChange(e),
|
|
t.emit("added", this),
|
|
this.emit("childAdded", t, this, e),
|
|
t
|
|
},
|
|
e.prototype.swapChildren = function (t, e) {
|
|
if (t !== e) {
|
|
var i = this.getChildIndex(t),
|
|
n = this.getChildIndex(e);
|
|
this.children[i] = e,
|
|
this.children[n] = t,
|
|
this.onChildrenChange(i < n ? i : n)
|
|
}
|
|
},
|
|
e.prototype.getChildIndex = function (t) {
|
|
var e = this.children.indexOf(t);
|
|
if (-1 === e)
|
|
throw new Error("The supplied DisplayObject must be a child of the caller");
|
|
return e
|
|
},
|
|
e.prototype.setChildIndex = function (t, e) {
|
|
if (e < 0 || e >= this.children.length)
|
|
throw new Error("The index " + e + " supplied is out of bounds " + this.children.length);
|
|
var i = this.getChildIndex(t);
|
|
(0, o.removeItems)(this.children, i, 1),
|
|
this.children.splice(e, 0, t),
|
|
this.onChildrenChange(e)
|
|
},
|
|
e.prototype.getChildAt = function (t) {
|
|
if (t < 0 || t >= this.children.length)
|
|
throw new Error("getChildAt: Index (" + t + ") does not exist.");
|
|
return this.children[t]
|
|
},
|
|
e.prototype.removeChild = function (t) {
|
|
var e = arguments,
|
|
i = arguments.length;
|
|
if (i > 1)
|
|
for (var n = 0; n < i; n++)
|
|
this.removeChild(e[n]);
|
|
else {
|
|
var r = this.children.indexOf(t);
|
|
if (-1 === r)
|
|
return null;
|
|
t.parent = null,
|
|
t.transform._parentID = -1,
|
|
(0, o.removeItems)(this.children, r, 1),
|
|
this._boundsID++,
|
|
this.onChildrenChange(r),
|
|
t.emit("removed", this),
|
|
this.emit("childRemoved", t, this, r)
|
|
}
|
|
return t
|
|
},
|
|
e.prototype.removeChildAt = function (t) {
|
|
var e = this.getChildAt(t);
|
|
return e.parent = null,
|
|
e.transform._parentID = -1,
|
|
(0, o.removeItems)(this.children, t, 1),
|
|
this._boundsID++,
|
|
this.onChildrenChange(t),
|
|
e.emit("removed", this),
|
|
this.emit("childRemoved", e, this, t),
|
|
e
|
|
},
|
|
e.prototype.removeChildren = function (t, e) {
|
|
void 0 === t && (t = 0);
|
|
var i,
|
|
n = t,
|
|
r = "number" == typeof e ? e : this.children.length,
|
|
o = r - n;
|
|
if (o > 0 && o <= r) {
|
|
i = this.children.splice(n, o);
|
|
for (var s = 0; s < i.length; ++s)
|
|
i[s].parent = null, i[s].transform && (i[s].transform._parentID = -1);
|
|
this._boundsID++,
|
|
this.onChildrenChange(t);
|
|
for (var a = 0; a < i.length; ++a)
|
|
i[a].emit("removed", this), this.emit("childRemoved", i[a], this, a);
|
|
return i
|
|
}
|
|
if (0 === o && 0 === this.children.length)
|
|
return [];
|
|
throw new RangeError("removeChildren: numeric values are outside the acceptable range.")
|
|
},
|
|
e.prototype.sortChildren = function () {
|
|
for (var t = !1, e = 0, i = this.children.length; e < i; ++e) {
|
|
var n = this.children[e];
|
|
n._lastSortedIndex = e,
|
|
t || 0 === n.zIndex || (t = !0)
|
|
}
|
|
t && this.children.length > 1 && this.children.sort(h),
|
|
this.sortDirty = !1
|
|
},
|
|
e.prototype.updateTransform = function () {
|
|
this.sortableChildren && this.sortDirty && this.sortChildren(),
|
|
this._boundsID++,
|
|
this.transform.updateTransform(this.parent.transform),
|
|
this.worldAlpha = this.alpha * this.parent.worldAlpha;
|
|
for (var t = 0, e = this.children.length; t < e; ++t) {
|
|
var i = this.children[t];
|
|
i.visible && i.updateTransform()
|
|
}
|
|
},
|
|
e.prototype.calculateBounds = function () {
|
|
this._bounds.clear(),
|
|
this._calculateBounds();
|
|
for (var t = 0; t < this.children.length; t++) {
|
|
var e = this.children[t];
|
|
if (e.visible && e.renderable)
|
|
if (e.calculateBounds(), e._mask) {
|
|
var i = e._mask.maskObject || e._mask;
|
|
i.calculateBounds(),
|
|
this._bounds.addBoundsMask(e._bounds, i._bounds)
|
|
} else
|
|
e.filterArea ? this._bounds.addBoundsArea(e._bounds, e.filterArea) : this._bounds.addBounds(e._bounds)
|
|
}
|
|
this._lastBoundsID = this._boundsID
|
|
},
|
|
e.prototype._calculateBounds = function () {},
|
|
e.prototype.render = function (t) {
|
|
if (this.visible && !(this.worldAlpha <= 0) && this.renderable)
|
|
if (this._mask || this.filters && this.filters.length)
|
|
this.renderAdvanced(t);
|
|
else {
|
|
this._render(t);
|
|
for (var e = 0, i = this.children.length; e < i; ++e)
|
|
this.children[e].render(t)
|
|
}
|
|
},
|
|
e.prototype.renderAdvanced = function (t) {
|
|
t.batch.flush();
|
|
var e = this.filters,
|
|
i = this._mask;
|
|
if (e) {
|
|
this._enabledFilters || (this._enabledFilters = []),
|
|
this._enabledFilters.length = 0;
|
|
for (var n = 0; n < e.length; n++)
|
|
e[n].enabled && this._enabledFilters.push(e[n]);
|
|
this._enabledFilters.length && t.filter.push(this, this._enabledFilters)
|
|
}
|
|
i && t.mask.push(this, this._mask),
|
|
this._render(t);
|
|
for (var r = 0, o = this.children.length; r < o; r++)
|
|
this.children[r].render(t);
|
|
t.batch.flush(),
|
|
i && t.mask.pop(this, this._mask),
|
|
e && this._enabledFilters && this._enabledFilters.length && t.filter.pop()
|
|
},
|
|
e.prototype._render = function (t) {},
|
|
e.prototype.destroy = function (e) {
|
|
t.prototype.destroy.call(this),
|
|
this.sortDirty = !1;
|
|
var i = "boolean" == typeof e ? e : e && e.children,
|
|
n = this.removeChildren(0, this.children.length);
|
|
if (i)
|
|
for (var r = 0; r < n.length; ++r)
|
|
n[r].destroy(e)
|
|
},
|
|
i.width.get = function () {
|
|
return this.scale.x * this.getLocalBounds().width
|
|
},
|
|
i.width.set = function (t) {
|
|
var e = this.getLocalBounds().width;
|
|
this.scale.x = 0 !== e ? t / e : 1,
|
|
this._width = t
|
|
},
|
|
i.height.get = function () {
|
|
return this.scale.y * this.getLocalBounds().height
|
|
},
|
|
i.height.set = function (t) {
|
|
var e = this.getLocalBounds().height;
|
|
this.scale.y = 0 !== e ? t / e : 1,
|
|
this._height = t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(a);
|
|
i.Container = l,
|
|
l.prototype.containerUpdateTransform = l.prototype.updateTransform
|
|
}, {
|
|
"@pixi/settings": "v11T",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/utils": "x5Ec"
|
|
}
|
|
],
|
|
jFkj: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.accessibleTarget = i.AccessibilityManager = void 0;
|
|
var n = t("@pixi/utils"),
|
|
r = t("@pixi/display"),
|
|
o = {
|
|
accessible: !1,
|
|
accessibleTitle: null,
|
|
accessibleHint: null,
|
|
tabIndex: 0,
|
|
_accessibleActive: !1,
|
|
_accessibleDiv: !1,
|
|
accessibleType: "button",
|
|
accessiblePointerEvents: "auto",
|
|
accessibleChildren: !0
|
|
};
|
|
i.accessibleTarget = o,
|
|
r.DisplayObject.mixin(o);
|
|
var s = function (t) {
|
|
this._hookDiv = null,
|
|
(n.isMobile.tablet || n.isMobile.phone) && this.createTouchHook();
|
|
var e = document.createElement("div");
|
|
e.style.width = "100px",
|
|
e.style.height = "100px",
|
|
e.style.position = "absolute",
|
|
e.style.top = "0px",
|
|
e.style.left = "0px",
|
|
e.style.zIndex = 2,
|
|
this.div = e,
|
|
this.pool = [],
|
|
this.renderId = 0,
|
|
this.debug = !1,
|
|
this.renderer = t,
|
|
this.children = [],
|
|
this._onKeyDown = this._onKeyDown.bind(this),
|
|
this._onMouseMove = this._onMouseMove.bind(this),
|
|
this.isActive = !1,
|
|
this.isMobileAccessibility = !1,
|
|
window.addEventListener("keydown", this._onKeyDown, !1)
|
|
};
|
|
i.AccessibilityManager = s,
|
|
s.prototype.createTouchHook = function () {
|
|
var t = this,
|
|
e = document.createElement("button");
|
|
e.style.width = "1px",
|
|
e.style.height = "1px",
|
|
e.style.position = "absolute",
|
|
e.style.top = "-1000px",
|
|
e.style.left = "-1000px",
|
|
e.style.zIndex = 2,
|
|
e.style.backgroundColor = "#FF0000",
|
|
e.title = "HOOK DIV",
|
|
e.addEventListener("focus", (function () {
|
|
t.isMobileAccessibility = !0,
|
|
t.activate(),
|
|
t.destroyTouchHook()
|
|
})),
|
|
document.body.appendChild(e),
|
|
this._hookDiv = e
|
|
},
|
|
s.prototype.destroyTouchHook = function () {
|
|
this._hookDiv && (document.body.removeChild(this._hookDiv), this._hookDiv = null)
|
|
},
|
|
s.prototype.activate = function () {
|
|
this.isActive || (this.isActive = !0, window.document.addEventListener("mousemove", this._onMouseMove, !0), window.removeEventListener("keydown", this._onKeyDown, !1), this.renderer.on("postrender", this.update, this), this.renderer.view.parentNode && this.renderer.view.parentNode.appendChild(this.div))
|
|
},
|
|
s.prototype.deactivate = function () {
|
|
this.isActive && !this.isMobileAccessibility && (this.isActive = !1, window.document.removeEventListener("mousemove", this._onMouseMove, !0), window.addEventListener("keydown", this._onKeyDown, !1), this.renderer.off("postrender", this.update), this.div.parentNode && this.div.parentNode.removeChild(this.div))
|
|
},
|
|
s.prototype.updateAccessibleObjects = function (t) {
|
|
if (t.visible && t.accessibleChildren) {
|
|
t.accessible && t.interactive && (t._accessibleActive || this.addChild(t), t.renderId = this.renderId);
|
|
for (var e = t.children, i = 0; i < e.length; i++)
|
|
this.updateAccessibleObjects(e[i])
|
|
}
|
|
},
|
|
s.prototype.update = function () {
|
|
if (this.renderer.renderingToScreen) {
|
|
this.updateAccessibleObjects(this.renderer._lastObjectRendered);
|
|
var t = this.renderer.view.getBoundingClientRect(),
|
|
e = t.width / this.renderer.width,
|
|
i = t.height / this.renderer.height,
|
|
r = this.div;
|
|
r.style.left = t.left + "px",
|
|
r.style.top = t.top + "px",
|
|
r.style.width = this.renderer.width + "px",
|
|
r.style.height = this.renderer.height + "px";
|
|
for (var o = 0; o < this.children.length; o++) {
|
|
var s = this.children[o];
|
|
if (s.renderId !== this.renderId)
|
|
s._accessibleActive = !1, (0, n.removeItems)(this.children, o, 1), this.div.removeChild(s._accessibleDiv), this.pool.push(s._accessibleDiv), s._accessibleDiv = null, o--, 0 === this.children.length && this.deactivate();
|
|
else {
|
|
r = s._accessibleDiv;
|
|
var a = s.hitArea,
|
|
h = s.worldTransform;
|
|
s.hitArea ? (r.style.left = (h.tx + a.x * h.a) * e + "px", r.style.top = (h.ty + a.y * h.d) * i + "px", r.style.width = a.width * h.a * e + "px", r.style.height = a.height * h.d * i + "px") : (a = s.getBounds(), this.capHitArea(a), r.style.left = a.x * e + "px", r.style.top = a.y * i + "px", r.style.width = a.width * e + "px", r.style.height = a.height * i + "px", r.title !== s.accessibleTitle && null !== s.accessibleTitle && (r.title = s.accessibleTitle), r.getAttribute("aria-label") !== s.accessibleHint && null !== s.accessibleHint && r.setAttribute("aria-label", s.accessibleHint)),
|
|
s.accessibleTitle === r.title && s.tabIndex === r.tabIndex || (r.title = s.accessibleTitle, r.tabIndex = s.tabIndex, this.debug && this.updateDebugHTML(r))
|
|
}
|
|
}
|
|
this.renderId++
|
|
}
|
|
},
|
|
s.prototype.updateDebugHTML = function (t) {
|
|
t.innerHTML = "type: " + t.type + "</br> title : " + t.title + "</br> tabIndex: " + t.tabIndex
|
|
},
|
|
s.prototype.capHitArea = function (t) {
|
|
t.x < 0 && (t.width += t.x, t.x = 0),
|
|
t.y < 0 && (t.height += t.y, t.y = 0),
|
|
t.x + t.width > this.renderer.width && (t.width = this.renderer.width - t.x),
|
|
t.y + t.height > this.renderer.height && (t.height = this.renderer.height - t.y)
|
|
},
|
|
s.prototype.addChild = function (t) {
|
|
var e = this.pool.pop();
|
|
e || ((e = document.createElement("button")).style.width = "100px", e.style.height = "100px", e.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" : "transparent", e.style.position = "absolute", e.style.zIndex = 2, e.style.borderStyle = "none", navigator.userAgent.toLowerCase().indexOf("chrome") > -1 ? e.setAttribute("aria-live", "off") : e.setAttribute("aria-live", "polite"), navigator.userAgent.match(/rv:.*Gecko\//) ? e.setAttribute("aria-relevant", "additions") : e.setAttribute("aria-relevant", "text"), e.addEventListener("click", this._onClick.bind(this)), e.addEventListener("focus", this._onFocus.bind(this)), e.addEventListener("focusout", this._onFocusOut.bind(this))),
|
|
e.style.pointerEvents = t.accessiblePointerEvents,
|
|
e.type = t.accessibleType,
|
|
t.accessibleTitle && null !== t.accessibleTitle ? e.title = t.accessibleTitle : t.accessibleHint && null !== t.accessibleHint || (e.title = "displayObject " + t.tabIndex),
|
|
t.accessibleHint && null !== t.accessibleHint && e.setAttribute("aria-label", t.accessibleHint),
|
|
this.debug && this.updateDebugHTML(e),
|
|
t._accessibleActive = !0,
|
|
t._accessibleDiv = e,
|
|
e.displayObject = t,
|
|
this.children.push(t),
|
|
this.div.appendChild(t._accessibleDiv),
|
|
t._accessibleDiv.tabIndex = t.tabIndex
|
|
},
|
|
s.prototype._onClick = function (t) {
|
|
var e = this.renderer.plugins.interaction;
|
|
e.dispatchEvent(t.target.displayObject, "click", e.eventData),
|
|
e.dispatchEvent(t.target.displayObject, "pointertap", e.eventData),
|
|
e.dispatchEvent(t.target.displayObject, "tap", e.eventData)
|
|
},
|
|
s.prototype._onFocus = function (t) {
|
|
t.target.getAttribute("aria-live", "off") || t.target.setAttribute("aria-live", "assertive");
|
|
var e = this.renderer.plugins.interaction;
|
|
e.dispatchEvent(t.target.displayObject, "mouseover", e.eventData)
|
|
},
|
|
s.prototype._onFocusOut = function (t) {
|
|
t.target.getAttribute("aria-live", "off") || t.target.setAttribute("aria-live", "polite");
|
|
var e = this.renderer.plugins.interaction;
|
|
e.dispatchEvent(t.target.displayObject, "mouseout", e.eventData)
|
|
},
|
|
s.prototype._onKeyDown = function (t) {
|
|
9 === t.keyCode && this.activate()
|
|
},
|
|
s.prototype._onMouseMove = function (t) {
|
|
0 === t.movementX && 0 === t.movementY || this.deactivate()
|
|
},
|
|
s.prototype.destroy = function () {
|
|
this.destroyTouchHook(),
|
|
this.div = null;
|
|
for (var t = 0; t < this.children.length; t++)
|
|
this.children[t].div = null;
|
|
window.document.removeEventListener("mousemove", this._onMouseMove, !0),
|
|
window.removeEventListener("keydown", this._onKeyDown),
|
|
this.pool = null,
|
|
this.children = null,
|
|
this.renderer = null
|
|
}
|
|
}, {
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/display": "LJAM"
|
|
}
|
|
],
|
|
t27b: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.UPDATE_PRIORITY = i.TickerPlugin = i.Ticker = void 0;
|
|
var n,
|
|
r = t("@pixi/settings");
|
|
/*!
|
|
* @pixi/ticker - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/ticker is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
r.settings.TARGET_FPMS = .06,
|
|
i.UPDATE_PRIORITY = n,
|
|
function (t) {
|
|
t[t.INTERACTION = 50] = "INTERACTION",
|
|
t[t.HIGH = 25] = "HIGH",
|
|
t[t.NORMAL = 0] = "NORMAL",
|
|
t[t.LOW = -25] = "LOW",
|
|
t[t.UTILITY = -50] = "UTILITY"
|
|
}
|
|
(n || (i.UPDATE_PRIORITY = n = {}));
|
|
var o = function () {
|
|
function t(t, e, i, n) {
|
|
void 0 === e && (e = null),
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = !1),
|
|
this.fn = t,
|
|
this.context = e,
|
|
this.priority = i,
|
|
this.once = n,
|
|
this.next = null,
|
|
this.previous = null,
|
|
this._destroyed = !1
|
|
}
|
|
return t.prototype.match = function (t, e) {
|
|
return void 0 === e && (e = null),
|
|
this.fn === t && this.context === e
|
|
},
|
|
t.prototype.emit = function (t) {
|
|
this.fn && (this.context ? this.fn.call(this.context, t) : this.fn(t));
|
|
var e = this.next;
|
|
return this.once && this.destroy(!0),
|
|
this._destroyed && (this.next = null),
|
|
e
|
|
},
|
|
t.prototype.connect = function (t) {
|
|
this.previous = t,
|
|
t.next && (t.next.previous = this),
|
|
this.next = t.next,
|
|
t.next = this
|
|
},
|
|
t.prototype.destroy = function (t) {
|
|
void 0 === t && (t = !1),
|
|
this._destroyed = !0,
|
|
this.fn = null,
|
|
this.context = null,
|
|
this.previous && (this.previous.next = this.next),
|
|
this.next && (this.next.previous = this.previous);
|
|
var e = this.next;
|
|
return this.next = t ? null : e,
|
|
this.previous = null,
|
|
e
|
|
},
|
|
t
|
|
}
|
|
(),
|
|
s = function () {
|
|
function t() {
|
|
var t = this;
|
|
this._head = new o(null, null, 1 / 0),
|
|
this._requestId = null,
|
|
this._maxElapsedMS = 100,
|
|
this._minElapsedMS = 0,
|
|
this.autoStart = !1,
|
|
this.deltaTime = 1,
|
|
this.deltaMS = 1 / r.settings.TARGET_FPMS,
|
|
this.elapsedMS = 1 / r.settings.TARGET_FPMS,
|
|
this.lastTime = -1,
|
|
this.speed = 1,
|
|
this.started = !1,
|
|
this._protected = !1,
|
|
this._lastFrame = -1,
|
|
this._tick = function (e) {
|
|
t._requestId = null,
|
|
t.started && (t.update(e), t.started && null === t._requestId && t._head.next && (t._requestId = requestAnimationFrame(t._tick)))
|
|
}
|
|
}
|
|
return t.prototype._requestIfNeeded = function () {
|
|
null === this._requestId && this._head.next && (this.lastTime = performance.now(), this._lastFrame = this.lastTime, this._requestId = requestAnimationFrame(this._tick))
|
|
},
|
|
t.prototype._cancelIfNeeded = function () {
|
|
null !== this._requestId && (cancelAnimationFrame(this._requestId), this._requestId = null)
|
|
},
|
|
t.prototype._startIfPossible = function () {
|
|
this.started ? this._requestIfNeeded() : this.autoStart && this.start()
|
|
},
|
|
t.prototype.add = function (t, e, i) {
|
|
return void 0 === i && (i = n.NORMAL),
|
|
this._addListener(new o(t, e, i))
|
|
},
|
|
t.prototype.addOnce = function (t, e, i) {
|
|
return void 0 === i && (i = n.NORMAL),
|
|
this._addListener(new o(t, e, i, !0))
|
|
},
|
|
t.prototype._addListener = function (t) {
|
|
var e = this._head.next,
|
|
i = this._head;
|
|
if (e) {
|
|
for (; e; ) {
|
|
if (t.priority > e.priority) {
|
|
t.connect(i);
|
|
break
|
|
}
|
|
i = e,
|
|
e = e.next
|
|
}
|
|
t.previous || t.connect(i)
|
|
} else
|
|
t.connect(i);
|
|
return this._startIfPossible(),
|
|
this
|
|
},
|
|
t.prototype.remove = function (t, e) {
|
|
for (var i = this._head.next; i; )
|
|
i = i.match(t, e) ? i.destroy() : i.next;
|
|
return this._head.next || this._cancelIfNeeded(),
|
|
this
|
|
},
|
|
Object.defineProperty(t.prototype, "count", {
|
|
get: function () {
|
|
if (!this._head)
|
|
return 0;
|
|
for (var t = 0, e = this._head; e = e.next; )
|
|
t++;
|
|
return t
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t.prototype.start = function () {
|
|
this.started || (this.started = !0, this._requestIfNeeded())
|
|
},
|
|
t.prototype.stop = function () {
|
|
this.started && (this.started = !1, this._cancelIfNeeded())
|
|
},
|
|
t.prototype.destroy = function () {
|
|
if (!this._protected) {
|
|
this.stop();
|
|
for (var t = this._head.next; t; )
|
|
t = t.destroy(!0);
|
|
this._head.destroy(),
|
|
this._head = null
|
|
}
|
|
},
|
|
t.prototype.update = function (t) {
|
|
var e;
|
|
if (void 0 === t && (t = performance.now()), t > this.lastTime) {
|
|
if ((e = this.elapsedMS = t - this.lastTime) > this._maxElapsedMS && (e = this._maxElapsedMS), e *= this.speed, this._minElapsedMS) {
|
|
var i = t - this._lastFrame | 0;
|
|
if (i < this._minElapsedMS)
|
|
return;
|
|
this._lastFrame = t - i % this._minElapsedMS
|
|
}
|
|
this.deltaMS = e,
|
|
this.deltaTime = this.deltaMS * r.settings.TARGET_FPMS;
|
|
for (var n = this._head, o = n.next; o; )
|
|
o = o.emit(this.deltaTime);
|
|
n.next || this._cancelIfNeeded()
|
|
} else
|
|
this.deltaTime = this.deltaMS = this.elapsedMS = 0;
|
|
this.lastTime = t
|
|
},
|
|
Object.defineProperty(t.prototype, "FPS", {
|
|
get: function () {
|
|
return 1e3 / this.elapsedMS
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "minFPS", {
|
|
get: function () {
|
|
return 1e3 / this._maxElapsedMS
|
|
},
|
|
set: function (t) {
|
|
var e = Math.min(this.maxFPS, t),
|
|
i = Math.min(Math.max(0, e) / 1e3, r.settings.TARGET_FPMS);
|
|
this._maxElapsedMS = 1 / i
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "maxFPS", {
|
|
get: function () {
|
|
return this._minElapsedMS ? Math.round(1e3 / this._minElapsedMS) : 0
|
|
},
|
|
set: function (t) {
|
|
if (0 === t)
|
|
this._minElapsedMS = 0;
|
|
else {
|
|
var e = Math.max(this.minFPS, t);
|
|
this._minElapsedMS = 1 / (e / 1e3)
|
|
}
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t, "shared", {
|
|
get: function () {
|
|
if (!t._shared) {
|
|
var e = t._shared = new t;
|
|
e.autoStart = !0,
|
|
e._protected = !0
|
|
}
|
|
return t._shared
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t, "system", {
|
|
get: function () {
|
|
if (!t._system) {
|
|
var e = t._system = new t;
|
|
e.autoStart = !0,
|
|
e._protected = !0
|
|
}
|
|
return t._system
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t
|
|
}
|
|
();
|
|
i.Ticker = s;
|
|
var a = function () {
|
|
function t() {}
|
|
return t.init = function (t) {
|
|
var e = this;
|
|
t = Object.assign({
|
|
autoStart: !0,
|
|
sharedTicker: !1
|
|
}, t),
|
|
Object.defineProperty(this, "ticker", {
|
|
set: function (t) {
|
|
this._ticker && this._ticker.remove(this.render, this),
|
|
this._ticker = t,
|
|
t && t.add(this.render, this, n.LOW)
|
|
},
|
|
get: function () {
|
|
return this._ticker
|
|
}
|
|
}),
|
|
this.stop = function () {
|
|
e._ticker.stop()
|
|
},
|
|
this.start = function () {
|
|
e._ticker.start()
|
|
},
|
|
this._ticker = null,
|
|
this.ticker = t.sharedTicker ? s.shared : new s,
|
|
t.autoStart && this.start()
|
|
},
|
|
t.destroy = function () {
|
|
if (this._ticker) {
|
|
var t = this._ticker;
|
|
this.ticker = null,
|
|
t.destroy()
|
|
}
|
|
},
|
|
t
|
|
}
|
|
();
|
|
i.TickerPlugin = a
|
|
}, {
|
|
"@pixi/settings": "v11T"
|
|
}
|
|
],
|
|
RmUs: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.interactiveTarget = i.InteractionTrackingData = i.InteractionManager = i.InteractionEvent = i.InteractionData = void 0;
|
|
var n = t("@pixi/math"),
|
|
r = t("@pixi/ticker"),
|
|
o = t("@pixi/display"),
|
|
s = t("@pixi/utils"),
|
|
a = function () {
|
|
this.global = new n.Point,
|
|
this.target = null,
|
|
this.originalEvent = null,
|
|
this.identifier = null,
|
|
this.isPrimary = !1,
|
|
this.button = 0,
|
|
this.buttons = 0,
|
|
this.width = 0,
|
|
this.height = 0,
|
|
this.tiltX = 0,
|
|
this.tiltY = 0,
|
|
this.pointerType = null,
|
|
this.pressure = 0,
|
|
this.rotationAngle = 0,
|
|
this.twist = 0,
|
|
this.tangentialPressure = 0
|
|
};
|
|
i.InteractionData = a;
|
|
var h = {
|
|
pointerId: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
h.pointerId.get = function () {
|
|
return this.identifier
|
|
},
|
|
a.prototype.getLocalPosition = function (t, e, i) {
|
|
return t.worldTransform.applyInverse(i || this.global, e)
|
|
},
|
|
a.prototype.copyEvent = function (t) {
|
|
t.isPrimary && (this.isPrimary = !0),
|
|
this.button = t.button,
|
|
this.buttons = Number.isInteger(t.buttons) ? t.buttons : t.which,
|
|
this.width = t.width,
|
|
this.height = t.height,
|
|
this.tiltX = t.tiltX,
|
|
this.tiltY = t.tiltY,
|
|
this.pointerType = t.pointerType,
|
|
this.pressure = t.pressure,
|
|
this.rotationAngle = t.rotationAngle,
|
|
this.twist = t.twist || 0,
|
|
this.tangentialPressure = t.tangentialPressure || 0
|
|
},
|
|
a.prototype.reset = function () {
|
|
this.isPrimary = !1
|
|
},
|
|
Object.defineProperties(a.prototype, h);
|
|
var l = function () {
|
|
this.stopped = !1,
|
|
this.stopsPropagatingAt = null,
|
|
this.stopPropagationHint = !1,
|
|
this.target = null,
|
|
this.currentTarget = null,
|
|
this.type = null,
|
|
this.data = null
|
|
};
|
|
i.InteractionEvent = l,
|
|
l.prototype.stopPropagation = function () {
|
|
this.stopped = !0,
|
|
this.stopPropagationHint = !0,
|
|
this.stopsPropagatingAt = this.currentTarget
|
|
},
|
|
l.prototype.reset = function () {
|
|
this.stopped = !1,
|
|
this.stopsPropagatingAt = null,
|
|
this.stopPropagationHint = !1,
|
|
this.currentTarget = null,
|
|
this.target = null
|
|
};
|
|
var u = function t(e) {
|
|
this._pointerId = e,
|
|
this._flags = t.FLAGS.NONE
|
|
};
|
|
i.InteractionTrackingData = u;
|
|
var c = {
|
|
pointerId: {
|
|
configurable: !0
|
|
},
|
|
flags: {
|
|
configurable: !0
|
|
},
|
|
none: {
|
|
configurable: !0
|
|
},
|
|
over: {
|
|
configurable: !0
|
|
},
|
|
rightDown: {
|
|
configurable: !0
|
|
},
|
|
leftDown: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
u.prototype._doSet = function (t, e) {
|
|
this._flags = e ? this._flags | t : this._flags & ~t
|
|
},
|
|
c.pointerId.get = function () {
|
|
return this._pointerId
|
|
},
|
|
c.flags.get = function () {
|
|
return this._flags
|
|
},
|
|
c.flags.set = function (t) {
|
|
this._flags = t
|
|
},
|
|
c.none.get = function () {
|
|
return this._flags === this.constructor.FLAGS.NONE
|
|
},
|
|
c.over.get = function () {
|
|
return 0 != (this._flags & this.constructor.FLAGS.OVER)
|
|
},
|
|
c.over.set = function (t) {
|
|
this._doSet(this.constructor.FLAGS.OVER, t)
|
|
},
|
|
c.rightDown.get = function () {
|
|
return 0 != (this._flags & this.constructor.FLAGS.RIGHT_DOWN)
|
|
},
|
|
c.rightDown.set = function (t) {
|
|
this._doSet(this.constructor.FLAGS.RIGHT_DOWN, t)
|
|
},
|
|
c.leftDown.get = function () {
|
|
return 0 != (this._flags & this.constructor.FLAGS.LEFT_DOWN)
|
|
},
|
|
c.leftDown.set = function (t) {
|
|
this._doSet(this.constructor.FLAGS.LEFT_DOWN, t)
|
|
},
|
|
Object.defineProperties(u.prototype, c),
|
|
u.FLAGS = Object.freeze({
|
|
NONE: 0,
|
|
OVER: 1,
|
|
LEFT_DOWN: 2,
|
|
RIGHT_DOWN: 4
|
|
});
|
|
var p = function () {
|
|
this._tempPoint = new n.Point
|
|
};
|
|
p.prototype.recursiveFindHit = function (t, e, i, n, r) {
|
|
if (!e || !e.visible)
|
|
return !1;
|
|
var o = t.data.global,
|
|
s = !1,
|
|
a = r = e.interactive || r,
|
|
h = !0;
|
|
if (e.hitArea ? (n && (e.worldTransform.applyInverse(o, this._tempPoint), e.hitArea.contains(this._tempPoint.x, this._tempPoint.y) ? s = !0 : (n = !1, h = !1)), a = !1) : e._mask && n && (e._mask.containsPoint && e._mask.containsPoint(o) || (n = !1)), h && e.interactiveChildren && e.children)
|
|
for (var l = e.children, u = l.length - 1; u >= 0; u--) {
|
|
var c = l[u],
|
|
p = this.recursiveFindHit(t, c, i, n, a);
|
|
if (p) {
|
|
if (!c.parent)
|
|
continue;
|
|
a = !1,
|
|
p && (t.target && (n = !1), s = !0)
|
|
}
|
|
}
|
|
return r && (n && !t.target && !e.hitArea && e.containsPoint && e.containsPoint(o) && (s = !0), e.interactive && (s && !t.target && (t.target = e), i && i(t, e, !!s))),
|
|
s
|
|
},
|
|
p.prototype.findHit = function (t, e, i, n) {
|
|
this.recursiveFindHit(t, e, i, n, !1)
|
|
};
|
|
var d = {
|
|
interactive: !1,
|
|
interactiveChildren: !0,
|
|
hitArea: null,
|
|
get buttonMode() {
|
|
return "pointer" === this.cursor
|
|
},
|
|
set buttonMode(t) {
|
|
t ? this.cursor = "pointer" : "pointer" === this.cursor && (this.cursor = null)
|
|
},
|
|
cursor: null,
|
|
get trackedPointers() {
|
|
return void 0 === this._trackedPointers && (this._trackedPointers = {}),
|
|
this._trackedPointers
|
|
},
|
|
_trackedPointers: void 0
|
|
};
|
|
i.interactiveTarget = d,
|
|
o.DisplayObject.mixin(d);
|
|
var f = {
|
|
target: null,
|
|
data: {
|
|
global: null
|
|
}
|
|
},
|
|
_ = function (t) {
|
|
function e(e, i) {
|
|
t.call(this),
|
|
i = i || {},
|
|
this.renderer = e,
|
|
this.autoPreventDefault = void 0 === i.autoPreventDefault || i.autoPreventDefault,
|
|
this.interactionFrequency = i.interactionFrequency || 10,
|
|
this.mouse = new a,
|
|
this.mouse.identifier = 1,
|
|
this.mouse.global.set(-999999),
|
|
this.activeInteractionData = {},
|
|
this.activeInteractionData[1] = this.mouse,
|
|
this.interactionDataPool = [],
|
|
this.eventData = new l,
|
|
this.interactionDOMElement = null,
|
|
this.moveWhenInside = !1,
|
|
this.eventsAdded = !1,
|
|
this.tickerAdded = !1,
|
|
this.mouseOverRenderer = !1,
|
|
this.supportsTouchEvents = "ontouchstart" in window,
|
|
this.supportsPointerEvents = !!window.PointerEvent,
|
|
this.onPointerUp = this.onPointerUp.bind(this),
|
|
this.processPointerUp = this.processPointerUp.bind(this),
|
|
this.onPointerCancel = this.onPointerCancel.bind(this),
|
|
this.processPointerCancel = this.processPointerCancel.bind(this),
|
|
this.onPointerDown = this.onPointerDown.bind(this),
|
|
this.processPointerDown = this.processPointerDown.bind(this),
|
|
this.onPointerMove = this.onPointerMove.bind(this),
|
|
this.processPointerMove = this.processPointerMove.bind(this),
|
|
this.onPointerOut = this.onPointerOut.bind(this),
|
|
this.processPointerOverOut = this.processPointerOverOut.bind(this),
|
|
this.onPointerOver = this.onPointerOver.bind(this),
|
|
this.cursorStyles = {
|
|
default:
|
|
"inherit",
|
|
pointer: "pointer"
|
|
},
|
|
this.currentCursorMode = null,
|
|
this.cursor = null,
|
|
this.resolution = 1,
|
|
this.delayedEvents = [],
|
|
this.search = new p,
|
|
this._useSystemTicker = void 0 === i.useSystemTicker || i.useSystemTicker,
|
|
this.setTargetElement(this.renderer.view, this.renderer.resolution)
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
useSystemTicker: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.useSystemTicker.get = function () {
|
|
return this._useSystemTicker
|
|
},
|
|
i.useSystemTicker.set = function (t) {
|
|
this._useSystemTicker = t,
|
|
t ? this.addTickerListener() : this.removeTickerListener()
|
|
},
|
|
e.prototype.hitTest = function (t, e) {
|
|
return f.target = null,
|
|
f.data.global = t,
|
|
e || (e = this.renderer._lastObjectRendered),
|
|
this.processInteractive(f, e, null, !0),
|
|
f.target
|
|
},
|
|
e.prototype.setTargetElement = function (t, e) {
|
|
void 0 === e && (e = 1),
|
|
this.removeTickerListener(),
|
|
this.removeEvents(),
|
|
this.interactionDOMElement = t,
|
|
this.resolution = e,
|
|
this.addEvents(),
|
|
this.addTickerListener()
|
|
},
|
|
e.prototype.addTickerListener = function () {
|
|
!this.tickerAdded && this.interactionDOMElement && this._useSystemTicker && (r.Ticker.system.add(this.tickerUpdate, this, r.UPDATE_PRIORITY.INTERACTION), this.tickerAdded = !0)
|
|
},
|
|
e.prototype.removeTickerListener = function () {
|
|
this.tickerAdded && (r.Ticker.system.remove(this.tickerUpdate, this), this.tickerAdded = !1)
|
|
},
|
|
e.prototype.addEvents = function () {
|
|
!this.eventsAdded && this.interactionDOMElement && (window.navigator.msPointerEnabled ? (this.interactionDOMElement.style["-ms-content-zooming"] = "none", this.interactionDOMElement.style["-ms-touch-action"] = "none") : this.supportsPointerEvents && (this.interactionDOMElement.style["touch-action"] = "none"), this.supportsPointerEvents ? (window.document.addEventListener("pointermove", this.onPointerMove, !0), this.interactionDOMElement.addEventListener("pointerdown", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("pointerleave", this.onPointerOut, !0), this.interactionDOMElement.addEventListener("pointerover", this.onPointerOver, !0), window.addEventListener("pointercancel", this.onPointerCancel, !0), window.addEventListener("pointerup", this.onPointerUp, !0)) : (window.document.addEventListener("mousemove", this.onPointerMove, !0), this.interactionDOMElement.addEventListener("mousedown", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("mouseout", this.onPointerOut, !0), this.interactionDOMElement.addEventListener("mouseover", this.onPointerOver, !0), window.addEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.interactionDOMElement.addEventListener("touchstart", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("touchcancel", this.onPointerCancel, !0), this.interactionDOMElement.addEventListener("touchend", this.onPointerUp, !0), this.interactionDOMElement.addEventListener("touchmove", this.onPointerMove, !0)), this.eventsAdded = !0)
|
|
},
|
|
e.prototype.removeEvents = function () {
|
|
this.eventsAdded && this.interactionDOMElement && (window.navigator.msPointerEnabled ? (this.interactionDOMElement.style["-ms-content-zooming"] = "", this.interactionDOMElement.style["-ms-touch-action"] = "") : this.supportsPointerEvents && (this.interactionDOMElement.style["touch-action"] = ""), this.supportsPointerEvents ? (window.document.removeEventListener("pointermove", this.onPointerMove, !0), this.interactionDOMElement.removeEventListener("pointerdown", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("pointerleave", this.onPointerOut, !0), this.interactionDOMElement.removeEventListener("pointerover", this.onPointerOver, !0), window.removeEventListener("pointercancel", this.onPointerCancel, !0), window.removeEventListener("pointerup", this.onPointerUp, !0)) : (window.document.removeEventListener("mousemove", this.onPointerMove, !0), this.interactionDOMElement.removeEventListener("mousedown", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("mouseout", this.onPointerOut, !0), this.interactionDOMElement.removeEventListener("mouseover", this.onPointerOver, !0), window.removeEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.interactionDOMElement.removeEventListener("touchstart", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("touchcancel", this.onPointerCancel, !0), this.interactionDOMElement.removeEventListener("touchend", this.onPointerUp, !0), this.interactionDOMElement.removeEventListener("touchmove", this.onPointerMove, !0)), this.interactionDOMElement = null, this.eventsAdded = !1)
|
|
},
|
|
e.prototype.tickerUpdate = function (t) {
|
|
this._deltaTime += t,
|
|
this._deltaTime < this.interactionFrequency || (this._deltaTime = 0, this.update())
|
|
},
|
|
e.prototype.update = function () {
|
|
if (this.interactionDOMElement)
|
|
if (this.didMove)
|
|
this.didMove = !1;
|
|
else {
|
|
for (var t in this.cursor = null, this.activeInteractionData)
|
|
if (this.activeInteractionData.hasOwnProperty(t)) {
|
|
var e = this.activeInteractionData[t];
|
|
if (e.originalEvent && "touch" !== e.pointerType) {
|
|
var i = this.configureInteractionEventForDOMEvent(this.eventData, e.originalEvent, e);
|
|
this.processInteractive(i, this.renderer._lastObjectRendered, this.processPointerOverOut, !0)
|
|
}
|
|
}
|
|
this.setCursorMode(this.cursor)
|
|
}
|
|
},
|
|
e.prototype.setCursorMode = function (t) {
|
|
if (t = t || "default", this.currentCursorMode !== t) {
|
|
this.currentCursorMode = t;
|
|
var e = this.cursorStyles[t];
|
|
if (e)
|
|
switch (typeof e) {
|
|
case "string":
|
|
this.interactionDOMElement.style.cursor = e;
|
|
break;
|
|
case "function":
|
|
e(t);
|
|
break;
|
|
case "object":
|
|
Object.assign(this.interactionDOMElement.style, e)
|
|
}
|
|
else
|
|
"string" != typeof t || Object.prototype.hasOwnProperty.call(this.cursorStyles, t) || (this.interactionDOMElement.style.cursor = t)
|
|
}
|
|
},
|
|
e.prototype.dispatchEvent = function (t, e, i) {
|
|
i.stopPropagationHint && t !== i.stopsPropagatingAt || (i.currentTarget = t, i.type = e, t.emit(e, i), t[e] && t[e](i))
|
|
},
|
|
e.prototype.delayDispatchEvent = function (t, e, i) {
|
|
this.delayedEvents.push({
|
|
displayObject: t,
|
|
eventString: e,
|
|
eventData: i
|
|
})
|
|
},
|
|
e.prototype.mapPositionToPoint = function (t, e, i) {
|
|
var n;
|
|
n = this.interactionDOMElement.parentElement ? this.interactionDOMElement.getBoundingClientRect() : {
|
|
x: 0,
|
|
y: 0,
|
|
width: 0,
|
|
height: 0
|
|
};
|
|
var r = 1 / this.resolution;
|
|
t.x = (e - n.left) * (this.interactionDOMElement.width / n.width) * r,
|
|
t.y = (i - n.top) * (this.interactionDOMElement.height / n.height) * r
|
|
},
|
|
e.prototype.processInteractive = function (t, e, i, n) {
|
|
var r = this.search.findHit(t, e, i, n),
|
|
o = this.delayedEvents;
|
|
if (!o.length)
|
|
return r;
|
|
t.stopPropagationHint = !1;
|
|
var s = o.length;
|
|
this.delayedEvents = [];
|
|
for (var a = 0; a < s; a++) {
|
|
var h = o[a],
|
|
l = h.displayObject,
|
|
u = h.eventString,
|
|
c = h.eventData;
|
|
c.stopsPropagatingAt === l && (c.stopPropagationHint = !0),
|
|
this.dispatchEvent(l, u, c)
|
|
}
|
|
return r
|
|
},
|
|
e.prototype.onPointerDown = function (t) {
|
|
if (!this.supportsTouchEvents || "touch" !== t.pointerType) {
|
|
var e = this.normalizeToPointerData(t);
|
|
if (this.autoPreventDefault && e[0].isNormalized)
|
|
(t.cancelable || !("cancelable" in t)) && t.preventDefault();
|
|
for (var i = e.length, n = 0; n < i; n++) {
|
|
var r = e[n],
|
|
o = this.getInteractionDataForPointerId(r),
|
|
s = this.configureInteractionEventForDOMEvent(this.eventData, r, o);
|
|
if (s.data.originalEvent = t, this.processInteractive(s, this.renderer._lastObjectRendered, this.processPointerDown, !0), this.emit("pointerdown", s), "touch" === r.pointerType)
|
|
this.emit("touchstart", s);
|
|
else if ("mouse" === r.pointerType || "pen" === r.pointerType) {
|
|
var a = 2 === r.button;
|
|
this.emit(a ? "rightdown" : "mousedown", this.eventData)
|
|
}
|
|
}
|
|
}
|
|
},
|
|
e.prototype.processPointerDown = function (t, e, i) {
|
|
var n = t.data,
|
|
r = t.data.identifier;
|
|
if (i)
|
|
if (e.trackedPointers[r] || (e.trackedPointers[r] = new u(r)), this.dispatchEvent(e, "pointerdown", t), "touch" === n.pointerType)
|
|
this.dispatchEvent(e, "touchstart", t);
|
|
else if ("mouse" === n.pointerType || "pen" === n.pointerType) {
|
|
var o = 2 === n.button;
|
|
o ? e.trackedPointers[r].rightDown = !0 : e.trackedPointers[r].leftDown = !0,
|
|
this.dispatchEvent(e, o ? "rightdown" : "mousedown", t)
|
|
}
|
|
},
|
|
e.prototype.onPointerComplete = function (t, e, i) {
|
|
for (var n = this.normalizeToPointerData(t), r = n.length, o = t.target !== this.interactionDOMElement ? "outside" : "", s = 0; s < r; s++) {
|
|
var a = n[s],
|
|
h = this.getInteractionDataForPointerId(a),
|
|
l = this.configureInteractionEventForDOMEvent(this.eventData, a, h);
|
|
if (l.data.originalEvent = t, this.processInteractive(l, this.renderer._lastObjectRendered, i, e || !o), this.emit(e ? "pointercancel" : "pointerup" + o, l), "mouse" === a.pointerType || "pen" === a.pointerType) {
|
|
var u = 2 === a.button;
|
|
this.emit(u ? "rightup" + o : "mouseup" + o, l)
|
|
} else
|
|
"touch" === a.pointerType && (this.emit(e ? "touchcancel" : "touchend" + o, l), this.releaseInteractionDataForPointerId(a.pointerId, h))
|
|
}
|
|
},
|
|
e.prototype.onPointerCancel = function (t) {
|
|
this.supportsTouchEvents && "touch" === t.pointerType || this.onPointerComplete(t, !0, this.processPointerCancel)
|
|
},
|
|
e.prototype.processPointerCancel = function (t, e) {
|
|
var i = t.data,
|
|
n = t.data.identifier;
|
|
void 0 !== e.trackedPointers[n] && (delete e.trackedPointers[n], this.dispatchEvent(e, "pointercancel", t), "touch" === i.pointerType && this.dispatchEvent(e, "touchcancel", t))
|
|
},
|
|
e.prototype.onPointerUp = function (t) {
|
|
this.supportsTouchEvents && "touch" === t.pointerType || this.onPointerComplete(t, !1, this.processPointerUp)
|
|
},
|
|
e.prototype.processPointerUp = function (t, e, i) {
|
|
var n = t.data,
|
|
r = t.data.identifier,
|
|
o = e.trackedPointers[r],
|
|
s = "touch" === n.pointerType,
|
|
a = "mouse" === n.pointerType || "pen" === n.pointerType,
|
|
h = !1;
|
|
if (a) {
|
|
var l = 2 === n.button,
|
|
c = u.FLAGS,
|
|
p = l ? c.RIGHT_DOWN : c.LEFT_DOWN,
|
|
d = void 0 !== o && o.flags & p;
|
|
i ? (this.dispatchEvent(e, l ? "rightup" : "mouseup", t), d && (this.dispatchEvent(e, l ? "rightclick" : "click", t), h = !0)) : d && this.dispatchEvent(e, l ? "rightupoutside" : "mouseupoutside", t),
|
|
o && (l ? o.rightDown = !1 : o.leftDown = !1)
|
|
}
|
|
i ? (this.dispatchEvent(e, "pointerup", t), s && this.dispatchEvent(e, "touchend", t), o && (a && !h || this.dispatchEvent(e, "pointertap", t), s && (this.dispatchEvent(e, "tap", t), o.over = !1))) : o && (this.dispatchEvent(e, "pointerupoutside", t), s && this.dispatchEvent(e, "touchendoutside", t)),
|
|
o && o.none && delete e.trackedPointers[r]
|
|
},
|
|
e.prototype.onPointerMove = function (t) {
|
|
if (!this.supportsTouchEvents || "touch" !== t.pointerType) {
|
|
var e = this.normalizeToPointerData(t);
|
|
"mouse" !== e[0].pointerType && "pen" !== e[0].pointerType || (this.didMove = !0, this.cursor = null);
|
|
for (var i = e.length, n = 0; n < i; n++) {
|
|
var r = e[n],
|
|
o = this.getInteractionDataForPointerId(r),
|
|
s = this.configureInteractionEventForDOMEvent(this.eventData, r, o);
|
|
s.data.originalEvent = t,
|
|
this.processInteractive(s, this.renderer._lastObjectRendered, this.processPointerMove, !0),
|
|
this.emit("pointermove", s),
|
|
"touch" === r.pointerType && this.emit("touchmove", s),
|
|
"mouse" !== r.pointerType && "pen" !== r.pointerType || this.emit("mousemove", s)
|
|
}
|
|
"mouse" === e[0].pointerType && this.setCursorMode(this.cursor)
|
|
}
|
|
},
|
|
e.prototype.processPointerMove = function (t, e, i) {
|
|
var n = t.data,
|
|
r = "touch" === n.pointerType,
|
|
o = "mouse" === n.pointerType || "pen" === n.pointerType;
|
|
o && this.processPointerOverOut(t, e, i),
|
|
this.moveWhenInside && !i || (this.dispatchEvent(e, "pointermove", t), r && this.dispatchEvent(e, "touchmove", t), o && this.dispatchEvent(e, "mousemove", t))
|
|
},
|
|
e.prototype.onPointerOut = function (t) {
|
|
if (!this.supportsTouchEvents || "touch" !== t.pointerType) {
|
|
var e = this.normalizeToPointerData(t)[0];
|
|
"mouse" === e.pointerType && (this.mouseOverRenderer = !1, this.setCursorMode(null));
|
|
var i = this.getInteractionDataForPointerId(e),
|
|
n = this.configureInteractionEventForDOMEvent(this.eventData, e, i);
|
|
n.data.originalEvent = e,
|
|
this.processInteractive(n, this.renderer._lastObjectRendered, this.processPointerOverOut, !1),
|
|
this.emit("pointerout", n),
|
|
"mouse" === e.pointerType || "pen" === e.pointerType ? this.emit("mouseout", n) : this.releaseInteractionDataForPointerId(i.identifier)
|
|
}
|
|
},
|
|
e.prototype.processPointerOverOut = function (t, e, i) {
|
|
var n = t.data,
|
|
r = t.data.identifier,
|
|
o = "mouse" === n.pointerType || "pen" === n.pointerType,
|
|
s = e.trackedPointers[r];
|
|
i && !s && (s = e.trackedPointers[r] = new u(r)),
|
|
void 0 !== s && (i && this.mouseOverRenderer ? (s.over || (s.over = !0, this.delayDispatchEvent(e, "pointerover", t), o && this.delayDispatchEvent(e, "mouseover", t)), o && null === this.cursor && (this.cursor = e.cursor)) : s.over && (s.over = !1, this.dispatchEvent(e, "pointerout", this.eventData), o && this.dispatchEvent(e, "mouseout", t), s.none && delete e.trackedPointers[r]))
|
|
},
|
|
e.prototype.onPointerOver = function (t) {
|
|
var e = this.normalizeToPointerData(t)[0],
|
|
i = this.getInteractionDataForPointerId(e),
|
|
n = this.configureInteractionEventForDOMEvent(this.eventData, e, i);
|
|
n.data.originalEvent = e,
|
|
"mouse" === e.pointerType && (this.mouseOverRenderer = !0),
|
|
this.emit("pointerover", n),
|
|
"mouse" !== e.pointerType && "pen" !== e.pointerType || this.emit("mouseover", n)
|
|
},
|
|
e.prototype.getInteractionDataForPointerId = function (t) {
|
|
var e,
|
|
i = t.pointerId;
|
|
return 1 === i || "mouse" === t.pointerType ? e = this.mouse : this.activeInteractionData[i] ? e = this.activeInteractionData[i] : ((e = this.interactionDataPool.pop() || new a).identifier = i, this.activeInteractionData[i] = e),
|
|
e.copyEvent(t),
|
|
e
|
|
},
|
|
e.prototype.releaseInteractionDataForPointerId = function (t) {
|
|
var e = this.activeInteractionData[t];
|
|
e && (delete this.activeInteractionData[t], e.reset(), this.interactionDataPool.push(e))
|
|
},
|
|
e.prototype.configureInteractionEventForDOMEvent = function (t, e, i) {
|
|
return t.data = i,
|
|
this.mapPositionToPoint(i.global, e.clientX, e.clientY),
|
|
"touch" === e.pointerType && (e.globalX = i.global.x, e.globalY = i.global.y),
|
|
i.originalEvent = e,
|
|
t.reset(),
|
|
t
|
|
},
|
|
e.prototype.normalizeToPointerData = function (t) {
|
|
var e = [];
|
|
if (this.supportsTouchEvents && t instanceof TouchEvent)
|
|
for (var i = 0, n = t.changedTouches.length; i < n; i++) {
|
|
var r = t.changedTouches[i];
|
|
void 0 === r.button && (r.button = t.touches.length ? 1 : 0),
|
|
void 0 === r.buttons && (r.buttons = t.touches.length ? 1 : 0),
|
|
void 0 === r.isPrimary && (r.isPrimary = 1 === t.touches.length && "touchstart" === t.type),
|
|
void 0 === r.width && (r.width = r.radiusX || 1),
|
|
void 0 === r.height && (r.height = r.radiusY || 1),
|
|
void 0 === r.tiltX && (r.tiltX = 0),
|
|
void 0 === r.tiltY && (r.tiltY = 0),
|
|
void 0 === r.pointerType && (r.pointerType = "touch"),
|
|
void 0 === r.pointerId && (r.pointerId = r.identifier || 0),
|
|
void 0 === r.pressure && (r.pressure = r.force || .5),
|
|
void 0 === r.twist && (r.twist = 0),
|
|
void 0 === r.tangentialPressure && (r.tangentialPressure = 0),
|
|
void 0 === r.layerX && (r.layerX = r.offsetX = r.clientX),
|
|
void 0 === r.layerY && (r.layerY = r.offsetY = r.clientY),
|
|
r.isNormalized = !0,
|
|
e.push(r)
|
|
}
|
|
else !(t instanceof MouseEvent) || this.supportsPointerEvents && t instanceof window.PointerEvent || (void 0 === t.isPrimary && (t.isPrimary = !0), void 0 === t.width && (t.width = 1), void 0 === t.height && (t.height = 1), void 0 === t.tiltX && (t.tiltX = 0), void 0 === t.tiltY && (t.tiltY = 0), void 0 === t.pointerType && (t.pointerType = "mouse"), void 0 === t.pointerId && (t.pointerId = 1), void 0 === t.pressure && (t.pressure = .5), void 0 === t.twist && (t.twist = 0), void 0 === t.tangentialPressure && (t.tangentialPressure = 0), t.isNormalized = !0), e.push(t);
|
|
return e
|
|
},
|
|
e.prototype.destroy = function () {
|
|
this.removeEvents(),
|
|
this.removeTickerListener(),
|
|
this.removeAllListeners(),
|
|
this.renderer = null,
|
|
this.mouse = null,
|
|
this.eventData = null,
|
|
this.interactionDOMElement = null,
|
|
this.onPointerDown = null,
|
|
this.processPointerDown = null,
|
|
this.onPointerUp = null,
|
|
this.processPointerUp = null,
|
|
this.onPointerCancel = null,
|
|
this.processPointerCancel = null,
|
|
this.onPointerMove = null,
|
|
this.processPointerMove = null,
|
|
this.onPointerOut = null,
|
|
this.processPointerOverOut = null,
|
|
this.onPointerOver = null,
|
|
this.search = null
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(s.EventEmitter);
|
|
i.InteractionManager = _
|
|
}, {
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/ticker": "t27b",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/utils": "x5Ec"
|
|
}
|
|
],
|
|
jcTq: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.Runner = void 0;
|
|
/*!
|
|
* @pixi/runner - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/runner is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
var n = function () {
|
|
function t(t) {
|
|
this.items = [],
|
|
this._name = t,
|
|
this._aliasCount = 0
|
|
}
|
|
return t.prototype.emit = function (t, e, i, n, r, o, s, a) {
|
|
if (arguments.length > 8)
|
|
throw new Error("max arguments reached");
|
|
var h = this,
|
|
l = h.name,
|
|
u = h.items;
|
|
this._aliasCount++;
|
|
for (var c = 0, p = u.length; c < p; c++)
|
|
u[c][l](t, e, i, n, r, o, s, a);
|
|
return u === this.items && this._aliasCount--,
|
|
this
|
|
},
|
|
t.prototype.ensureNonAliasedItems = function () {
|
|
this._aliasCount > 0 && this.items.length > 1 && (this._aliasCount = 0, this.items = this.items.slice(0))
|
|
},
|
|
t.prototype.add = function (t) {
|
|
return t[this._name] && (this.ensureNonAliasedItems(), this.remove(t), this.items.push(t)),
|
|
this
|
|
},
|
|
t.prototype.remove = function (t) {
|
|
var e = this.items.indexOf(t);
|
|
return -1 !== e && (this.ensureNonAliasedItems(), this.items.splice(e, 1)),
|
|
this
|
|
},
|
|
t.prototype.contains = function (t) {
|
|
return -1 !== this.items.indexOf(t)
|
|
},
|
|
t.prototype.removeAll = function () {
|
|
return this.ensureNonAliasedItems(),
|
|
this.items.length = 0,
|
|
this
|
|
},
|
|
t.prototype.destroy = function () {
|
|
this.removeAll(),
|
|
this.items = null,
|
|
this._name = null
|
|
},
|
|
Object.defineProperty(t.prototype, "empty", {
|
|
get: function () {
|
|
return 0 === this.items.length
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "name", {
|
|
get: function () {
|
|
return this._name
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t
|
|
}
|
|
();
|
|
i.Runner = n,
|
|
Object.defineProperties(n.prototype, {
|
|
dispatch: {
|
|
value: n.prototype.emit
|
|
},
|
|
run: {
|
|
value: n.prototype.emit
|
|
}
|
|
})
|
|
}, {}
|
|
],
|
|
qqf8: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.autoDetectRenderer = function (t) {
|
|
return re.create(t)
|
|
},
|
|
i.checkMaxIfStatementsInShader = At,
|
|
i.systems = i.resources = i.defaultVertex = i.defaultFilterVertex = i.ViewableBuffer = i.UniformGroup = i.TextureUvs = i.TextureMatrix = i.Texture = i.System = i.State = i.SpriteMaskFilter = i.Shader = i.Renderer = i.RenderTexturePool = i.RenderTexture = i.QuadUv = i.Quad = i.Program = i.ObjectRenderer = i.MaskData = i.Geometry = i.GLTexture = i.GLProgram = i.Framebuffer = i.Filter = i.CubeTexture = i.Buffer = i.BatchTextureArray = i.BatchShaderGenerator = i.BatchRenderer = i.BatchPluginFactory = i.BatchGeometry = i.BatchDrawCall = i.BaseTexture = i.BaseRenderTexture = i.Attribute = i.AbstractRenderer = i.AbstractBatchRenderer = void 0;
|
|
var n = t("@pixi/runner"),
|
|
r = t("@pixi/utils"),
|
|
o = t("@pixi/constants"),
|
|
s = t("@pixi/settings"),
|
|
a = t("@pixi/ticker"),
|
|
h = t("@pixi/math"),
|
|
l = t("@pixi/display"),
|
|
u = function (t, e) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
this._width = t,
|
|
this._height = e,
|
|
this.destroyed = !1,
|
|
this.internal = !1,
|
|
this.onResize = new n.Runner("setRealSize", 2),
|
|
this.onUpdate = new n.Runner("update"),
|
|
this.onError = new n.Runner("onError", 1)
|
|
},
|
|
c = {
|
|
valid: {
|
|
configurable: !0
|
|
},
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
u.prototype.bind = function (t) {
|
|
this.onResize.add(t),
|
|
this.onUpdate.add(t),
|
|
this.onError.add(t),
|
|
(this._width || this._height) && this.onResize.run(this._width, this._height)
|
|
},
|
|
u.prototype.unbind = function (t) {
|
|
this.onResize.remove(t),
|
|
this.onUpdate.remove(t),
|
|
this.onError.remove(t)
|
|
},
|
|
u.prototype.resize = function (t, e) {
|
|
t === this._width && e === this._height || (this._width = t, this._height = e, this.onResize.run(t, e))
|
|
},
|
|
c.valid.get = function () {
|
|
return !!this._width && !!this._height
|
|
},
|
|
u.prototype.update = function () {
|
|
this.destroyed || this.onUpdate.run()
|
|
},
|
|
u.prototype.load = function () {
|
|
return Promise.resolve()
|
|
},
|
|
c.width.get = function () {
|
|
return this._width
|
|
},
|
|
c.height.get = function () {
|
|
return this._height
|
|
},
|
|
u.prototype.upload = function (t, e, i) {
|
|
return !1
|
|
},
|
|
u.prototype.style = function (t, e, i) {
|
|
return !1
|
|
},
|
|
u.prototype.dispose = function () {},
|
|
u.prototype.destroy = function () {
|
|
this.destroyed || (this.destroyed = !0, this.dispose(), this.onError.removeAll(), this.onError = null, this.onResize.removeAll(), this.onResize = null, this.onUpdate.removeAll(), this.onUpdate = null)
|
|
},
|
|
Object.defineProperties(u.prototype, c);
|
|
var p = function (t) {
|
|
function e(e) {
|
|
var i = e.naturalWidth || e.videoWidth || e.width,
|
|
n = e.naturalHeight || e.videoHeight || e.height;
|
|
t.call(this, i, n),
|
|
this.source = e,
|
|
this.noSubImage = !1
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.crossOrigin = function (t, e, i) {
|
|
void 0 === i && 0 !== e.indexOf("data:") ? t.crossOrigin = (0, r.determineCrossOrigin)(e) : !1 !== i && (t.crossOrigin = "string" == typeof i ? i : "anonymous")
|
|
},
|
|
e.prototype.upload = function (t, e, i, n) {
|
|
var r = t.gl,
|
|
s = e.realWidth,
|
|
a = e.realHeight;
|
|
return n = n || this.source,
|
|
r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL, e.alphaMode === o.ALPHA_MODES.UNPACK),
|
|
this.noSubImage || e.target !== r.TEXTURE_2D || i.width !== s || i.height !== a ? (i.width = s, i.height = a, r.texImage2D(e.target, 0, e.format, e.format, e.type, n)) : r.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, e.format, e.type, n),
|
|
!0
|
|
},
|
|
e.prototype.update = function () {
|
|
if (!this.destroyed) {
|
|
var e = this.source.naturalWidth || this.source.videoWidth || this.source.width,
|
|
i = this.source.naturalHeight || this.source.videoHeight || this.source.height;
|
|
this.resize(e, i),
|
|
t.prototype.update.call(this)
|
|
}
|
|
},
|
|
e.prototype.dispose = function () {
|
|
this.source = null
|
|
},
|
|
e
|
|
}
|
|
(u),
|
|
d = function (t) {
|
|
function e(e, i) {
|
|
if (i = i || {}, !(e instanceof HTMLImageElement)) {
|
|
var n = new Image;
|
|
t.crossOrigin(n, e, i.crossorigin),
|
|
n.src = e,
|
|
e = n
|
|
}
|
|
t.call(this, e),
|
|
!e.complete && this._width && this._height && (this._width = 0, this._height = 0),
|
|
this.url = e.src,
|
|
this._process = null,
|
|
this.preserveBitmap = !1,
|
|
this.createBitmap = (void 0 !== i.createBitmap ? i.createBitmap : s.settings.CREATE_IMAGE_BITMAP) && !!window.createImageBitmap,
|
|
this.alphaMode = "number" == typeof i.alphaMode ? i.alphaMode : null,
|
|
void 0 !== i.premultiplyAlpha && (this.premultiplyAlpha = i.premultiplyAlpha),
|
|
this.bitmap = null,
|
|
this._load = null,
|
|
!1 !== i.autoLoad && this.load()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.load = function (t) {
|
|
var e = this;
|
|
return void 0 !== t && (this.createBitmap = t),
|
|
this._load || (this._load = new Promise((function (t) {
|
|
e.url = e.source.src;
|
|
var i = e.source,
|
|
n = function () {
|
|
e.destroyed || (i.onload = null, i.onerror = null, e.resize(i.width, i.height), e._load = null, e.createBitmap ? t(e.process()) : t(e))
|
|
};
|
|
i.complete && i.src ? n() : (i.onload = n, i.onerror = function (t) {
|
|
return e.onError.run(t)
|
|
})
|
|
}))),
|
|
this._load
|
|
},
|
|
e.prototype.process = function () {
|
|
var t = this;
|
|
return null !== this._process ? this._process : null === this.bitmap && window.createImageBitmap ? (this._process = window.createImageBitmap(this.source, 0, 0, this.source.width, this.source.height, {
|
|
premultiplyAlpha: this.premultiplyAlpha === o.ALPHA_MODES.UNPACK ? "premultiply" : "none"
|
|
}).then((function (e) {
|
|
return t.destroyed ? Promise.reject() : (t.bitmap = e, t.update(), t._process = null, Promise.resolve(t))
|
|
})), this._process) : Promise.resolve(this)
|
|
},
|
|
e.prototype.upload = function (e, i, n) {
|
|
if ("number" == typeof this.alphaMode && (i.alphaMode = this.alphaMode), !this.createBitmap)
|
|
return t.prototype.upload.call(this, e, i, n);
|
|
if (!this.bitmap && (this.process(), !this.bitmap))
|
|
return !1;
|
|
if (t.prototype.upload.call(this, e, i, n, this.bitmap), !this.preserveBitmap) {
|
|
var r = !0;
|
|
for (var o in i._glTextures) {
|
|
var s = i._glTextures[o];
|
|
if (s !== n && s.dirtyId !== i.dirtyId) {
|
|
r = !1;
|
|
break
|
|
}
|
|
}
|
|
r && (this.bitmap.close && this.bitmap.close(), this.bitmap = null)
|
|
}
|
|
return !0
|
|
},
|
|
e.prototype.dispose = function () {
|
|
this.source.onload = null,
|
|
this.source.onerror = null,
|
|
t.prototype.dispose.call(this),
|
|
this.bitmap && (this.bitmap.close(), this.bitmap = null),
|
|
this._process = null,
|
|
this._load = null
|
|
},
|
|
e
|
|
}
|
|
(p),
|
|
f = [];
|
|
function _(t, e) {
|
|
if (!t)
|
|
return null;
|
|
var i = "";
|
|
if ("string" == typeof t) {
|
|
var n = /\.(\w{3,4})(?:$|\?|#)/i.exec(t);
|
|
n && (i = n[1].toLowerCase())
|
|
}
|
|
for (var r = f.length - 1; r >= 0; --r) {
|
|
var o = f[r];
|
|
if (o.test && o.test(t, i))
|
|
return new o(t, e)
|
|
}
|
|
return new d(t, e)
|
|
}
|
|
var m = function (t) {
|
|
function e(e, i) {
|
|
var n = i || {},
|
|
r = n.width,
|
|
o = n.height;
|
|
if (!r || !o)
|
|
throw new Error("BufferResource width or height invalid");
|
|
t.call(this, r, o),
|
|
this.data = e
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.upload = function (t, e, i) {
|
|
var n = t.gl;
|
|
return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, e.alphaMode === o.ALPHA_MODES.UNPACK),
|
|
i.width === e.width && i.height === e.height ? n.texSubImage2D(e.target, 0, 0, 0, e.width, e.height, e.format, e.type, this.data) : (i.width = e.width, i.height = e.height, n.texImage2D(e.target, 0, i.internalFormat, e.width, e.height, 0, e.format, i.type, this.data)),
|
|
!0
|
|
},
|
|
e.prototype.dispose = function () {
|
|
this.data = null
|
|
},
|
|
e.test = function (t) {
|
|
return t instanceof Float32Array || t instanceof Uint8Array || t instanceof Uint32Array
|
|
},
|
|
e
|
|
}
|
|
(u),
|
|
y = {
|
|
scaleMode: o.SCALE_MODES.NEAREST,
|
|
format: o.FORMATS.RGBA,
|
|
alphaMode: o.ALPHA_MODES.NPM
|
|
},
|
|
g = function (t) {
|
|
function e(e, i) {
|
|
void 0 === e && (e = null),
|
|
void 0 === i && (i = null),
|
|
t.call(this);
|
|
var n = (i = i || {}).alphaMode,
|
|
a = i.mipmap,
|
|
h = i.anisotropicLevel,
|
|
l = i.scaleMode,
|
|
c = i.width,
|
|
p = i.height,
|
|
d = i.wrapMode,
|
|
f = i.format,
|
|
m = i.type,
|
|
y = i.target,
|
|
g = i.resolution,
|
|
v = i.resourceOptions;
|
|
!e || e instanceof u || ((e = _(e, v)).internal = !0),
|
|
this.width = c || 0,
|
|
this.height = p || 0,
|
|
this.resolution = g || s.settings.RESOLUTION,
|
|
this.mipmap = void 0 !== a ? a : s.settings.MIPMAP_TEXTURES,
|
|
this.anisotropicLevel = void 0 !== h ? h : s.settings.ANISOTROPIC_LEVEL,
|
|
this.wrapMode = d || s.settings.WRAP_MODE,
|
|
this.scaleMode = void 0 !== l ? l : s.settings.SCALE_MODE,
|
|
this.format = f || o.FORMATS.RGBA,
|
|
this.type = m || o.TYPES.UNSIGNED_BYTE,
|
|
this.target = y || o.TARGETS.TEXTURE_2D,
|
|
this.alphaMode = void 0 !== n ? n : o.ALPHA_MODES.UNPACK,
|
|
void 0 !== i.premultiplyAlpha && (this.premultiplyAlpha = i.premultiplyAlpha),
|
|
this.uid = (0, r.uid)(),
|
|
this.touched = 0,
|
|
this.isPowerOfTwo = !1,
|
|
this._refreshPOT(),
|
|
this._glTextures = {},
|
|
this.dirtyId = 0,
|
|
this.dirtyStyleId = 0,
|
|
this.cacheId = null,
|
|
this.valid = c > 0 && p > 0,
|
|
this.textureCacheIds = [],
|
|
this.destroyed = !1,
|
|
this.resource = null,
|
|
this._batchEnabled = 0,
|
|
this._batchLocation = 0,
|
|
this.setResource(e)
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
realWidth: {
|
|
configurable: !0
|
|
},
|
|
realHeight: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.realWidth.get = function () {
|
|
return Math.ceil(this.width * this.resolution - 1e-4)
|
|
},
|
|
i.realHeight.get = function () {
|
|
return Math.ceil(this.height * this.resolution - 1e-4)
|
|
},
|
|
e.prototype.setStyle = function (t, e) {
|
|
var i;
|
|
return void 0 !== t && t !== this.scaleMode && (this.scaleMode = t, i = !0),
|
|
void 0 !== e && e !== this.mipmap && (this.mipmap = e, i = !0),
|
|
i && this.dirtyStyleId++,
|
|
this
|
|
},
|
|
e.prototype.setSize = function (t, e, i) {
|
|
return this.resolution = i || this.resolution,
|
|
this.width = t,
|
|
this.height = e,
|
|
this._refreshPOT(),
|
|
this.update(),
|
|
this
|
|
},
|
|
e.prototype.setRealSize = function (t, e, i) {
|
|
return this.resolution = i || this.resolution,
|
|
this.width = t / this.resolution,
|
|
this.height = e / this.resolution,
|
|
this._refreshPOT(),
|
|
this.update(),
|
|
this
|
|
},
|
|
e.prototype._refreshPOT = function () {
|
|
this.isPowerOfTwo = (0, r.isPow2)(this.realWidth) && (0, r.isPow2)(this.realHeight)
|
|
},
|
|
e.prototype.setResolution = function (t) {
|
|
var e = this.resolution;
|
|
return e === t || (this.resolution = t, this.valid && (this.width = this.width * e / t, this.height = this.height * e / t, this.emit("update", this)), this._refreshPOT()),
|
|
this
|
|
},
|
|
e.prototype.setResource = function (t) {
|
|
if (this.resource === t)
|
|
return this;
|
|
if (this.resource)
|
|
throw new Error("Resource can be set only once");
|
|
return t.bind(this),
|
|
this.resource = t,
|
|
this
|
|
},
|
|
e.prototype.update = function () {
|
|
this.valid ? (this.dirtyId++, this.dirtyStyleId++, this.emit("update", this)) : this.width > 0 && this.height > 0 && (this.valid = !0, this.emit("loaded", this), this.emit("update", this))
|
|
},
|
|
e.prototype.onError = function (t) {
|
|
this.emit("error", this, t)
|
|
},
|
|
e.prototype.destroy = function () {
|
|
this.resource && (this.resource.unbind(this), this.resource.internal && this.resource.destroy(), this.resource = null),
|
|
this.cacheId && (delete r.BaseTextureCache[this.cacheId], delete r.TextureCache[this.cacheId], this.cacheId = null),
|
|
this.dispose(),
|
|
e.removeFromCache(this),
|
|
this.textureCacheIds = null,
|
|
this.destroyed = !0
|
|
},
|
|
e.prototype.dispose = function () {
|
|
this.emit("dispose", this)
|
|
},
|
|
e.from = function (t, i, n) {
|
|
void 0 === n && (n = s.settings.STRICT_TEXTURE_CACHE);
|
|
var o = "string" == typeof t,
|
|
a = null;
|
|
o ? a = t : (t._pixiId || (t._pixiId = "pixiid_" + (0, r.uid)()), a = t._pixiId);
|
|
var h = r.BaseTextureCache[a];
|
|
if (o && n && !h)
|
|
throw new Error('The cacheId "' + a + '" does not exist in BaseTextureCache.');
|
|
return h || ((h = new e(t, i)).cacheId = a, e.addToCache(h, a)),
|
|
h
|
|
},
|
|
e.fromBuffer = function (t, i, n, r) {
|
|
t = t || new Float32Array(i * n * 4);
|
|
var s = new m(t, {
|
|
width: i,
|
|
height: n
|
|
}),
|
|
a = t instanceof Float32Array ? o.TYPES.FLOAT : o.TYPES.UNSIGNED_BYTE;
|
|
return new e(s, Object.assign(y, r || {
|
|
width: i,
|
|
height: n,
|
|
type: a
|
|
}))
|
|
},
|
|
e.addToCache = function (t, e) {
|
|
e && (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e), r.BaseTextureCache[e] && console.warn("BaseTexture added to the cache with an id [" + e + "] that already had an entry"), r.BaseTextureCache[e] = t)
|
|
},
|
|
e.removeFromCache = function (t) {
|
|
if ("string" == typeof t) {
|
|
var e = r.BaseTextureCache[t];
|
|
if (e) {
|
|
var i = e.textureCacheIds.indexOf(t);
|
|
return i > -1 && e.textureCacheIds.splice(i, 1),
|
|
delete r.BaseTextureCache[t],
|
|
e
|
|
}
|
|
} else if (t && t.textureCacheIds) {
|
|
for (var n = 0; n < t.textureCacheIds.length; ++n)
|
|
delete r.BaseTextureCache[t.textureCacheIds[n]];
|
|
return t.textureCacheIds.length = 0,
|
|
t
|
|
}
|
|
return null
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(r.EventEmitter);
|
|
i.BaseTexture = g,
|
|
g._globalBatch = 0;
|
|
var v = function (t) {
|
|
function e(e, i) {
|
|
var n;
|
|
i = i || {};
|
|
var r = e;
|
|
Array.isArray(e) && (n = e, r = e.length),
|
|
t.call(this, i.width, i.height),
|
|
this.items = [],
|
|
this.itemDirtyIds = [];
|
|
for (var o = 0; o < r; o++) {
|
|
var s = new g;
|
|
this.items.push(s),
|
|
this.itemDirtyIds.push(-1)
|
|
}
|
|
if (this.length = r, this._load = null, n)
|
|
for (var a = 0; a < r; a++)
|
|
this.addResourceAt(_(n[a], i), a)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.dispose = function () {
|
|
for (var t = 0, e = this.length; t < e; t++)
|
|
this.items[t].destroy();
|
|
this.items = null,
|
|
this.itemDirtyIds = null,
|
|
this._load = null
|
|
},
|
|
e.prototype.addResourceAt = function (t, e) {
|
|
if (!this.items[e])
|
|
throw new Error("Index " + e + " is out of bounds");
|
|
return t.valid && !this.valid && this.resize(t.width, t.height),
|
|
this.items[e].setResource(t),
|
|
this
|
|
},
|
|
e.prototype.bind = function (e) {
|
|
t.prototype.bind.call(this, e),
|
|
e.target = o.TARGETS.TEXTURE_2D_ARRAY;
|
|
for (var i = 0; i < this.length; i++)
|
|
this.items[i].on("update", e.update, e)
|
|
},
|
|
e.prototype.unbind = function (e) {
|
|
t.prototype.unbind.call(this, e);
|
|
for (var i = 0; i < this.length; i++)
|
|
this.items[i].off("update", e.update, e)
|
|
},
|
|
e.prototype.load = function () {
|
|
var t = this;
|
|
if (this._load)
|
|
return this._load;
|
|
var e = this.items.map((function (t) {
|
|
return t.resource
|
|
})),
|
|
i = e.map((function (t) {
|
|
return t.load()
|
|
}));
|
|
return this._load = Promise.all(i).then((function () {
|
|
var i = e[0],
|
|
n = i.width,
|
|
r = i.height;
|
|
return t.resize(n, r),
|
|
Promise.resolve(t)
|
|
})),
|
|
this._load
|
|
},
|
|
e.prototype.upload = function (t, e, i) {
|
|
var n = this.length,
|
|
r = this.itemDirtyIds,
|
|
o = this.items,
|
|
s = t.gl;
|
|
i.dirtyId < 0 && s.texImage3D(s.TEXTURE_2D_ARRAY, 0, e.format, this._width, this._height, n, 0, e.format, e.type, null);
|
|
for (var a = 0; a < n; a++) {
|
|
var h = o[a];
|
|
r[a] < h.dirtyId && (r[a] = h.dirtyId, h.valid && s.texSubImage3D(s.TEXTURE_2D_ARRAY, 0, 0, 0, a, h.resource.width, h.resource.height, 1, e.format, e.type, h.resource.source))
|
|
}
|
|
return !0
|
|
},
|
|
e
|
|
}
|
|
(u),
|
|
w = function (t) {
|
|
function e() {
|
|
t.apply(this, arguments)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.test = function (t) {
|
|
var e = window.OffscreenCanvas;
|
|
return !!(e && t instanceof e) || t instanceof HTMLCanvasElement
|
|
},
|
|
e
|
|
}
|
|
(p),
|
|
x = function (t) {
|
|
function e(i, n) {
|
|
if (n = n || {}, t.call(this, i, n), this.length !== e.SIDES)
|
|
throw new Error("Invalid length. Got " + this.length + ", expected 6");
|
|
for (var r = 0; r < e.SIDES; r++)
|
|
this.items[r].target = o.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + r;
|
|
!1 !== n.autoLoad && this.load()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.bind = function (e) {
|
|
t.prototype.bind.call(this, e),
|
|
e.target = o.TARGETS.TEXTURE_CUBE_MAP
|
|
},
|
|
e.prototype.upload = function (t, i, n) {
|
|
for (var r = this.itemDirtyIds, o = 0; o < e.SIDES; o++) {
|
|
var s = this.items[o];
|
|
r[o] < s.dirtyId && (r[o] = s.dirtyId, s.valid && s.resource.upload(t, s, n))
|
|
}
|
|
return !0
|
|
},
|
|
e
|
|
}
|
|
(v);
|
|
x.SIDES = 6;
|
|
var b = function (t) {
|
|
function e(e, i) {
|
|
i = i || {},
|
|
t.call(this, document.createElement("canvas")),
|
|
this._width = 0,
|
|
this._height = 0,
|
|
this.svg = e,
|
|
this.scale = i.scale || 1,
|
|
this._overrideWidth = i.width,
|
|
this._overrideHeight = i.height,
|
|
this._resolve = null,
|
|
this._crossorigin = i.crossorigin,
|
|
this._load = null,
|
|
!1 !== i.autoLoad && this.load()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.load = function () {
|
|
var t = this;
|
|
return this._load || (this._load = new Promise((function (e) {
|
|
if (t._resolve = function () {
|
|
t.resize(t.source.width, t.source.height),
|
|
e(t)
|
|
}, /^\<svg/.test(t.svg.trim())) {
|
|
if (!btoa)
|
|
throw new Error("Your browser doesn't support base64 conversions.");
|
|
t.svg = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(t.svg)))
|
|
}
|
|
t._loadSvg()
|
|
}))),
|
|
this._load
|
|
},
|
|
e.prototype._loadSvg = function () {
|
|
var e = this,
|
|
i = new Image;
|
|
t.crossOrigin(i, this.svg, this._crossorigin),
|
|
i.src = this.svg,
|
|
i.onerror = function (t) {
|
|
i.onerror = null,
|
|
e.onError.run(t)
|
|
},
|
|
i.onload = function () {
|
|
var t = i.width,
|
|
n = i.height;
|
|
if (!t || !n)
|
|
throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");
|
|
var o = t * e.scale,
|
|
s = n * e.scale;
|
|
(e._overrideWidth || e._overrideHeight) && (o = e._overrideWidth || e._overrideHeight / n * t, s = e._overrideHeight || e._overrideWidth / t * n),
|
|
o = Math.round(o),
|
|
s = Math.round(s);
|
|
var a = e.source;
|
|
a.width = o,
|
|
a.height = s,
|
|
a._pixiId = "canvas_" + (0, r.uid)(),
|
|
a.getContext("2d").drawImage(i, 0, 0, t, n, 0, 0, o, s),
|
|
e._resolve(),
|
|
e._resolve = null
|
|
}
|
|
},
|
|
e.getSize = function (t) {
|
|
var i = e.SVG_SIZE.exec(t),
|
|
n = {};
|
|
return i && (n[i[1]] = Math.round(parseFloat(i[3])), n[i[5]] = Math.round(parseFloat(i[7]))),
|
|
n
|
|
},
|
|
e.prototype.dispose = function () {
|
|
t.prototype.dispose.call(this),
|
|
this._resolve = null,
|
|
this._crossorigin = null
|
|
},
|
|
e.test = function (t, e) {
|
|
return "svg" === e || "string" == typeof t && 0 === t.indexOf("data:image/svg+xml;base64") || "string" == typeof t && 0 === t.indexOf("<svg")
|
|
},
|
|
e
|
|
}
|
|
(p);
|
|
b.SVG_SIZE = /<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;
|
|
var E = function (t) {
|
|
function e(e, i) {
|
|
if (i = i || {}, !(e instanceof HTMLVideoElement)) {
|
|
var n = document.createElement("video");
|
|
n.setAttribute("preload", "auto"),
|
|
n.setAttribute("webkit-playsinline", ""),
|
|
n.setAttribute("playsinline", ""),
|
|
"string" == typeof e && (e = [e]),
|
|
t.crossOrigin(n, e[0].src || e[0], i.crossorigin);
|
|
for (var r = 0; r < e.length; ++r) {
|
|
var o = document.createElement("source"),
|
|
s = e[r],
|
|
a = s.src,
|
|
h = s.mime,
|
|
l = (a = a || e[r]).split("?").shift().toLowerCase(),
|
|
u = l.substr(l.lastIndexOf(".") + 1);
|
|
h = h || "video/" + u,
|
|
o.src = a,
|
|
o.type = h,
|
|
n.appendChild(o)
|
|
}
|
|
e = n
|
|
}
|
|
t.call(this, e),
|
|
this.noSubImage = !0,
|
|
this._autoUpdate = !0,
|
|
this._isAutoUpdating = !1,
|
|
this._updateFPS = i.updateFPS || 0,
|
|
this._msToNextUpdate = 0,
|
|
this.autoPlay = !1 !== i.autoPlay,
|
|
this._load = null,
|
|
this._resolve = null,
|
|
this._onCanPlay = this._onCanPlay.bind(this),
|
|
this._onError = this._onError.bind(this),
|
|
!1 !== i.autoLoad && this.load()
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
autoUpdate: {
|
|
configurable: !0
|
|
},
|
|
updateFPS: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.update = function (e) {
|
|
if (void 0 === e && (e = 0), !this.destroyed) {
|
|
var i = a.Ticker.shared.elapsedMS * this.source.playbackRate;
|
|
this._msToNextUpdate = Math.floor(this._msToNextUpdate - i),
|
|
(!this._updateFPS || this._msToNextUpdate <= 0) && (t.prototype.update.call(this, e), this._msToNextUpdate = this._updateFPS ? Math.floor(1e3 / this._updateFPS) : 0)
|
|
}
|
|
},
|
|
e.prototype.load = function () {
|
|
var t = this;
|
|
if (this._load)
|
|
return this._load;
|
|
var e = this.source;
|
|
return (e.readyState === e.HAVE_ENOUGH_DATA || e.readyState === e.HAVE_FUTURE_DATA) && e.width && e.height && (e.complete = !0),
|
|
e.addEventListener("play", this._onPlayStart.bind(this)),
|
|
e.addEventListener("pause", this._onPlayStop.bind(this)),
|
|
this._isSourceReady() ? this._onCanPlay() : (e.addEventListener("canplay", this._onCanPlay), e.addEventListener("canplaythrough", this._onCanPlay), e.addEventListener("error", this._onError, !0)),
|
|
this._load = new Promise((function (i) {
|
|
t.valid ? i(t) : (t._resolve = i, e.load())
|
|
})),
|
|
this._load
|
|
},
|
|
e.prototype._onError = function () {
|
|
this.source.removeEventListener("error", this._onError, !0),
|
|
this.onError.run(event)
|
|
},
|
|
e.prototype._isSourcePlaying = function () {
|
|
var t = this.source;
|
|
return t.currentTime > 0 && !1 === t.paused && !1 === t.ended && t.readyState > 2
|
|
},
|
|
e.prototype._isSourceReady = function () {
|
|
return 3 === this.source.readyState || 4 === this.source.readyState
|
|
},
|
|
e.prototype._onPlayStart = function () {
|
|
this.valid || this._onCanPlay(),
|
|
!this._isAutoUpdating && this.autoUpdate && (a.Ticker.shared.add(this.update, this), this._isAutoUpdating = !0)
|
|
},
|
|
e.prototype._onPlayStop = function () {
|
|
this._isAutoUpdating && (a.Ticker.shared.remove(this.update, this), this._isAutoUpdating = !1)
|
|
},
|
|
e.prototype._onCanPlay = function () {
|
|
var t = this.source;
|
|
t.removeEventListener("canplay", this._onCanPlay),
|
|
t.removeEventListener("canplaythrough", this._onCanPlay);
|
|
var e = this.valid;
|
|
this.resize(t.videoWidth, t.videoHeight),
|
|
!e && this._resolve && (this._resolve(this), this._resolve = null),
|
|
this._isSourcePlaying() ? this._onPlayStart() : this.autoPlay && t.play()
|
|
},
|
|
e.prototype.dispose = function () {
|
|
this._isAutoUpdating && a.Ticker.shared.remove(this.update, this),
|
|
this.source && (this.source.removeEventListener("error", this._onError, !0), this.source.pause(), this.source.src = "", this.source.load()),
|
|
t.prototype.dispose.call(this)
|
|
},
|
|
i.autoUpdate.get = function () {
|
|
return this._autoUpdate
|
|
},
|
|
i.autoUpdate.set = function (t) {
|
|
t !== this._autoUpdate && (this._autoUpdate = t, !this._autoUpdate && this._isAutoUpdating ? (a.Ticker.shared.remove(this.update, this), this._isAutoUpdating = !1) : this._autoUpdate && !this._isAutoUpdating && (a.Ticker.shared.add(this.update, this), this._isAutoUpdating = !0))
|
|
},
|
|
i.updateFPS.get = function () {
|
|
return this._updateFPS
|
|
},
|
|
i.updateFPS.set = function (t) {
|
|
t !== this._updateFPS && (this._updateFPS = t)
|
|
},
|
|
e.test = function (t, i) {
|
|
return t instanceof HTMLVideoElement || e.TYPES.indexOf(i) > -1
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(p);
|
|
E.TYPES = ["mp4", "m4v", "webm", "ogg", "ogv", "h264", "avi", "mov"];
|
|
var $ = function (t) {
|
|
function e() {
|
|
t.apply(this, arguments)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.test = function (t) {
|
|
return !!window.createImageBitmap && t instanceof ImageBitmap
|
|
},
|
|
e
|
|
}
|
|
(p);
|
|
f.push(d, $, w, E, b, m, x, v);
|
|
var A = {
|
|
INSTALLED: f,
|
|
autoDetectResource: _,
|
|
ArrayResource: v,
|
|
BufferResource: m,
|
|
CanvasResource: w,
|
|
CubeResource: x,
|
|
ImageResource: d,
|
|
ImageBitmapResource: $,
|
|
SVGResource: b,
|
|
VideoResource: E,
|
|
Resource: u,
|
|
BaseImageResource: p
|
|
};
|
|
i.resources = A;
|
|
var S = function (t) {
|
|
this.renderer = t
|
|
};
|
|
i.System = S,
|
|
S.prototype.destroy = function () {
|
|
this.renderer = null
|
|
};
|
|
var T = function (t) {
|
|
function e() {
|
|
t.apply(this, arguments)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.upload = function (t, e, i) {
|
|
var n = t.gl;
|
|
return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, e.alphaMode === o.ALPHA_MODES.UNPACK),
|
|
i.width === e.width && i.height === e.height ? n.texSubImage2D(e.target, 0, 0, 0, e.width, e.height, e.format, e.type, this.data) : (i.width = e.width, i.height = e.height, n.texImage2D(e.target, 0, n.DEPTH_COMPONENT16, e.width, e.height, 0, e.format, e.type, this.data)),
|
|
!0
|
|
},
|
|
e
|
|
}
|
|
(m),
|
|
C = function (t, e) {
|
|
this.width = Math.ceil(t || 100),
|
|
this.height = Math.ceil(e || 100),
|
|
this.stencil = !1,
|
|
this.depth = !1,
|
|
this.dirtyId = 0,
|
|
this.dirtyFormat = 0,
|
|
this.dirtySize = 0,
|
|
this.depthTexture = null,
|
|
this.colorTextures = [],
|
|
this.glFramebuffers = {},
|
|
this.disposeRunner = new n.Runner("disposeFramebuffer", 2)
|
|
};
|
|
i.Framebuffer = C;
|
|
var M = {
|
|
colorTexture: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
M.colorTexture.get = function () {
|
|
return this.colorTextures[0]
|
|
},
|
|
C.prototype.addColorTexture = function (t, e) {
|
|
return void 0 === t && (t = 0),
|
|
this.colorTextures[t] = e || new g(null, {
|
|
scaleMode: 0,
|
|
resolution: 1,
|
|
mipmap: !1,
|
|
width: this.width,
|
|
height: this.height
|
|
}),
|
|
this.dirtyId++,
|
|
this.dirtyFormat++,
|
|
this
|
|
},
|
|
C.prototype.addDepthTexture = function (t) {
|
|
return this.depthTexture = t || new g(new T(null, {
|
|
width: this.width,
|
|
height: this.height
|
|
}), {
|
|
scaleMode: 0,
|
|
resolution: 1,
|
|
width: this.width,
|
|
height: this.height,
|
|
mipmap: !1,
|
|
format: o.FORMATS.DEPTH_COMPONENT,
|
|
type: o.TYPES.UNSIGNED_SHORT
|
|
}),
|
|
this.dirtyId++,
|
|
this.dirtyFormat++,
|
|
this
|
|
},
|
|
C.prototype.enableDepth = function () {
|
|
return this.depth = !0,
|
|
this.dirtyId++,
|
|
this.dirtyFormat++,
|
|
this
|
|
},
|
|
C.prototype.enableStencil = function () {
|
|
return this.stencil = !0,
|
|
this.dirtyId++,
|
|
this.dirtyFormat++,
|
|
this
|
|
},
|
|
C.prototype.resize = function (t, e) {
|
|
if (t = Math.ceil(t), e = Math.ceil(e), t !== this.width || e !== this.height) {
|
|
this.width = t,
|
|
this.height = e,
|
|
this.dirtyId++,
|
|
this.dirtySize++;
|
|
for (var i = 0; i < this.colorTextures.length; i++) {
|
|
var n = this.colorTextures[i],
|
|
r = n.resolution;
|
|
n.setSize(t / r, e / r)
|
|
}
|
|
if (this.depthTexture) {
|
|
var o = this.depthTexture.resolution;
|
|
this.depthTexture.setSize(t / o, e / o)
|
|
}
|
|
}
|
|
},
|
|
C.prototype.dispose = function () {
|
|
this.disposeRunner.run(this, !1)
|
|
},
|
|
Object.defineProperties(C.prototype, M);
|
|
var I = function (t) {
|
|
function e(e) {
|
|
if ("number" == typeof e) {
|
|
var i = arguments[0],
|
|
n = arguments[1],
|
|
r = arguments[2],
|
|
o = arguments[3];
|
|
e = {
|
|
width: i,
|
|
height: n,
|
|
scaleMode: r,
|
|
resolution: o
|
|
}
|
|
}
|
|
t.call(this, null, e);
|
|
var s = e || {},
|
|
a = s.width,
|
|
h = s.height;
|
|
this.mipmap = !1,
|
|
this.width = Math.ceil(a) || 100,
|
|
this.height = Math.ceil(h) || 100,
|
|
this.valid = !0,
|
|
this._canvasRenderTarget = null,
|
|
this.clearColor = [0, 0, 0, 0],
|
|
this.framebuffer = new C(this.width * this.resolution, this.height * this.resolution).addColorTexture(0, this),
|
|
this.maskStack = [],
|
|
this.filterStack = [{}
|
|
]
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.resize = function (t, e) {
|
|
t = Math.ceil(t),
|
|
e = Math.ceil(e),
|
|
this.framebuffer.resize(t * this.resolution, e * this.resolution)
|
|
},
|
|
e.prototype.dispose = function () {
|
|
this.framebuffer.dispose(),
|
|
t.prototype.dispose.call(this)
|
|
},
|
|
e.prototype.destroy = function () {
|
|
t.prototype.destroy.call(this, !0),
|
|
this.framebuffer = null
|
|
},
|
|
e
|
|
}
|
|
(g);
|
|
i.BaseRenderTexture = I;
|
|
var P = function () {
|
|
this.x0 = 0,
|
|
this.y0 = 0,
|
|
this.x1 = 1,
|
|
this.y1 = 0,
|
|
this.x2 = 1,
|
|
this.y2 = 1,
|
|
this.x3 = 0,
|
|
this.y3 = 1,
|
|
this.uvsFloat32 = new Float32Array(8)
|
|
};
|
|
i.TextureUvs = P,
|
|
P.prototype.set = function (t, e, i) {
|
|
var n = e.width,
|
|
r = e.height;
|
|
if (i) {
|
|
var o = t.width / 2 / n,
|
|
s = t.height / 2 / r,
|
|
a = t.x / n + o,
|
|
l = t.y / r + s;
|
|
i = h.groupD8.add(i, h.groupD8.NW),
|
|
this.x0 = a + o * h.groupD8.uX(i),
|
|
this.y0 = l + s * h.groupD8.uY(i),
|
|
i = h.groupD8.add(i, 2),
|
|
this.x1 = a + o * h.groupD8.uX(i),
|
|
this.y1 = l + s * h.groupD8.uY(i),
|
|
i = h.groupD8.add(i, 2),
|
|
this.x2 = a + o * h.groupD8.uX(i),
|
|
this.y2 = l + s * h.groupD8.uY(i),
|
|
i = h.groupD8.add(i, 2),
|
|
this.x3 = a + o * h.groupD8.uX(i),
|
|
this.y3 = l + s * h.groupD8.uY(i)
|
|
} else
|
|
this.x0 = t.x / n, this.y0 = t.y / r, this.x1 = (t.x + t.width) / n, this.y1 = t.y / r, this.x2 = (t.x + t.width) / n, this.y2 = (t.y + t.height) / r, this.x3 = t.x / n, this.y3 = (t.y + t.height) / r;
|
|
this.uvsFloat32[0] = this.x0,
|
|
this.uvsFloat32[1] = this.y0,
|
|
this.uvsFloat32[2] = this.x1,
|
|
this.uvsFloat32[3] = this.y1,
|
|
this.uvsFloat32[4] = this.x2,
|
|
this.uvsFloat32[5] = this.y2,
|
|
this.uvsFloat32[6] = this.x3,
|
|
this.uvsFloat32[7] = this.y3
|
|
};
|
|
var O = new P,
|
|
R = function (t) {
|
|
function e(i, n, r, o, s, a) {
|
|
if (t.call(this), this.noFrame = !1, n || (this.noFrame = !0, n = new h.Rectangle(0, 0, 1, 1)), i instanceof e && (i = i.baseTexture), this.baseTexture = i, this._frame = n, this.trim = o, this.valid = !1, this.requiresUpdate = !1, this._uvs = O, this.uvMatrix = null, this.orig = r || n, this._rotate = Number(s || 0), !0 === s)
|
|
this._rotate = 2;
|
|
else if (this._rotate % 2 != 0)
|
|
throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");
|
|
this.defaultAnchor = a ? new h.Point(a.x, a.y) : new h.Point(0, 0),
|
|
this._updateID = 0,
|
|
this.textureCacheIds = [],
|
|
i.valid ? this.noFrame ? i.valid && this.onBaseTextureUpdated(i) : this.frame = n : i.once("loaded", this.onBaseTextureUpdated, this),
|
|
this.noFrame && i.on("update", this.onBaseTextureUpdated, this)
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
resolution: {
|
|
configurable: !0
|
|
},
|
|
frame: {
|
|
configurable: !0
|
|
},
|
|
rotate: {
|
|
configurable: !0
|
|
},
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.update = function () {
|
|
this.baseTexture.resource && this.baseTexture.resource.update()
|
|
},
|
|
e.prototype.onBaseTextureUpdated = function (t) {
|
|
if (this.noFrame) {
|
|
if (!this.baseTexture.valid)
|
|
return;
|
|
this._frame.width = t.width,
|
|
this._frame.height = t.height,
|
|
this.valid = !0,
|
|
this.updateUvs()
|
|
} else
|
|
this.frame = this._frame;
|
|
this.emit("update", this)
|
|
},
|
|
e.prototype.destroy = function (t) {
|
|
if (this.baseTexture) {
|
|
if (t) {
|
|
var i = this.baseTexture.resource;
|
|
i && r.TextureCache[i.url] && e.removeFromCache(i.url),
|
|
this.baseTexture.destroy()
|
|
}
|
|
this.baseTexture.off("update", this.onBaseTextureUpdated, this),
|
|
this.baseTexture = null
|
|
}
|
|
this._frame = null,
|
|
this._uvs = null,
|
|
this.trim = null,
|
|
this.orig = null,
|
|
this.valid = !1,
|
|
e.removeFromCache(this),
|
|
this.textureCacheIds = null
|
|
},
|
|
e.prototype.clone = function () {
|
|
return new e(this.baseTexture, this.frame, this.orig, this.trim, this.rotate, this.defaultAnchor)
|
|
},
|
|
e.prototype.updateUvs = function () {
|
|
this._uvs === O && (this._uvs = new P),
|
|
this._uvs.set(this._frame, this.baseTexture, this.rotate),
|
|
this._updateID++
|
|
},
|
|
e.from = function (t, i, n) {
|
|
void 0 === i && (i = {}),
|
|
void 0 === n && (n = s.settings.STRICT_TEXTURE_CACHE);
|
|
var o = "string" == typeof t,
|
|
a = null;
|
|
o ? a = t : (t._pixiId || (t._pixiId = "pixiid_" + (0, r.uid)()), a = t._pixiId);
|
|
var h = r.TextureCache[a];
|
|
if (o && n && !h)
|
|
throw new Error('The cacheId "' + a + '" does not exist in TextureCache.');
|
|
return h || (i.resolution || (i.resolution = (0, r.getResolutionOfUrl)(t)), (h = new e(new g(t, i))).baseTexture.cacheId = a, g.addToCache(h.baseTexture, a), e.addToCache(h, a)),
|
|
h
|
|
},
|
|
e.fromBuffer = function (t, i, n, r) {
|
|
return new e(g.fromBuffer(t, i, n, r))
|
|
},
|
|
e.fromLoader = function (t, i, n) {
|
|
var o = new d(t);
|
|
o.url = i;
|
|
var a = new e(new g(o, {
|
|
scaleMode: s.settings.SCALE_MODE,
|
|
resolution: (0, r.getResolutionOfUrl)(i)
|
|
}));
|
|
return n || (n = i),
|
|
g.addToCache(a.baseTexture, n),
|
|
e.addToCache(a, n),
|
|
n !== i && (g.addToCache(a.baseTexture, i), e.addToCache(a, i)),
|
|
a
|
|
},
|
|
e.addToCache = function (t, e) {
|
|
e && (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e), r.TextureCache[e] && console.warn("Texture added to the cache with an id [" + e + "] that already had an entry"), r.TextureCache[e] = t)
|
|
},
|
|
e.removeFromCache = function (t) {
|
|
if ("string" == typeof t) {
|
|
var e = r.TextureCache[t];
|
|
if (e) {
|
|
var i = e.textureCacheIds.indexOf(t);
|
|
return i > -1 && e.textureCacheIds.splice(i, 1),
|
|
delete r.TextureCache[t],
|
|
e
|
|
}
|
|
} else if (t && t.textureCacheIds) {
|
|
for (var n = 0; n < t.textureCacheIds.length; ++n)
|
|
r.TextureCache[t.textureCacheIds[n]] === t && delete r.TextureCache[t.textureCacheIds[n]];
|
|
return t.textureCacheIds.length = 0,
|
|
t
|
|
}
|
|
return null
|
|
},
|
|
i.resolution.get = function () {
|
|
return this.baseTexture.resolution
|
|
},
|
|
i.frame.get = function () {
|
|
return this._frame
|
|
},
|
|
i.frame.set = function (t) {
|
|
this._frame = t,
|
|
this.noFrame = !1;
|
|
var e = t.x,
|
|
i = t.y,
|
|
n = t.width,
|
|
r = t.height,
|
|
o = e + n > this.baseTexture.width,
|
|
s = i + r > this.baseTexture.height;
|
|
if (o || s) {
|
|
var a = o && s ? "and" : "or",
|
|
h = "X: " + e + " + " + n + " = " + (e + n) + " > " + this.baseTexture.width,
|
|
l = "Y: " + i + " + " + r + " = " + (i + r) + " > " + this.baseTexture.height;
|
|
throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: " + h + " " + a + " " + l)
|
|
}
|
|
this.valid = n && r && this.baseTexture.valid,
|
|
this.trim || this.rotate || (this.orig = t),
|
|
this.valid && this.updateUvs()
|
|
},
|
|
i.rotate.get = function () {
|
|
return this._rotate
|
|
},
|
|
i.rotate.set = function (t) {
|
|
this._rotate = t,
|
|
this.valid && this.updateUvs()
|
|
},
|
|
i.width.get = function () {
|
|
return this.orig.width
|
|
},
|
|
i.height.get = function () {
|
|
return this.orig.height
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(r.EventEmitter);
|
|
function D(t) {
|
|
t.destroy = function () {},
|
|
t.on = function () {},
|
|
t.once = function () {},
|
|
t.emit = function () {}
|
|
}
|
|
i.Texture = R,
|
|
R.EMPTY = new R(new g),
|
|
D(R.EMPTY),
|
|
D(R.EMPTY.baseTexture),
|
|
R.WHITE = function () {
|
|
var t = document.createElement("canvas");
|
|
t.width = 16,
|
|
t.height = 16;
|
|
var e = t.getContext("2d");
|
|
return e.fillStyle = "white",
|
|
e.fillRect(0, 0, 16, 16),
|
|
new R(new g(new w(t)))
|
|
}
|
|
(),
|
|
D(R.WHITE),
|
|
D(R.WHITE.baseTexture);
|
|
var L = function (t) {
|
|
function e(e, i) {
|
|
var n = null;
|
|
if (!(e instanceof I)) {
|
|
var r = arguments[1],
|
|
o = arguments[2],
|
|
s = arguments[3],
|
|
a = arguments[4];
|
|
console.warn("Please use RenderTexture.create(" + r + ", " + o + ") instead of the ctor directly."),
|
|
n = arguments[0],
|
|
i = null,
|
|
e = new I({
|
|
width: r,
|
|
height: o,
|
|
scaleMode: s,
|
|
resolution: a
|
|
})
|
|
}
|
|
t.call(this, e, i),
|
|
this.legacyRenderer = n,
|
|
this.valid = !0,
|
|
this.filterFrame = null,
|
|
this.filterPoolKey = null,
|
|
this.updateUvs()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.resize = function (t, e, i) {
|
|
void 0 === i && (i = !0),
|
|
t = Math.ceil(t),
|
|
e = Math.ceil(e),
|
|
this.valid = t > 0 && e > 0,
|
|
this._frame.width = this.orig.width = t,
|
|
this._frame.height = this.orig.height = e,
|
|
i && this.baseTexture.resize(t, e),
|
|
this.updateUvs()
|
|
},
|
|
e.prototype.setResolution = function (t) {
|
|
var e = this.baseTexture;
|
|
e.resolution !== t && (e.setResolution(t), this.resize(e.width, e.height, !1))
|
|
},
|
|
e.create = function (t) {
|
|
return "number" == typeof t && (t = {
|
|
width: t,
|
|
height: arguments[1],
|
|
scaleMode: arguments[2],
|
|
resolution: arguments[3]
|
|
}),
|
|
new e(new I(t))
|
|
},
|
|
e
|
|
}
|
|
(R);
|
|
i.RenderTexture = L;
|
|
var k = function (t) {
|
|
this.texturePool = {},
|
|
this.textureOptions = t || {},
|
|
this.enableFullScreen = !1,
|
|
this._pixelsWidth = 0,
|
|
this._pixelsHeight = 0
|
|
};
|
|
i.RenderTexturePool = k,
|
|
k.prototype.createTexture = function (t, e) {
|
|
var i = new I(Object.assign({
|
|
width: t,
|
|
height: e,
|
|
resolution: 1
|
|
}, this.textureOptions));
|
|
return new L(i)
|
|
},
|
|
k.prototype.getOptimalTexture = function (t, e, i) {
|
|
void 0 === i && (i = 1);
|
|
var n = k.SCREEN_KEY;
|
|
t *= i,
|
|
e *= i,
|
|
this.enableFullScreen && t === this._pixelsWidth && e === this._pixelsHeight || (n = (65535 & (t = (0, r.nextPow2)(t))) << 16 | 65535 & (e = (0, r.nextPow2)(e))),
|
|
this.texturePool[n] || (this.texturePool[n] = []);
|
|
var o = this.texturePool[n].pop();
|
|
return o || (o = this.createTexture(t, e)),
|
|
o.filterPoolKey = n,
|
|
o.setResolution(i),
|
|
o
|
|
},
|
|
k.prototype.getFilterTexture = function (t, e) {
|
|
var i = this.getOptimalTexture(t.width, t.height, e || t.resolution);
|
|
return i.filterFrame = t.filterFrame,
|
|
i
|
|
},
|
|
k.prototype.returnTexture = function (t) {
|
|
var e = t.filterPoolKey;
|
|
t.filterFrame = null,
|
|
this.texturePool[e].push(t)
|
|
},
|
|
k.prototype.returnFilterTexture = function (t) {
|
|
this.returnTexture(t)
|
|
},
|
|
k.prototype.clear = function (t) {
|
|
if (t = !1 !== t)
|
|
for (var e in this.texturePool) {
|
|
var i = this.texturePool[e];
|
|
if (i)
|
|
for (var n = 0; n < i.length; n++)
|
|
i[n].destroy(!0)
|
|
}
|
|
this.texturePool = {}
|
|
},
|
|
k.prototype.setScreenSize = function (t) {
|
|
if (t.width !== this._pixelsWidth || t.height !== this._pixelsHeight) {
|
|
var e = k.SCREEN_KEY,
|
|
i = this.texturePool[e];
|
|
if (this.enableFullScreen = t.width > 0 && t.height > 0, i)
|
|
for (var n = 0; n < i.length; n++)
|
|
i[n].destroy(!0);
|
|
this.texturePool[e] = [],
|
|
this._pixelsWidth = t.width,
|
|
this._pixelsHeight = t.height
|
|
}
|
|
},
|
|
k.SCREEN_KEY = "screen";
|
|
var F = function (t, e, i, n, r, o, s) {
|
|
void 0 === i && (i = !1),
|
|
void 0 === n && (n = 5126),
|
|
this.buffer = t,
|
|
this.size = e,
|
|
this.normalized = i,
|
|
this.type = n,
|
|
this.stride = r,
|
|
this.start = o,
|
|
this.instance = s
|
|
};
|
|
i.Attribute = F,
|
|
F.prototype.destroy = function () {
|
|
this.buffer = null
|
|
},
|
|
F.from = function (t, e, i, n, r) {
|
|
return new F(t, e, i, n, r)
|
|
};
|
|
var N = 0,
|
|
B = function (t, e, i) {
|
|
void 0 === e && (e = !0),
|
|
void 0 === i && (i = !1),
|
|
this.data = t || new Float32Array(1),
|
|
this._glBuffers = {},
|
|
this._updateID = 0,
|
|
this.index = i,
|
|
this.static = e,
|
|
this.id = N++,
|
|
this.disposeRunner = new n.Runner("disposeBuffer", 2)
|
|
};
|
|
function U(t) {
|
|
if (4 === t.BYTES_PER_ELEMENT)
|
|
return t instanceof Float32Array ? "Float32Array" : t instanceof Uint32Array ? "Uint32Array" : "Int32Array";
|
|
if (2 === t.BYTES_PER_ELEMENT) {
|
|
if (t instanceof Uint16Array)
|
|
return "Uint16Array"
|
|
} else if (1 === t.BYTES_PER_ELEMENT && t instanceof Uint8Array)
|
|
return "Uint8Array";
|
|
return null
|
|
}
|
|
i.Buffer = B,
|
|
B.prototype.update = function (t) {
|
|
this.data = t || this.data,
|
|
this._updateID++
|
|
},
|
|
B.prototype.dispose = function () {
|
|
this.disposeRunner.run(this, !1)
|
|
},
|
|
B.prototype.destroy = function () {
|
|
this.dispose(),
|
|
this.data = null
|
|
},
|
|
B.from = function (t) {
|
|
return t instanceof Array && (t = new Float32Array(t)),
|
|
new B(t)
|
|
};
|
|
var X = {
|
|
Float32Array: Float32Array,
|
|
Uint32Array: Uint32Array,
|
|
Int32Array: Int32Array,
|
|
Uint8Array: Uint8Array
|
|
};
|
|
var j = {
|
|
5126: 4,
|
|
5123: 2,
|
|
5121: 1
|
|
},
|
|
V = 0,
|
|
H = {
|
|
Float32Array: Float32Array,
|
|
Uint32Array: Uint32Array,
|
|
Int32Array: Int32Array,
|
|
Uint8Array: Uint8Array,
|
|
Uint16Array: Uint16Array
|
|
},
|
|
G = function (t, e) {
|
|
void 0 === t && (t = []),
|
|
void 0 === e && (e = {}),
|
|
this.buffers = t,
|
|
this.indexBuffer = null,
|
|
this.attributes = e,
|
|
this.glVertexArrayObjects = {},
|
|
this.id = V++,
|
|
this.instanced = !1,
|
|
this.instanceCount = 1,
|
|
this.disposeRunner = new n.Runner("disposeGeometry", 2),
|
|
this.refCount = 0
|
|
};
|
|
i.Geometry = G,
|
|
G.prototype.addAttribute = function (t, e, i, n, r, o, s, a) {
|
|
if (void 0 === n && (n = !1), void 0 === a && (a = !1), !e)
|
|
throw new Error("You must pass a buffer when creating an attribute");
|
|
e.data || (e instanceof Array && (e = new Float32Array(e)), e = new B(e));
|
|
var h = t.split("|");
|
|
if (h.length > 1) {
|
|
for (var l = 0; l < h.length; l++)
|
|
this.addAttribute(h[l], e, i, n, r);
|
|
return this
|
|
}
|
|
var u = this.buffers.indexOf(e);
|
|
return -1 === u && (this.buffers.push(e), u = this.buffers.length - 1),
|
|
this.attributes[t] = new F(u, i, n, r, o, s, a),
|
|
this.instanced = this.instanced || a,
|
|
this
|
|
},
|
|
G.prototype.getAttribute = function (t) {
|
|
return this.attributes[t]
|
|
},
|
|
G.prototype.getBuffer = function (t) {
|
|
return this.buffers[this.getAttribute(t).buffer]
|
|
},
|
|
G.prototype.addIndex = function (t) {
|
|
return t.data || (t instanceof Array && (t = new Uint16Array(t)), t = new B(t)),
|
|
t.index = !0,
|
|
this.indexBuffer = t,
|
|
-1 === this.buffers.indexOf(t) && this.buffers.push(t),
|
|
this
|
|
},
|
|
G.prototype.getIndex = function () {
|
|
return this.indexBuffer
|
|
},
|
|
G.prototype.interleave = function () {
|
|
if (1 === this.buffers.length || 2 === this.buffers.length && this.indexBuffer)
|
|
return this;
|
|
var t,
|
|
e = [],
|
|
i = [],
|
|
n = new B;
|
|
for (t in this.attributes) {
|
|
var r = this.attributes[t],
|
|
o = this.buffers[r.buffer];
|
|
e.push(o.data),
|
|
i.push(r.size * j[r.type] / 4),
|
|
r.buffer = 0
|
|
}
|
|
for (n.data = function (t, e) {
|
|
for (var i = 0, n = 0, r = {}, o = 0; o < t.length; o++)
|
|
n += e[o], i += t[o].length;
|
|
for (var s = new ArrayBuffer(4 * i), a = null, h = 0, l = 0; l < t.length; l++) {
|
|
var u = e[l],
|
|
c = t[l],
|
|
p = U(c);
|
|
r[p] || (r[p] = new X[p](s)),
|
|
a = r[p];
|
|
for (var d = 0; d < c.length; d++) {
|
|
a[(d / u | 0) * n + h + d % u] = c[d]
|
|
}
|
|
h += u
|
|
}
|
|
return new Float32Array(s)
|
|
}
|
|
(e, i), t = 0; t < this.buffers.length; t++)
|
|
this.buffers[t] !== this.indexBuffer && this.buffers[t].destroy();
|
|
return this.buffers = [n],
|
|
this.indexBuffer && this.buffers.push(this.indexBuffer),
|
|
this
|
|
},
|
|
G.prototype.getSize = function () {
|
|
for (var t in this.attributes) {
|
|
var e = this.attributes[t];
|
|
return this.buffers[e.buffer].data.length / (e.stride / 4 || e.size)
|
|
}
|
|
return 0
|
|
},
|
|
G.prototype.dispose = function () {
|
|
this.disposeRunner.run(this, !1)
|
|
},
|
|
G.prototype.destroy = function () {
|
|
this.dispose(),
|
|
this.buffers = null,
|
|
this.indexBuffer = null,
|
|
this.attributes = null
|
|
},
|
|
G.prototype.clone = function () {
|
|
for (var t = new G, e = 0; e < this.buffers.length; e++)
|
|
t.buffers[e] = new B(this.buffers[e].data.slice());
|
|
for (var i in this.attributes) {
|
|
var n = this.attributes[i];
|
|
t.attributes[i] = new F(n.buffer, n.size, n.normalized, n.type, n.stride, n.start, n.instance)
|
|
}
|
|
return this.indexBuffer && (t.indexBuffer = t.buffers[this.buffers.indexOf(this.indexBuffer)], t.indexBuffer.index = !0),
|
|
t
|
|
},
|
|
G.merge = function (t) {
|
|
for (var e, i = new G, n = [], r = [], o = [], s = 0; s < t.length; s++) {
|
|
e = t[s];
|
|
for (var a = 0; a < e.buffers.length; a++)
|
|
r[a] = r[a] || 0, r[a] += e.buffers[a].data.length, o[a] = 0
|
|
}
|
|
for (var h = 0; h < e.buffers.length; h++)
|
|
n[h] = new(H[U(e.buffers[h].data)])(r[h]), i.buffers[h] = new B(n[h]);
|
|
for (var l = 0; l < t.length; l++) {
|
|
e = t[l];
|
|
for (var u = 0; u < e.buffers.length; u++)
|
|
n[u].set(e.buffers[u].data, o[u]), o[u] += e.buffers[u].data.length
|
|
}
|
|
if (i.attributes = e.attributes, e.indexBuffer) {
|
|
i.indexBuffer = i.buffers[e.buffers.indexOf(e.indexBuffer)],
|
|
i.indexBuffer.index = !0;
|
|
for (var c = 0, p = 0, d = 0, f = 0, _ = 0; _ < e.buffers.length; _++)
|
|
if (e.buffers[_] !== e.indexBuffer) {
|
|
f = _;
|
|
break
|
|
}
|
|
for (var m in e.attributes) {
|
|
var y = e.attributes[m];
|
|
(0 | y.buffer) === f && (p += y.size * j[y.type] / 4)
|
|
}
|
|
for (var g = 0; g < t.length; g++) {
|
|
for (var v = t[g].indexBuffer.data, w = 0; w < v.length; w++)
|
|
i.indexBuffer.data[w + d] += c;
|
|
c += e.buffers[f].data.length / p,
|
|
d += v.length
|
|
}
|
|
}
|
|
return i
|
|
};
|
|
var Y = function (t) {
|
|
function e() {
|
|
t.call(this),
|
|
this.addAttribute("aVertexPosition", [0, 0, 1, 0, 1, 1, 0, 1]).addIndex([0, 1, 3, 2])
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(G);
|
|
i.Quad = Y;
|
|
var W = function (t) {
|
|
function e() {
|
|
t.call(this),
|
|
this.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]),
|
|
this.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
|
|
this.vertexBuffer = new B(this.vertices),
|
|
this.uvBuffer = new B(this.uvs),
|
|
this.addAttribute("aVertexPosition", this.vertexBuffer).addAttribute("aTextureCoord", this.uvBuffer).addIndex([0, 1, 2, 0, 2, 3])
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.map = function (t, e) {
|
|
var i = 0,
|
|
n = 0;
|
|
return this.uvs[0] = i,
|
|
this.uvs[1] = n,
|
|
this.uvs[2] = i + e.width / t.width,
|
|
this.uvs[3] = n,
|
|
this.uvs[4] = i + e.width / t.width,
|
|
this.uvs[5] = n + e.height / t.height,
|
|
this.uvs[6] = i,
|
|
this.uvs[7] = n + e.height / t.height,
|
|
i = e.x,
|
|
n = e.y,
|
|
this.vertices[0] = i,
|
|
this.vertices[1] = n,
|
|
this.vertices[2] = i + e.width,
|
|
this.vertices[3] = n,
|
|
this.vertices[4] = i + e.width,
|
|
this.vertices[5] = n + e.height,
|
|
this.vertices[6] = i,
|
|
this.vertices[7] = n + e.height,
|
|
this.invalidate(),
|
|
this
|
|
},
|
|
e.prototype.invalidate = function () {
|
|
return this.vertexBuffer._updateID++,
|
|
this.uvBuffer._updateID++,
|
|
this
|
|
},
|
|
e
|
|
}
|
|
(G);
|
|
i.QuadUv = W;
|
|
var z = 0,
|
|
q = function (t, e) {
|
|
this.uniforms = t,
|
|
this.group = !0,
|
|
this.syncUniforms = {},
|
|
this.dirtyId = 0,
|
|
this.id = z++,
|
|
this.static = !!e
|
|
};
|
|
i.UniformGroup = q,
|
|
q.prototype.update = function () {
|
|
this.dirtyId++
|
|
},
|
|
q.prototype.add = function (t, e, i) {
|
|
this.uniforms[t] = new q(e, i)
|
|
},
|
|
q.from = function (t, e) {
|
|
return new q(t, e)
|
|
};
|
|
var J = function () {
|
|
this.renderTexture = null,
|
|
this.target = null,
|
|
this.legacy = !1,
|
|
this.resolution = 1,
|
|
this.sourceFrame = new h.Rectangle,
|
|
this.destinationFrame = new h.Rectangle,
|
|
this.filters = []
|
|
};
|
|
J.prototype.clear = function () {
|
|
this.target = null,
|
|
this.filters = null,
|
|
this.renderTexture = null
|
|
};
|
|
var K = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.defaultFilterStack = [{}
|
|
],
|
|
this.texturePool = new k,
|
|
this.texturePool.setScreenSize(e.view),
|
|
this.statePool = [],
|
|
this.quad = new Y,
|
|
this.quadUv = new W,
|
|
this.tempRect = new h.Rectangle,
|
|
this.activeState = {},
|
|
this.globalUniforms = new q({
|
|
outputFrame: this.tempRect,
|
|
inputSize: new Float32Array(4),
|
|
inputPixel: new Float32Array(4),
|
|
inputClamp: new Float32Array(4),
|
|
resolution: 1,
|
|
filterArea: new Float32Array(4),
|
|
filterClamp: new Float32Array(4)
|
|
}, !0),
|
|
this._pixelsWidth = e.view.width,
|
|
this._pixelsHeight = e.view.height
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.push = function (t, e) {
|
|
for (var i = this.renderer, n = this.defaultFilterStack, r = this.statePool.pop() || new J, o = e[0].resolution, s = e[0].padding, a = e[0].autoFit, h = e[0].legacy, l = 1; l < e.length; l++) {
|
|
var u = e[l];
|
|
o = Math.min(o, u.resolution),
|
|
s = Math.max(s, u.padding),
|
|
a = a || u.autoFit,
|
|
h = h || u.legacy
|
|
}
|
|
1 === n.length && (this.defaultFilterStack[0].renderTexture = i.renderTexture.current),
|
|
n.push(r),
|
|
r.resolution = o,
|
|
r.legacy = h,
|
|
r.target = t,
|
|
r.sourceFrame.copyFrom(t.filterArea || t.getBounds(!0)),
|
|
r.sourceFrame.pad(s),
|
|
a && r.sourceFrame.fit(this.renderer.renderTexture.sourceFrame),
|
|
r.sourceFrame.ceil(o),
|
|
r.renderTexture = this.getOptimalFilterTexture(r.sourceFrame.width, r.sourceFrame.height, o),
|
|
r.filters = e,
|
|
r.destinationFrame.width = r.renderTexture.width,
|
|
r.destinationFrame.height = r.renderTexture.height,
|
|
r.renderTexture.filterFrame = r.sourceFrame,
|
|
i.renderTexture.bind(r.renderTexture, r.sourceFrame),
|
|
i.renderTexture.clear()
|
|
},
|
|
e.prototype.pop = function () {
|
|
var t = this.defaultFilterStack,
|
|
e = t.pop(),
|
|
i = e.filters;
|
|
this.activeState = e;
|
|
var n = this.globalUniforms.uniforms;
|
|
n.outputFrame = e.sourceFrame,
|
|
n.resolution = e.resolution;
|
|
var r = n.inputSize,
|
|
o = n.inputPixel,
|
|
s = n.inputClamp;
|
|
if (r[0] = e.destinationFrame.width, r[1] = e.destinationFrame.height, r[2] = 1 / r[0], r[3] = 1 / r[1], o[0] = r[0] * e.resolution, o[1] = r[1] * e.resolution, o[2] = 1 / o[0], o[3] = 1 / o[1], s[0] = .5 * o[2], s[1] = .5 * o[3], s[2] = e.sourceFrame.width * r[2] - .5 * o[2], s[3] = e.sourceFrame.height * r[3] - .5 * o[3], e.legacy) {
|
|
var a = n.filterArea;
|
|
a[0] = e.destinationFrame.width,
|
|
a[1] = e.destinationFrame.height,
|
|
a[2] = e.sourceFrame.x,
|
|
a[3] = e.sourceFrame.y,
|
|
n.filterClamp = n.inputClamp
|
|
}
|
|
this.globalUniforms.update();
|
|
var h = t[t.length - 1];
|
|
if (1 === i.length)
|
|
i[0].apply(this, e.renderTexture, h.renderTexture, !1, e), this.returnFilterTexture(e.renderTexture);
|
|
else {
|
|
var l = e.renderTexture,
|
|
u = this.getOptimalFilterTexture(l.width, l.height, e.resolution);
|
|
u.filterFrame = l.filterFrame;
|
|
var c = 0;
|
|
for (c = 0; c < i.length - 1; ++c) {
|
|
i[c].apply(this, l, u, !0, e);
|
|
var p = l;
|
|
l = u,
|
|
u = p
|
|
}
|
|
i[c].apply(this, l, h.renderTexture, !1, e),
|
|
this.returnFilterTexture(l),
|
|
this.returnFilterTexture(u)
|
|
}
|
|
e.clear(),
|
|
this.statePool.push(e)
|
|
},
|
|
e.prototype.applyFilter = function (t, e, i, n) {
|
|
var r = this.renderer;
|
|
r.renderTexture.bind(i, i ? i.filterFrame : null),
|
|
n && r.renderTexture.clear(),
|
|
t.uniforms.uSampler = e,
|
|
t.uniforms.filterGlobals = this.globalUniforms,
|
|
r.state.set(t.state),
|
|
r.shader.bind(t),
|
|
t.legacy ? (this.quadUv.map(e._frame, e.filterFrame), r.geometry.bind(this.quadUv), r.geometry.draw(o.DRAW_MODES.TRIANGLES)) : (r.geometry.bind(this.quad), r.geometry.draw(o.DRAW_MODES.TRIANGLE_STRIP))
|
|
},
|
|
e.prototype.calculateSpriteMatrix = function (t, e) {
|
|
var i = this.activeState,
|
|
n = i.sourceFrame,
|
|
r = i.destinationFrame,
|
|
o = e._texture.orig,
|
|
s = t.set(r.width, 0, 0, r.height, n.x, n.y),
|
|
a = e.worldTransform.copyTo(h.Matrix.TEMP_MATRIX);
|
|
return a.invert(),
|
|
s.prepend(a),
|
|
s.scale(1 / o.width, 1 / o.height),
|
|
s.translate(e.anchor.x, e.anchor.y),
|
|
s
|
|
},
|
|
e.prototype.destroy = function () {
|
|
this.texturePool.clear(!1)
|
|
},
|
|
e.prototype.getOptimalFilterTexture = function (t, e, i) {
|
|
return void 0 === i && (i = 1),
|
|
this.texturePool.getOptimalTexture(t, e, i)
|
|
},
|
|
e.prototype.getFilterTexture = function (t, e) {
|
|
if ("number" == typeof t) {
|
|
var i = t;
|
|
t = e,
|
|
e = i
|
|
}
|
|
t = t || this.activeState.renderTexture;
|
|
var n = this.texturePool.getOptimalTexture(t.width, t.height, e || t.resolution);
|
|
return n.filterFrame = t.filterFrame,
|
|
n
|
|
},
|
|
e.prototype.returnFilterTexture = function (t) {
|
|
this.texturePool.returnTexture(t)
|
|
},
|
|
e.prototype.emptyPool = function () {
|
|
this.texturePool.clear(!0)
|
|
},
|
|
e.prototype.resize = function () {
|
|
this.texturePool.setScreenSize(this.renderer.view)
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
Z = function (t) {
|
|
this.renderer = t
|
|
};
|
|
i.ObjectRenderer = Z,
|
|
Z.prototype.flush = function () {},
|
|
Z.prototype.destroy = function () {
|
|
this.renderer = null
|
|
},
|
|
Z.prototype.start = function () {},
|
|
Z.prototype.stop = function () {
|
|
this.flush()
|
|
},
|
|
Z.prototype.render = function (t) {};
|
|
var Q = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.emptyRenderer = new Z(e),
|
|
this.currentRenderer = this.emptyRenderer
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.setObjectRenderer = function (t) {
|
|
this.currentRenderer !== t && (this.currentRenderer.stop(), this.currentRenderer = t, this.currentRenderer.start())
|
|
},
|
|
e.prototype.flush = function () {
|
|
this.setObjectRenderer(this.emptyRenderer)
|
|
},
|
|
e.prototype.reset = function () {
|
|
this.setObjectRenderer(this.emptyRenderer)
|
|
},
|
|
e.prototype.copyBoundTextures = function (t, e) {
|
|
for (var i = this.renderer.texture.boundTextures, n = e - 1; n >= 0; --n)
|
|
t[n] = i[n] || null, t[n] && (t[n]._batchLocation = n)
|
|
},
|
|
e.prototype.boundArray = function (t, e, i, n) {
|
|
for (var r = t.elements, o = t.ids, s = t.count, a = 0, h = 0; h < s; h++) {
|
|
var l = r[h],
|
|
u = l._batchLocation;
|
|
if (u >= 0 && u < n && e[u] === l)
|
|
o[h] = u;
|
|
else
|
|
for (; a < n; ) {
|
|
var c = e[a];
|
|
if (!c || c._batchEnabled !== i || c._batchLocation !== a) {
|
|
o[h] = a,
|
|
l._batchLocation = a,
|
|
e[a] = l;
|
|
break
|
|
}
|
|
a++
|
|
}
|
|
}
|
|
},
|
|
e
|
|
}
|
|
(S);
|
|
s.settings.PREFER_ENV = r.isMobile.any ? o.ENV.WEBGL : o.ENV.WEBGL2,
|
|
s.settings.STRICT_TEXTURE_CACHE = !1;
|
|
var tt = 0,
|
|
et = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.webGLVersion = 1,
|
|
this.extensions = {},
|
|
this.handleContextLost = this.handleContextLost.bind(this),
|
|
this.handleContextRestored = this.handleContextRestored.bind(this),
|
|
e.view.addEventListener("webglcontextlost", this.handleContextLost, !1),
|
|
e.view.addEventListener("webglcontextrestored", this.handleContextRestored, !1)
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
isLost: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.isLost.get = function () {
|
|
return !this.gl || this.gl.isContextLost()
|
|
},
|
|
e.prototype.contextChange = function (t) {
|
|
this.gl = t,
|
|
this.renderer.gl = t,
|
|
this.renderer.CONTEXT_UID = tt++,
|
|
t.isContextLost() && t.getExtension("WEBGL_lose_context") && t.getExtension("WEBGL_lose_context").restoreContext()
|
|
},
|
|
e.prototype.initFromContext = function (t) {
|
|
this.gl = t,
|
|
this.validateContext(t),
|
|
this.renderer.gl = t,
|
|
this.renderer.CONTEXT_UID = tt++,
|
|
this.renderer.runners.contextChange.run(t)
|
|
},
|
|
e.prototype.initFromOptions = function (t) {
|
|
var e = this.createContext(this.renderer.view, t);
|
|
this.initFromContext(e)
|
|
},
|
|
e.prototype.createContext = function (t, e) {
|
|
var i;
|
|
if (s.settings.PREFER_ENV >= o.ENV.WEBGL2 && (i = t.getContext("webgl2", e)), i)
|
|
this.webGLVersion = 2;
|
|
else if (this.webGLVersion = 1, !(i = t.getContext("webgl", e) || t.getContext("experimental-webgl", e)))
|
|
throw new Error("This browser does not support WebGL. Try using the canvas renderer");
|
|
return this.gl = i,
|
|
this.getExtensions(),
|
|
i
|
|
},
|
|
e.prototype.getExtensions = function () {
|
|
var t = this.gl;
|
|
1 === this.webGLVersion ? Object.assign(this.extensions, {
|
|
drawBuffers: t.getExtension("WEBGL_draw_buffers"),
|
|
depthTexture: t.getExtension("WEBKIT_WEBGL_depth_texture"),
|
|
loseContext: t.getExtension("WEBGL_lose_context"),
|
|
vertexArrayObject: t.getExtension("OES_vertex_array_object") || t.getExtension("MOZ_OES_vertex_array_object") || t.getExtension("WEBKIT_OES_vertex_array_object"),
|
|
anisotropicFiltering: t.getExtension("EXT_texture_filter_anisotropic"),
|
|
uint32ElementIndex: t.getExtension("OES_element_index_uint"),
|
|
floatTexture: t.getExtension("OES_texture_float"),
|
|
floatTextureLinear: t.getExtension("OES_texture_float_linear"),
|
|
textureHalfFloat: t.getExtension("OES_texture_half_float"),
|
|
textureHalfFloatLinear: t.getExtension("OES_texture_half_float_linear")
|
|
}) : 2 === this.webGLVersion && Object.assign(this.extensions, {
|
|
anisotropicFiltering: t.getExtension("EXT_texture_filter_anisotropic"),
|
|
colorBufferFloat: t.getExtension("EXT_color_buffer_float"),
|
|
floatTextureLinear: t.getExtension("OES_texture_float_linear")
|
|
})
|
|
},
|
|
e.prototype.handleContextLost = function (t) {
|
|
t.preventDefault()
|
|
},
|
|
e.prototype.handleContextRestored = function () {
|
|
this.renderer.runners.contextChange.run(this.gl)
|
|
},
|
|
e.prototype.destroy = function () {
|
|
var t = this.renderer.view;
|
|
t.removeEventListener("webglcontextlost", this.handleContextLost),
|
|
t.removeEventListener("webglcontextrestored", this.handleContextRestored),
|
|
this.gl.useProgram(null),
|
|
this.extensions.loseContext && this.extensions.loseContext.loseContext()
|
|
},
|
|
e.prototype.postrender = function () {
|
|
this.renderer.renderingToScreen && this.gl.flush()
|
|
},
|
|
e.prototype.validateContext = function (t) {
|
|
t.getContextAttributes().stencil || console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(S),
|
|
it = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.managedFramebuffers = [],
|
|
this.unknownFramebuffer = new C(10, 10)
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
size: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.contextChange = function () {
|
|
var t = this.gl = this.renderer.gl;
|
|
if (this.CONTEXT_UID = this.renderer.CONTEXT_UID, this.current = this.unknownFramebuffer, this.viewport = new h.Rectangle, this.hasMRT = !0, this.writeDepthTexture = !0, this.disposeAll(!0), 1 === this.renderer.context.webGLVersion) {
|
|
var e = this.renderer.context.extensions.drawBuffers,
|
|
i = this.renderer.context.extensions.depthTexture;
|
|
s.settings.PREFER_ENV === o.ENV.WEBGL_LEGACY && (e = null, i = null),
|
|
e ? t.drawBuffers = function (t) {
|
|
return e.drawBuffersWEBGL(t)
|
|
}
|
|
: (this.hasMRT = !1, t.drawBuffers = function () {}),
|
|
i || (this.writeDepthTexture = !1)
|
|
}
|
|
},
|
|
e.prototype.bind = function (t, e) {
|
|
var i = this.gl;
|
|
if (t) {
|
|
var n = t.glFramebuffers[this.CONTEXT_UID] || this.initFramebuffer(t);
|
|
this.current !== t && (this.current = t, i.bindFramebuffer(i.FRAMEBUFFER, n.framebuffer)),
|
|
n.dirtyId !== t.dirtyId && (n.dirtyId = t.dirtyId, n.dirtyFormat !== t.dirtyFormat ? (n.dirtyFormat = t.dirtyFormat, this.updateFramebuffer(t)) : n.dirtySize !== t.dirtySize && (n.dirtySize = t.dirtySize, this.resizeFramebuffer(t)));
|
|
for (var r = 0; r < t.colorTextures.length; r++)
|
|
t.colorTextures[r].texturePart ? this.renderer.texture.unbind(t.colorTextures[r].texture) : this.renderer.texture.unbind(t.colorTextures[r]);
|
|
t.depthTexture && this.renderer.texture.unbind(t.depthTexture),
|
|
e ? this.setViewport(e.x, e.y, e.width, e.height) : this.setViewport(0, 0, t.width, t.height)
|
|
} else
|
|
this.current && (this.current = null, i.bindFramebuffer(i.FRAMEBUFFER, null)), e ? this.setViewport(e.x, e.y, e.width, e.height) : this.setViewport(0, 0, this.renderer.width, this.renderer.height)
|
|
},
|
|
e.prototype.setViewport = function (t, e, i, n) {
|
|
var r = this.viewport;
|
|
r.width === i && r.height === n && r.x === t && r.y === e || (r.x = t, r.y = e, r.width = i, r.height = n, this.gl.viewport(t, e, i, n))
|
|
},
|
|
i.size.get = function () {
|
|
return this.current ? {
|
|
x: 0,
|
|
y: 0,
|
|
width: this.current.width,
|
|
height: this.current.height
|
|
}
|
|
: {
|
|
x: 0,
|
|
y: 0,
|
|
width: this.renderer.width,
|
|
height: this.renderer.height
|
|
}
|
|
},
|
|
e.prototype.clear = function (t, e, i, n) {
|
|
var r = this.gl;
|
|
r.clearColor(t, e, i, n),
|
|
r.clear(r.COLOR_BUFFER_BIT | r.DEPTH_BUFFER_BIT)
|
|
},
|
|
e.prototype.initFramebuffer = function (t) {
|
|
var e = {
|
|
framebuffer: this.gl.createFramebuffer(),
|
|
stencil: null,
|
|
dirtyId: 0,
|
|
dirtyFormat: 0,
|
|
dirtySize: 0
|
|
};
|
|
return t.glFramebuffers[this.CONTEXT_UID] = e,
|
|
this.managedFramebuffers.push(t),
|
|
t.disposeRunner.add(this),
|
|
e
|
|
},
|
|
e.prototype.resizeFramebuffer = function (t) {
|
|
var e = this.gl,
|
|
i = t.glFramebuffers[this.CONTEXT_UID];
|
|
i.stencil && (e.bindRenderbuffer(e.RENDERBUFFER, i.stencil), e.renderbufferStorage(e.RENDERBUFFER, e.DEPTH_STENCIL, t.width, t.height));
|
|
for (var n = t.colorTextures, r = 0; r < n.length; r++)
|
|
this.renderer.texture.bind(n[r], 0);
|
|
t.depthTexture && this.renderer.texture.bind(t.depthTexture, 0)
|
|
},
|
|
e.prototype.updateFramebuffer = function (t) {
|
|
var e = this.gl,
|
|
i = t.glFramebuffers[this.CONTEXT_UID],
|
|
n = t.colorTextures.length;
|
|
e.drawBuffers || (n = Math.min(n, 1));
|
|
for (var r = [], o = 0; o < n; o++) {
|
|
var s = t.colorTextures[o];
|
|
s.texturePart ? (this.renderer.texture.bind(s.texture, 0), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + o, e.TEXTURE_CUBE_MAP_NEGATIVE_X + s.side, s.texture._glTextures[this.CONTEXT_UID].texture, 0)) : (this.renderer.texture.bind(s, 0), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + o, e.TEXTURE_2D, s._glTextures[this.CONTEXT_UID].texture, 0)),
|
|
r.push(e.COLOR_ATTACHMENT0 + o)
|
|
}
|
|
if ((r.length > 1 && e.drawBuffers(r), t.depthTexture) && this.writeDepthTexture) {
|
|
var a = t.depthTexture;
|
|
this.renderer.texture.bind(a, 0),
|
|
e.framebufferTexture2D(e.FRAMEBUFFER, e.DEPTH_ATTACHMENT, e.TEXTURE_2D, a._glTextures[this.CONTEXT_UID].texture, 0)
|
|
}
|
|
i.stencil || !t.stencil && !t.depth || (i.stencil = e.createRenderbuffer(), e.bindRenderbuffer(e.RENDERBUFFER, i.stencil), e.renderbufferStorage(e.RENDERBUFFER, e.DEPTH_STENCIL, t.width, t.height), t.depthTexture || e.framebufferRenderbuffer(e.FRAMEBUFFER, e.DEPTH_STENCIL_ATTACHMENT, e.RENDERBUFFER, i.stencil))
|
|
},
|
|
e.prototype.disposeFramebuffer = function (t, e) {
|
|
var i = t.glFramebuffers[this.CONTEXT_UID],
|
|
n = this.gl;
|
|
if (i) {
|
|
delete t.glFramebuffers[this.CONTEXT_UID];
|
|
var r = this.managedFramebuffers.indexOf(t);
|
|
r >= 0 && this.managedFramebuffers.splice(r, 1),
|
|
t.disposeRunner.remove(this),
|
|
e || (n.deleteFramebuffer(i.framebuffer), i.stencil && n.deleteRenderbuffer(i.stencil))
|
|
}
|
|
},
|
|
e.prototype.disposeAll = function (t) {
|
|
var e = this.managedFramebuffers;
|
|
this.managedFramebuffers = [];
|
|
for (var i = 0; i < e.length; i++)
|
|
this.disposeFramebuffer(e[i], t)
|
|
},
|
|
e.prototype.forceStencil = function () {
|
|
var t = this.current;
|
|
if (t) {
|
|
var e = t.glFramebuffers[this.CONTEXT_UID];
|
|
if (e && !e.stencil) {
|
|
t.enableStencil();
|
|
var i = t.width,
|
|
n = t.height,
|
|
r = this.gl,
|
|
o = r.createRenderbuffer();
|
|
r.bindRenderbuffer(r.RENDERBUFFER, o),
|
|
r.renderbufferStorage(r.RENDERBUFFER, r.DEPTH_STENCIL, i, n),
|
|
e.stencil = o,
|
|
r.framebufferRenderbuffer(r.FRAMEBUFFER, r.DEPTH_STENCIL_ATTACHMENT, r.RENDERBUFFER, o)
|
|
}
|
|
}
|
|
},
|
|
e.prototype.reset = function () {
|
|
this.current = this.unknownFramebuffer,
|
|
this.viewport = new h.Rectangle
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(S),
|
|
nt = function (t) {
|
|
this.buffer = t,
|
|
this.updateID = -1,
|
|
this.byteLength = -1,
|
|
this.refCount = 0
|
|
},
|
|
rt = {
|
|
5126: 4,
|
|
5123: 2,
|
|
5121: 1
|
|
},
|
|
ot = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this._activeGeometry = null,
|
|
this._activeVao = null,
|
|
this.hasVao = !0,
|
|
this.hasInstance = !0,
|
|
this.canUseUInt32ElementIndex = !1,
|
|
this.boundBuffers = {},
|
|
this.managedGeometries = {},
|
|
this.managedBuffers = {}
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.contextChange = function () {
|
|
this.disposeAll(!0);
|
|
var t = this.gl = this.renderer.gl,
|
|
e = this.renderer.context;
|
|
if (this.CONTEXT_UID = this.renderer.CONTEXT_UID, !t.createVertexArray) {
|
|
var i = this.renderer.context.extensions.vertexArrayObject;
|
|
s.settings.PREFER_ENV === o.ENV.WEBGL_LEGACY && (i = null),
|
|
i ? (t.createVertexArray = function () {
|
|
return i.createVertexArrayOES()
|
|
}, t.bindVertexArray = function (t) {
|
|
return i.bindVertexArrayOES(t)
|
|
}, t.deleteVertexArray = function (t) {
|
|
return i.deleteVertexArrayOES(t)
|
|
}) : (this.hasVao = !1, t.createVertexArray = function () {}, t.bindVertexArray = function () {}, t.deleteVertexArray = function () {})
|
|
}
|
|
if (!t.vertexAttribDivisor) {
|
|
var n = t.getExtension("ANGLE_instanced_arrays");
|
|
n ? (t.vertexAttribDivisor = function (t, e) {
|
|
return n.vertexAttribDivisorANGLE(t, e)
|
|
}, t.drawElementsInstanced = function (t, e, i, r, o) {
|
|
return n.drawElementsInstancedANGLE(t, e, i, r, o)
|
|
}, t.drawArraysInstanced = function (t, e, i, r) {
|
|
return n.drawArraysInstancedANGLE(t, e, i, r)
|
|
}) : this.hasInstance = !1
|
|
}
|
|
this.canUseUInt32ElementIndex = 2 === e.webGLVersion || !!e.extensions.uint32ElementIndex
|
|
},
|
|
e.prototype.bind = function (t, e) {
|
|
e = e || this.renderer.shader.shader;
|
|
var i = this.gl,
|
|
n = t.glVertexArrayObjects[this.CONTEXT_UID];
|
|
n || (this.managedGeometries[t.id] = t, t.disposeRunner.add(this), t.glVertexArrayObjects[this.CONTEXT_UID] = n = {});
|
|
var r = n[e.program.id] || this.initGeometryVao(t, e.program);
|
|
this._activeGeometry = t,
|
|
this._activeVao !== r && (this._activeVao = r, this.hasVao ? i.bindVertexArray(r) : this.activateVao(t, e.program)),
|
|
this.updateBuffers()
|
|
},
|
|
e.prototype.reset = function () {
|
|
this.unbind()
|
|
},
|
|
e.prototype.updateBuffers = function () {
|
|
for (var t = this._activeGeometry, e = this.gl, i = 0; i < t.buffers.length; i++) {
|
|
var n = t.buffers[i],
|
|
r = n._glBuffers[this.CONTEXT_UID];
|
|
if (n._updateID !== r.updateID) {
|
|
r.updateID = n._updateID;
|
|
var o = n.index ? e.ELEMENT_ARRAY_BUFFER : e.ARRAY_BUFFER;
|
|
if (e.bindBuffer(o, r.buffer), this._boundBuffer = r, r.byteLength >= n.data.byteLength)
|
|
e.bufferSubData(o, 0, n.data);
|
|
else {
|
|
var s = n.static ? e.STATIC_DRAW : e.DYNAMIC_DRAW;
|
|
r.byteLength = n.data.byteLength,
|
|
e.bufferData(o, n.data, s)
|
|
}
|
|
}
|
|
}
|
|
},
|
|
e.prototype.checkCompatibility = function (t, e) {
|
|
var i = t.attributes,
|
|
n = e.attributeData;
|
|
for (var r in n)
|
|
if (!i[r])
|
|
throw new Error('shader and geometry incompatible, geometry missing the "' + r + '" attribute')
|
|
},
|
|
e.prototype.getSignature = function (t, e) {
|
|
var i = t.attributes,
|
|
n = e.attributeData,
|
|
r = ["g", t.id];
|
|
for (var o in i)
|
|
n[o] && r.push(o);
|
|
return r.join("-")
|
|
},
|
|
e.prototype.initGeometryVao = function (t, e) {
|
|
this.checkCompatibility(t, e);
|
|
var i = this.gl,
|
|
n = this.CONTEXT_UID,
|
|
r = this.getSignature(t, e),
|
|
o = t.glVertexArrayObjects[this.CONTEXT_UID],
|
|
s = o[r];
|
|
if (s)
|
|
return o[e.id] = s, s;
|
|
var a = t.buffers,
|
|
h = t.attributes,
|
|
l = {},
|
|
u = {};
|
|
for (var c in a)
|
|
l[c] = 0, u[c] = 0;
|
|
for (var p in h)
|
|
!h[p].size && e.attributeData[p] ? h[p].size = e.attributeData[p].size : h[p].size || console.warn("PIXI Geometry attribute '" + p + "' size cannot be determined (likely the bound shader does not have the attribute)"), l[h[p].buffer] += h[p].size * rt[h[p].type];
|
|
for (var d in h) {
|
|
var f = h[d],
|
|
_ = f.size;
|
|
void 0 === f.stride && (l[f.buffer] === _ * rt[f.type] ? f.stride = 0 : f.stride = l[f.buffer]),
|
|
void 0 === f.start && (f.start = u[f.buffer], u[f.buffer] += _ * rt[f.type])
|
|
}
|
|
s = i.createVertexArray(),
|
|
i.bindVertexArray(s);
|
|
for (var m = 0; m < a.length; m++) {
|
|
var y = a[m];
|
|
y._glBuffers[n] || (y._glBuffers[n] = new nt(i.createBuffer()), this.managedBuffers[y.id] = y, y.disposeRunner.add(this)),
|
|
y._glBuffers[n].refCount++
|
|
}
|
|
return this.activateVao(t, e),
|
|
this._activeVao = s,
|
|
o[e.id] = s,
|
|
o[r] = s,
|
|
s
|
|
},
|
|
e.prototype.disposeBuffer = function (t, e) {
|
|
if (this.managedBuffers[t.id]) {
|
|
delete this.managedBuffers[t.id];
|
|
var i = t._glBuffers[this.CONTEXT_UID],
|
|
n = this.gl;
|
|
t.disposeRunner.remove(this),
|
|
i && (e || n.deleteBuffer(i.buffer), delete t._glBuffers[this.CONTEXT_UID])
|
|
}
|
|
},
|
|
e.prototype.disposeGeometry = function (t, e) {
|
|
if (this.managedGeometries[t.id]) {
|
|
delete this.managedGeometries[t.id];
|
|
var i = t.glVertexArrayObjects[this.CONTEXT_UID],
|
|
n = this.gl,
|
|
r = t.buffers;
|
|
if (t.disposeRunner.remove(this), i) {
|
|
for (var o = 0; o < r.length; o++) {
|
|
var s = r[o]._glBuffers[this.CONTEXT_UID];
|
|
s.refCount--,
|
|
0 !== s.refCount || e || this.disposeBuffer(r[o], e)
|
|
}
|
|
if (!e)
|
|
for (var a in i)
|
|
if ("g" === a[0]) {
|
|
var h = i[a];
|
|
this._activeVao === h && this.unbind(),
|
|
n.deleteVertexArray(h)
|
|
}
|
|
delete t.glVertexArrayObjects[this.CONTEXT_UID]
|
|
}
|
|
}
|
|
},
|
|
e.prototype.disposeAll = function (t) {
|
|
for (var e = Object.keys(this.managedGeometries), i = 0; i < e.length; i++)
|
|
this.disposeGeometry(this.managedGeometries[e[i]], t);
|
|
e = Object.keys(this.managedBuffers);
|
|
for (var n = 0; n < e.length; n++)
|
|
this.disposeBuffer(this.managedBuffers[e[n]], t)
|
|
},
|
|
e.prototype.activateVao = function (t, e) {
|
|
var i = this.gl,
|
|
n = this.CONTEXT_UID,
|
|
r = t.buffers,
|
|
o = t.attributes;
|
|
t.indexBuffer && i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, t.indexBuffer._glBuffers[n].buffer);
|
|
var s = null;
|
|
for (var a in o) {
|
|
var h = o[a],
|
|
l = r[h.buffer]._glBuffers[n];
|
|
if (e.attributeData[a]) {
|
|
s !== l && (i.bindBuffer(i.ARRAY_BUFFER, l.buffer), s = l);
|
|
var u = e.attributeData[a].location;
|
|
if (i.enableVertexAttribArray(u), i.vertexAttribPointer(u, h.size, h.type || i.FLOAT, h.normalized, h.stride, h.start), h.instance) {
|
|
if (!this.hasInstance)
|
|
throw new Error("geometry error, GPU Instancing is not supported on this device");
|
|
i.vertexAttribDivisor(u, 1)
|
|
}
|
|
}
|
|
}
|
|
},
|
|
e.prototype.draw = function (t, e, i, n) {
|
|
var r = this.gl,
|
|
o = this._activeGeometry;
|
|
if (o.indexBuffer) {
|
|
var s = o.indexBuffer.data.BYTES_PER_ELEMENT,
|
|
a = 2 === s ? r.UNSIGNED_SHORT : r.UNSIGNED_INT;
|
|
2 === s || 4 === s && this.canUseUInt32ElementIndex ? o.instanced ? r.drawElementsInstanced(t, e || o.indexBuffer.data.length, a, (i || 0) * s, n || 1) : r.drawElements(t, e || o.indexBuffer.data.length, a, (i || 0) * s) : console.warn("unsupported index buffer type: uint32")
|
|
} else
|
|
o.instanced ? r.drawArraysInstanced(t, i, e || o.getSize(), n || 1) : r.drawArrays(t, i, e || o.getSize());
|
|
return this
|
|
},
|
|
e.prototype.unbind = function () {
|
|
this.gl.bindVertexArray(null),
|
|
this._activeVao = null,
|
|
this._activeGeometry = null
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
st = function (t) {
|
|
this.type = o.MASK_TYPES.NONE,
|
|
this.autoDetect = !0,
|
|
this.maskObject = t || null,
|
|
this.pooled = !1,
|
|
this.isMaskData = !0,
|
|
this._stencilCounter = 0,
|
|
this._scissorCounter = 0,
|
|
this._scissorRect = null,
|
|
this._target = null
|
|
};
|
|
function at(t, e, i, n) {
|
|
var r = ht(t, t.VERTEX_SHADER, e),
|
|
o = ht(t, t.FRAGMENT_SHADER, i),
|
|
s = t.createProgram();
|
|
if (t.attachShader(s, r), t.attachShader(s, o), n)
|
|
for (var a in n)
|
|
t.bindAttribLocation(s, n[a], a);
|
|
return t.linkProgram(s),
|
|
t.getProgramParameter(s, t.LINK_STATUS) || (t.getShaderParameter(r, t.COMPILE_STATUS) || (console.warn(e), console.error(t.getShaderInfoLog(r))), t.getShaderParameter(o, t.COMPILE_STATUS) || (console.warn(i), console.error(t.getShaderInfoLog(o))), console.error("Pixi.js Error: Could not initialize shader."), console.error("gl.VALIDATE_STATUS", t.getProgramParameter(s, t.VALIDATE_STATUS)), console.error("gl.getError()", t.getError()), "" !== t.getProgramInfoLog(s) && console.warn("Pixi.js Warning: gl.getProgramInfoLog()", t.getProgramInfoLog(s)), t.deleteProgram(s), s = null),
|
|
t.deleteShader(r),
|
|
t.deleteShader(o),
|
|
s
|
|
}
|
|
function ht(t, e, i) {
|
|
var n = t.createShader(e);
|
|
return t.shaderSource(n, i),
|
|
t.compileShader(n),
|
|
n
|
|
}
|
|
function lt(t, e) {
|
|
switch (t) {
|
|
case "float":
|
|
return 0;
|
|
case "vec2":
|
|
return new Float32Array(2 * e);
|
|
case "vec3":
|
|
return new Float32Array(3 * e);
|
|
case "vec4":
|
|
return new Float32Array(4 * e);
|
|
case "int":
|
|
case "sampler2D":
|
|
case "sampler2DArray":
|
|
return 0;
|
|
case "ivec2":
|
|
return new Int32Array(2 * e);
|
|
case "ivec3":
|
|
return new Int32Array(3 * e);
|
|
case "ivec4":
|
|
return new Int32Array(4 * e);
|
|
case "bool":
|
|
return !1;
|
|
case "bvec2":
|
|
return ut(2 * e);
|
|
case "bvec3":
|
|
return ut(3 * e);
|
|
case "bvec4":
|
|
return ut(4 * e);
|
|
case "mat2":
|
|
return new Float32Array([1, 0, 0, 1]);
|
|
case "mat3":
|
|
return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
|
case "mat4":
|
|
return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
|
|
}
|
|
return null
|
|
}
|
|
function ut(t) {
|
|
for (var e = new Array(t), i = 0; i < e.length; i++)
|
|
e[i] = !1;
|
|
return e
|
|
}
|
|
i.MaskData = st,
|
|
st.prototype.reset = function () {
|
|
this.pooled && (this.maskObject = null, this.type = o.MASK_TYPES.NONE, this.autoDetect = !0),
|
|
this._target = null
|
|
},
|
|
st.prototype.copyCountersOrReset = function (t) {
|
|
t ? (this._stencilCounter = t._stencilCounter, this._scissorCounter = t._scissorCounter, this._scissorRect = t._scissorRect) : (this._stencilCounter = 0, this._scissorCounter = 0, this._scissorRect = null)
|
|
};
|
|
var ct,
|
|
pt = {},
|
|
dt = pt;
|
|
function ft() {
|
|
if (dt === pt || dt && dt.isContextLost()) {
|
|
var t,
|
|
e = document.createElement("canvas");
|
|
s.settings.PREFER_ENV >= o.ENV.WEBGL2 && (t = e.getContext("webgl2", {})),
|
|
t || ((t = e.getContext("webgl", {}) || e.getContext("experimental-webgl", {})) ? t.getExtension("WEBGL_draw_buffers") : t = null),
|
|
dt = t
|
|
}
|
|
return dt
|
|
}
|
|
function _t(t, e, i) {
|
|
if ("precision" !== t.substring(0, 9)) {
|
|
var n = e;
|
|
return e === o.PRECISION.HIGH && i !== o.PRECISION.HIGH && (n = o.PRECISION.MEDIUM),
|
|
"precision " + n + " float;\n" + t
|
|
}
|
|
return i !== o.PRECISION.HIGH && "precision highp" === t.substring(0, 15) ? t.replace("precision highp", "precision mediump") : t
|
|
}
|
|
var mt = {
|
|
float: 1,
|
|
vec2: 2,
|
|
vec3: 3,
|
|
vec4: 4,
|
|
int: 1,
|
|
ivec2: 2,
|
|
ivec3: 3,
|
|
ivec4: 4,
|
|
bool: 1,
|
|
bvec2: 2,
|
|
bvec3: 3,
|
|
bvec4: 4,
|
|
mat2: 4,
|
|
mat3: 9,
|
|
mat4: 16,
|
|
sampler2D: 1
|
|
};
|
|
function yt(t) {
|
|
return mt[t]
|
|
}
|
|
var gt = null,
|
|
vt = {
|
|
FLOAT: "float",
|
|
FLOAT_VEC2: "vec2",
|
|
FLOAT_VEC3: "vec3",
|
|
FLOAT_VEC4: "vec4",
|
|
INT: "int",
|
|
INT_VEC2: "ivec2",
|
|
INT_VEC3: "ivec3",
|
|
INT_VEC4: "ivec4",
|
|
BOOL: "bool",
|
|
BOOL_VEC2: "bvec2",
|
|
BOOL_VEC3: "bvec3",
|
|
BOOL_VEC4: "bvec4",
|
|
FLOAT_MAT2: "mat2",
|
|
FLOAT_MAT3: "mat3",
|
|
FLOAT_MAT4: "mat4",
|
|
SAMPLER_2D: "sampler2D",
|
|
SAMPLER_CUBE: "samplerCube",
|
|
SAMPLER_2D_ARRAY: "sampler2DArray"
|
|
};
|
|
function wt(t, e) {
|
|
if (!gt) {
|
|
var i = Object.keys(vt);
|
|
gt = {};
|
|
for (var n = 0; n < i.length; ++n) {
|
|
var r = i[n];
|
|
gt[t[r]] = vt[r]
|
|
}
|
|
}
|
|
return gt[e]
|
|
}
|
|
var xt = {
|
|
float: "\n if(cv !== v)\n {\n cv.v = v;\n gl.uniform1f(location, v)\n }",
|
|
vec2: "\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1])\n }",
|
|
vec3: "\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",
|
|
vec4: "gl.uniform4f(location, v[0], v[1], v[2], v[3])",
|
|
int: "gl.uniform1i(location, v)",
|
|
ivec2: "gl.uniform2i(location, v[0], v[1])",
|
|
ivec3: "gl.uniform3i(location, v[0], v[1], v[2])",
|
|
ivec4: "gl.uniform4i(location, v[0], v[1], v[2], v[3])",
|
|
bool: "gl.uniform1i(location, v)",
|
|
bvec2: "gl.uniform2i(location, v[0], v[1])",
|
|
bvec3: "gl.uniform3i(location, v[0], v[1], v[2])",
|
|
bvec4: "gl.uniform4i(location, v[0], v[1], v[2], v[3])",
|
|
mat2: "gl.uniformMatrix2fv(location, false, v)",
|
|
mat3: "gl.uniformMatrix3fv(location, false, v)",
|
|
mat4: "gl.uniformMatrix4fv(location, false, v)",
|
|
sampler2D: "gl.uniform1i(location, v)",
|
|
samplerCube: "gl.uniform1i(location, v)",
|
|
sampler2DArray: "gl.uniform1i(location, v)"
|
|
},
|
|
bt = {
|
|
float: "gl.uniform1fv(location, v)",
|
|
vec2: "gl.uniform2fv(location, v)",
|
|
vec3: "gl.uniform3fv(location, v)",
|
|
vec4: "gl.uniform4fv(location, v)",
|
|
mat4: "gl.uniformMatrix4fv(location, false, v)",
|
|
mat3: "gl.uniformMatrix3fv(location, false, v)",
|
|
mat2: "gl.uniformMatrix2fv(location, false, v)",
|
|
int: "gl.uniform1iv(location, v)",
|
|
ivec2: "gl.uniform2iv(location, v)",
|
|
ivec3: "gl.uniform3iv(location, v)",
|
|
ivec4: "gl.uniform4iv(location, v)",
|
|
bool: "gl.uniform1iv(location, v)",
|
|
bvec2: "gl.uniform2iv(location, v)",
|
|
bvec3: "gl.uniform3iv(location, v)",
|
|
bvec4: "gl.uniform4iv(location, v)",
|
|
sampler2D: "gl.uniform1iv(location, v)",
|
|
samplerCube: "gl.uniform1iv(location, v)",
|
|
sampler2DArray: "gl.uniform1iv(location, v)"
|
|
};
|
|
var Et,
|
|
$t = ["precision mediump float;", "void main(void){", "float test = 0.1;", "%forloop%", "gl_FragColor = vec4(0.0);", "}"].join("\n");
|
|
function At(t, e) {
|
|
if (0 === t)
|
|
throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");
|
|
for (var i = e.createShader(e.FRAGMENT_SHADER); ; ) {
|
|
var n = $t.replace(/%forloop%/gi, St(t));
|
|
if (e.shaderSource(i, n), e.compileShader(i), e.getShaderParameter(i, e.COMPILE_STATUS))
|
|
break;
|
|
t = t / 2 | 0
|
|
}
|
|
return t
|
|
}
|
|
function St(t) {
|
|
for (var e = "", i = 0; i < t; ++i)
|
|
i > 0 && (e += "\nelse "), i < t - 1 && (e += "if(test == " + i + ".0){}");
|
|
return e
|
|
}
|
|
var Tt = 0,
|
|
Ct = {},
|
|
Mt = function t(e, i, n) {
|
|
void 0 === n && (n = "pixi-shader"),
|
|
this.id = Tt++,
|
|
this.vertexSrc = e || t.defaultVertexSrc,
|
|
this.fragmentSrc = i || t.defaultFragmentSrc,
|
|
this.vertexSrc = this.vertexSrc.trim(),
|
|
this.fragmentSrc = this.fragmentSrc.trim(),
|
|
"#version" !== this.vertexSrc.substring(0, 8) && (n = n.replace(/\s+/g, "-"), Ct[n] ? (Ct[n]++, n += "-" + Ct[n]) : Ct[n] = 1, this.vertexSrc = "#define SHADER_NAME " + n + "\n" + this.vertexSrc, this.fragmentSrc = "#define SHADER_NAME " + n + "\n" + this.fragmentSrc, this.vertexSrc = _t(this.vertexSrc, s.settings.PRECISION_VERTEX, o.PRECISION.HIGH), this.fragmentSrc = _t(this.fragmentSrc, s.settings.PRECISION_FRAGMENT, function () {
|
|
if (!ct) {
|
|
ct = o.PRECISION.MEDIUM;
|
|
var t = ft();
|
|
if (t && t.getShaderPrecisionFormat) {
|
|
var e = t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT);
|
|
ct = e.precision ? o.PRECISION.HIGH : o.PRECISION.MEDIUM
|
|
}
|
|
}
|
|
return ct
|
|
}
|
|
())),
|
|
this.extractData(this.vertexSrc, this.fragmentSrc),
|
|
this.glPrograms = {},
|
|
this.syncUniforms = null
|
|
};
|
|
i.Program = Mt;
|
|
var It = {
|
|
defaultVertexSrc: {
|
|
configurable: !0
|
|
},
|
|
defaultFragmentSrc: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
Mt.prototype.extractData = function (t, e) {
|
|
var i = ft();
|
|
if (i) {
|
|
var n = at(i, t, e);
|
|
this.attributeData = this.getAttributeData(n, i),
|
|
this.uniformData = this.getUniformData(n, i),
|
|
i.deleteProgram(n)
|
|
} else
|
|
this.uniformData = {},
|
|
this.attributeData = {}
|
|
},
|
|
Mt.prototype.getAttributeData = function (t, e) {
|
|
for (var i = {}, n = [], r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
|
|
var s = e.getActiveAttrib(t, o),
|
|
a = wt(e, s.type),
|
|
h = {
|
|
type: a,
|
|
name: s.name,
|
|
size: yt(a),
|
|
location: 0
|
|
};
|
|
i[s.name] = h,
|
|
n.push(h)
|
|
}
|
|
n.sort((function (t, e) {
|
|
return t.name > e.name ? 1 : -1
|
|
}));
|
|
for (var l = 0; l < n.length; l++)
|
|
n[l].location = l;
|
|
return i
|
|
},
|
|
Mt.prototype.getUniformData = function (t, e) {
|
|
for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
|
|
var o = e.getActiveUniform(t, r),
|
|
s = o.name.replace(/\[.*?\]/, ""),
|
|
a = o.name.match(/\[.*?\]/, ""),
|
|
h = wt(e, o.type);
|
|
i[s] = {
|
|
type: h,
|
|
size: o.size,
|
|
isArray: a,
|
|
value: lt(h, o.size)
|
|
}
|
|
}
|
|
return i
|
|
},
|
|
It.defaultVertexSrc.get = function () {
|
|
return "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"
|
|
},
|
|
It.defaultFragmentSrc.get = function () {
|
|
return "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"
|
|
},
|
|
Mt.from = function (t, e, i) {
|
|
var n = t + e,
|
|
o = r.ProgramCache[n];
|
|
return o || (r.ProgramCache[n] = o = new Mt(t, e, i)),
|
|
o
|
|
},
|
|
Object.defineProperties(Mt, It);
|
|
var Pt = function (t, e) {
|
|
for (var i in this.program = t, this.uniformGroup = e ? e instanceof q ? e : new q(e) : new q({}), t.uniformData)
|
|
this.uniformGroup.uniforms[i]instanceof Array && (this.uniformGroup.uniforms[i] = new Float32Array(this.uniformGroup.uniforms[i]))
|
|
};
|
|
i.Shader = Pt;
|
|
var Ot = {
|
|
uniforms: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
Pt.prototype.checkUniformExists = function (t, e) {
|
|
if (e.uniforms[t])
|
|
return !0;
|
|
for (var i in e.uniforms) {
|
|
var n = e.uniforms[i];
|
|
if (n.group && this.checkUniformExists(t, n))
|
|
return !0
|
|
}
|
|
return !1
|
|
},
|
|
Pt.prototype.destroy = function () {
|
|
this.uniformGroup = null
|
|
},
|
|
Ot.uniforms.get = function () {
|
|
return this.uniformGroup.uniforms
|
|
},
|
|
Pt.from = function (t, e, i) {
|
|
var n = Mt.from(t, e);
|
|
return new Pt(n, i)
|
|
},
|
|
Object.defineProperties(Pt.prototype, Ot);
|
|
var Rt = function () {
|
|
this.data = 0,
|
|
this.blendMode = o.BLEND_MODES.NORMAL,
|
|
this.polygonOffset = 0,
|
|
this.blend = !0
|
|
};
|
|
i.State = Rt;
|
|
var Dt = {
|
|
blend: {
|
|
configurable: !0
|
|
},
|
|
offsets: {
|
|
configurable: !0
|
|
},
|
|
culling: {
|
|
configurable: !0
|
|
},
|
|
depthTest: {
|
|
configurable: !0
|
|
},
|
|
clockwiseFrontFace: {
|
|
configurable: !0
|
|
},
|
|
blendMode: {
|
|
configurable: !0
|
|
},
|
|
polygonOffset: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
Dt.blend.get = function () {
|
|
return !!(1 & this.data)
|
|
},
|
|
Dt.blend.set = function (t) {
|
|
!!(1 & this.data) !== t && (this.data ^= 1)
|
|
},
|
|
Dt.offsets.get = function () {
|
|
return !!(2 & this.data)
|
|
},
|
|
Dt.offsets.set = function (t) {
|
|
!!(2 & this.data) !== t && (this.data ^= 2)
|
|
},
|
|
Dt.culling.get = function () {
|
|
return !!(4 & this.data)
|
|
},
|
|
Dt.culling.set = function (t) {
|
|
!!(4 & this.data) !== t && (this.data ^= 4)
|
|
},
|
|
Dt.depthTest.get = function () {
|
|
return !!(8 & this.data)
|
|
},
|
|
Dt.depthTest.set = function (t) {
|
|
!!(8 & this.data) !== t && (this.data ^= 8)
|
|
},
|
|
Dt.clockwiseFrontFace.get = function () {
|
|
return !!(16 & this.data)
|
|
},
|
|
Dt.clockwiseFrontFace.set = function (t) {
|
|
!!(16 & this.data) !== t && (this.data ^= 16)
|
|
},
|
|
Dt.blendMode.get = function () {
|
|
return this._blendMode
|
|
},
|
|
Dt.blendMode.set = function (t) {
|
|
this.blend = t !== o.BLEND_MODES.NONE,
|
|
this._blendMode = t
|
|
},
|
|
Dt.polygonOffset.get = function () {
|
|
return this._polygonOffset
|
|
},
|
|
Dt.polygonOffset.set = function (t) {
|
|
this.offsets = !!t,
|
|
this._polygonOffset = t
|
|
},
|
|
Rt.for2d = function () {
|
|
var t = new Rt;
|
|
return t.depthTest = !1,
|
|
t.blend = !0,
|
|
t
|
|
},
|
|
Object.defineProperties(Rt.prototype, Dt);
|
|
var Lt = function (t) {
|
|
function e(i, n, r) {
|
|
var o = Mt.from(i || e.defaultVertexSrc, n || e.defaultFragmentSrc);
|
|
t.call(this, o, r),
|
|
this.padding = 0,
|
|
this.resolution = s.settings.FILTER_RESOLUTION,
|
|
this.enabled = !0,
|
|
this.autoFit = !0,
|
|
this.legacy = !!this.program.attributeData.aTextureCoord,
|
|
this.state = new Rt
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
blendMode: {
|
|
configurable: !0
|
|
}
|
|
},
|
|
n = {
|
|
defaultVertexSrc: {
|
|
configurable: !0
|
|
},
|
|
defaultFragmentSrc: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.apply = function (t, e, i, n, r) {
|
|
t.applyFilter(this, e, i, n, r)
|
|
},
|
|
i.blendMode.get = function () {
|
|
return this.state.blendMode
|
|
},
|
|
i.blendMode.set = function (t) {
|
|
this.state.blendMode = t
|
|
},
|
|
n.defaultVertexSrc.get = function () {
|
|
return "attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"
|
|
},
|
|
n.defaultFragmentSrc.get = function () {
|
|
return "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
Object.defineProperties(e, n),
|
|
e
|
|
}
|
|
(Pt);
|
|
i.Filter = Lt,
|
|
Lt.SOURCE_KEY_MAP = {};
|
|
var kt = new h.Matrix,
|
|
Ft = function (t, e) {
|
|
this._texture = t,
|
|
this.mapCoord = new h.Matrix,
|
|
this.uClampFrame = new Float32Array(4),
|
|
this.uClampOffset = new Float32Array(2),
|
|
this._updateID = -1,
|
|
this.clampOffset = 0,
|
|
this.clampMargin = void 0 === e ? .5 : e,
|
|
this.isSimple = !1
|
|
};
|
|
i.TextureMatrix = Ft;
|
|
var Nt = {
|
|
texture: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
Nt.texture.get = function () {
|
|
return this._texture
|
|
},
|
|
Nt.texture.set = function (t) {
|
|
this._texture = t,
|
|
this._updateID = -1
|
|
},
|
|
Ft.prototype.multiplyUvs = function (t, e) {
|
|
void 0 === e && (e = t);
|
|
for (var i = this.mapCoord, n = 0; n < t.length; n += 2) {
|
|
var r = t[n],
|
|
o = t[n + 1];
|
|
e[n] = r * i.a + o * i.c + i.tx,
|
|
e[n + 1] = r * i.b + o * i.d + i.ty
|
|
}
|
|
return e
|
|
},
|
|
Ft.prototype.update = function (t) {
|
|
var e = this._texture;
|
|
if (!e || !e.valid)
|
|
return !1;
|
|
if (!t && this._updateID === e._updateID)
|
|
return !1;
|
|
this._updateID = e._updateID;
|
|
var i = e._uvs;
|
|
this.mapCoord.set(i.x1 - i.x0, i.y1 - i.y0, i.x3 - i.x0, i.y3 - i.y0, i.x0, i.y0);
|
|
var n = e.orig,
|
|
r = e.trim;
|
|
r && (kt.set(n.width / r.width, 0, 0, n.height / r.height, -r.x / r.width, -r.y / r.height), this.mapCoord.append(kt));
|
|
var o = e.baseTexture,
|
|
s = this.uClampFrame,
|
|
a = this.clampMargin / o.resolution,
|
|
h = this.clampOffset;
|
|
return s[0] = (e._frame.x + a + h) / o.width,
|
|
s[1] = (e._frame.y + a + h) / o.height,
|
|
s[2] = (e._frame.x + e._frame.width - a + h) / o.width,
|
|
s[3] = (e._frame.y + e._frame.height - a + h) / o.height,
|
|
this.uClampOffset[0] = h / o.realWidth,
|
|
this.uClampOffset[1] = h / o.realHeight,
|
|
this.isSimple = e._frame.width === o.width && e._frame.height === o.height && 0 === e.rotate,
|
|
!0
|
|
},
|
|
Object.defineProperties(Ft.prototype, Nt);
|
|
var Bt = function (t) {
|
|
function e(e) {
|
|
var i = new h.Matrix;
|
|
t.call(this, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n", "varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n"),
|
|
e.renderable = !1,
|
|
this.maskSprite = e,
|
|
this.maskMatrix = i
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.apply = function (t, e, i, n) {
|
|
var r = this.maskSprite,
|
|
o = this.maskSprite.texture;
|
|
o.valid && (o.transform || (o.transform = new Ft(o, 0)), o.transform.update(), this.uniforms.npmAlpha = o.baseTexture.alphaMode ? 0 : 1, this.uniforms.mask = o, this.uniforms.otherMatrix = t.calculateSpriteMatrix(this.maskMatrix, r).prepend(o.transform.mapCoord), this.uniforms.alpha = r.worldAlpha, this.uniforms.maskClamp = o.transform.uClampFrame, t.applyFilter(this, e, i, n))
|
|
},
|
|
e
|
|
}
|
|
(Lt);
|
|
i.SpriteMaskFilter = Bt;
|
|
var Ut = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.scissorRenderTarget = null,
|
|
this.enableScissor = !1,
|
|
this.alphaMaskPool = [],
|
|
this.maskDataPool = [],
|
|
this.maskStack = [],
|
|
this.alphaMaskIndex = 0
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.setMaskStack = function (t) {
|
|
this.maskStack = t,
|
|
this.renderer.scissor.setMaskStack(t),
|
|
this.renderer.stencil.setMaskStack(t)
|
|
},
|
|
e.prototype.push = function (t, e) {
|
|
if (!e.isMaskData) {
|
|
var i = this.maskDataPool.pop() || new st;
|
|
i.pooled = !0,
|
|
i.maskObject = e,
|
|
e = i
|
|
}
|
|
switch (e.autoDetect && this.detect(e), e.copyCountersOrReset(this.maskStack[this.maskStack.length - 1]), e._target = t, e.type) {
|
|
case o.MASK_TYPES.SCISSOR:
|
|
this.maskStack.push(e),
|
|
this.renderer.scissor.push(e);
|
|
break;
|
|
case o.MASK_TYPES.STENCIL:
|
|
this.maskStack.push(e),
|
|
this.renderer.stencil.push(e);
|
|
break;
|
|
case o.MASK_TYPES.SPRITE:
|
|
e.copyCountersOrReset(null),
|
|
this.pushSpriteMask(e),
|
|
this.maskStack.push(e)
|
|
}
|
|
},
|
|
e.prototype.pop = function (t) {
|
|
var e = this.maskStack.pop();
|
|
if (e && e._target === t) {
|
|
switch (e.type) {
|
|
case o.MASK_TYPES.SCISSOR:
|
|
this.renderer.scissor.pop();
|
|
break;
|
|
case o.MASK_TYPES.STENCIL:
|
|
this.renderer.stencil.pop(e.maskObject);
|
|
break;
|
|
case o.MASK_TYPES.SPRITE:
|
|
this.popSpriteMask()
|
|
}
|
|
e.reset(),
|
|
e.pooled && this.maskDataPool.push(e)
|
|
}
|
|
},
|
|
e.prototype.detect = function (t) {
|
|
var e = t.maskObject;
|
|
if (e.isSprite)
|
|
t.type = o.MASK_TYPES.SPRITE;
|
|
else if (t.type = o.MASK_TYPES.STENCIL, this.enableScissor && e.isFastRect && e.isFastRect()) {
|
|
var i = e.worldTransform,
|
|
n = Math.atan2(i.b, i.a),
|
|
r = Math.atan2(i.d, i.c);
|
|
n = Math.round(n * (180 / Math.PI) * 100),
|
|
r = ((r = Math.round(r * (180 / Math.PI) * 100) - n) % 18e3 + 18e3) % 18e3,
|
|
0 === (n = (n % 9e3 + 9e3) % 9e3) && 9e3 === r && (t.type = o.MASK_TYPES.SCISSOR)
|
|
}
|
|
},
|
|
e.prototype.pushSpriteMask = function (t) {
|
|
var e = t.maskObject,
|
|
i = t._target,
|
|
n = this.alphaMaskPool[this.alphaMaskIndex];
|
|
n || (n = this.alphaMaskPool[this.alphaMaskIndex] = [new Bt(e)]),
|
|
n[0].resolution = this.renderer.resolution,
|
|
n[0].maskSprite = e;
|
|
var r = i.filterArea;
|
|
i.filterArea = e.getBounds(!0),
|
|
this.renderer.filter.push(i, n),
|
|
i.filterArea = r,
|
|
this.alphaMaskIndex++
|
|
},
|
|
e.prototype.popSpriteMask = function () {
|
|
this.renderer.filter.pop(),
|
|
this.alphaMaskIndex--
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
Xt = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.maskStack = [],
|
|
this.glConst = 0
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.getStackLength = function () {
|
|
return this.maskStack.length
|
|
},
|
|
e.prototype.setMaskStack = function (t) {
|
|
var e = this.renderer.gl,
|
|
i = this.getStackLength();
|
|
this.maskStack = t;
|
|
var n = this.getStackLength();
|
|
n !== i && (0 === n ? e.disable(this.glConst) : (e.enable(this.glConst), this._useCurrent()))
|
|
},
|
|
e.prototype._useCurrent = function () {},
|
|
e.prototype.destroy = function () {
|
|
t.prototype.destroy.call(this, this),
|
|
this.maskStack = null
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
jt = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.glConst = WebGLRenderingContext.SCISSOR_TEST
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.getStackLength = function () {
|
|
var t = this.maskStack[this.maskStack.length - 1];
|
|
return t ? t._scissorCounter : 0
|
|
},
|
|
e.prototype.push = function (t) {
|
|
var e = t.maskObject;
|
|
e.renderable = !0;
|
|
var i = t._scissorRect,
|
|
n = e.getBounds(!0),
|
|
r = this.renderer.gl;
|
|
e.renderable = !1,
|
|
i ? n.fit(i) : r.enable(r.SCISSOR_TEST),
|
|
t._scissorCounter++,
|
|
t._scissorRect = n,
|
|
this._useCurrent()
|
|
},
|
|
e.prototype.pop = function () {
|
|
var t = this.renderer.gl;
|
|
this.getStackLength() > 0 ? this._useCurrent() : t.disable(t.SCISSOR_TEST)
|
|
},
|
|
e.prototype._useCurrent = function () {
|
|
var t = this.maskStack[this.maskStack.length - 1]._scissorRect,
|
|
e = this.renderer.renderTexture.current,
|
|
i = this.renderer.projection,
|
|
n = i.transform,
|
|
r = i.sourceFrame,
|
|
o = i.destinationFrame,
|
|
s = e ? e.resolution : this.renderer.resolution,
|
|
a = (t.x - r.x) * s + o.x,
|
|
h = (t.y - r.y) * s + o.y,
|
|
l = t.width * s,
|
|
u = t.height * s;
|
|
n && (a += n.tx * s, h += n.ty * s),
|
|
e || (h = this.renderer.height - u - h),
|
|
this.renderer.gl.scissor(a, h, l, u)
|
|
},
|
|
e
|
|
}
|
|
(Xt),
|
|
Vt = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.glConst = WebGLRenderingContext.STENCIL_TEST
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.getStackLength = function () {
|
|
var t = this.maskStack[this.maskStack.length - 1];
|
|
return t ? t._stencilCounter : 0
|
|
},
|
|
e.prototype.push = function (t) {
|
|
var e = t.maskObject,
|
|
i = this.renderer.gl,
|
|
n = t._stencilCounter;
|
|
0 === n && (this.renderer.framebuffer.forceStencil(), i.enable(i.STENCIL_TEST)),
|
|
t._stencilCounter++,
|
|
i.colorMask(!1, !1, !1, !1),
|
|
i.stencilFunc(i.EQUAL, n, this._getBitwiseMask()),
|
|
i.stencilOp(i.KEEP, i.KEEP, i.INCR),
|
|
e.renderable = !0,
|
|
e.render(this.renderer),
|
|
this.renderer.batch.flush(),
|
|
e.renderable = !1,
|
|
this._useCurrent()
|
|
},
|
|
e.prototype.pop = function (t) {
|
|
var e = this.renderer.gl;
|
|
0 === this.getStackLength() ? (e.disable(e.STENCIL_TEST), e.clear(e.STENCIL_BUFFER_BIT), e.clearStencil(0)) : (e.colorMask(!1, !1, !1, !1), e.stencilOp(e.KEEP, e.KEEP, e.DECR), t.renderable = !0, t.render(this.renderer), this.renderer.batch.flush(), t.renderable = !1, this._useCurrent())
|
|
},
|
|
e.prototype._useCurrent = function () {
|
|
var t = this.renderer.gl;
|
|
t.colorMask(!0, !0, !0, !0),
|
|
t.stencilFunc(t.EQUAL, this.getStackLength(), this._getBitwiseMask()),
|
|
t.stencilOp(t.KEEP, t.KEEP, t.KEEP)
|
|
},
|
|
e.prototype._getBitwiseMask = function () {
|
|
return (1 << this.getStackLength()) - 1
|
|
},
|
|
e
|
|
}
|
|
(Xt),
|
|
Ht = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.destinationFrame = null,
|
|
this.sourceFrame = null,
|
|
this.defaultFrame = null,
|
|
this.projectionMatrix = new h.Matrix,
|
|
this.transform = null
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.update = function (t, e, i, n) {
|
|
this.destinationFrame = t || this.destinationFrame || this.defaultFrame,
|
|
this.sourceFrame = e || this.sourceFrame || t,
|
|
this.calculateProjection(this.destinationFrame, this.sourceFrame, i, n),
|
|
this.transform && this.projectionMatrix.append(this.transform);
|
|
var r = this.renderer;
|
|
r.globalUniforms.uniforms.projectionMatrix = this.projectionMatrix,
|
|
r.globalUniforms.update(),
|
|
r.shader.shader && r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)
|
|
},
|
|
e.prototype.calculateProjection = function (t, e, i, n) {
|
|
var r = this.projectionMatrix;
|
|
n ? (r.a = 1 / t.width * 2 * i, r.d = -1 / t.height * 2 * i, r.tx = -1 - e.x * r.a, r.ty = 1 - e.y * r.d) : (r.a = 1 / t.width * 2 * i, r.d = 1 / t.height * 2 * i, r.tx = -1 - e.x * r.a, r.ty = -1 - e.y * r.d)
|
|
},
|
|
e.prototype.setTransform = function () {},
|
|
e
|
|
}
|
|
(S),
|
|
Gt = new h.Rectangle,
|
|
Yt = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.clearColor = e._backgroundColorRgba,
|
|
this.defaultMaskStack = [],
|
|
this.current = null,
|
|
this.sourceFrame = new h.Rectangle,
|
|
this.destinationFrame = new h.Rectangle
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.bind = function (t, e, i) {
|
|
void 0 === t && (t = null),
|
|
this.current = t;
|
|
var n,
|
|
r = this.renderer;
|
|
if (t) {
|
|
var o = t.baseTexture;
|
|
n = o.resolution,
|
|
i || (Gt.width = o.realWidth, Gt.height = o.realHeight, i = Gt),
|
|
e || (e = i),
|
|
this.renderer.framebuffer.bind(o.framebuffer, i),
|
|
this.renderer.projection.update(i, e, n, !1),
|
|
this.renderer.mask.setMaskStack(o.maskStack)
|
|
} else
|
|
n = this.renderer.resolution, i || (Gt.width = r.width, Gt.height = r.height, i = Gt), e || (e = i), r.framebuffer.bind(null, i), this.renderer.projection.update(i, e, n, !0), this.renderer.mask.setMaskStack(this.defaultMaskStack);
|
|
this.sourceFrame.copyFrom(e),
|
|
this.destinationFrame.x = i.x / n,
|
|
this.destinationFrame.y = i.y / n,
|
|
this.destinationFrame.width = i.width / n,
|
|
this.destinationFrame.height = i.height / n,
|
|
e === i && this.sourceFrame.copyFrom(this.destinationFrame)
|
|
},
|
|
e.prototype.clear = function (t) {
|
|
t = this.current ? t || this.current.baseTexture.clearColor : t || this.clearColor,
|
|
this.renderer.framebuffer.clear(t[0], t[1], t[2], t[3])
|
|
},
|
|
e.prototype.resize = function () {
|
|
this.bind(null)
|
|
},
|
|
e.prototype.reset = function () {
|
|
this.bind(null)
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
Wt = function (t, e) {
|
|
this.program = t,
|
|
this.uniformData = e,
|
|
this.uniformGroups = {}
|
|
};
|
|
i.GLProgram = Wt,
|
|
Wt.prototype.destroy = function () {
|
|
this.uniformData = null,
|
|
this.uniformGroups = null,
|
|
this.program = null
|
|
};
|
|
var zt = 0,
|
|
qt = {
|
|
textureCount: 0
|
|
},
|
|
Jt = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.systemCheck(),
|
|
this.gl = null,
|
|
this.shader = null,
|
|
this.program = null,
|
|
this.cache = {},
|
|
this.id = zt++
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.systemCheck = function () {
|
|
if (!function () {
|
|
if ("boolean" == typeof Et)
|
|
return Et;
|
|
try {
|
|
var t = new Function("param1", "param2", "param3", "return param1[param2] === param3;");
|
|
Et = !0 === t({
|
|
a: "b"
|
|
}, "a", "b")
|
|
} catch (t) {
|
|
Et = !1
|
|
}
|
|
return Et
|
|
}
|
|
())
|
|
throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")
|
|
},
|
|
e.prototype.contextChange = function (t) {
|
|
this.gl = t,
|
|
this.reset()
|
|
},
|
|
e.prototype.bind = function (t, e) {
|
|
t.uniforms.globals = this.renderer.globalUniforms;
|
|
var i = t.program,
|
|
n = i.glPrograms[this.renderer.CONTEXT_UID] || this.generateShader(t);
|
|
return this.shader = t,
|
|
this.program !== i && (this.program = i, this.gl.useProgram(n.program)),
|
|
e || (qt.textureCount = 0, this.syncUniformGroup(t.uniformGroup, qt)),
|
|
n
|
|
},
|
|
e.prototype.setUniforms = function (t) {
|
|
var e = this.shader.program,
|
|
i = e.glPrograms[this.renderer.CONTEXT_UID];
|
|
e.syncUniforms(i.uniformData, t, this.renderer)
|
|
},
|
|
e.prototype.syncUniformGroup = function (t, e) {
|
|
var i = this.getglProgram();
|
|
t.static && t.dirtyId === i.uniformGroups[t.id] || (i.uniformGroups[t.id] = t.dirtyId, this.syncUniforms(t, i, e))
|
|
},
|
|
e.prototype.syncUniforms = function (t, e, i) {
|
|
(t.syncUniforms[this.shader.program.id] || this.createSyncGroups(t))(e.uniformData, t.uniforms, this.renderer, i)
|
|
},
|
|
e.prototype.createSyncGroups = function (t) {
|
|
var e = this.getSignature(t, this.shader.program.uniformData);
|
|
return this.cache[e] || (this.cache[e] = function (t, e) {
|
|
var i = "var v = null;\n var cv = null\n var t = 0;\n var gl = renderer.gl\n ";
|
|
for (var n in t.uniforms) {
|
|
var r = e[n];
|
|
if (r)
|
|
if ("float" === r.type && 1 === r.size)
|
|
i += "\n if(uv." + n + " !== ud." + n + ".value)\n {\n ud." + n + ".value = uv." + n + "\n gl.uniform1f(ud." + n + ".location, uv." + n + ")\n }\n";
|
|
else if ("sampler2D" !== r.type && "samplerCube" !== r.type && "sampler2DArray" !== r.type || 1 !== r.size || r.isArray)
|
|
if ("mat3" === r.type && 1 === r.size)
|
|
void 0 !== t.uniforms[n].a ? i += "\n gl.uniformMatrix3fv(ud." + n + ".location, false, uv." + n + ".toArray(true));\n \n" : i += "\n gl.uniformMatrix3fv(ud." + n + ".location, false, uv." + n + ");\n \n";
|
|
else if ("vec2" === r.type && 1 === r.size)
|
|
void 0 !== t.uniforms[n].x ? i += "\n cv = ud." + n + ".value;\n v = uv." + n + ";\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud." + n + ".location, v.x, v.y);\n }\n" : i += "\n cv = ud." + n + ".value;\n v = uv." + n + ";\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud." + n + ".location, v[0], v[1]);\n }\n \n";
|
|
else if ("vec4" === r.type && 1 === r.size)
|
|
void 0 !== t.uniforms[n].width ? i += "\n cv = ud." + n + ".value;\n v = uv." + n + ";\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud." + n + ".location, v.x, v.y, v.width, v.height)\n }\n" : i += "\n cv = ud." + n + ".value;\n v = uv." + n + ";\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud." + n + ".location, v[0], v[1], v[2], v[3])\n }\n \n";
|
|
else {
|
|
i += "\n cv = ud." + n + ".value;\n v = uv." + n + ";\n " + (1 === r.size ? xt : bt)[r.type].replace("location", "ud." + n + ".location") + ";\n"
|
|
}
|
|
else
|
|
i += "\n\n t = syncData.textureCount++;\n\n renderer.texture.bind(uv." + n + ", t);\n \n if(ud." + n + ".value !== t)\n {\n ud." + n + ".value = t;\n gl.uniform1i(ud." + n + ".location, t);\n; // eslint-disable-line max-len\n }\n";
|
|
else
|
|
t.uniforms[n].group && (i += "\n renderer.shader.syncUniformGroup(uv." + n + ", syncData);\n ")
|
|
}
|
|
return new Function("ud", "uv", "renderer", "syncData", i)
|
|
}
|
|
(t, this.shader.program.uniformData)),
|
|
t.syncUniforms[this.shader.program.id] = this.cache[e],
|
|
t.syncUniforms[this.shader.program.id]
|
|
},
|
|
e.prototype.getSignature = function (t, e) {
|
|
var i = t.uniforms,
|
|
n = [];
|
|
for (var r in i)
|
|
n.push(r), e[r] && n.push(e[r].type);
|
|
return n.join("-")
|
|
},
|
|
e.prototype.getglProgram = function () {
|
|
return this.shader ? this.shader.program.glPrograms[this.renderer.CONTEXT_UID] : null
|
|
},
|
|
e.prototype.generateShader = function (t) {
|
|
var e = this.gl,
|
|
i = t.program,
|
|
n = {};
|
|
for (var r in i.attributeData)
|
|
n[r] = i.attributeData[r].location;
|
|
var o = at(e, i.vertexSrc, i.fragmentSrc, n),
|
|
s = {};
|
|
for (var a in i.uniformData) {
|
|
var h = i.uniformData[a];
|
|
s[a] = {
|
|
location: e.getUniformLocation(o, a),
|
|
value: lt(h.type, h.size)
|
|
}
|
|
}
|
|
var l = new Wt(o, s);
|
|
return i.glPrograms[this.renderer.CONTEXT_UID] = l,
|
|
l
|
|
},
|
|
e.prototype.reset = function () {
|
|
this.program = null,
|
|
this.shader = null
|
|
},
|
|
e.prototype.destroy = function () {
|
|
this.destroyed = !0
|
|
},
|
|
e
|
|
}
|
|
(S);
|
|
var Kt = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.gl = null,
|
|
this.stateId = 0,
|
|
this.polygonOffset = 0,
|
|
this.blendMode = o.BLEND_MODES.NONE,
|
|
this._blendEq = !1,
|
|
this.map = [],
|
|
this.map[0] = this.setBlend,
|
|
this.map[1] = this.setOffset,
|
|
this.map[2] = this.setCullFace,
|
|
this.map[3] = this.setDepthTest,
|
|
this.map[4] = this.setFrontFace,
|
|
this.checks = [],
|
|
this.defaultState = new Rt,
|
|
this.defaultState.blend = !0,
|
|
this.defaultState.depth = !0
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.contextChange = function (t) {
|
|
this.gl = t,
|
|
this.blendModes = function (t, e) {
|
|
return void 0 === e && (e = []),
|
|
e[o.BLEND_MODES.NORMAL] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.ADD] = [t.ONE, t.ONE],
|
|
e[o.BLEND_MODES.MULTIPLY] = [t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.SCREEN] = [t.ONE, t.ONE_MINUS_SRC_COLOR, t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.OVERLAY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.DARKEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.LIGHTEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.COLOR_DODGE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.COLOR_BURN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.HARD_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.SOFT_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.DIFFERENCE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.EXCLUSION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.HUE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.SATURATION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.COLOR] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.LUMINOSITY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.NONE] = [0, 0],
|
|
e[o.BLEND_MODES.NORMAL_NPM] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.ADD_NPM] = [t.SRC_ALPHA, t.ONE, t.ONE, t.ONE],
|
|
e[o.BLEND_MODES.SCREEN_NPM] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_COLOR, t.ONE, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.SRC_IN] = [t.DST_ALPHA, t.ZERO],
|
|
e[o.BLEND_MODES.SRC_OUT] = [t.ONE_MINUS_DST_ALPHA, t.ZERO],
|
|
e[o.BLEND_MODES.SRC_ATOP] = [t.DST_ALPHA, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.DST_OVER] = [t.ONE_MINUS_DST_ALPHA, t.ONE],
|
|
e[o.BLEND_MODES.DST_IN] = [t.ZERO, t.SRC_ALPHA],
|
|
e[o.BLEND_MODES.DST_OUT] = [t.ZERO, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.DST_ATOP] = [t.ONE_MINUS_DST_ALPHA, t.SRC_ALPHA],
|
|
e[o.BLEND_MODES.XOR] = [t.ONE_MINUS_DST_ALPHA, t.ONE_MINUS_SRC_ALPHA],
|
|
e[o.BLEND_MODES.SUBTRACT] = [t.ONE, t.ONE, t.ONE, t.ONE, t.FUNC_REVERSE_SUBTRACT, t.FUNC_ADD],
|
|
e
|
|
}
|
|
(t),
|
|
this.set(this.defaultState),
|
|
this.reset()
|
|
},
|
|
e.prototype.set = function (t) {
|
|
if (t = t || this.defaultState, this.stateId !== t.data) {
|
|
for (var e = this.stateId ^ t.data, i = 0; e; )
|
|
1 & e && this.map[i].call(this, !!(t.data & 1 << i)), e >>= 1, i++;
|
|
this.stateId = t.data
|
|
}
|
|
for (var n = 0; n < this.checks.length; n++)
|
|
this.checks[n](this, t)
|
|
},
|
|
e.prototype.forceState = function (t) {
|
|
t = t || this.defaultState;
|
|
for (var e = 0; e < this.map.length; e++)
|
|
this.map[e].call(this, !!(t.data & 1 << e));
|
|
for (var i = 0; i < this.checks.length; i++)
|
|
this.checks[i](this, t);
|
|
this.stateId = t.data
|
|
},
|
|
e.prototype.setBlend = function (t) {
|
|
this.updateCheck(e.checkBlendMode, t),
|
|
this.gl[t ? "enable" : "disable"](this.gl.BLEND)
|
|
},
|
|
e.prototype.setOffset = function (t) {
|
|
this.updateCheck(e.checkPolygonOffset, t),
|
|
this.gl[t ? "enable" : "disable"](this.gl.POLYGON_OFFSET_FILL)
|
|
},
|
|
e.prototype.setDepthTest = function (t) {
|
|
this.gl[t ? "enable" : "disable"](this.gl.DEPTH_TEST)
|
|
},
|
|
e.prototype.setCullFace = function (t) {
|
|
this.gl[t ? "enable" : "disable"](this.gl.CULL_FACE)
|
|
},
|
|
e.prototype.setFrontFace = function (t) {
|
|
this.gl.frontFace(this.gl[t ? "CW" : "CCW"])
|
|
},
|
|
e.prototype.setBlendMode = function (t) {
|
|
if (t !== this.blendMode) {
|
|
this.blendMode = t;
|
|
var e = this.blendModes[t],
|
|
i = this.gl;
|
|
2 === e.length ? i.blendFunc(e[0], e[1]) : i.blendFuncSeparate(e[0], e[1], e[2], e[3]),
|
|
6 === e.length ? (this._blendEq = !0, i.blendEquationSeparate(e[4], e[5])) : this._blendEq && (this._blendEq = !1, i.blendEquationSeparate(i.FUNC_ADD, i.FUNC_ADD))
|
|
}
|
|
},
|
|
e.prototype.setPolygonOffset = function (t, e) {
|
|
this.gl.polygonOffset(t, e)
|
|
},
|
|
e.prototype.reset = function () {
|
|
this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1),
|
|
this.forceState(0),
|
|
this._blendEq = !0,
|
|
this.blendMode = -1,
|
|
this.setBlendMode(0)
|
|
},
|
|
e.prototype.updateCheck = function (t, e) {
|
|
var i = this.checks.indexOf(t);
|
|
e && -1 === i ? this.checks.push(t) : e || -1 === i || this.checks.splice(i, 1)
|
|
},
|
|
e.checkBlendMode = function (t, e) {
|
|
t.setBlendMode(e.blendMode)
|
|
},
|
|
e.checkPolygonOffset = function (t, e) {
|
|
t.setPolygonOffset(e.polygonOffset, 0)
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
Zt = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.count = 0,
|
|
this.checkCount = 0,
|
|
this.maxIdle = s.settings.GC_MAX_IDLE,
|
|
this.checkCountMax = s.settings.GC_MAX_CHECK_COUNT,
|
|
this.mode = s.settings.GC_MODE
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.postrender = function () {
|
|
this.renderer.renderingToScreen && (this.count++, this.mode !== o.GC_MODES.MANUAL && (this.checkCount++, this.checkCount > this.checkCountMax && (this.checkCount = 0, this.run())))
|
|
},
|
|
e.prototype.run = function () {
|
|
for (var t = this.renderer.texture, e = t.managedTextures, i = !1, n = 0; n < e.length; n++) {
|
|
var r = e[n];
|
|
!r.framebuffer && this.count - r.touched > this.maxIdle && (t.destroyTexture(r, !0), e[n] = null, i = !0)
|
|
}
|
|
if (i) {
|
|
for (var o = 0, s = 0; s < e.length; s++)
|
|
null !== e[s] && (e[o++] = e[s]);
|
|
e.length = o
|
|
}
|
|
},
|
|
e.prototype.unload = function (t) {
|
|
var e = this.renderer.textureSystem;
|
|
t._texture && t._texture._glRenderTargets && e.destroyTexture(t._texture);
|
|
for (var i = t.children.length - 1; i >= 0; i--)
|
|
this.unload(t.children[i])
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
Qt = function (t) {
|
|
this.texture = t,
|
|
this.width = -1,
|
|
this.height = -1,
|
|
this.dirtyId = -1,
|
|
this.dirtyStyleId = -1,
|
|
this.mipmap = !1,
|
|
this.wrapMode = 33071,
|
|
this.type = 6408,
|
|
this.internalFormat = 5121
|
|
};
|
|
i.GLTexture = Qt;
|
|
var te = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.boundTextures = [],
|
|
this.currentLocation = -1,
|
|
this.managedTextures = [],
|
|
this._unknownBoundTextures = !1,
|
|
this.unknownTexture = new g
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.contextChange = function () {
|
|
var t = this.gl = this.renderer.gl;
|
|
this.CONTEXT_UID = this.renderer.CONTEXT_UID,
|
|
this.webGLVersion = this.renderer.context.webGLVersion;
|
|
var e = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);
|
|
this.boundTextures.length = e;
|
|
for (var i = 0; i < e; i++)
|
|
this.boundTextures[i] = null;
|
|
this.emptyTextures = {};
|
|
var n = new Qt(t.createTexture());
|
|
t.bindTexture(t.TEXTURE_2D, n.texture),
|
|
t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, 1, 1, 0, t.RGBA, t.UNSIGNED_BYTE, new Uint8Array(4)),
|
|
this.emptyTextures[t.TEXTURE_2D] = n,
|
|
this.emptyTextures[t.TEXTURE_CUBE_MAP] = new Qt(t.createTexture()),
|
|
t.bindTexture(t.TEXTURE_CUBE_MAP, this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);
|
|
for (var r = 0; r < 6; r++)
|
|
t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0, t.RGBA, 1, 1, 0, t.RGBA, t.UNSIGNED_BYTE, null);
|
|
t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MAG_FILTER, t.LINEAR),
|
|
t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MIN_FILTER, t.LINEAR);
|
|
for (var o = 0; o < this.boundTextures.length; o++)
|
|
this.bind(null, o)
|
|
},
|
|
e.prototype.bind = function (t, e) {
|
|
void 0 === e && (e = 0);
|
|
var i = this.gl;
|
|
if (t) {
|
|
if ((t = t.baseTexture || t).valid) {
|
|
t.touched = this.renderer.textureGC.count;
|
|
var n = t._glTextures[this.CONTEXT_UID] || this.initTexture(t);
|
|
this.boundTextures[e] !== t && (this.currentLocation !== e && (this.currentLocation = e, i.activeTexture(i.TEXTURE0 + e)), i.bindTexture(t.target, n.texture)),
|
|
n.dirtyId !== t.dirtyId && (this.currentLocation !== e && (this.currentLocation = e, i.activeTexture(i.TEXTURE0 + e)), this.updateTexture(t)),
|
|
this.boundTextures[e] = t
|
|
}
|
|
} else
|
|
this.currentLocation !== e && (this.currentLocation = e, i.activeTexture(i.TEXTURE0 + e)), i.bindTexture(i.TEXTURE_2D, this.emptyTextures[i.TEXTURE_2D].texture), this.boundTextures[e] = null
|
|
},
|
|
e.prototype.reset = function () {
|
|
this._unknownBoundTextures = !0,
|
|
this.currentLocation = -1;
|
|
for (var t = 0; t < this.boundTextures.length; t++)
|
|
this.boundTextures[t] = this.unknownTexture
|
|
},
|
|
e.prototype.unbind = function (t) {
|
|
var e = this.gl,
|
|
i = this.boundTextures;
|
|
if (this._unknownBoundTextures) {
|
|
this._unknownBoundTextures = !1;
|
|
for (var n = 0; n < i.length; n++)
|
|
i[n] === this.unknownTexture && this.bind(null, n)
|
|
}
|
|
for (var r = 0; r < i.length; r++)
|
|
i[r] === t && (this.currentLocation !== r && (e.activeTexture(e.TEXTURE0 + r), this.currentLocation = r), e.bindTexture(e.TEXTURE_2D, this.emptyTextures[t.target].texture), i[r] = null)
|
|
},
|
|
e.prototype.initTexture = function (t) {
|
|
var e = new Qt(this.gl.createTexture());
|
|
return e.dirtyId = -1,
|
|
t._glTextures[this.CONTEXT_UID] = e,
|
|
this.managedTextures.push(t),
|
|
t.on("dispose", this.destroyTexture, this),
|
|
e
|
|
},
|
|
e.prototype.initTextureType = function (t, e) {
|
|
if (e.internalFormat = t.format, e.type = t.type, 2 === this.webGLVersion) {
|
|
var i = this.renderer.gl;
|
|
t.type === i.FLOAT && t.format === i.RGBA && (e.internalFormat = i.RGBA32F),
|
|
t.type === o.TYPES.HALF_FLOAT && (e.type = i.HALF_FLOAT),
|
|
e.type === i.HALF_FLOAT && t.format === i.RGBA && (e.internalFormat = i.RGBA16F)
|
|
}
|
|
},
|
|
e.prototype.updateTexture = function (t) {
|
|
var e = t._glTextures[this.CONTEXT_UID];
|
|
if (e) {
|
|
var i = this.renderer;
|
|
if (this.initTextureType(t, e), t.resource && t.resource.upload(i, t, e));
|
|
else {
|
|
var n = t.realWidth,
|
|
r = t.realHeight,
|
|
o = i.gl;
|
|
(e.width !== n || e.height !== r || e.dirtyId < 0) && (e.width = n, e.height = r, o.texImage2D(t.target, 0, e.internalFormat, n, r, 0, t.format, e.type, null))
|
|
}
|
|
t.dirtyStyleId !== e.dirtyStyleId && this.updateTextureStyle(t),
|
|
e.dirtyId = t.dirtyId
|
|
}
|
|
},
|
|
e.prototype.destroyTexture = function (t, e) {
|
|
var i = this.gl;
|
|
if ((t = t.baseTexture || t)._glTextures[this.CONTEXT_UID] && (this.unbind(t), i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture), t.off("dispose", this.destroyTexture, this), delete t._glTextures[this.CONTEXT_UID], !e)) {
|
|
var n = this.managedTextures.indexOf(t);
|
|
-1 !== n && (0, r.removeItems)(this.managedTextures, n, 1)
|
|
}
|
|
},
|
|
e.prototype.updateTextureStyle = function (t) {
|
|
var e = t._glTextures[this.CONTEXT_UID];
|
|
e && (t.mipmap !== o.MIPMAP_MODES.POW2 && 2 === this.webGLVersion || t.isPowerOfTwo ? e.mipmap = t.mipmap >= 1 : e.mipmap = 0, 2 === this.webGLVersion || t.isPowerOfTwo ? e.wrapMode = t.wrapMode : e.wrapMode = o.WRAP_MODES.CLAMP, t.resource && t.resource.style(this.renderer, t, e) || this.setStyle(t, e), e.dirtyStyleId = t.dirtyStyleId)
|
|
},
|
|
e.prototype.setStyle = function (t, e) {
|
|
var i = this.gl;
|
|
if (e.mipmap && i.generateMipmap(t.target), i.texParameteri(t.target, i.TEXTURE_WRAP_S, e.wrapMode), i.texParameteri(t.target, i.TEXTURE_WRAP_T, e.wrapMode), e.mipmap) {
|
|
i.texParameteri(t.target, i.TEXTURE_MIN_FILTER, t.scaleMode ? i.LINEAR_MIPMAP_LINEAR : i.NEAREST_MIPMAP_NEAREST);
|
|
var n = this.renderer.context.extensions.anisotropicFiltering;
|
|
if (n && t.anisotropicLevel > 0 && t.scaleMode === o.SCALE_MODES.LINEAR) {
|
|
var r = Math.min(t.anisotropicLevel, i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
|
|
i.texParameterf(t.target, n.TEXTURE_MAX_ANISOTROPY_EXT, r)
|
|
}
|
|
} else
|
|
i.texParameteri(t.target, i.TEXTURE_MIN_FILTER, t.scaleMode ? i.LINEAR : i.NEAREST);
|
|
i.texParameteri(t.target, i.TEXTURE_MAG_FILTER, t.scaleMode ? i.LINEAR : i.NEAREST)
|
|
},
|
|
e
|
|
}
|
|
(S),
|
|
ee = {
|
|
FilterSystem: K,
|
|
BatchSystem: Q,
|
|
ContextSystem: et,
|
|
FramebufferSystem: it,
|
|
GeometrySystem: ot,
|
|
MaskSystem: Ut,
|
|
ScissorSystem: jt,
|
|
StencilSystem: Vt,
|
|
ProjectionSystem: Ht,
|
|
RenderTextureSystem: Yt,
|
|
ShaderSystem: Jt,
|
|
StateSystem: Kt,
|
|
TextureGCSystem: Zt,
|
|
TextureSystem: te
|
|
};
|
|
i.systems = ee;
|
|
var ie = new h.Matrix,
|
|
ne = function (t) {
|
|
function e(e, i) {
|
|
t.call(this),
|
|
(i = Object.assign({}, s.settings.RENDER_OPTIONS, i)).roundPixels && (s.settings.ROUND_PIXELS = i.roundPixels, (0, r.deprecation)("5.0.0", "Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS", 2)),
|
|
this.options = i,
|
|
this.type = o.RENDERER_TYPE.UNKNOWN,
|
|
this.screen = new h.Rectangle(0, 0, i.width, i.height),
|
|
this.view = i.view || document.createElement("canvas"),
|
|
this.resolution = i.resolution || s.settings.RESOLUTION,
|
|
this.transparent = i.transparent,
|
|
this.autoDensity = i.autoDensity || i.autoResize || !1,
|
|
this.preserveDrawingBuffer = i.preserveDrawingBuffer,
|
|
this.clearBeforeRender = i.clearBeforeRender,
|
|
this._backgroundColor = 0,
|
|
this._backgroundColorRgba = [0, 0, 0, 0],
|
|
this._backgroundColorString = "#000000",
|
|
this.backgroundColor = i.backgroundColor || this._backgroundColor,
|
|
this._tempDisplayObjectParent = new l.Container,
|
|
this._lastObjectRendered = this._tempDisplayObjectParent,
|
|
this.plugins = {}
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
},
|
|
backgroundColor: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.initPlugins = function (t) {
|
|
for (var e in t)
|
|
this.plugins[e] = new t[e](this)
|
|
},
|
|
i.width.get = function () {
|
|
return this.view.width
|
|
},
|
|
i.height.get = function () {
|
|
return this.view.height
|
|
},
|
|
e.prototype.resize = function (t, e) {
|
|
this.screen.width = t,
|
|
this.screen.height = e,
|
|
this.view.width = t * this.resolution,
|
|
this.view.height = e * this.resolution,
|
|
this.autoDensity && (this.view.style.width = t + "px", this.view.style.height = e + "px")
|
|
},
|
|
e.prototype.generateTexture = function (t, e, i, n) {
|
|
0 === (n = n || t.getLocalBounds()).width && (n.width = 1),
|
|
0 === n.height && (n.height = 1);
|
|
var r = L.create(0 | n.width, 0 | n.height, e, i);
|
|
return ie.tx = -n.x,
|
|
ie.ty = -n.y,
|
|
this.render(t, r, !1, ie, !!t.parent),
|
|
r
|
|
},
|
|
e.prototype.destroy = function (t) {
|
|
for (var e in this.plugins)
|
|
this.plugins[e].destroy(), this.plugins[e] = null;
|
|
t && this.view.parentNode && this.view.parentNode.removeChild(this.view),
|
|
this.plugins = null,
|
|
this.type = o.RENDERER_TYPE.UNKNOWN,
|
|
this.view = null,
|
|
this.screen = null,
|
|
this.resolution = 0,
|
|
this.transparent = !1,
|
|
this.autoDensity = !1,
|
|
this.blendModes = null,
|
|
this.options = null,
|
|
this.preserveDrawingBuffer = !1,
|
|
this.clearBeforeRender = !1,
|
|
this._backgroundColor = 0,
|
|
this._backgroundColorRgba = null,
|
|
this._backgroundColorString = null,
|
|
this._tempDisplayObjectParent = null,
|
|
this._lastObjectRendered = null
|
|
},
|
|
i.backgroundColor.get = function () {
|
|
return this._backgroundColor
|
|
},
|
|
i.backgroundColor.set = function (t) {
|
|
this._backgroundColor = t,
|
|
this._backgroundColorString = (0, r.hex2string)(t),
|
|
(0, r.hex2rgb)(t, this._backgroundColorRgba)
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(r.EventEmitter);
|
|
i.AbstractRenderer = ne;
|
|
var re = function (t) {
|
|
function e(i) {
|
|
void 0 === i && (i = {}),
|
|
t.call(this, "WebGL", i),
|
|
i = this.options,
|
|
this.type = o.RENDERER_TYPE.WEBGL,
|
|
this.gl = null,
|
|
this.CONTEXT_UID = 0,
|
|
this.runners = {
|
|
destroy: new n.Runner("destroy"),
|
|
contextChange: new n.Runner("contextChange", 1),
|
|
reset: new n.Runner("reset"),
|
|
update: new n.Runner("update"),
|
|
postrender: new n.Runner("postrender"),
|
|
prerender: new n.Runner("prerender"),
|
|
resize: new n.Runner("resize", 2)
|
|
},
|
|
this.globalUniforms = new q({
|
|
projectionMatrix: new h.Matrix
|
|
}, !0),
|
|
this.addSystem(Ut, "mask").addSystem(et, "context").addSystem(Kt, "state").addSystem(Jt, "shader").addSystem(te, "texture").addSystem(ot, "geometry").addSystem(it, "framebuffer").addSystem(jt, "scissor").addSystem(Vt, "stencil").addSystem(Ht, "projection").addSystem(Zt, "textureGC").addSystem(K, "filter").addSystem(Yt, "renderTexture").addSystem(Q, "batch"),
|
|
this.initPlugins(e.__plugins),
|
|
i.context ? this.context.initFromContext(i.context) : this.context.initFromOptions({
|
|
alpha: this.transparent,
|
|
antialias: i.antialias,
|
|
premultipliedAlpha: this.transparent && "notMultiplied" !== this.transparent,
|
|
stencil: !0,
|
|
preserveDrawingBuffer: i.preserveDrawingBuffer,
|
|
powerPreference: this.options.powerPreference
|
|
}),
|
|
this.renderingToScreen = !0,
|
|
(0, r.sayHello)(2 === this.context.webGLVersion ? "WebGL 2" : "WebGL 1"),
|
|
this.resize(this.options.width, this.options.height)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.create = function (t) {
|
|
if ((0, r.isWebGLSupported)())
|
|
return new e(t);
|
|
throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')
|
|
},
|
|
e.prototype.addSystem = function (t, e) {
|
|
e || (e = t.name);
|
|
var i = new t(this);
|
|
if (this[e])
|
|
throw new Error('Whoops! The name "' + e + '" is already in use');
|
|
for (var n in this[e] = i, this.runners)
|
|
this.runners[n].add(i);
|
|
return this
|
|
},
|
|
e.prototype.render = function (t, e, i, n, r) {
|
|
if (this.renderingToScreen = !e, this.runners.prerender.run(), this.emit("prerender"), this.projection.transform = n, !this.context.isLost) {
|
|
if (e || (this._lastObjectRendered = t), !r) {
|
|
var o = t.parent;
|
|
t.parent = this._tempDisplayObjectParent,
|
|
t.updateTransform(),
|
|
t.parent = o
|
|
}
|
|
this.renderTexture.bind(e),
|
|
this.batch.currentRenderer.start(),
|
|
(void 0 !== i ? i : this.clearBeforeRender) && this.renderTexture.clear(),
|
|
t.render(this),
|
|
this.batch.currentRenderer.flush(),
|
|
e && e.baseTexture.update(),
|
|
this.runners.postrender.run(),
|
|
this.projection.transform = null,
|
|
this.emit("postrender")
|
|
}
|
|
},
|
|
e.prototype.resize = function (e, i) {
|
|
t.prototype.resize.call(this, e, i),
|
|
this.runners.resize.run(e, i)
|
|
},
|
|
e.prototype.reset = function () {
|
|
return this.runners.reset.run(),
|
|
this
|
|
},
|
|
e.prototype.clear = function () {
|
|
this.framebuffer.bind(),
|
|
this.framebuffer.clear()
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
for (var i in this.runners.destroy.run(), this.runners)
|
|
this.runners[i].destroy();
|
|
t.prototype.destroy.call(this, e),
|
|
this.gl = null
|
|
},
|
|
e.registerPlugin = function (t, i) {
|
|
e.__plugins = e.__plugins || {},
|
|
e.__plugins[t] = i
|
|
},
|
|
e
|
|
}
|
|
(ne);
|
|
i.Renderer = re;
|
|
i.defaultVertex = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}";
|
|
i.defaultFilterVertex = "attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n";
|
|
var oe = function (t) {
|
|
function e() {
|
|
t.apply(this, arguments)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.from = function (t, i) {
|
|
return new e(new x(t, i))
|
|
},
|
|
e
|
|
}
|
|
(g);
|
|
i.CubeTexture = oe;
|
|
var se = function () {
|
|
this.texArray = null,
|
|
this.blend = 0,
|
|
this.type = o.DRAW_MODES.TRIANGLES,
|
|
this.start = 0,
|
|
this.size = 0,
|
|
this.data = null
|
|
};
|
|
i.BatchDrawCall = se;
|
|
var ae = function () {
|
|
this.elements = [],
|
|
this.ids = [],
|
|
this.count = 0
|
|
};
|
|
i.BatchTextureArray = ae,
|
|
ae.prototype.clear = function () {
|
|
for (var t = 0; t < this.count; t++)
|
|
this.elements[t] = null;
|
|
this.count = 0
|
|
};
|
|
var he = function (t) {
|
|
this.rawBinaryData = new ArrayBuffer(t),
|
|
this.uint32View = new Uint32Array(this.rawBinaryData),
|
|
this.float32View = new Float32Array(this.rawBinaryData)
|
|
};
|
|
i.ViewableBuffer = he;
|
|
var le = {
|
|
int8View: {
|
|
configurable: !0
|
|
},
|
|
uint8View: {
|
|
configurable: !0
|
|
},
|
|
int16View: {
|
|
configurable: !0
|
|
},
|
|
uint16View: {
|
|
configurable: !0
|
|
},
|
|
int32View: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
le.int8View.get = function () {
|
|
return this._int8View || (this._int8View = new Int8Array(this.rawBinaryData)),
|
|
this._int8View
|
|
},
|
|
le.uint8View.get = function () {
|
|
return this._uint8View || (this._uint8View = new Uint8Array(this.rawBinaryData)),
|
|
this._uint8View
|
|
},
|
|
le.int16View.get = function () {
|
|
return this._int16View || (this._int16View = new Int16Array(this.rawBinaryData)),
|
|
this._int16View
|
|
},
|
|
le.uint16View.get = function () {
|
|
return this._uint16View || (this._uint16View = new Uint16Array(this.rawBinaryData)),
|
|
this._uint16View
|
|
},
|
|
le.int32View.get = function () {
|
|
return this._int32View || (this._int32View = new Int32Array(this.rawBinaryData)),
|
|
this._int32View
|
|
},
|
|
he.prototype.view = function (t) {
|
|
return this[t + "View"]
|
|
},
|
|
he.prototype.destroy = function () {
|
|
this.rawBinaryData = null,
|
|
this._int8View = null,
|
|
this._uint8View = null,
|
|
this._int16View = null,
|
|
this._uint16View = null,
|
|
this._int32View = null,
|
|
this.uint32View = null,
|
|
this.float32View = null
|
|
},
|
|
he.sizeOf = function (t) {
|
|
switch (t) {
|
|
case "int8":
|
|
case "uint8":
|
|
return 1;
|
|
case "int16":
|
|
case "uint16":
|
|
return 2;
|
|
case "int32":
|
|
case "uint32":
|
|
case "float32":
|
|
return 4;
|
|
default:
|
|
throw new Error(t + " isn't a valid view type")
|
|
}
|
|
},
|
|
Object.defineProperties(he.prototype, le);
|
|
var ue = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.shaderGenerator = null,
|
|
this.geometryClass = null,
|
|
this.vertexSize = null,
|
|
this.state = Rt.for2d(),
|
|
this.size = 4 * s.settings.SPRITE_BATCH_SIZE,
|
|
this._vertexCount = 0,
|
|
this._indexCount = 0,
|
|
this._bufferedElements = [],
|
|
this._bufferedTextures = [],
|
|
this._bufferSize = 0,
|
|
this._shader = null,
|
|
this._packedGeometries = [],
|
|
this._packedGeometryPoolSize = 2,
|
|
this._flushId = 0,
|
|
this._aBuffers = {},
|
|
this._iBuffers = {},
|
|
this.MAX_TEXTURES = 1,
|
|
this.renderer.on("prerender", this.onPrerender, this),
|
|
e.runners.contextChange.add(this),
|
|
this._dcIndex = 0,
|
|
this._aIndex = 0,
|
|
this._iIndex = 0,
|
|
this._attributeBuffer = null,
|
|
this._indexBuffer = null,
|
|
this._tempBoundTextures = []
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.contextChange = function () {
|
|
var t = this.renderer.gl;
|
|
s.settings.PREFER_ENV === o.ENV.WEBGL_LEGACY ? this.MAX_TEXTURES = 1 : (this.MAX_TEXTURES = Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS), s.settings.SPRITE_MAX_TEXTURES), this.MAX_TEXTURES = At(this.MAX_TEXTURES, t)),
|
|
this._shader = this.shaderGenerator.generateShader(this.MAX_TEXTURES);
|
|
for (var e = 0; e < this._packedGeometryPoolSize; e++)
|
|
this._packedGeometries[e] = new this.geometryClass;
|
|
this.initFlushBuffers()
|
|
},
|
|
e.prototype.initFlushBuffers = function () {
|
|
for (var t = e._drawCallPool, i = e._textureArrayPool, n = this.size / 4, r = Math.floor(n / this.MAX_TEXTURES) + 1; t.length < n; )
|
|
t.push(new se);
|
|
for (; i.length < r; )
|
|
i.push(new ae);
|
|
for (var o = 0; o < this.MAX_TEXTURES; o++)
|
|
this._tempBoundTextures[o] = null
|
|
},
|
|
e.prototype.onPrerender = function () {
|
|
this._flushId = 0
|
|
},
|
|
e.prototype.render = function (t) {
|
|
t._texture.valid && (this._vertexCount + t.vertexData.length / 2 > this.size && this.flush(), this._vertexCount += t.vertexData.length / 2, this._indexCount += t.indices.length, this._bufferedTextures[this._bufferSize] = t._texture.baseTexture, this._bufferedElements[this._bufferSize++] = t)
|
|
},
|
|
e.prototype.buildTexturesAndDrawCalls = function () {
|
|
var t = this._bufferedTextures,
|
|
i = this.MAX_TEXTURES,
|
|
n = e._textureArrayPool,
|
|
r = this.renderer.batch,
|
|
o = this._tempBoundTextures,
|
|
s = this.renderer.textureGC.count,
|
|
a = ++g._globalBatch,
|
|
h = 0,
|
|
l = n[0],
|
|
u = 0;
|
|
r.copyBoundTextures(o, i);
|
|
for (var c = 0; c < this._bufferSize; ++c) {
|
|
var p = t[c];
|
|
t[c] = null,
|
|
p._batchEnabled !== a && (l.count >= i && (r.boundArray(l, o, a, i), this.buildDrawCalls(l, u, c), u = c, l = n[++h], ++a), p._batchEnabled = a, p.touched = s, l.elements[l.count++] = p)
|
|
}
|
|
l.count > 0 && (r.boundArray(l, o, a, i), this.buildDrawCalls(l, u, this._bufferSize), ++h, ++a);
|
|
for (var d = 0; d < o.length; d++)
|
|
o[d] = null;
|
|
g._globalBatch = a
|
|
},
|
|
e.prototype.buildDrawCalls = function (t, i, n) {
|
|
var o = this._bufferedElements,
|
|
s = this._attributeBuffer,
|
|
a = this._indexBuffer,
|
|
h = this.vertexSize,
|
|
l = e._drawCallPool,
|
|
u = this._dcIndex,
|
|
c = this._aIndex,
|
|
p = this._iIndex,
|
|
d = l[u];
|
|
d.start = this._iIndex,
|
|
d.texArray = t;
|
|
for (var f = i; f < n; ++f) {
|
|
var _ = o[f],
|
|
m = _._texture.baseTexture,
|
|
y = r.premultiplyBlendMode[m.alphaMode ? 1 : 0][_.blendMode];
|
|
o[f] = null,
|
|
i < f && d.blend !== y && (d.size = p - d.start, i = f, (d = l[++u]).texArray = t, d.start = p),
|
|
this.packInterleavedGeometry(_, s, a, c, p),
|
|
c += _.vertexData.length / 2 * h,
|
|
p += _.indices.length,
|
|
d.blend = y
|
|
}
|
|
i < n && (d.size = p - d.start, ++u),
|
|
this._dcIndex = u,
|
|
this._aIndex = c,
|
|
this._iIndex = p
|
|
},
|
|
e.prototype.bindAndClearTexArray = function (t) {
|
|
for (var e = this.renderer.texture, i = 0; i < t.count; i++)
|
|
e.bind(t.elements[i], t.ids[i]), t.elements[i] = null;
|
|
t.count = 0
|
|
},
|
|
e.prototype.updateGeometry = function () {
|
|
var t = this._packedGeometries,
|
|
e = this._attributeBuffer,
|
|
i = this._indexBuffer;
|
|
s.settings.CAN_UPLOAD_SAME_BUFFER ? (t[this._flushId]._buffer.update(e.rawBinaryData), t[this._flushId]._indexBuffer.update(i), this.renderer.geometry.updateBuffers()) : (this._packedGeometryPoolSize <= this._flushId && (this._packedGeometryPoolSize++, t[this._flushId] = new this.geometryClass), t[this._flushId]._buffer.update(e.rawBinaryData), t[this._flushId]._indexBuffer.update(i), this.renderer.geometry.bind(t[this._flushId]), this.renderer.geometry.updateBuffers(), this._flushId++)
|
|
},
|
|
e.prototype.drawBatches = function () {
|
|
for (var t = this._dcIndex, i = this.renderer, n = i.gl, r = i.state, o = e._drawCallPool, s = null, a = 0; a < t; a++) {
|
|
var h = o[a],
|
|
l = h.texArray,
|
|
u = h.type,
|
|
c = h.size,
|
|
p = h.start,
|
|
d = h.blend;
|
|
s !== l && (s = l, this.bindAndClearTexArray(l)),
|
|
this.state.blendMode = d,
|
|
r.set(this.state),
|
|
n.drawElements(u, c, n.UNSIGNED_SHORT, 2 * p)
|
|
}
|
|
},
|
|
e.prototype.flush = function () {
|
|
0 !== this._vertexCount && (this._attributeBuffer = this.getAttributeBuffer(this._vertexCount), this._indexBuffer = this.getIndexBuffer(this._indexCount), this._aIndex = 0, this._iIndex = 0, this._dcIndex = 0, this.buildTexturesAndDrawCalls(), this.updateGeometry(), this.drawBatches(), this._bufferSize = 0, this._vertexCount = 0, this._indexCount = 0)
|
|
},
|
|
e.prototype.start = function () {
|
|
this.renderer.state.set(this.state),
|
|
this.renderer.shader.bind(this._shader),
|
|
s.settings.CAN_UPLOAD_SAME_BUFFER && this.renderer.geometry.bind(this._packedGeometries[this._flushId])
|
|
},
|
|
e.prototype.stop = function () {
|
|
this.flush()
|
|
},
|
|
e.prototype.destroy = function () {
|
|
for (var e = 0; e < this._packedGeometryPoolSize; e++)
|
|
this._packedGeometries[e] && this._packedGeometries[e].destroy();
|
|
this.renderer.off("prerender", this.onPrerender, this),
|
|
this._aBuffers = null,
|
|
this._iBuffers = null,
|
|
this._packedGeometries = null,
|
|
this._attributeBuffer = null,
|
|
this._indexBuffer = null,
|
|
this._shader && (this._shader.destroy(), this._shader = null),
|
|
t.prototype.destroy.call(this)
|
|
},
|
|
e.prototype.getAttributeBuffer = function (t) {
|
|
var e = (0, r.nextPow2)(Math.ceil(t / 8)),
|
|
i = (0, r.log2)(e),
|
|
n = 8 * e;
|
|
this._aBuffers.length <= i && (this._iBuffers.length = i + 1);
|
|
var o = this._aBuffers[n];
|
|
return o || (this._aBuffers[n] = o = new he(n * this.vertexSize * 4)),
|
|
o
|
|
},
|
|
e.prototype.getIndexBuffer = function (t) {
|
|
var e = (0, r.nextPow2)(Math.ceil(t / 12)),
|
|
i = (0, r.log2)(e),
|
|
n = 12 * e;
|
|
this._iBuffers.length <= i && (this._iBuffers.length = i + 1);
|
|
var o = this._iBuffers[i];
|
|
return o || (this._iBuffers[i] = o = new Uint16Array(n)),
|
|
o
|
|
},
|
|
e.prototype.packInterleavedGeometry = function (t, e, i, n, o) {
|
|
for (var s = e.uint32View, a = e.float32View, h = n / this.vertexSize, l = t.uvs, u = t.indices, c = t.vertexData, p = t._texture.baseTexture._batchLocation, d = Math.min(t.worldAlpha, 1), f = d < 1 && t._texture.baseTexture.alphaMode ? (0, r.premultiplyTint)(t._tintRGB, d) : t._tintRGB + (255 * d << 24), _ = 0; _ < c.length; _ += 2)
|
|
a[n++] = c[_], a[n++] = c[_ + 1], a[n++] = l[_], a[n++] = l[_ + 1], s[n++] = f, a[n++] = p;
|
|
for (var m = 0; m < u.length; m++)
|
|
i[o++] = h + u[m]
|
|
},
|
|
e
|
|
}
|
|
(Z);
|
|
i.AbstractBatchRenderer = ue,
|
|
ue._drawCallPool = [],
|
|
ue._textureArrayPool = [];
|
|
var ce = function (t, e) {
|
|
if (this.vertexSrc = t, this.fragTemplate = e, this.programCache = {}, this.defaultGroupCache = {}, e.indexOf("%count%") < 0)
|
|
throw new Error('Fragment template must contain "%count%".');
|
|
if (e.indexOf("%forloop%") < 0)
|
|
throw new Error('Fragment template must contain "%forloop%".')
|
|
};
|
|
i.BatchShaderGenerator = ce,
|
|
ce.prototype.generateShader = function (t) {
|
|
if (!this.programCache[t]) {
|
|
for (var e = new Int32Array(t), i = 0; i < t; i++)
|
|
e[i] = i;
|
|
this.defaultGroupCache[t] = q.from({
|
|
uSamplers: e
|
|
}, !0);
|
|
var n = this.fragTemplate;
|
|
n = (n = n.replace(/%count%/gi, "" + t)).replace(/%forloop%/gi, this.generateSampleSrc(t)),
|
|
this.programCache[t] = new Mt(this.vertexSrc, n)
|
|
}
|
|
var r = {
|
|
tint: new Float32Array([1, 1, 1, 1]),
|
|
translationMatrix: new h.Matrix,
|
|
default:
|
|
this.defaultGroupCache[t]
|
|
};
|
|
return new Pt(this.programCache[t], r)
|
|
},
|
|
ce.prototype.generateSampleSrc = function (t) {
|
|
var e = "";
|
|
e += "\n",
|
|
e += "\n";
|
|
for (var i = 0; i < t; i++)
|
|
i > 0 && (e += "\nelse "), i < t - 1 && (e += "if(vTextureId < " + i + ".5)"), e += "\n{", e += "\n\tcolor = texture2D(uSamplers[" + i + "], vTextureCoord);", e += "\n}";
|
|
return e += "\n",
|
|
e += "\n"
|
|
};
|
|
var pe = function (t) {
|
|
function e(e) {
|
|
void 0 === e && (e = !1),
|
|
t.call(this),
|
|
this._buffer = new B(null, e, !1),
|
|
this._indexBuffer = new B(null, e, !0),
|
|
this.addAttribute("aVertexPosition", this._buffer, 2, !1, o.TYPES.FLOAT).addAttribute("aTextureCoord", this._buffer, 2, !1, o.TYPES.FLOAT).addAttribute("aColor", this._buffer, 4, !0, o.TYPES.UNSIGNED_BYTE).addAttribute("aTextureId", this._buffer, 1, !0, o.TYPES.FLOAT).addIndex(this._indexBuffer)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(G);
|
|
i.BatchGeometry = pe;
|
|
var de = "precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",
|
|
fe = "varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n",
|
|
_e = function () {};
|
|
i.BatchPluginFactory = _e;
|
|
var me = {
|
|
defaultVertexSrc: {
|
|
configurable: !0
|
|
},
|
|
defaultFragmentTemplate: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
_e.create = function (t) {
|
|
var e = Object.assign({
|
|
vertex: de,
|
|
fragment: fe,
|
|
geometryClass: pe,
|
|
vertexSize: 6
|
|
}, t),
|
|
i = e.vertex,
|
|
n = e.fragment,
|
|
r = e.vertexSize,
|
|
o = e.geometryClass;
|
|
return function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.shaderGenerator = new ce(i, n),
|
|
this.geometryClass = o,
|
|
this.vertexSize = r
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(ue)
|
|
},
|
|
me.defaultVertexSrc.get = function () {
|
|
return de
|
|
},
|
|
me.defaultFragmentTemplate.get = function () {
|
|
return fe
|
|
},
|
|
Object.defineProperties(_e, me);
|
|
var ye = _e.create();
|
|
i.BatchRenderer = ye
|
|
}, {
|
|
"@pixi/runner": "jcTq",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/constants": "R76a",
|
|
"@pixi/settings": "v11T",
|
|
"@pixi/ticker": "t27b",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/display": "LJAM"
|
|
}
|
|
],
|
|
HdTX: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.Application = void 0;
|
|
var n = t("@pixi/display"),
|
|
r = t("@pixi/core"),
|
|
o = function t(e) {
|
|
var i = this;
|
|
e = Object.assign({
|
|
forceCanvas: !1
|
|
}, e),
|
|
this.renderer = (0, r.autoDetectRenderer)(e),
|
|
this.stage = new n.Container,
|
|
t._plugins.forEach((function (t) {
|
|
t.init.call(i, e)
|
|
}))
|
|
};
|
|
i.Application = o;
|
|
var s = {
|
|
view: {
|
|
configurable: !0
|
|
},
|
|
screen: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
o.registerPlugin = function (t) {
|
|
o._plugins.push(t)
|
|
},
|
|
o.prototype.render = function () {
|
|
this.renderer.render(this.stage)
|
|
},
|
|
s.view.get = function () {
|
|
return this.renderer.view
|
|
},
|
|
s.screen.get = function () {
|
|
return this.renderer.screen
|
|
},
|
|
o.prototype.destroy = function (t, e) {
|
|
var i = this,
|
|
n = o._plugins.slice(0);
|
|
n.reverse(),
|
|
n.forEach((function (t) {
|
|
t.destroy.call(i)
|
|
})),
|
|
this.stage.destroy(e),
|
|
this.stage = null,
|
|
this.renderer.destroy(t),
|
|
this.renderer = null,
|
|
this._options = null
|
|
},
|
|
Object.defineProperties(o.prototype, s),
|
|
o._plugins = [];
|
|
var a = function () {};
|
|
a.init = function (t) {
|
|
var e = this;
|
|
Object.defineProperty(this, "resizeTo", {
|
|
set: function (t) {
|
|
window.removeEventListener("resize", this.resize),
|
|
this._resizeTo = t,
|
|
t && (window.addEventListener("resize", this.resize), this.resize())
|
|
},
|
|
get: function () {
|
|
return this._resizeTo
|
|
}
|
|
}),
|
|
this.resize = function () {
|
|
e._resizeTo && (e._resizeTo === window ? e.renderer.resize(window.innerWidth, window.innerHeight) : e.renderer.resize(e._resizeTo.clientWidth, e._resizeTo.clientHeight))
|
|
},
|
|
this._resizeTo = null,
|
|
this.resizeTo = t.resizeTo || null
|
|
},
|
|
a.destroy = function () {
|
|
this.resizeTo = null,
|
|
this.resize = null
|
|
},
|
|
o.registerPlugin(a)
|
|
}, {
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/core": "qqf8"
|
|
}
|
|
],
|
|
lAKD: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.Extract = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/utils"),
|
|
o = new(t("@pixi/math").Rectangle),
|
|
s = function (t) {
|
|
this.renderer = t,
|
|
t.extract = this
|
|
};
|
|
i.Extract = s,
|
|
s.prototype.image = function (t, e, i) {
|
|
var n = new Image;
|
|
return n.src = this.base64(t, e, i),
|
|
n
|
|
},
|
|
s.prototype.base64 = function (t, e, i) {
|
|
return this.canvas(t).toDataURL(e, i)
|
|
},
|
|
s.prototype.canvas = function (t) {
|
|
var e,
|
|
i,
|
|
a,
|
|
h = this.renderer,
|
|
l = !1,
|
|
u = !1;
|
|
t && (t instanceof n.RenderTexture ? a = t : (a = this.renderer.generateTexture(t), u = !0)),
|
|
a ? (e = a.baseTexture.resolution, i = a.frame, l = !1, h.renderTexture.bind(a)) : (e = this.renderer.resolution, l = !0, (i = o).width = this.renderer.width, i.height = this.renderer.height, h.renderTexture.bind(null));
|
|
var c = Math.floor(i.width * e + 1e-4),
|
|
p = Math.floor(i.height * e + 1e-4),
|
|
d = new r.CanvasRenderTarget(c, p, 1),
|
|
f = new Uint8Array(4 * c * p),
|
|
_ = h.gl;
|
|
_.readPixels(i.x * e, i.y * e, c, p, _.RGBA, _.UNSIGNED_BYTE, f);
|
|
var m = d.context.getImageData(0, 0, c, p);
|
|
return s.arrayPostDivide(f, m.data),
|
|
d.context.putImageData(m, 0, 0),
|
|
l && (d.context.scale(1, -1), d.context.drawImage(d.canvas, 0, -p)),
|
|
u && a.destroy(!0),
|
|
d.canvas
|
|
},
|
|
s.prototype.pixels = function (t) {
|
|
var e,
|
|
i,
|
|
r,
|
|
a = this.renderer,
|
|
h = !1;
|
|
t && (t instanceof n.RenderTexture ? r = t : (r = this.renderer.generateTexture(t), h = !0)),
|
|
r ? (e = r.baseTexture.resolution, i = r.frame, a.renderTexture.bind(r)) : (e = a.resolution, (i = o).width = a.width, i.height = a.height, a.renderTexture.bind(null));
|
|
var l = i.width * e,
|
|
u = i.height * e,
|
|
c = new Uint8Array(4 * l * u),
|
|
p = a.gl;
|
|
return p.readPixels(i.x * e, i.y * e, l, u, p.RGBA, p.UNSIGNED_BYTE, c),
|
|
h && r.destroy(!0),
|
|
s.arrayPostDivide(c, c),
|
|
c
|
|
},
|
|
s.prototype.destroy = function () {
|
|
this.renderer.extract = null,
|
|
this.renderer = null
|
|
},
|
|
s.arrayPostDivide = function (t, e) {
|
|
for (var i = 0; i < t.length; i += 4) {
|
|
var n = e[i + 3] = t[i + 3];
|
|
0 !== n ? (e[i] = Math.round(Math.min(255 * t[i] / n, 255)), e[i + 1] = Math.round(Math.min(255 * t[i + 1] / n, 255)), e[i + 2] = Math.round(Math.min(255 * t[i + 2] / n, 255))) : (e[i] = t[i], e[i + 1] = t[i + 1], e[i + 2] = t[i + 2])
|
|
}
|
|
}
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/math": "GTL5"
|
|
}
|
|
],
|
|
SFsV: [function (t, e, i) {
|
|
"use strict";
|
|
e.exports = function (t, e) {
|
|
e = e || {};
|
|
for (var i = {
|
|
key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"],
|
|
q: {
|
|
name: "queryKey",
|
|
parser: /(?:^|&)([^&=]*)=?([^&]*)/g
|
|
},
|
|
parser: {
|
|
strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
|
|
loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
|
|
}
|
|
}, n = i.parser[e.strictMode ? "strict" : "loose"].exec(t), r = {}, o = 14; o--; )
|
|
r[i.key[o]] = n[o] || "";
|
|
return r[i.q.name] = {},
|
|
r[i.key[12]].replace(i.q.parser, (function (t, e, n) {
|
|
e && (r[i.q.name][e] = n)
|
|
})),
|
|
r
|
|
}
|
|
}, {}
|
|
],
|
|
KIAI: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
});
|
|
var n = function () {
|
|
function t(t, e) {
|
|
for (var i = 0; i < e.length; i++) {
|
|
var n = e[i];
|
|
n.enumerable = n.enumerable || !1,
|
|
n.configurable = !0,
|
|
"value" in n && (n.writable = !0),
|
|
Object.defineProperty(t, n.key, n)
|
|
}
|
|
}
|
|
return function (e, i, n) {
|
|
return i && t(e.prototype, i),
|
|
n && t(e, n),
|
|
e
|
|
}
|
|
}
|
|
();
|
|
function r(t, e) {
|
|
if (!(t instanceof e))
|
|
throw new TypeError("Cannot call a class as a function")
|
|
}
|
|
var o = function () {
|
|
function t(e, i, n) {
|
|
void 0 === i && (i = !1),
|
|
r(this, t),
|
|
this._fn = e,
|
|
this._once = i,
|
|
this._thisArg = n,
|
|
this._next = this._prev = this._owner = null
|
|
}
|
|
return n(t, [{
|
|
key: "detach",
|
|
value: function () {
|
|
return null !== this._owner && (this._owner.detach(this), !0)
|
|
}
|
|
}
|
|
]),
|
|
t
|
|
}
|
|
();
|
|
function s(t, e) {
|
|
return t._head ? (t._tail._next = e, e._prev = t._tail, t._tail = e) : (t._head = e, t._tail = e),
|
|
e._owner = t,
|
|
e
|
|
}
|
|
var a = function () {
|
|
function t() {
|
|
r(this, t),
|
|
this._head = this._tail = void 0
|
|
}
|
|
return n(t, [{
|
|
key: "handlers",
|
|
value: function () {
|
|
var t = !(arguments.length <= 0 || void 0 === arguments[0]) && arguments[0],
|
|
e = this._head;
|
|
if (t)
|
|
return !!e;
|
|
for (var i = []; e; )
|
|
i.push(e), e = e._next;
|
|
return i
|
|
}
|
|
}, {
|
|
key: "has",
|
|
value: function (t) {
|
|
if (!(t instanceof o))
|
|
throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");
|
|
return t._owner === this
|
|
}
|
|
}, {
|
|
key: "dispatch",
|
|
value: function () {
|
|
var t = this._head;
|
|
if (!t)
|
|
return !1;
|
|
for (; t; )
|
|
t._once && this.detach(t), t._fn.apply(t._thisArg, arguments), t = t._next;
|
|
return !0
|
|
}
|
|
}, {
|
|
key: "add",
|
|
value: function (t) {
|
|
var e = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
|
|
if ("function" != typeof t)
|
|
throw new Error("MiniSignal#add(): First arg must be a Function.");
|
|
return s(this, new o(t, !1, e))
|
|
}
|
|
}, {
|
|
key: "once",
|
|
value: function (t) {
|
|
var e = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
|
|
if ("function" != typeof t)
|
|
throw new Error("MiniSignal#once(): First arg must be a Function.");
|
|
return s(this, new o(t, !0, e))
|
|
}
|
|
}, {
|
|
key: "detach",
|
|
value: function (t) {
|
|
if (!(t instanceof o))
|
|
throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");
|
|
return t._owner !== this || (t._prev && (t._prev._next = t._next), t._next && (t._next._prev = t._prev), t === this._head ? (this._head = t._next, null === t._next && (this._tail = null)) : t === this._tail && (this._tail = t._prev, this._tail._next = null), t._owner = null),
|
|
this
|
|
}
|
|
}, {
|
|
key: "detachAll",
|
|
value: function () {
|
|
var t = this._head;
|
|
if (!t)
|
|
return this;
|
|
for (this._head = this._tail = null; t; )
|
|
t._owner = null, t = t._next;
|
|
return this
|
|
}
|
|
}
|
|
]),
|
|
t
|
|
}
|
|
();
|
|
a.MiniSignalBinding = o,
|
|
i.default = a,
|
|
e.exports = i.default
|
|
}, {}
|
|
],
|
|
ndyJ: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.encodeBinary = w,
|
|
i.middleware = i.async = i.Resource = i.Loader = void 0;
|
|
var n = o(t("parse-uri")),
|
|
r = o(t("mini-signals"));
|
|
function o(t) {
|
|
return t && t.__esModule ? t : {
|
|
default:
|
|
t
|
|
}
|
|
}
|
|
/*!
|
|
* resource-loader - v3.0.1
|
|
* https://github.com/pixijs/pixi-sound
|
|
* Compiled Tue, 02 Jul 2019 14:06:18 UTC
|
|
*
|
|
* resource-loader is licensed under the MIT license.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
function s() {}
|
|
function a(t, e, i, n) {
|
|
var r = 0,
|
|
o = t.length;
|
|
!function s(a) {
|
|
a || r === o ? i && i(a) : n ? setTimeout((function () {
|
|
e(t[r++], s)
|
|
}), 1) : e(t[r++], s)
|
|
}
|
|
()
|
|
}
|
|
function h(t) {
|
|
return function () {
|
|
if (null === t)
|
|
throw new Error("Callback was already called.");
|
|
var e = t;
|
|
t = null,
|
|
e.apply(this, arguments)
|
|
}
|
|
}
|
|
function l(t, e) {
|
|
if (null == e)
|
|
e = 1;
|
|
else if (0 === e)
|
|
throw new Error("Concurrency must not be zero");
|
|
var i = 0,
|
|
n = {
|
|
_tasks: [],
|
|
concurrency: e,
|
|
saturated: s,
|
|
unsaturated: s,
|
|
buffer: e / 4,
|
|
empty: s,
|
|
drain: s,
|
|
error: s,
|
|
started: !1,
|
|
paused: !1,
|
|
push: function (t, e) {
|
|
r(t, !1, e)
|
|
},
|
|
kill: function () {
|
|
i = 0,
|
|
n.drain = s,
|
|
n.started = !1,
|
|
n._tasks = []
|
|
},
|
|
unshift: function (t, e) {
|
|
r(t, !0, e)
|
|
},
|
|
process: function () {
|
|
for (; !n.paused && i < n.concurrency && n._tasks.length; ) {
|
|
var e = n._tasks.shift();
|
|
0 === n._tasks.length && n.empty(),
|
|
(i += 1) === n.concurrency && n.saturated(),
|
|
t(e.data, h(o(e)))
|
|
}
|
|
},
|
|
length: function () {
|
|
return n._tasks.length
|
|
},
|
|
running: function () {
|
|
return i
|
|
},
|
|
idle: function () {
|
|
return n._tasks.length + i === 0
|
|
},
|
|
pause: function () {
|
|
!0 !== n.paused && (n.paused = !0)
|
|
},
|
|
resume: function () {
|
|
if (!1 !== n.paused) {
|
|
n.paused = !1;
|
|
for (var t = 1; t <= n.concurrency; t++)
|
|
n.process()
|
|
}
|
|
}
|
|
};
|
|
function r(t, e, i) {
|
|
if (null != i && "function" != typeof i)
|
|
throw new Error("task callback must be a function");
|
|
if (n.started = !0, null == t && n.idle())
|
|
setTimeout((function () {
|
|
return n.drain()
|
|
}), 1);
|
|
else {
|
|
var r = {
|
|
data: t,
|
|
callback: "function" == typeof i ? i : s
|
|
};
|
|
e ? n._tasks.unshift(r) : n._tasks.push(r),
|
|
setTimeout((function () {
|
|
return n.process()
|
|
}), 1)
|
|
}
|
|
}
|
|
function o(t) {
|
|
return function () {
|
|
i -= 1,
|
|
t.callback.apply(t, arguments),
|
|
null != arguments[0] && n.error(arguments[0], t.data),
|
|
i <= n.concurrency - n.buffer && n.unsaturated(),
|
|
n.idle() && n.drain(),
|
|
n.process()
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
var u = {
|
|
eachSeries: a,
|
|
queue: l
|
|
};
|
|
i.async = u;
|
|
var c = {};
|
|
function p(t, e) {
|
|
for (var i = 0; i < e.length; i++) {
|
|
var n = e[i];
|
|
n.enumerable = n.enumerable || !1,
|
|
n.configurable = !0,
|
|
"value" in n && (n.writable = !0),
|
|
Object.defineProperty(t, n.key, n)
|
|
}
|
|
}
|
|
function d(t, e, i) {
|
|
return e && p(t.prototype, e),
|
|
i && p(t, i),
|
|
t
|
|
}
|
|
var f = !(!window.XDomainRequest || "withCredentials" in new XMLHttpRequest),
|
|
_ = null;
|
|
function m() {}
|
|
var y = function () {
|
|
function t(e, i, n) {
|
|
if ("string" != typeof e || "string" != typeof i)
|
|
throw new Error("Both name and url are required for constructing a resource.");
|
|
n = n || {},
|
|
this._flags = 0,
|
|
this._setFlag(t.STATUS_FLAGS.DATA_URL, 0 === i.indexOf("data:")),
|
|
this.name = e,
|
|
this.url = i,
|
|
this.extension = this._getExtension(),
|
|
this.data = null,
|
|
this.crossOrigin = !0 === n.crossOrigin ? "anonymous" : n.crossOrigin,
|
|
this.timeout = n.timeout || 0,
|
|
this.loadType = n.loadType || this._determineLoadType(),
|
|
this.xhrType = n.xhrType,
|
|
this.metadata = n.metadata || {},
|
|
this.error = null,
|
|
this.xhr = null,
|
|
this.children = [],
|
|
this.type = t.TYPE.UNKNOWN,
|
|
this.progressChunk = 0,
|
|
this._dequeue = m,
|
|
this._onLoadBinding = null,
|
|
this._elementTimer = 0,
|
|
this._boundComplete = this.complete.bind(this),
|
|
this._boundOnError = this._onError.bind(this),
|
|
this._boundOnProgress = this._onProgress.bind(this),
|
|
this._boundOnTimeout = this._onTimeout.bind(this),
|
|
this._boundXhrOnError = this._xhrOnError.bind(this),
|
|
this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this),
|
|
this._boundXhrOnAbort = this._xhrOnAbort.bind(this),
|
|
this._boundXhrOnLoad = this._xhrOnLoad.bind(this),
|
|
this.onStart = new r.default,
|
|
this.onProgress = new r.default,
|
|
this.onComplete = new r.default,
|
|
this.onAfterMiddleware = new r.default
|
|
}
|
|
t.setExtensionLoadType = function (e, i) {
|
|
g(t._loadTypeMap, e, i)
|
|
},
|
|
t.setExtensionXhrType = function (e, i) {
|
|
g(t._xhrTypeMap, e, i)
|
|
};
|
|
var e = t.prototype;
|
|
return e.complete = function () {
|
|
this._clearEvents(),
|
|
this._finish()
|
|
},
|
|
e.abort = function (e) {
|
|
if (!this.error) {
|
|
if (this.error = new Error(e), this._clearEvents(), this.xhr)
|
|
this.xhr.abort();
|
|
else if (this.xdr)
|
|
this.xdr.abort();
|
|
else if (this.data)
|
|
if (this.data.src)
|
|
this.data.src = t.EMPTY_GIF;
|
|
else
|
|
for (; this.data.firstChild; )
|
|
this.data.removeChild(this.data.firstChild);
|
|
this._finish()
|
|
}
|
|
},
|
|
e.load = function (e) {
|
|
var i = this;
|
|
if (!this.isLoading)
|
|
if (this.isComplete)
|
|
e && setTimeout((function () {
|
|
return e(i)
|
|
}), 1);
|
|
else
|
|
switch (e && this.onComplete.once(e), this._setFlag(t.STATUS_FLAGS.LOADING, !0), this.onStart.dispatch(this), !1 !== this.crossOrigin && "string" == typeof this.crossOrigin || (this.crossOrigin = this._determineCrossOrigin(this.url)), this.loadType) {
|
|
case t.LOAD_TYPE.IMAGE:
|
|
this.type = t.TYPE.IMAGE,
|
|
this._loadElement("image");
|
|
break;
|
|
case t.LOAD_TYPE.AUDIO:
|
|
this.type = t.TYPE.AUDIO,
|
|
this._loadSourceElement("audio");
|
|
break;
|
|
case t.LOAD_TYPE.VIDEO:
|
|
this.type = t.TYPE.VIDEO,
|
|
this._loadSourceElement("video");
|
|
break;
|
|
case t.LOAD_TYPE.XHR:
|
|
default:
|
|
f && this.crossOrigin ? this._loadXdr() : this._loadXhr()
|
|
}
|
|
},
|
|
e._hasFlag = function (t) {
|
|
return 0 != (this._flags & t)
|
|
},
|
|
e._setFlag = function (t, e) {
|
|
this._flags = e ? this._flags | t : this._flags & ~t
|
|
},
|
|
e._clearEvents = function () {
|
|
clearTimeout(this._elementTimer),
|
|
this.data && this.data.removeEventListener && (this.data.removeEventListener("error", this._boundOnError, !1), this.data.removeEventListener("load", this._boundComplete, !1), this.data.removeEventListener("progress", this._boundOnProgress, !1), this.data.removeEventListener("canplaythrough", this._boundComplete, !1)),
|
|
this.xhr && (this.xhr.removeEventListener ? (this.xhr.removeEventListener("error", this._boundXhrOnError, !1), this.xhr.removeEventListener("timeout", this._boundXhrOnTimeout, !1), this.xhr.removeEventListener("abort", this._boundXhrOnAbort, !1), this.xhr.removeEventListener("progress", this._boundOnProgress, !1), this.xhr.removeEventListener("load", this._boundXhrOnLoad, !1)) : (this.xhr.onerror = null, this.xhr.ontimeout = null, this.xhr.onprogress = null, this.xhr.onload = null))
|
|
},
|
|
e._finish = function () {
|
|
if (this.isComplete)
|
|
throw new Error("Complete called again for an already completed resource.");
|
|
this._setFlag(t.STATUS_FLAGS.COMPLETE, !0),
|
|
this._setFlag(t.STATUS_FLAGS.LOADING, !1),
|
|
this.onComplete.dispatch(this)
|
|
},
|
|
e._loadElement = function (t) {
|
|
this.metadata.loadElement ? this.data = this.metadata.loadElement : "image" === t && void 0 !== window.Image ? this.data = new Image : this.data = document.createElement(t),
|
|
this.crossOrigin && (this.data.crossOrigin = this.crossOrigin),
|
|
this.metadata.skipSource || (this.data.src = this.url),
|
|
this.data.addEventListener("error", this._boundOnError, !1),
|
|
this.data.addEventListener("load", this._boundComplete, !1),
|
|
this.data.addEventListener("progress", this._boundOnProgress, !1),
|
|
this.timeout && (this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout))
|
|
},
|
|
e._loadSourceElement = function (t) {
|
|
if (this.metadata.loadElement ? this.data = this.metadata.loadElement : "audio" === t && void 0 !== window.Audio ? this.data = new Audio : this.data = document.createElement(t), null !== this.data) {
|
|
if (this.crossOrigin && (this.data.crossOrigin = this.crossOrigin), !this.metadata.skipSource)
|
|
if (navigator.isCocoonJS)
|
|
this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;
|
|
else if (Array.isArray(this.url))
|
|
for (var e = this.metadata.mimeType, i = 0; i < this.url.length; ++i)
|
|
this.data.appendChild(this._createSource(t, this.url[i], Array.isArray(e) ? e[i] : e));
|
|
else {
|
|
var n = this.metadata.mimeType;
|
|
this.data.appendChild(this._createSource(t, this.url, Array.isArray(n) ? n[0] : n))
|
|
}
|
|
this.data.addEventListener("error", this._boundOnError, !1),
|
|
this.data.addEventListener("load", this._boundComplete, !1),
|
|
this.data.addEventListener("progress", this._boundOnProgress, !1),
|
|
this.data.addEventListener("canplaythrough", this._boundComplete, !1),
|
|
this.data.load(),
|
|
this.timeout && (this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout))
|
|
} else
|
|
this.abort("Unsupported element: " + t)
|
|
},
|
|
e._loadXhr = function () {
|
|
"string" != typeof this.xhrType && (this.xhrType = this._determineXhrType());
|
|
var e = this.xhr = new XMLHttpRequest;
|
|
e.open("GET", this.url, !0),
|
|
e.timeout = this.timeout,
|
|
this.xhrType === t.XHR_RESPONSE_TYPE.JSON || this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT ? e.responseType = t.XHR_RESPONSE_TYPE.TEXT : e.responseType = this.xhrType,
|
|
e.addEventListener("error", this._boundXhrOnError, !1),
|
|
e.addEventListener("timeout", this._boundXhrOnTimeout, !1),
|
|
e.addEventListener("abort", this._boundXhrOnAbort, !1),
|
|
e.addEventListener("progress", this._boundOnProgress, !1),
|
|
e.addEventListener("load", this._boundXhrOnLoad, !1),
|
|
e.send()
|
|
},
|
|
e._loadXdr = function () {
|
|
"string" != typeof this.xhrType && (this.xhrType = this._determineXhrType());
|
|
var t = this.xhr = new XDomainRequest;
|
|
t.timeout = this.timeout || 5e3,
|
|
t.onerror = this._boundXhrOnError,
|
|
t.ontimeout = this._boundXhrOnTimeout,
|
|
t.onprogress = this._boundOnProgress,
|
|
t.onload = this._boundXhrOnLoad,
|
|
t.open("GET", this.url, !0),
|
|
setTimeout((function () {
|
|
return t.send()
|
|
}), 1)
|
|
},
|
|
e._createSource = function (t, e, i) {
|
|
i || (i = t + "/" + this._getExtension(e));
|
|
var n = document.createElement("source");
|
|
return n.src = e,
|
|
n.type = i,
|
|
n
|
|
},
|
|
e._onError = function (t) {
|
|
this.abort("Failed to load element using: " + t.target.nodeName)
|
|
},
|
|
e._onProgress = function (t) {
|
|
t && t.lengthComputable && this.onProgress.dispatch(this, t.loaded / t.total)
|
|
},
|
|
e._onTimeout = function () {
|
|
this.abort("Load timed out.")
|
|
},
|
|
e._xhrOnError = function () {
|
|
var t = this.xhr;
|
|
this.abort(v(t) + " Request failed. Status: " + t.status + ', text: "' + t.statusText + '"')
|
|
},
|
|
e._xhrOnTimeout = function () {
|
|
var t = this.xhr;
|
|
this.abort(v(t) + " Request timed out.")
|
|
},
|
|
e._xhrOnAbort = function () {
|
|
var t = this.xhr;
|
|
this.abort(v(t) + " Request was aborted by the user.")
|
|
},
|
|
e._xhrOnLoad = function () {
|
|
var e = this.xhr,
|
|
i = "",
|
|
n = void 0 === e.status ? 200 : e.status;
|
|
if ("" !== e.responseType && "text" !== e.responseType && void 0 !== e.responseType || (i = e.responseText), 0 === n && (i.length > 0 || e.responseType === t.XHR_RESPONSE_TYPE.BUFFER) ? n = 200 : 1223 === n && (n = 204), 2 === (n / 100 | 0)) {
|
|
if (this.xhrType === t.XHR_RESPONSE_TYPE.TEXT)
|
|
this.data = i, this.type = t.TYPE.TEXT;
|
|
else if (this.xhrType === t.XHR_RESPONSE_TYPE.JSON)
|
|
try {
|
|
this.data = JSON.parse(i),
|
|
this.type = t.TYPE.JSON
|
|
} catch (t) {
|
|
return void this.abort("Error trying to parse loaded json: " + t)
|
|
}
|
|
else if (this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT)
|
|
try {
|
|
if (window.DOMParser) {
|
|
var r = new DOMParser;
|
|
this.data = r.parseFromString(i, "text/xml")
|
|
} else {
|
|
var o = document.createElement("div");
|
|
o.innerHTML = i,
|
|
this.data = o
|
|
}
|
|
this.type = t.TYPE.XML
|
|
} catch (t) {
|
|
return void this.abort("Error trying to parse loaded xml: " + t)
|
|
}
|
|
else
|
|
this.data = e.response || i;
|
|
this.complete()
|
|
} else
|
|
this.abort("[" + e.status + "] " + e.statusText + ": " + e.responseURL)
|
|
},
|
|
e._determineCrossOrigin = function (t, e) {
|
|
if (0 === t.indexOf("data:"))
|
|
return "";
|
|
if (window.origin !== window.location.origin)
|
|
return "anonymous";
|
|
e = e || window.location,
|
|
_ || (_ = document.createElement("a")),
|
|
_.href = t;
|
|
var i = !(t = (0, n.default)(_.href, {
|
|
strictMode: !0
|
|
})).port && "" === e.port || t.port === e.port,
|
|
r = t.protocol ? t.protocol + ":" : "";
|
|
return t.host === e.hostname && i && r === e.protocol ? "" : "anonymous"
|
|
},
|
|
e._determineXhrType = function () {
|
|
return t._xhrTypeMap[this.extension] || t.XHR_RESPONSE_TYPE.TEXT
|
|
},
|
|
e._determineLoadType = function () {
|
|
return t._loadTypeMap[this.extension] || t.LOAD_TYPE.XHR
|
|
},
|
|
e._getExtension = function () {
|
|
var t = this.url,
|
|
e = "";
|
|
if (this.isDataUrl) {
|
|
var i = t.indexOf("/");
|
|
e = t.substring(i + 1, t.indexOf(";", i))
|
|
} else {
|
|
var n = t.indexOf("?"),
|
|
r = t.indexOf("#"),
|
|
o = Math.min(n > -1 ? n : t.length, r > -1 ? r : t.length);
|
|
e = (t = t.substring(0, o)).substring(t.lastIndexOf(".") + 1)
|
|
}
|
|
return e.toLowerCase()
|
|
},
|
|
e._getMimeFromXhrType = function (e) {
|
|
switch (e) {
|
|
case t.XHR_RESPONSE_TYPE.BUFFER:
|
|
return "application/octet-binary";
|
|
case t.XHR_RESPONSE_TYPE.BLOB:
|
|
return "application/blob";
|
|
case t.XHR_RESPONSE_TYPE.DOCUMENT:
|
|
return "application/xml";
|
|
case t.XHR_RESPONSE_TYPE.JSON:
|
|
return "application/json";
|
|
case t.XHR_RESPONSE_TYPE.DEFAULT:
|
|
case t.XHR_RESPONSE_TYPE.TEXT:
|
|
default:
|
|
return "text/plain"
|
|
}
|
|
},
|
|
d(t, [{
|
|
key: "isDataUrl",
|
|
get: function () {
|
|
return this._hasFlag(t.STATUS_FLAGS.DATA_URL)
|
|
}
|
|
}, {
|
|
key: "isComplete",
|
|
get: function () {
|
|
return this._hasFlag(t.STATUS_FLAGS.COMPLETE)
|
|
}
|
|
}, {
|
|
key: "isLoading",
|
|
get: function () {
|
|
return this._hasFlag(t.STATUS_FLAGS.LOADING)
|
|
}
|
|
}
|
|
]),
|
|
t
|
|
}
|
|
();
|
|
function g(t, e, i) {
|
|
e && 0 === e.indexOf(".") && (e = e.substring(1)),
|
|
e && (t[e] = i)
|
|
}
|
|
function v(t) {
|
|
return t.toString().replace("object ", "")
|
|
}
|
|
i.Resource = y,
|
|
y.STATUS_FLAGS = {
|
|
NONE: 0,
|
|
DATA_URL: 1,
|
|
COMPLETE: 2,
|
|
LOADING: 4
|
|
},
|
|
y.TYPE = {
|
|
UNKNOWN: 0,
|
|
JSON: 1,
|
|
XML: 2,
|
|
IMAGE: 3,
|
|
AUDIO: 4,
|
|
VIDEO: 5,
|
|
TEXT: 6
|
|
},
|
|
y.LOAD_TYPE = {
|
|
XHR: 1,
|
|
IMAGE: 2,
|
|
AUDIO: 3,
|
|
VIDEO: 4
|
|
},
|
|
y.XHR_RESPONSE_TYPE = {
|
|
DEFAULT: "text",
|
|
BUFFER: "arraybuffer",
|
|
BLOB: "blob",
|
|
DOCUMENT: "document",
|
|
JSON: "json",
|
|
TEXT: "text"
|
|
},
|
|
y._loadTypeMap = {
|
|
gif: y.LOAD_TYPE.IMAGE,
|
|
png: y.LOAD_TYPE.IMAGE,
|
|
bmp: y.LOAD_TYPE.IMAGE,
|
|
jpg: y.LOAD_TYPE.IMAGE,
|
|
jpeg: y.LOAD_TYPE.IMAGE,
|
|
tif: y.LOAD_TYPE.IMAGE,
|
|
tiff: y.LOAD_TYPE.IMAGE,
|
|
webp: y.LOAD_TYPE.IMAGE,
|
|
tga: y.LOAD_TYPE.IMAGE,
|
|
svg: y.LOAD_TYPE.IMAGE,
|
|
"svg+xml": y.LOAD_TYPE.IMAGE,
|
|
mp3: y.LOAD_TYPE.AUDIO,
|
|
ogg: y.LOAD_TYPE.AUDIO,
|
|
wav: y.LOAD_TYPE.AUDIO,
|
|
mp4: y.LOAD_TYPE.VIDEO,
|
|
webm: y.LOAD_TYPE.VIDEO
|
|
},
|
|
y._xhrTypeMap = {
|
|
xhtml: y.XHR_RESPONSE_TYPE.DOCUMENT,
|
|
html: y.XHR_RESPONSE_TYPE.DOCUMENT,
|
|
htm: y.XHR_RESPONSE_TYPE.DOCUMENT,
|
|
xml: y.XHR_RESPONSE_TYPE.DOCUMENT,
|
|
tmx: y.XHR_RESPONSE_TYPE.DOCUMENT,
|
|
svg: y.XHR_RESPONSE_TYPE.DOCUMENT,
|
|
tsx: y.XHR_RESPONSE_TYPE.DOCUMENT,
|
|
gif: y.XHR_RESPONSE_TYPE.BLOB,
|
|
png: y.XHR_RESPONSE_TYPE.BLOB,
|
|
bmp: y.XHR_RESPONSE_TYPE.BLOB,
|
|
jpg: y.XHR_RESPONSE_TYPE.BLOB,
|
|
jpeg: y.XHR_RESPONSE_TYPE.BLOB,
|
|
tif: y.XHR_RESPONSE_TYPE.BLOB,
|
|
tiff: y.XHR_RESPONSE_TYPE.BLOB,
|
|
webp: y.XHR_RESPONSE_TYPE.BLOB,
|
|
tga: y.XHR_RESPONSE_TYPE.BLOB,
|
|
json: y.XHR_RESPONSE_TYPE.JSON,
|
|
text: y.XHR_RESPONSE_TYPE.TEXT,
|
|
txt: y.XHR_RESPONSE_TYPE.TEXT,
|
|
ttf: y.XHR_RESPONSE_TYPE.BUFFER,
|
|
otf: y.XHR_RESPONSE_TYPE.BUFFER
|
|
},
|
|
y.EMPTY_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
|
|
function w(t) {
|
|
for (var e = "", i = 0; i < t.length; ) {
|
|
for (var n = [0, 0, 0], r = [0, 0, 0, 0], o = 0; o < n.length; ++o)
|
|
i < t.length ? n[o] = 255 & t.charCodeAt(i++) : n[o] = 0;
|
|
switch (r[0] = n[0] >> 2, r[1] = (3 & n[0]) << 4 | n[1] >> 4, r[2] = (15 & n[1]) << 2 | n[2] >> 6, r[3] = 63 & n[2], i - (t.length - 1)) {
|
|
case 2:
|
|
r[3] = 64,
|
|
r[2] = 64;
|
|
break;
|
|
case 1:
|
|
r[3] = 64
|
|
}
|
|
for (var s = 0; s < r.length; ++s)
|
|
e += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r[s])
|
|
}
|
|
return e
|
|
}
|
|
var x = window.URL || window.webkitURL;
|
|
var b = {
|
|
caching: function (t, e) {
|
|
var i = this;
|
|
c[t.url] ? (t.data = c[t.url], t.complete()) : t.onComplete.once((function () {
|
|
return c[i.url] = i.data
|
|
})),
|
|
e()
|
|
},
|
|
parsing: function (t, e) {
|
|
if (t.data) {
|
|
if (t.xhr && t.xhrType === y.XHR_RESPONSE_TYPE.BLOB)
|
|
if (window.Blob && "string" != typeof t.data) {
|
|
if (0 === t.data.type.indexOf("image")) {
|
|
var i = x.createObjectURL(t.data);
|
|
return t.blob = t.data,
|
|
t.data = new Image,
|
|
t.data.src = i,
|
|
t.type = y.TYPE.IMAGE,
|
|
void(t.data.onload = function () {
|
|
x.revokeObjectURL(i),
|
|
t.data.onload = null,
|
|
e()
|
|
})
|
|
}
|
|
} else {
|
|
var n = t.xhr.getResponseHeader("content-type");
|
|
if (n && 0 === n.indexOf("image"))
|
|
return t.data = new Image, t.data.src = "data:" + n + ";base64," + w(t.xhr.responseText), t.type = y.TYPE.IMAGE, void(t.data.onload = function () {
|
|
t.data.onload = null,
|
|
e()
|
|
})
|
|
}
|
|
e()
|
|
} else
|
|
e()
|
|
}
|
|
};
|
|
i.middleware = b;
|
|
var E = /(#[\w-]+)?$/,
|
|
$ = function () {
|
|
function t(e, i) {
|
|
var n = this;
|
|
void 0 === e && (e = ""),
|
|
void 0 === i && (i = 10),
|
|
this.baseUrl = e,
|
|
this.progress = 0,
|
|
this.loading = !1,
|
|
this.defaultQueryString = "",
|
|
this._beforeMiddleware = [],
|
|
this._afterMiddleware = [],
|
|
this._resourcesParsing = [],
|
|
this._boundLoadResource = function (t, e) {
|
|
return n._loadResource(t, e)
|
|
},
|
|
this._queue = l(this._boundLoadResource, i),
|
|
this._queue.pause(),
|
|
this.resources = {},
|
|
this.onProgress = new r.default,
|
|
this.onError = new r.default,
|
|
this.onLoad = new r.default,
|
|
this.onStart = new r.default,
|
|
this.onComplete = new r.default;
|
|
for (var o = 0; o < t._defaultBeforeMiddleware.length; ++o)
|
|
this.pre(t._defaultBeforeMiddleware[o]);
|
|
for (var s = 0; s < t._defaultAfterMiddleware.length; ++s)
|
|
this.use(t._defaultAfterMiddleware[s])
|
|
}
|
|
var e = t.prototype;
|
|
return e.add = function (t, e, i, n) {
|
|
if (Array.isArray(t)) {
|
|
for (var r = 0; r < t.length; ++r)
|
|
this.add(t[r]);
|
|
return this
|
|
}
|
|
if ("object" == typeof t && (n = e || t.callback || t.onComplete, i = t, e = t.url, t = t.name || t.key || t.url), "string" != typeof e && (n = i, i = e, e = t), "string" != typeof e)
|
|
throw new Error("No url passed to add resource to loader.");
|
|
if ("function" == typeof i && (n = i, i = null), this.loading && (!i || !i.parentResource))
|
|
throw new Error("Cannot add resources while the loader is running.");
|
|
if (this.resources[t])
|
|
throw new Error('Resource named "' + t + '" already exists.');
|
|
if (e = this._prepareUrl(e), this.resources[t] = new y(t, e, i), "function" == typeof n && this.resources[t].onAfterMiddleware.once(n), this.loading) {
|
|
for (var o = i.parentResource, s = [], a = 0; a < o.children.length; ++a)
|
|
o.children[a].isComplete || s.push(o.children[a]);
|
|
var h = o.progressChunk * (s.length + 1) / (s.length + 2);
|
|
o.children.push(this.resources[t]),
|
|
o.progressChunk = h;
|
|
for (var l = 0; l < s.length; ++l)
|
|
s[l].progressChunk = h;
|
|
this.resources[t].progressChunk = h
|
|
}
|
|
return this._queue.push(this.resources[t]),
|
|
this
|
|
},
|
|
e.pre = function (t) {
|
|
return this._beforeMiddleware.push(t),
|
|
this
|
|
},
|
|
e.use = function (t) {
|
|
return this._afterMiddleware.push(t),
|
|
this
|
|
},
|
|
e.reset = function () {
|
|
for (var t in this.progress = 0, this.loading = !1, this._queue.kill(), this._queue.pause(), this.resources) {
|
|
var e = this.resources[t];
|
|
e._onLoadBinding && e._onLoadBinding.detach(),
|
|
e.isLoading && e.abort()
|
|
}
|
|
return this.resources = {},
|
|
this
|
|
},
|
|
e.load = function (t) {
|
|
if ("function" == typeof t && this.onComplete.once(t), this.loading)
|
|
return this;
|
|
if (this._queue.idle())
|
|
this._onStart(), this._onComplete();
|
|
else {
|
|
for (var e = 100 / this._queue._tasks.length, i = 0; i < this._queue._tasks.length; ++i)
|
|
this._queue._tasks[i].data.progressChunk = e;
|
|
this._onStart(),
|
|
this._queue.resume()
|
|
}
|
|
return this
|
|
},
|
|
e._prepareUrl = function (t) {
|
|
var e,
|
|
i = (0, n.default)(t, {
|
|
strictMode: !0
|
|
});
|
|
if (e = i.protocol || !i.path || 0 === t.indexOf("//") ? t : this.baseUrl.length && this.baseUrl.lastIndexOf("/") !== this.baseUrl.length - 1 && "/" !== t.charAt(0) ? this.baseUrl + "/" + t : this.baseUrl + t, this.defaultQueryString) {
|
|
var r = E.exec(e)[0];
|
|
-1 !== (e = e.substr(0, e.length - r.length)).indexOf("?") ? e += "&" + this.defaultQueryString : e += "?" + this.defaultQueryString,
|
|
e += r
|
|
}
|
|
return e
|
|
},
|
|
e._loadResource = function (t, e) {
|
|
var i = this;
|
|
t._dequeue = e,
|
|
a(this._beforeMiddleware, (function (e, n) {
|
|
e.call(i, t, (function () {
|
|
n(t.isComplete ? {}
|
|
: null)
|
|
}))
|
|
}), (function () {
|
|
t.isComplete ? i._onLoad(t) : (t._onLoadBinding = t.onComplete.once(i._onLoad, i), t.load())
|
|
}), !0)
|
|
},
|
|
e._onStart = function () {
|
|
this.progress = 0,
|
|
this.loading = !0,
|
|
this.onStart.dispatch(this)
|
|
},
|
|
e._onComplete = function () {
|
|
this.progress = 100,
|
|
this.loading = !1,
|
|
this.onComplete.dispatch(this, this.resources)
|
|
},
|
|
e._onLoad = function (t) {
|
|
var e = this;
|
|
t._onLoadBinding = null,
|
|
this._resourcesParsing.push(t),
|
|
t._dequeue(),
|
|
a(this._afterMiddleware, (function (i, n) {
|
|
i.call(e, t, n)
|
|
}), (function () {
|
|
t.onAfterMiddleware.dispatch(t),
|
|
e.progress = Math.min(100, e.progress + t.progressChunk),
|
|
e.onProgress.dispatch(e, t),
|
|
t.error ? e.onError.dispatch(t.error, e, t) : e.onLoad.dispatch(e, t),
|
|
e._resourcesParsing.splice(e._resourcesParsing.indexOf(t), 1),
|
|
e._queue.idle() && 0 === e._resourcesParsing.length && e._onComplete()
|
|
}), !0)
|
|
},
|
|
d(t, [{
|
|
key: "concurrency",
|
|
get: function () {
|
|
return this._queue.concurrency
|
|
},
|
|
set: function (t) {
|
|
this._queue.concurrency = t
|
|
}
|
|
}
|
|
]),
|
|
t
|
|
}
|
|
();
|
|
i.Loader = $,
|
|
$._defaultBeforeMiddleware = [],
|
|
$._defaultAfterMiddleware = [],
|
|
$.pre = function (t) {
|
|
return $._defaultBeforeMiddleware.push(t),
|
|
$
|
|
},
|
|
$.use = function (t) {
|
|
return $._defaultAfterMiddleware.push(t),
|
|
$
|
|
}
|
|
}, {
|
|
"parse-uri": "SFsV",
|
|
"mini-signals": "KIAI"
|
|
}
|
|
],
|
|
pAmg: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.TextureLoader = i.LoaderResource = i.Loader = i.AppLoaderPlugin = void 0;
|
|
var n = t("resource-loader"),
|
|
r = t("@pixi/utils"),
|
|
o = t("@pixi/core"),
|
|
s = function () {};
|
|
i.TextureLoader = s,
|
|
s.use = function (t, e) {
|
|
t.data && t.type === n.Resource.TYPE.IMAGE && (t.texture = o.Texture.fromLoader(t.data, t.url, t.name)),
|
|
e()
|
|
};
|
|
var a = function (t) {
|
|
function e(i, n) {
|
|
var o = this;
|
|
t.call(this, i, n),
|
|
r.EventEmitter.call(this);
|
|
for (var s = 0; s < e._plugins.length; ++s) {
|
|
var a = e._plugins[s],
|
|
h = a.pre,
|
|
l = a.use;
|
|
h && this.pre(h),
|
|
l && this.use(l)
|
|
}
|
|
this.onStart.add((function (t) {
|
|
return o.emit("start", t)
|
|
})),
|
|
this.onProgress.add((function (t, e) {
|
|
return o.emit("progress", t, e)
|
|
})),
|
|
this.onError.add((function (t, e, i) {
|
|
return o.emit("error", t, e, i)
|
|
})),
|
|
this.onLoad.add((function (t, e) {
|
|
return o.emit("load", t, e)
|
|
})),
|
|
this.onComplete.add((function (t, e) {
|
|
return o.emit("complete", t, e)
|
|
})),
|
|
this._protected = !1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
shared: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.destroy = function () {
|
|
this._protected || (this.removeAllListeners(), this.reset())
|
|
},
|
|
i.shared.get = function () {
|
|
var t = e._shared;
|
|
return t || ((t = new e)._protected = !0, e._shared = t),
|
|
t
|
|
},
|
|
Object.defineProperties(e, i),
|
|
e
|
|
}
|
|
(n.Loader);
|
|
i.Loader = a,
|
|
Object.assign(a.prototype, r.EventEmitter.prototype),
|
|
a._plugins = [],
|
|
a.registerPlugin = function (t) {
|
|
return a._plugins.push(t),
|
|
t.add && t.add(),
|
|
a
|
|
},
|
|
a.registerPlugin({
|
|
use: n.middleware.parsing
|
|
}),
|
|
a.registerPlugin(s);
|
|
var h = function () {};
|
|
i.AppLoaderPlugin = h,
|
|
h.init = function (t) {
|
|
t = Object.assign({
|
|
sharedLoader: !1
|
|
}, t),
|
|
this.loader = t.sharedLoader ? a.shared : new a
|
|
},
|
|
h.destroy = function () {
|
|
this.loader && (this.loader.destroy(), this.loader = null)
|
|
};
|
|
var l = n.Resource;
|
|
i.LoaderResource = l
|
|
}, {
|
|
"resource-loader": "ndyJ",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/core": "qqf8"
|
|
}
|
|
],
|
|
lXcw: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.ParticleRenderer = i.ParticleContainer = void 0;
|
|
var n = t("@pixi/constants"),
|
|
r = t("@pixi/utils"),
|
|
o = t("@pixi/display"),
|
|
s = t("@pixi/core"),
|
|
a = t("@pixi/math"),
|
|
h = function (t) {
|
|
function e(e, i, r, o) {
|
|
void 0 === e && (e = 1500),
|
|
void 0 === r && (r = 16384),
|
|
void 0 === o && (o = !1),
|
|
t.call(this);
|
|
r > 16384 && (r = 16384),
|
|
this._properties = [!1, !0, !1, !1, !1],
|
|
this._maxSize = e,
|
|
this._batchSize = r,
|
|
this._buffers = null,
|
|
this._bufferUpdateIDs = [],
|
|
this._updateID = 0,
|
|
this.interactiveChildren = !1,
|
|
this.blendMode = n.BLEND_MODES.NORMAL,
|
|
this.autoResize = o,
|
|
this.roundPixels = !0,
|
|
this.baseTexture = null,
|
|
this.setProperties(i),
|
|
this._tint = 0,
|
|
this.tintRgb = new Float32Array(4),
|
|
this.tint = 16777215
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
tint: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.setProperties = function (t) {
|
|
t && (this._properties[0] = "vertices" in t || "scale" in t ? !!t.vertices || !!t.scale : this._properties[0], this._properties[1] = "position" in t ? !!t.position : this._properties[1], this._properties[2] = "rotation" in t ? !!t.rotation : this._properties[2], this._properties[3] = "uvs" in t ? !!t.uvs : this._properties[3], this._properties[4] = "tint" in t || "alpha" in t ? !!t.tint || !!t.alpha : this._properties[4])
|
|
},
|
|
e.prototype.updateTransform = function () {
|
|
this.displayObjectUpdateTransform()
|
|
},
|
|
i.tint.get = function () {
|
|
return this._tint
|
|
},
|
|
i.tint.set = function (t) {
|
|
this._tint = t,
|
|
(0, r.hex2rgb)(t, this.tintRgb)
|
|
},
|
|
e.prototype.render = function (t) {
|
|
var e = this;
|
|
this.visible && !(this.worldAlpha <= 0) && this.children.length && this.renderable && (this.baseTexture || (this.baseTexture = this.children[0]._texture.baseTexture, this.baseTexture.valid || this.baseTexture.once("update", (function () {
|
|
return e.onChildrenChange(0)
|
|
}))), t.batch.setObjectRenderer(t.plugins.particle), t.plugins.particle.render(this))
|
|
},
|
|
e.prototype.onChildrenChange = function (t) {
|
|
for (var e = Math.floor(t / this._batchSize); this._bufferUpdateIDs.length < e; )
|
|
this._bufferUpdateIDs.push(0);
|
|
this._bufferUpdateIDs[e] = ++this._updateID
|
|
},
|
|
e.prototype.dispose = function () {
|
|
if (this._buffers) {
|
|
for (var t = 0; t < this._buffers.length; ++t)
|
|
this._buffers[t].destroy();
|
|
this._buffers = null
|
|
}
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
t.prototype.destroy.call(this, e),
|
|
this.dispose(),
|
|
this._properties = null,
|
|
this._buffers = null,
|
|
this._bufferUpdateIDs = null
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(o.Container);
|
|
i.ParticleContainer = h;
|
|
var l = function (t, e, i) {
|
|
this.geometry = new s.Geometry,
|
|
this.indexBuffer = null,
|
|
this.size = i,
|
|
this.dynamicProperties = [],
|
|
this.staticProperties = [];
|
|
for (var r = 0; r < t.length; ++r) {
|
|
var o = t[r];
|
|
o = {
|
|
attributeName: o.attributeName,
|
|
size: o.size,
|
|
uploadFunction: o.uploadFunction,
|
|
type: o.type || n.TYPES.FLOAT,
|
|
offset: o.offset
|
|
},
|
|
e[r] ? this.dynamicProperties.push(o) : this.staticProperties.push(o)
|
|
}
|
|
this.staticStride = 0,
|
|
this.staticBuffer = null,
|
|
this.staticData = null,
|
|
this.staticDataUint32 = null,
|
|
this.dynamicStride = 0,
|
|
this.dynamicBuffer = null,
|
|
this.dynamicData = null,
|
|
this.dynamicDataUint32 = null,
|
|
this._updateID = 0,
|
|
this.initBuffers()
|
|
};
|
|
l.prototype.initBuffers = function () {
|
|
var t = this.geometry,
|
|
e = 0;
|
|
this.indexBuffer = new s.Buffer((0, r.createIndicesForQuads)(this.size), !0, !0),
|
|
t.addIndex(this.indexBuffer),
|
|
this.dynamicStride = 0;
|
|
for (var i = 0; i < this.dynamicProperties.length; ++i) {
|
|
var o = this.dynamicProperties[i];
|
|
o.offset = e,
|
|
e += o.size,
|
|
this.dynamicStride += o.size
|
|
}
|
|
var a = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);
|
|
this.dynamicData = new Float32Array(a),
|
|
this.dynamicDataUint32 = new Uint32Array(a),
|
|
this.dynamicBuffer = new s.Buffer(this.dynamicData, !1, !1);
|
|
var h = 0;
|
|
this.staticStride = 0;
|
|
for (var l = 0; l < this.staticProperties.length; ++l) {
|
|
var u = this.staticProperties[l];
|
|
u.offset = h,
|
|
h += u.size,
|
|
this.staticStride += u.size
|
|
}
|
|
var c = new ArrayBuffer(this.size * this.staticStride * 4 * 4);
|
|
this.staticData = new Float32Array(c),
|
|
this.staticDataUint32 = new Uint32Array(c),
|
|
this.staticBuffer = new s.Buffer(this.staticData, !0, !1);
|
|
for (var p = 0; p < this.dynamicProperties.length; ++p) {
|
|
var d = this.dynamicProperties[p];
|
|
t.addAttribute(d.attributeName, this.dynamicBuffer, 0, d.type === n.TYPES.UNSIGNED_BYTE, d.type, 4 * this.dynamicStride, 4 * d.offset)
|
|
}
|
|
for (var f = 0; f < this.staticProperties.length; ++f) {
|
|
var _ = this.staticProperties[f];
|
|
t.addAttribute(_.attributeName, this.staticBuffer, 0, _.type === n.TYPES.UNSIGNED_BYTE, _.type, 4 * this.staticStride, 4 * _.offset)
|
|
}
|
|
},
|
|
l.prototype.uploadDynamic = function (t, e, i) {
|
|
for (var r = 0; r < this.dynamicProperties.length; r++) {
|
|
var o = this.dynamicProperties[r];
|
|
o.uploadFunction(t, e, i, o.type === n.TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, o.offset)
|
|
}
|
|
this.dynamicBuffer._updateID++
|
|
},
|
|
l.prototype.uploadStatic = function (t, e, i) {
|
|
for (var r = 0; r < this.staticProperties.length; r++) {
|
|
var o = this.staticProperties[r];
|
|
o.uploadFunction(t, e, i, o.type === n.TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, this.staticStride, o.offset)
|
|
}
|
|
this.staticBuffer._updateID++
|
|
},
|
|
l.prototype.destroy = function () {
|
|
this.indexBuffer = null,
|
|
this.dynamicProperties = null,
|
|
this.dynamicBuffer = null,
|
|
this.dynamicData = null,
|
|
this.dynamicDataUint32 = null,
|
|
this.staticProperties = null,
|
|
this.staticBuffer = null,
|
|
this.staticData = null,
|
|
this.staticDataUint32 = null,
|
|
this.geometry.destroy()
|
|
};
|
|
var u = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.shader = null,
|
|
this.properties = null,
|
|
this.tempMatrix = new a.Matrix,
|
|
this.properties = [{
|
|
attributeName: "aVertexPosition",
|
|
size: 2,
|
|
uploadFunction: this.uploadVertices,
|
|
offset: 0
|
|
}, {
|
|
attributeName: "aPositionCoord",
|
|
size: 2,
|
|
uploadFunction: this.uploadPosition,
|
|
offset: 0
|
|
}, {
|
|
attributeName: "aRotation",
|
|
size: 1,
|
|
uploadFunction: this.uploadRotation,
|
|
offset: 0
|
|
}, {
|
|
attributeName: "aTextureCoord",
|
|
size: 2,
|
|
uploadFunction: this.uploadUvs,
|
|
offset: 0
|
|
}, {
|
|
attributeName: "aColor",
|
|
size: 1,
|
|
type: n.TYPES.UNSIGNED_BYTE,
|
|
uploadFunction: this.uploadTint,
|
|
offset: 0
|
|
}
|
|
],
|
|
this.shader = s.Shader.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n", "varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}", {}),
|
|
this.state = s.State.for2d()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.render = function (t) {
|
|
var e = t.children,
|
|
i = t._maxSize,
|
|
n = t._batchSize,
|
|
o = this.renderer,
|
|
s = e.length;
|
|
if (0 !== s) {
|
|
s > i && !t.autoResize && (s = i);
|
|
var a = t._buffers;
|
|
a || (a = t._buffers = this.generateBuffers(t));
|
|
var h = e[0]._texture.baseTexture;
|
|
this.state.blendMode = (0, r.correctBlendMode)(t.blendMode, h.alphaMode),
|
|
o.state.set(this.state);
|
|
var l = o.gl,
|
|
u = t.worldTransform.copyTo(this.tempMatrix);
|
|
u.prepend(o.globalUniforms.uniforms.projectionMatrix),
|
|
this.shader.uniforms.translationMatrix = u.toArray(!0),
|
|
this.shader.uniforms.uColor = (0, r.premultiplyRgba)(t.tintRgb, t.worldAlpha, this.shader.uniforms.uColor, h.alphaMode),
|
|
this.shader.uniforms.uSampler = h,
|
|
this.renderer.shader.bind(this.shader);
|
|
for (var c = !1, p = 0, d = 0; p < s; p += n, d += 1) {
|
|
var f = s - p;
|
|
f > n && (f = n),
|
|
d >= a.length && a.push(this._generateOneMoreBuffer(t));
|
|
var _ = a[d];
|
|
_.uploadDynamic(e, p, f);
|
|
var m = t._bufferUpdateIDs[d] || 0;
|
|
(c = c || _._updateID < m) && (_._updateID = t._updateID, _.uploadStatic(e, p, f)),
|
|
o.geometry.bind(_.geometry),
|
|
l.drawElements(l.TRIANGLES, 6 * f, l.UNSIGNED_SHORT, 0)
|
|
}
|
|
}
|
|
},
|
|
e.prototype.generateBuffers = function (t) {
|
|
for (var e = [], i = t._maxSize, n = t._batchSize, r = t._properties, o = 0; o < i; o += n)
|
|
e.push(new l(this.properties, r, n));
|
|
return e
|
|
},
|
|
e.prototype._generateOneMoreBuffer = function (t) {
|
|
var e = t._batchSize,
|
|
i = t._properties;
|
|
return new l(this.properties, i, e)
|
|
},
|
|
e.prototype.uploadVertices = function (t, e, i, n, r, o) {
|
|
for (var s = 0, a = 0, h = 0, l = 0, u = 0; u < i; ++u) {
|
|
var c = t[e + u],
|
|
p = c._texture,
|
|
d = c.scale.x,
|
|
f = c.scale.y,
|
|
_ = p.trim,
|
|
m = p.orig;
|
|
_ ? (s = (a = _.x - c.anchor.x * m.width) + _.width, h = (l = _.y - c.anchor.y * m.height) + _.height) : (s = m.width * (1 - c.anchor.x), a = m.width * -c.anchor.x, h = m.height * (1 - c.anchor.y), l = m.height * -c.anchor.y),
|
|
n[o] = a * d,
|
|
n[o + 1] = l * f,
|
|
n[o + r] = s * d,
|
|
n[o + r + 1] = l * f,
|
|
n[o + 2 * r] = s * d,
|
|
n[o + 2 * r + 1] = h * f,
|
|
n[o + 3 * r] = a * d,
|
|
n[o + 3 * r + 1] = h * f,
|
|
o += 4 * r
|
|
}
|
|
},
|
|
e.prototype.uploadPosition = function (t, e, i, n, r, o) {
|
|
for (var s = 0; s < i; s++) {
|
|
var a = t[e + s].position;
|
|
n[o] = a.x,
|
|
n[o + 1] = a.y,
|
|
n[o + r] = a.x,
|
|
n[o + r + 1] = a.y,
|
|
n[o + 2 * r] = a.x,
|
|
n[o + 2 * r + 1] = a.y,
|
|
n[o + 3 * r] = a.x,
|
|
n[o + 3 * r + 1] = a.y,
|
|
o += 4 * r
|
|
}
|
|
},
|
|
e.prototype.uploadRotation = function (t, e, i, n, r, o) {
|
|
for (var s = 0; s < i; s++) {
|
|
var a = t[e + s].rotation;
|
|
n[o] = a,
|
|
n[o + r] = a,
|
|
n[o + 2 * r] = a,
|
|
n[o + 3 * r] = a,
|
|
o += 4 * r
|
|
}
|
|
},
|
|
e.prototype.uploadUvs = function (t, e, i, n, r, o) {
|
|
for (var s = 0; s < i; ++s) {
|
|
var a = t[e + s]._texture._uvs;
|
|
a ? (n[o] = a.x0, n[o + 1] = a.y0, n[o + r] = a.x1, n[o + r + 1] = a.y1, n[o + 2 * r] = a.x2, n[o + 2 * r + 1] = a.y2, n[o + 3 * r] = a.x3, n[o + 3 * r + 1] = a.y3, o += 4 * r) : (n[o] = 0, n[o + 1] = 0, n[o + r] = 0, n[o + r + 1] = 0, n[o + 2 * r] = 0, n[o + 2 * r + 1] = 0, n[o + 3 * r] = 0, n[o + 3 * r + 1] = 0, o += 4 * r)
|
|
}
|
|
},
|
|
e.prototype.uploadTint = function (t, e, i, n, o, s) {
|
|
for (var a = 0; a < i; ++a) {
|
|
var h = t[e + a],
|
|
l = h._texture.baseTexture.alphaMode > 0,
|
|
u = h.alpha,
|
|
c = u < 1 && l ? (0, r.premultiplyTint)(h._tintRGB, u) : h._tintRGB + (255 * u << 24);
|
|
n[s] = c,
|
|
n[s + o] = c,
|
|
n[s + 2 * o] = c,
|
|
n[s + 3 * o] = c,
|
|
s += 4 * o
|
|
}
|
|
},
|
|
e.prototype.destroy = function () {
|
|
t.prototype.destroy.call(this),
|
|
this.shader && (this.shader.destroy(), this.shader = null),
|
|
this.tempMatrix = null
|
|
},
|
|
e
|
|
}
|
|
(s.ObjectRenderer);
|
|
i.ParticleRenderer = u
|
|
}, {
|
|
"@pixi/constants": "R76a",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/math": "GTL5"
|
|
}
|
|
],
|
|
uuMi: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.graphicsUtils = i.LineStyle = i.GraphicsGeometry = i.GraphicsData = i.Graphics = i.GRAPHICS_CURVES = i.FillStyle = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/math"),
|
|
o = t("@pixi/utils"),
|
|
s = t("@pixi/constants"),
|
|
a = t("@pixi/display"),
|
|
h = {
|
|
adaptive: !0,
|
|
maxLength: 10,
|
|
minSegments: 8,
|
|
maxSegments: 2048,
|
|
_segmentsCount: function (t, e) {
|
|
if (void 0 === e && (e = 20), !this.adaptive || !t || Number.isNaN(t))
|
|
return e;
|
|
var i = Math.ceil(t / this.maxLength);
|
|
return i < this.minSegments ? i = this.minSegments : i > this.maxSegments && (i = this.maxSegments),
|
|
i
|
|
}
|
|
};
|
|
i.GRAPHICS_CURVES = h;
|
|
var l = function () {
|
|
this.reset()
|
|
};
|
|
i.FillStyle = l,
|
|
l.prototype.clone = function () {
|
|
var t = new l;
|
|
return t.color = this.color,
|
|
t.alpha = this.alpha,
|
|
t.texture = this.texture,
|
|
t.matrix = this.matrix,
|
|
t.visible = this.visible,
|
|
t
|
|
},
|
|
l.prototype.reset = function () {
|
|
this.color = 16777215,
|
|
this.alpha = 1,
|
|
this.texture = n.Texture.WHITE,
|
|
this.matrix = null,
|
|
this.visible = !1
|
|
},
|
|
l.prototype.destroy = function () {
|
|
this.texture = null,
|
|
this.matrix = null
|
|
};
|
|
var u = {
|
|
build: function (t) {
|
|
t.points = t.shape.points.slice()
|
|
},
|
|
triangulate: function (t, e) {
|
|
var i = t.points,
|
|
n = t.holes,
|
|
r = e.points,
|
|
s = e.indices;
|
|
if (i.length >= 6) {
|
|
for (var a = [], h = 0; h < n.length; h++) {
|
|
var l = n[h];
|
|
a.push(i.length / 2),
|
|
i = i.concat(l.points)
|
|
}
|
|
var u = (0, o.earcut)(i, a, 2);
|
|
if (!u)
|
|
return;
|
|
for (var c = r.length / 2, p = 0; p < u.length; p += 3)
|
|
s.push(u[p] + c), s.push(u[p + 1] + c), s.push(u[p + 2] + c);
|
|
for (var d = 0; d < i.length; d++)
|
|
r.push(i[d])
|
|
}
|
|
}
|
|
},
|
|
c = {
|
|
build: function (t) {
|
|
var e,
|
|
i,
|
|
n = t.shape,
|
|
o = t.points,
|
|
s = n.x,
|
|
a = n.y;
|
|
if (o.length = 0, t.type === r.SHAPES.CIRC ? (e = n.radius, i = n.radius) : (e = n.width, i = n.height), 0 !== e && 0 !== i) {
|
|
var h = Math.floor(30 * Math.sqrt(n.radius)) || Math.floor(15 * Math.sqrt(n.width + n.height));
|
|
h /= 2.3;
|
|
for (var l = 2 * Math.PI / h, u = 0; u < h - .5; u++)
|
|
o.push(s + Math.sin(-l * u) * e, a + Math.cos(-l * u) * i);
|
|
o.push(o[0], o[1])
|
|
}
|
|
},
|
|
triangulate: function (t, e) {
|
|
var i = t.points,
|
|
n = e.points,
|
|
r = e.indices,
|
|
o = n.length / 2,
|
|
s = o;
|
|
n.push(t.shape.x, t.shape.y);
|
|
for (var a = 0; a < i.length; a += 2)
|
|
n.push(i[a], i[a + 1]), r.push(o++, s, o)
|
|
}
|
|
},
|
|
p = {
|
|
build: function (t) {
|
|
var e = t.shape,
|
|
i = e.x,
|
|
n = e.y,
|
|
r = e.width,
|
|
o = e.height,
|
|
s = t.points;
|
|
s.length = 0,
|
|
s.push(i, n, i + r, n, i + r, n + o, i, n + o)
|
|
},
|
|
triangulate: function (t, e) {
|
|
var i = t.points,
|
|
n = e.points,
|
|
r = n.length / 2;
|
|
n.push(i[0], i[1], i[2], i[3], i[6], i[7], i[4], i[5]),
|
|
e.indices.push(r, r + 1, r + 2, r + 1, r + 2, r + 3)
|
|
}
|
|
},
|
|
d = {
|
|
build: function (t) {
|
|
var e = t.shape,
|
|
i = t.points,
|
|
n = e.x,
|
|
r = e.y,
|
|
o = e.width,
|
|
s = e.height,
|
|
a = e.radius;
|
|
i.length = 0,
|
|
_(n, r + a, n, r, n + a, r, i),
|
|
_(n + o - a, r, n + o, r, n + o, r + a, i),
|
|
_(n + o, r + s - a, n + o, r + s, n + o - a, r + s, i),
|
|
_(n + a, r + s, n, r + s, n, r + s - a, i)
|
|
},
|
|
triangulate: function (t, e) {
|
|
for (var i = t.points, n = e.points, r = e.indices, s = n.length / 2, a = (0, o.earcut)(i, null, 2), h = 0, l = a.length; h < l; h += 3)
|
|
r.push(a[h] + s), r.push(a[h + 1] + s), r.push(a[h + 2] + s);
|
|
for (var u = 0, c = i.length; u < c; u++)
|
|
n.push(i[u], i[++u])
|
|
}
|
|
};
|
|
function f(t, e, i) {
|
|
return t + (e - t) * i
|
|
}
|
|
function _(t, e, i, n, r, o, s) {
|
|
void 0 === s && (s = []);
|
|
for (var a = s, h = 0, l = 0, u = 0, c = 0, p = 0, d = 0, _ = 0, m = 0; _ <= 20; ++_)
|
|
h = f(t, i, m = _ / 20), l = f(e, n, m), u = f(i, r, m), c = f(n, o, m), p = f(h, u, m), d = f(l, c, m), a.push(p, d);
|
|
return a
|
|
}
|
|
function m(t, e) {
|
|
t.lineStyle.native ? function (t, e) {
|
|
var i = 0,
|
|
n = t.shape,
|
|
o = t.points || n.points,
|
|
s = n.type !== r.SHAPES.POLY || n.closeStroke;
|
|
if (0 === o.length)
|
|
return;
|
|
var a = e.points,
|
|
h = e.indices,
|
|
l = o.length / 2,
|
|
u = a.length / 2,
|
|
c = u;
|
|
for (a.push(o[0], o[1]), i = 1; i < l; i++)
|
|
a.push(o[2 * i], o[2 * i + 1]), h.push(c, c + 1), c++;
|
|
s && h.push(c, u)
|
|
}
|
|
(t, e) : function (t, e) {
|
|
var i = t.shape,
|
|
n = t.points || i.points.slice(),
|
|
o = e.closePointEps;
|
|
if (0 === n.length)
|
|
return;
|
|
var s = t.lineStyle,
|
|
a = new r.Point(n[0], n[1]),
|
|
h = new r.Point(n[n.length - 2], n[n.length - 1]),
|
|
l = i.type !== r.SHAPES.POLY || i.closeStroke,
|
|
u = Math.abs(a.x - h.x) < o && Math.abs(a.y - h.y) < o;
|
|
if (l) {
|
|
n = n.slice(),
|
|
u && (n.pop(), n.pop(), h.set(n[n.length - 2], n[n.length - 1]));
|
|
var c = h.x + .5 * (a.x - h.x),
|
|
p = h.y + .5 * (a.y - h.y);
|
|
n.unshift(c, p),
|
|
n.push(c, p)
|
|
}
|
|
var d = e.points,
|
|
f = n.length / 2,
|
|
_ = n.length,
|
|
m = d.length / 2,
|
|
y = s.width / 2,
|
|
g = n[0],
|
|
v = n[1],
|
|
w = n[2],
|
|
x = n[3],
|
|
b = 0,
|
|
E = 0,
|
|
$ = - (v - x),
|
|
A = g - w,
|
|
S = 0,
|
|
T = 0,
|
|
C = 0,
|
|
M = 0,
|
|
I = Math.sqrt($ * $ + A * A);
|
|
$ /= I,
|
|
A /= I,
|
|
$ *= y,
|
|
A *= y;
|
|
var P = s.alignment,
|
|
O = 2 * (1 - P),
|
|
R = 2 * P;
|
|
d.push(g - $ * O, v - A * O),
|
|
d.push(g + $ * R, v + A * R);
|
|
for (var D = 1; D < f - 1; ++D) {
|
|
g = n[2 * (D - 1)],
|
|
v = n[2 * (D - 1) + 1],
|
|
w = n[2 * D],
|
|
x = n[2 * D + 1],
|
|
b = n[2 * (D + 1)],
|
|
E = n[2 * (D + 1) + 1],
|
|
$ = - (v - x),
|
|
A = g - w,
|
|
I = Math.sqrt($ * $ + A * A),
|
|
$ /= I,
|
|
A /= I,
|
|
$ *= y,
|
|
A *= y,
|
|
S = - (x - E),
|
|
T = w - b,
|
|
I = Math.sqrt(S * S + T * T),
|
|
S /= I,
|
|
T /= I;
|
|
var L = -A + v - (-A + x),
|
|
k = -$ + w - (-$ + g),
|
|
F = (-$ + g) * (-A + x) - (-$ + w) * (-A + v),
|
|
N = - (T *= y) + E - (-T + x),
|
|
B = - (S *= y) + w - (-S + b),
|
|
U = (-S + b) * (-T + x) - (-S + w) * (-T + E),
|
|
X = L * B - N * k;
|
|
if (Math.abs(X) < .1)
|
|
X += 10.1, d.push(w - $ * O, x - A * O), d.push(w + $ * R, x + A * R);
|
|
else {
|
|
var j = (k * U - B * F) / X,
|
|
V = (N * F - L * U) / X;
|
|
(j - w) * (j - w) + (V - x) * (V - x) > 196 * y * y ? (C = $ - S, M = A - T, I = Math.sqrt(C * C + M * M), C /= I, M /= I, C *= y, M *= y, d.push(w - C * O, x - M * O), d.push(w + C * R, x + M * R), d.push(w - C * R * O, x - M * O), _++) : (d.push(w + (j - w) * O, x + (V - x) * O), d.push(w - (j - w) * R, x - (V - x) * R))
|
|
}
|
|
}
|
|
g = n[2 * (f - 2)],
|
|
v = n[2 * (f - 2) + 1],
|
|
w = n[2 * (f - 1)],
|
|
x = n[2 * (f - 1) + 1],
|
|
$ = - (v - x),
|
|
A = g - w,
|
|
I = Math.sqrt($ * $ + A * A),
|
|
$ /= I,
|
|
A /= I,
|
|
$ *= y,
|
|
A *= y,
|
|
d.push(w - $ * O, x - A * O),
|
|
d.push(w + $ * R, x + A * R);
|
|
for (var H = e.indices, G = 0; G < _ - 2; ++G)
|
|
H.push(m, m + 1, m + 2), m++
|
|
}
|
|
(t, e)
|
|
}
|
|
var y = function (t) {
|
|
function e(e, i, n, o, s, a) {
|
|
s = s || o / 2;
|
|
for (var h = -1 * Math.PI / 2 + a, l = 2 * n, u = r.PI_2 / l, c = [], p = 0; p < l; p++) {
|
|
var d = p % 2 ? s : o,
|
|
f = p * u + h;
|
|
c.push(e + d * Math.cos(f), i + d * Math.sin(f))
|
|
}
|
|
t.call(this, c)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(r.Polygon),
|
|
g = function () {};
|
|
g.curveTo = function (t, e, i, n, r, o) {
|
|
var s = o[o.length - 2],
|
|
a = o[o.length - 1] - e,
|
|
h = s - t,
|
|
l = n - e,
|
|
u = i - t,
|
|
c = Math.abs(a * u - h * l);
|
|
if (c < 1e-8 || 0 === r)
|
|
return o[o.length - 2] === t && o[o.length - 1] === e || o.push(t, e), null;
|
|
var p = a * a + h * h,
|
|
d = l * l + u * u,
|
|
f = a * l + h * u,
|
|
_ = r * Math.sqrt(p) / c,
|
|
m = r * Math.sqrt(d) / c,
|
|
y = _ * f / p,
|
|
g = m * f / d,
|
|
v = _ * u + m * h,
|
|
w = _ * l + m * a,
|
|
x = h * (m + y),
|
|
b = a * (m + y),
|
|
E = u * (_ + g),
|
|
$ = l * (_ + g);
|
|
return {
|
|
cx: v + t,
|
|
cy: w + e,
|
|
radius: r,
|
|
startAngle: Math.atan2(b - w, x - v),
|
|
endAngle: Math.atan2($ - w, E - v),
|
|
anticlockwise: h * l > u * a
|
|
}
|
|
},
|
|
g.arc = function (t, e, i, n, o, s, a, l, u) {
|
|
for (var c = a - s, p = h._segmentsCount(Math.abs(c) * o, 40 * Math.ceil(Math.abs(c) / r.PI_2)), d = c / (2 * p), f = 2 * d, _ = Math.cos(d), m = Math.sin(d), y = p - 1, g = y % 1 / y, v = 0; v <= y; ++v) {
|
|
var w = d + s + f * (v + g * v),
|
|
x = Math.cos(w),
|
|
b = -Math.sin(w);
|
|
u.push((_ * x + m * b) * o + i, (_ * -b + m * x) * o + n)
|
|
}
|
|
};
|
|
var v = function () {};
|
|
v.curveLength = function (t, e, i, n, r, o, s, a) {
|
|
for (var h = 0, l = 0, u = 0, c = 0, p = 0, d = 0, f = 0, _ = 0, m = 0, y = 0, g = 0, v = t, w = e, x = 1; x <= 10; ++x)
|
|
y = v - (_ = (f = (d = (p = 1 - (l = x / 10)) * p) * p) * t + 3 * d * l * i + 3 * p * (u = l * l) * r + (c = u * l) * s), g = w - (m = f * e + 3 * d * l * n + 3 * p * u * o + c * a), v = _, w = m, h += Math.sqrt(y * y + g * g);
|
|
return h
|
|
},
|
|
v.curveTo = function (t, e, i, n, r, o, s) {
|
|
var a = s[s.length - 2],
|
|
l = s[s.length - 1];
|
|
s.length -= 2;
|
|
var u = h._segmentsCount(v.curveLength(a, l, t, e, i, n, r, o)),
|
|
c = 0,
|
|
p = 0,
|
|
d = 0,
|
|
f = 0,
|
|
_ = 0;
|
|
s.push(a, l);
|
|
for (var m = 1, y = 0; m <= u; ++m)
|
|
d = (p = (c = 1 - (y = m / u)) * c) * c, _ = (f = y * y) * y, s.push(d * a + 3 * p * y * t + 3 * c * f * i + _ * r, d * l + 3 * p * y * e + 3 * c * f * n + _ * o)
|
|
};
|
|
var w = function () {};
|
|
w.curveLength = function (t, e, i, n, r, o) {
|
|
var s = t - 2 * i + r,
|
|
a = e - 2 * n + o,
|
|
h = 2 * i - 2 * t,
|
|
l = 2 * n - 2 * e,
|
|
u = 4 * (s * s + a * a),
|
|
c = 4 * (s * h + a * l),
|
|
p = h * h + l * l,
|
|
d = 2 * Math.sqrt(u + c + p),
|
|
f = Math.sqrt(u),
|
|
_ = 2 * u * f,
|
|
m = 2 * Math.sqrt(p),
|
|
y = c / f;
|
|
return (_ * d + f * c * (d - m) + (4 * p * u - c * c) * Math.log((2 * f + y + d) / (y + m))) / (4 * _)
|
|
},
|
|
w.curveTo = function (t, e, i, n, r) {
|
|
for (var o = r[r.length - 2], s = r[r.length - 1], a = h._segmentsCount(w.curveLength(o, s, t, e, i, n)), l = 0, u = 0, c = 1; c <= a; ++c) {
|
|
var p = c / a;
|
|
l = o + (t - o) * p,
|
|
u = s + (e - s) * p,
|
|
r.push(l + (t + (i - t) * p - l) * p, u + (e + (n - e) * p - u) * p)
|
|
}
|
|
};
|
|
var x = function () {
|
|
this.reset()
|
|
};
|
|
x.prototype.begin = function (t, e, i) {
|
|
this.reset(),
|
|
this.style = t,
|
|
this.start = e,
|
|
this.attribStart = i
|
|
},
|
|
x.prototype.end = function (t, e) {
|
|
this.attribSize = e - this.attribStart,
|
|
this.size = t - this.start
|
|
},
|
|
x.prototype.reset = function () {
|
|
this.style = null,
|
|
this.size = 0,
|
|
this.start = 0,
|
|
this.attribStart = 0,
|
|
this.attribSize = 0
|
|
};
|
|
var b = {};
|
|
b[r.SHAPES.POLY] = u,
|
|
b[r.SHAPES.CIRC] = c,
|
|
b[r.SHAPES.ELIP] = c,
|
|
b[r.SHAPES.RECT] = p,
|
|
b[r.SHAPES.RREC] = d;
|
|
var E = [],
|
|
$ = [],
|
|
A = {
|
|
buildPoly: u,
|
|
buildCircle: c,
|
|
buildRectangle: p,
|
|
buildRoundedRectangle: d,
|
|
FILL_COMMANDS: b,
|
|
BATCH_POOL: E,
|
|
DRAW_CALL_POOL: $,
|
|
buildLine: m,
|
|
buildComplexPoly: function (t, e) {
|
|
var i = t.points.slice();
|
|
if (!(i.length < 6)) {
|
|
var n = e.indices;
|
|
e.points = i,
|
|
e.alpha = t.fillAlpha,
|
|
e.color = (0, o.hex2rgb)(t.fillColor);
|
|
for (var r = 1 / 0, s = -1 / 0, a = 1 / 0, h = -1 / 0, l = 0, u = 0, c = 0; c < i.length; c += 2)
|
|
r = (l = i[c]) < r ? l : r, s = l > s ? l : s, a = (u = i[c + 1]) < a ? u : a, h = u > h ? u : h;
|
|
i.push(r, a, s, a, s, h, r, h);
|
|
for (var p = i.length / 2, d = 0; d < p; d++)
|
|
n.push(d)
|
|
}
|
|
},
|
|
bezierCurveTo: function (t, e, i, n, r, o, s, a, h, l) {
|
|
void 0 === l && (l = []);
|
|
var u = 0,
|
|
c = 0,
|
|
p = 0,
|
|
d = 0,
|
|
f = 0;
|
|
l.push(t, e);
|
|
for (var _ = 1, m = 0; _ <= h; ++_)
|
|
p = (c = (u = 1 - (m = _ / h)) * u) * u, f = (d = m * m) * m, l.push(p * t + 3 * c * m * i + 3 * u * d * r + f * s, p * e + 3 * c * m * n + 3 * u * d * o + f * a);
|
|
return l
|
|
},
|
|
Star: y,
|
|
ArcUtils: g,
|
|
BezierUtils: v,
|
|
QuadraticUtils: w,
|
|
BatchPart: x
|
|
};
|
|
i.graphicsUtils = A;
|
|
var S = function (t, e, i, n) {
|
|
void 0 === e && (e = null),
|
|
void 0 === i && (i = null),
|
|
void 0 === n && (n = null),
|
|
this.shape = t,
|
|
this.lineStyle = i,
|
|
this.fillStyle = e,
|
|
this.matrix = n,
|
|
this.type = t.type,
|
|
this.points = [],
|
|
this.holes = []
|
|
};
|
|
i.GraphicsData = S,
|
|
S.prototype.clone = function () {
|
|
return new S(this.shape, this.fillStyle, this.lineStyle, this.matrix)
|
|
},
|
|
S.prototype.destroy = function () {
|
|
this.shape = null,
|
|
this.holes.length = 0,
|
|
this.holes = null,
|
|
this.points.length = 0,
|
|
this.points = null,
|
|
this.lineStyle = null,
|
|
this.fillStyle = null
|
|
};
|
|
var T = new r.Point,
|
|
C = new a.Bounds,
|
|
M = function (t) {
|
|
function e() {
|
|
t.call(this),
|
|
this.points = [],
|
|
this.colors = [],
|
|
this.uvs = [],
|
|
this.indices = [],
|
|
this.textureIds = [],
|
|
this.graphicsData = [],
|
|
this.dirty = 0,
|
|
this.batchDirty = -1,
|
|
this.cacheDirty = -1,
|
|
this.clearDirty = 0,
|
|
this.drawCalls = [],
|
|
this.batches = [],
|
|
this.shapeIndex = 0,
|
|
this._bounds = new a.Bounds,
|
|
this.boundsDirty = -1,
|
|
this.boundsPadding = 0,
|
|
this.batchable = !1,
|
|
this.indicesUint16 = null,
|
|
this.uvsFloat32 = null,
|
|
this.closePointEps = 1e-4
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
bounds: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.bounds.get = function () {
|
|
return this.boundsDirty !== this.dirty && (this.boundsDirty = this.dirty, this.calculateBounds()),
|
|
this._bounds
|
|
},
|
|
e.prototype.invalidate = function () {
|
|
this.boundsDirty = -1,
|
|
this.dirty++,
|
|
this.batchDirty++,
|
|
this.shapeIndex = 0,
|
|
this.points.length = 0,
|
|
this.colors.length = 0,
|
|
this.uvs.length = 0,
|
|
this.indices.length = 0,
|
|
this.textureIds.length = 0;
|
|
for (var t = 0; t < this.drawCalls.length; t++)
|
|
this.drawCalls[t].textures.length = 0, $.push(this.drawCalls[t]);
|
|
this.drawCalls.length = 0;
|
|
for (var e = 0; e < this.batches.length; e++) {
|
|
var i = this.batches[e];
|
|
i.reset(),
|
|
E.push(i)
|
|
}
|
|
this.batches.length = 0
|
|
},
|
|
e.prototype.clear = function () {
|
|
return this.graphicsData.length > 0 && (this.invalidate(), this.clearDirty++, this.graphicsData.length = 0),
|
|
this
|
|
},
|
|
e.prototype.drawShape = function (t, e, i, n) {
|
|
var r = new S(t, e, i, n);
|
|
return this.graphicsData.push(r),
|
|
this.dirty++,
|
|
this
|
|
},
|
|
e.prototype.drawHole = function (t, e) {
|
|
if (!this.graphicsData.length)
|
|
return null;
|
|
var i = new S(t, null, null, e),
|
|
n = this.graphicsData[this.graphicsData.length - 1];
|
|
return i.lineStyle = n.lineStyle,
|
|
n.holes.push(i),
|
|
this.dirty++,
|
|
this
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
t.prototype.destroy.call(this, e);
|
|
for (var i = 0; i < this.graphicsData.length; ++i)
|
|
this.graphicsData[i].destroy();
|
|
this.points.length = 0,
|
|
this.points = null,
|
|
this.colors.length = 0,
|
|
this.colors = null,
|
|
this.uvs.length = 0,
|
|
this.uvs = null,
|
|
this.indices.length = 0,
|
|
this.indices = null,
|
|
this.indexBuffer.destroy(),
|
|
this.indexBuffer = null,
|
|
this.graphicsData.length = 0,
|
|
this.graphicsData = null,
|
|
this.drawCalls.length = 0,
|
|
this.drawCalls = null,
|
|
this.batches.length = 0,
|
|
this.batches = null,
|
|
this._bounds = null
|
|
},
|
|
e.prototype.containsPoint = function (t) {
|
|
for (var e = this.graphicsData, i = 0; i < e.length; ++i) {
|
|
var n = e[i];
|
|
if (n.fillStyle.visible && (n.shape && (n.matrix ? n.matrix.applyInverse(t, T) : T.copyFrom(t), n.shape.contains(T.x, T.y)))) {
|
|
var r = !1;
|
|
if (n.holes)
|
|
for (var o = 0; o < n.holes.length; o++) {
|
|
if (n.holes[o].shape.contains(T.x, T.y)) {
|
|
r = !0;
|
|
break
|
|
}
|
|
}
|
|
if (!r)
|
|
return !0
|
|
}
|
|
}
|
|
return !1
|
|
},
|
|
e.prototype.updateBatches = function () {
|
|
if (this.graphicsData.length) {
|
|
if (this.validateBatching()) {
|
|
this.cacheDirty = this.dirty;
|
|
var t = this.uvs,
|
|
e = this.graphicsData,
|
|
i = null,
|
|
n = null;
|
|
this.batches.length > 0 && (n = (i = this.batches[this.batches.length - 1]).style);
|
|
for (var r = this.shapeIndex; r < e.length; r++) {
|
|
this.shapeIndex++;
|
|
var o = e[r],
|
|
a = o.fillStyle,
|
|
h = o.lineStyle;
|
|
b[o.type].build(o),
|
|
o.matrix && this.transformPoints(o.points, o.matrix);
|
|
for (var l = 0; l < 2; l++) {
|
|
var u = 0 === l ? a : h;
|
|
if (u.visible) {
|
|
var c = u.texture.baseTexture,
|
|
p = this.indices.length,
|
|
d = this.points.length / 2;
|
|
c.wrapMode = s.WRAP_MODES.REPEAT,
|
|
0 === l ? this.processFill(o) : this.processLine(o);
|
|
var f = this.points.length / 2 - d;
|
|
0 !== f && (i && !this._compareStyles(n, u) && (i.end(p, d), i = null), i || ((i = E.pop() || new x).begin(u, p, d), this.batches.push(i), n = u), this.addUvs(this.points, t, u.texture, d, f, u.matrix))
|
|
}
|
|
}
|
|
}
|
|
if (i) {
|
|
var _ = this.indices.length,
|
|
m = this.points.length / 2;
|
|
i.end(_, m)
|
|
}
|
|
0 !== this.batches.length ? (this.indicesUint16 = new Uint16Array(this.indices), this.batchable = this.isBatchable(), this.batchable ? this.packBatches() : this.buildDrawCalls()) : this.batchable = !0
|
|
}
|
|
} else
|
|
this.batchable = !0
|
|
},
|
|
e.prototype._compareStyles = function (t, e) {
|
|
return !(!t || !e) && (t.texture.baseTexture === e.texture.baseTexture && (t.color + t.alpha === e.color + e.alpha && !!t.native == !!e.native))
|
|
},
|
|
e.prototype.validateBatching = function () {
|
|
if (this.dirty === this.cacheDirty || !this.graphicsData.length)
|
|
return !1;
|
|
for (var t = 0, e = this.graphicsData.length; t < e; t++) {
|
|
var i = this.graphicsData[t],
|
|
n = i.fillStyle,
|
|
r = i.lineStyle;
|
|
if (n && !n.texture.baseTexture.valid)
|
|
return !1;
|
|
if (r && !r.texture.baseTexture.valid)
|
|
return !1
|
|
}
|
|
return !0
|
|
},
|
|
e.prototype.packBatches = function () {
|
|
this.batchDirty++,
|
|
this.uvsFloat32 = new Float32Array(this.uvs);
|
|
for (var t = this.batches, e = 0, i = t.length; e < i; e++)
|
|
for (var n = t[e], r = 0; r < n.size; r++) {
|
|
var o = n.start + r;
|
|
this.indicesUint16[o] = this.indicesUint16[o] - n.attribStart
|
|
}
|
|
},
|
|
e.prototype.isBatchable = function () {
|
|
for (var t = this.batches, i = 0; i < t.length; i++)
|
|
if (t[i].style.native)
|
|
return !1;
|
|
return this.points.length < 2 * e.BATCHABLE_SIZE
|
|
},
|
|
e.prototype.buildDrawCalls = function () {
|
|
for (var t = ++n.BaseTexture._globalBatch, e = 0; e < this.drawCalls.length; e++)
|
|
this.drawCalls[e].textures.length = 0, $.push(this.drawCalls[e]);
|
|
this.drawCalls.length = 0;
|
|
var i = this.colors,
|
|
r = this.textureIds,
|
|
o = $.pop();
|
|
o || ((o = new n.BatchDrawCall).textures = new n.BatchTextureArray),
|
|
o.textures.count = 0,
|
|
o.start = 0,
|
|
o.size = 0,
|
|
o.type = s.DRAW_MODES.TRIANGLES;
|
|
var a = 0,
|
|
h = null,
|
|
l = 0,
|
|
u = !1,
|
|
c = s.DRAW_MODES.TRIANGLES,
|
|
p = 0;
|
|
this.drawCalls.push(o);
|
|
for (var d = 0; d < this.batches.length; d++) {
|
|
var f = this.batches[d],
|
|
_ = f.style,
|
|
m = _.texture.baseTexture;
|
|
u !== !!_.native && (c = (u = !!_.native) ? s.DRAW_MODES.LINES : s.DRAW_MODES.TRIANGLES, h = null, a = 8, t++),
|
|
h !== m && (h = m, m._batchEnabled !== t && (8 === a && (t++, a = 0, o.size > 0 && ((o = $.pop()) || ((o = new n.BatchDrawCall).textures = new n.BatchTextureArray), this.drawCalls.push(o)), o.start = p, o.size = 0, o.textures.count = 0, o.type = c), m.touched = 1, m._batchEnabled = t, m._batchLocation = a, m.wrapMode = 10497, o.textures.elements[o.textures.count++] = m, a++)),
|
|
o.size += f.size,
|
|
p += f.size,
|
|
l = m._batchLocation,
|
|
this.addColors(i, _.color, _.alpha, f.attribSize),
|
|
this.addTextureIds(r, l, f.attribSize)
|
|
}
|
|
n.BaseTexture._globalBatch = t,
|
|
this.packAttributes()
|
|
},
|
|
e.prototype.packAttributes = function () {
|
|
for (var t = this.points, e = this.uvs, i = this.colors, n = this.textureIds, r = new ArrayBuffer(3 * t.length * 4), o = new Float32Array(r), s = new Uint32Array(r), a = 0, h = 0; h < t.length / 2; h++)
|
|
o[a++] = t[2 * h], o[a++] = t[2 * h + 1], o[a++] = e[2 * h], o[a++] = e[2 * h + 1], s[a++] = i[h], o[a++] = n[h];
|
|
this._buffer.update(r),
|
|
this._indexBuffer.update(this.indicesUint16)
|
|
},
|
|
e.prototype.processFill = function (t) {
|
|
t.holes.length ? (this.processHoles(t.holes), u.triangulate(t, this)) : b[t.type].triangulate(t, this)
|
|
},
|
|
e.prototype.processLine = function (t) {
|
|
m(t, this);
|
|
for (var e = 0; e < t.holes.length; e++)
|
|
m(t.holes[e], this)
|
|
},
|
|
e.prototype.processHoles = function (t) {
|
|
for (var e = 0; e < t.length; e++) {
|
|
var i = t[e];
|
|
b[i.type].build(i),
|
|
i.matrix && this.transformPoints(i.points, i.matrix)
|
|
}
|
|
},
|
|
e.prototype.calculateBounds = function () {
|
|
var t = this._bounds,
|
|
e = C,
|
|
i = r.Matrix.IDENTITY;
|
|
this._bounds.clear(),
|
|
e.clear();
|
|
for (var n = 0; n < this.graphicsData.length; n++) {
|
|
var o = this.graphicsData[n],
|
|
s = o.shape,
|
|
a = o.type,
|
|
h = o.lineStyle,
|
|
l = o.matrix || r.Matrix.IDENTITY,
|
|
u = 0;
|
|
if (h && h.visible) {
|
|
var c = h.alignment;
|
|
u = h.width,
|
|
a === r.SHAPES.POLY ? u *= .5 + Math.abs(.5 - c) : u *= Math.max(0, c)
|
|
}
|
|
i !== l && (e.isEmpty() || (t.addBoundsMatrix(e, i), e.clear()), i = l),
|
|
a === r.SHAPES.RECT || a === r.SHAPES.RREC ? e.addFramePad(s.x, s.y, s.x + s.width, s.y + s.height, u, u) : a === r.SHAPES.CIRC ? e.addFramePad(s.x, s.y, s.x, s.y, s.radius + u, s.radius + u) : a === r.SHAPES.ELIP ? e.addFramePad(s.x, s.y, s.x, s.y, s.width + u, s.height + u) : t.addVerticesMatrix(i, s.points, 0, s.points.length, u, u)
|
|
}
|
|
e.isEmpty() || t.addBoundsMatrix(e, i),
|
|
t.pad(this.boundsPadding, this.boundsPadding)
|
|
},
|
|
e.prototype.transformPoints = function (t, e) {
|
|
for (var i = 0; i < t.length / 2; i++) {
|
|
var n = t[2 * i],
|
|
r = t[2 * i + 1];
|
|
t[2 * i] = e.a * n + e.c * r + e.tx,
|
|
t[2 * i + 1] = e.b * n + e.d * r + e.ty
|
|
}
|
|
},
|
|
e.prototype.addColors = function (t, e, i, n) {
|
|
for (var r = (e >> 16) + (65280 & e) + ((255 & e) << 16), s = (0, o.premultiplyTint)(r, i); n-- > 0; )
|
|
t.push(s)
|
|
},
|
|
e.prototype.addTextureIds = function (t, e, i) {
|
|
for (; i-- > 0; )
|
|
t.push(e)
|
|
},
|
|
e.prototype.addUvs = function (t, e, i, n, r, o) {
|
|
for (var s = 0, a = e.length, h = i.frame; s < r; ) {
|
|
var l = t[2 * (n + s)],
|
|
u = t[2 * (n + s) + 1];
|
|
if (o) {
|
|
var c = o.a * l + o.c * u + o.tx;
|
|
u = o.b * l + o.d * u + o.ty,
|
|
l = c
|
|
}
|
|
s++,
|
|
e.push(l / h.width, u / h.height)
|
|
}
|
|
var p = i.baseTexture;
|
|
(h.width < p.width || h.height < p.height) && this.adjustUvs(e, i, a, r)
|
|
},
|
|
e.prototype.adjustUvs = function (t, e, i, n) {
|
|
for (var r = e.baseTexture, o = i + 2 * n, s = e.frame, a = s.width / r.width, h = s.height / r.height, l = s.x / s.width, u = s.y / s.height, c = Math.floor(t[i] + 1e-6), p = Math.floor(t[i + 1] + 1e-6), d = i + 2; d < o; d += 2)
|
|
c = Math.min(c, Math.floor(t[d] + 1e-6)), p = Math.min(p, Math.floor(t[d + 1] + 1e-6));
|
|
l -= c,
|
|
u -= p;
|
|
for (var f = i; f < o; f += 2)
|
|
t[f] = (t[f] + l) * a, t[f + 1] = (t[f + 1] + u) * h
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.BatchGeometry);
|
|
i.GraphicsGeometry = M,
|
|
M.BATCHABLE_SIZE = 100;
|
|
var I = function (t) {
|
|
function e() {
|
|
t.apply(this, arguments)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.clone = function () {
|
|
var t = new e;
|
|
return t.color = this.color,
|
|
t.alpha = this.alpha,
|
|
t.texture = this.texture,
|
|
t.matrix = this.matrix,
|
|
t.visible = this.visible,
|
|
t.width = this.width,
|
|
t.alignment = this.alignment,
|
|
t.native = this.native,
|
|
t
|
|
},
|
|
e.prototype.reset = function () {
|
|
t.prototype.reset.call(this),
|
|
this.color = 0,
|
|
this.width = 0,
|
|
this.alignment = .5,
|
|
this.native = !1
|
|
},
|
|
e
|
|
}
|
|
(l);
|
|
i.LineStyle = I;
|
|
var P = new Float32Array(3),
|
|
O = {},
|
|
R = function (t) {
|
|
function e(e) {
|
|
void 0 === e && (e = null),
|
|
t.call(this),
|
|
this.geometry = e || new M,
|
|
this.geometry.refCount++,
|
|
this.shader = null,
|
|
this.state = n.State.for2d(),
|
|
this._fillStyle = new l,
|
|
this._lineStyle = new I,
|
|
this._matrix = null,
|
|
this._holeMode = !1,
|
|
this.currentPath = null,
|
|
this.batches = [],
|
|
this.batchTint = -1,
|
|
this.vertexData = null,
|
|
this._transformID = -1,
|
|
this.batchDirty = -1,
|
|
this.pluginName = "batch",
|
|
this.tint = 16777215,
|
|
this.blendMode = s.BLEND_MODES.NORMAL
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
blendMode: {
|
|
configurable: !0
|
|
},
|
|
tint: {
|
|
configurable: !0
|
|
},
|
|
fill: {
|
|
configurable: !0
|
|
},
|
|
line: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.clone = function () {
|
|
return this.finishPoly(),
|
|
new e(this.geometry)
|
|
},
|
|
i.blendMode.set = function (t) {
|
|
this.state.blendMode = t
|
|
},
|
|
i.blendMode.get = function () {
|
|
return this.state.blendMode
|
|
},
|
|
i.tint.get = function () {
|
|
return this._tint
|
|
},
|
|
i.tint.set = function (t) {
|
|
this._tint = t
|
|
},
|
|
i.fill.get = function () {
|
|
return this._fillStyle
|
|
},
|
|
i.line.get = function () {
|
|
return this._lineStyle
|
|
},
|
|
e.prototype.lineStyle = function (t) {
|
|
if ("number" == typeof t) {
|
|
var e = arguments;
|
|
t = {
|
|
width: e[0] || 0,
|
|
color: e[1] || 0,
|
|
alpha: void 0 !== e[2] ? e[2] : 1,
|
|
alignment: void 0 !== e[3] ? e[3] : .5,
|
|
native: !!e[4]
|
|
}
|
|
}
|
|
return this.lineTextureStyle(t)
|
|
},
|
|
e.prototype.lineTextureStyle = function (t) {
|
|
if ("number" == typeof t) {
|
|
(0, o.deprecation)("v5.2.0", "Please use object-based options for Graphics#lineTextureStyle");
|
|
var e = arguments[0],
|
|
i = arguments[1],
|
|
r = arguments[2],
|
|
s = arguments[3],
|
|
a = arguments[4],
|
|
h = arguments[5],
|
|
l = arguments[6];
|
|
t = {
|
|
width: e,
|
|
texture: i,
|
|
color: r,
|
|
alpha: s,
|
|
matrix: a,
|
|
alignment: h,
|
|
native: l
|
|
},
|
|
Object.keys(t).forEach((function (e) {
|
|
return void 0 === t[e] && delete t[e]
|
|
}))
|
|
}
|
|
t = Object.assign({
|
|
width: 0,
|
|
texture: n.Texture.WHITE,
|
|
color: t && t.texture ? 16777215 : 0,
|
|
alpha: 1,
|
|
matrix: null,
|
|
alignment: .5,
|
|
native: !1
|
|
}, t),
|
|
this.currentPath && this.startPoly();
|
|
var u = t.width > 0 && t.alpha > 0;
|
|
return u ? (t.matrix && (t.matrix = t.matrix.clone(), t.matrix.invert()), Object.assign(this._lineStyle, {
|
|
visible: u
|
|
}, t)) : this._lineStyle.reset(),
|
|
this
|
|
},
|
|
e.prototype.startPoly = function () {
|
|
if (this.currentPath) {
|
|
var t = this.currentPath.points,
|
|
e = this.currentPath.points.length;
|
|
e > 2 && (this.drawShape(this.currentPath), this.currentPath = new r.Polygon, this.currentPath.closeStroke = !1, this.currentPath.points.push(t[e - 2], t[e - 1]))
|
|
} else
|
|
this.currentPath = new r.Polygon, this.currentPath.closeStroke = !1
|
|
},
|
|
e.prototype.finishPoly = function () {
|
|
this.currentPath && (this.currentPath.points.length > 2 ? (this.drawShape(this.currentPath), this.currentPath = null) : this.currentPath.points.length = 0)
|
|
},
|
|
e.prototype.moveTo = function (t, e) {
|
|
return this.startPoly(),
|
|
this.currentPath.points[0] = t,
|
|
this.currentPath.points[1] = e,
|
|
this
|
|
},
|
|
e.prototype.lineTo = function (t, e) {
|
|
this.currentPath || this.moveTo(0, 0);
|
|
var i = this.currentPath.points,
|
|
n = i[i.length - 2],
|
|
r = i[i.length - 1];
|
|
return n === t && r === e || i.push(t, e),
|
|
this
|
|
},
|
|
e.prototype._initCurve = function (t, e) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
this.currentPath ? 0 === this.currentPath.points.length && (this.currentPath.points = [t, e]) : this.moveTo(t, e)
|
|
},
|
|
e.prototype.quadraticCurveTo = function (t, e, i, n) {
|
|
this._initCurve();
|
|
var r = this.currentPath.points;
|
|
return 0 === r.length && this.moveTo(0, 0),
|
|
w.curveTo(t, e, i, n, r),
|
|
this
|
|
},
|
|
e.prototype.bezierCurveTo = function (t, e, i, n, r, o) {
|
|
return this._initCurve(),
|
|
v.curveTo(t, e, i, n, r, o, this.currentPath.points),
|
|
this
|
|
},
|
|
e.prototype.arcTo = function (t, e, i, n, r) {
|
|
this._initCurve(t, e);
|
|
var o = this.currentPath.points,
|
|
s = g.curveTo(t, e, i, n, r, o);
|
|
if (s) {
|
|
var a = s.cx,
|
|
h = s.cy,
|
|
l = s.radius,
|
|
u = s.startAngle,
|
|
c = s.endAngle,
|
|
p = s.anticlockwise;
|
|
this.arc(a, h, l, u, c, p)
|
|
}
|
|
return this
|
|
},
|
|
e.prototype.arc = function (t, e, i, n, o, s) {
|
|
if (void 0 === s && (s = !1), n === o)
|
|
return this;
|
|
if (!s && o <= n ? o += r.PI_2 : s && n <= o && (n += r.PI_2), 0 === o - n)
|
|
return this;
|
|
var a = t + Math.cos(n) * i,
|
|
h = e + Math.sin(n) * i,
|
|
l = this.geometry.closePointEps,
|
|
u = this.currentPath ? this.currentPath.points : null;
|
|
if (u) {
|
|
var c = Math.abs(u[u.length - 2] - a),
|
|
p = Math.abs(u[u.length - 1] - h);
|
|
c < l && p < l || u.push(a, h)
|
|
} else
|
|
this.moveTo(a, h), u = this.currentPath.points;
|
|
return g.arc(a, h, t, e, i, n, o, s, u),
|
|
this
|
|
},
|
|
e.prototype.beginFill = function (t, e) {
|
|
return void 0 === t && (t = 0),
|
|
void 0 === e && (e = 1),
|
|
this.beginTextureFill({
|
|
texture: n.Texture.WHITE,
|
|
color: t,
|
|
alpha: e
|
|
})
|
|
},
|
|
e.prototype.beginTextureFill = function (t) {
|
|
if (t instanceof n.Texture) {
|
|
(0, o.deprecation)("v5.2.0", "Please use object-based options for Graphics#beginTextureFill");
|
|
var e = arguments[0],
|
|
i = arguments[1],
|
|
r = arguments[2],
|
|
s = arguments[3];
|
|
t = {
|
|
texture: e,
|
|
color: i,
|
|
alpha: r,
|
|
matrix: s
|
|
},
|
|
Object.keys(t).forEach((function (e) {
|
|
return void 0 === t[e] && delete t[e]
|
|
}))
|
|
}
|
|
t = Object.assign({
|
|
texture: n.Texture.WHITE,
|
|
color: 16777215,
|
|
alpha: 1,
|
|
matrix: null
|
|
}, t),
|
|
this.currentPath && this.startPoly();
|
|
var a = t.alpha > 0;
|
|
return a ? (t.matrix && (t.matrix = t.matrix.clone(), t.matrix.invert()), Object.assign(this._fillStyle, {
|
|
visible: a
|
|
}, t)) : this._fillStyle.reset(),
|
|
this
|
|
},
|
|
e.prototype.endFill = function () {
|
|
return this.finishPoly(),
|
|
this._fillStyle.reset(),
|
|
this
|
|
},
|
|
e.prototype.drawRect = function (t, e, i, n) {
|
|
return this.drawShape(new r.Rectangle(t, e, i, n))
|
|
},
|
|
e.prototype.drawRoundedRect = function (t, e, i, n, o) {
|
|
return this.drawShape(new r.RoundedRectangle(t, e, i, n, o))
|
|
},
|
|
e.prototype.drawCircle = function (t, e, i) {
|
|
return this.drawShape(new r.Circle(t, e, i))
|
|
},
|
|
e.prototype.drawEllipse = function (t, e, i, n) {
|
|
return this.drawShape(new r.Ellipse(t, e, i, n))
|
|
},
|
|
e.prototype.drawPolygon = function (t) {
|
|
var e = arguments,
|
|
i = t,
|
|
n = !0;
|
|
if (i.points && (n = i.closeStroke, i = i.points), !Array.isArray(i)) {
|
|
i = new Array(arguments.length);
|
|
for (var o = 0; o < i.length; ++o)
|
|
i[o] = e[o]
|
|
}
|
|
var s = new r.Polygon(i);
|
|
return s.closeStroke = n,
|
|
this.drawShape(s),
|
|
this
|
|
},
|
|
e.prototype.drawShape = function (t) {
|
|
return this._holeMode ? this.geometry.drawHole(t, this._matrix) : this.geometry.drawShape(t, this._fillStyle.clone(), this._lineStyle.clone(), this._matrix),
|
|
this
|
|
},
|
|
e.prototype.drawStar = function (t, e, i, n, r, o) {
|
|
return void 0 === o && (o = 0),
|
|
this.drawPolygon(new y(t, e, i, n, r, o))
|
|
},
|
|
e.prototype.clear = function () {
|
|
return this.geometry.clear(),
|
|
this._lineStyle.reset(),
|
|
this._fillStyle.reset(),
|
|
this._matrix = null,
|
|
this._holeMode = !1,
|
|
this.currentPath = null,
|
|
this
|
|
},
|
|
e.prototype.isFastRect = function () {
|
|
return 1 === this.geometry.graphicsData.length && this.geometry.graphicsData[0].shape.type === r.SHAPES.RECT && !this.geometry.graphicsData[0].lineWidth
|
|
},
|
|
e.prototype._render = function (t) {
|
|
this.finishPoly();
|
|
var e = this.geometry;
|
|
e.updateBatches(),
|
|
e.batchable ? (this.batchDirty !== e.batchDirty && this._populateBatches(), this._renderBatched(t)) : (t.batch.flush(), this._renderDirect(t))
|
|
},
|
|
e.prototype._populateBatches = function () {
|
|
var t = this.geometry,
|
|
e = this.blendMode;
|
|
this.batches = [],
|
|
this.batchTint = -1,
|
|
this._transformID = -1,
|
|
this.batchDirty = t.batchDirty,
|
|
this.vertexData = new Float32Array(t.points);
|
|
for (var i = 0, n = t.batches.length; i < n; i++) {
|
|
var r = t.batches[i],
|
|
s = r.style.color,
|
|
a = new Float32Array(this.vertexData.buffer, 4 * r.attribStart * 2, 2 * r.attribSize),
|
|
h = new Float32Array(t.uvsFloat32.buffer, 4 * r.attribStart * 2, 2 * r.attribSize),
|
|
l = {
|
|
vertexData: a,
|
|
blendMode: e,
|
|
indices: new Uint16Array(t.indicesUint16.buffer, 2 * r.start, r.size),
|
|
uvs: h,
|
|
_batchRGB: (0, o.hex2rgb)(s),
|
|
_tintRGB: s,
|
|
_texture: r.style.texture,
|
|
alpha: r.style.alpha,
|
|
worldAlpha: 1
|
|
};
|
|
this.batches[i] = l
|
|
}
|
|
},
|
|
e.prototype._renderBatched = function (t) {
|
|
if (this.batches.length) {
|
|
t.batch.setObjectRenderer(t.plugins[this.pluginName]),
|
|
this.calculateVertices(),
|
|
this.calculateTints();
|
|
for (var e = 0, i = this.batches.length; e < i; e++) {
|
|
var n = this.batches[e];
|
|
n.worldAlpha = this.worldAlpha * n.alpha,
|
|
t.plugins[this.pluginName].render(n)
|
|
}
|
|
}
|
|
},
|
|
e.prototype._renderDirect = function (t) {
|
|
var e = this._resolveDirectShader(t),
|
|
i = this.geometry,
|
|
n = this.tint,
|
|
r = this.worldAlpha,
|
|
o = e.uniforms,
|
|
s = i.drawCalls;
|
|
o.translationMatrix = this.transform.worldTransform,
|
|
o.tint[0] = (n >> 16 & 255) / 255 * r,
|
|
o.tint[1] = (n >> 8 & 255) / 255 * r,
|
|
o.tint[2] = (255 & n) / 255 * r,
|
|
o.tint[3] = r,
|
|
t.shader.bind(e),
|
|
t.geometry.bind(i, e),
|
|
t.state.set(this.state);
|
|
for (var a = 0, h = s.length; a < h; a++)
|
|
this._renderDrawCallDirect(t, i.drawCalls[a])
|
|
},
|
|
e.prototype._renderDrawCallDirect = function (t, e) {
|
|
for (var i = e.textures, n = e.type, r = e.size, o = e.start, s = i.count, a = 0; a < s; a++)
|
|
t.texture.bind(i.elements[a], a);
|
|
t.geometry.draw(n, r, o)
|
|
},
|
|
e.prototype._resolveDirectShader = function (t) {
|
|
var e = this.shader,
|
|
i = this.pluginName;
|
|
if (!e) {
|
|
if (!O[i]) {
|
|
for (var o = new Int32Array(16), s = 0; s < 16; s++)
|
|
o[s] = s;
|
|
var a = {
|
|
tint: new Float32Array([1, 1, 1, 1]),
|
|
translationMatrix: new r.Matrix,
|
|
default:
|
|
n.UniformGroup.from({
|
|
uSamplers: o
|
|
}, !0)
|
|
},
|
|
h = t.plugins[i]._shader.program;
|
|
O[i] = new n.Shader(h, a)
|
|
}
|
|
e = O[i]
|
|
}
|
|
return e
|
|
},
|
|
e.prototype._calculateBounds = function () {
|
|
this.finishPoly();
|
|
var t = this.geometry;
|
|
if (t.graphicsData.length) {
|
|
var e = t.bounds,
|
|
i = e.minX,
|
|
n = e.minY,
|
|
r = e.maxX,
|
|
o = e.maxY;
|
|
this._bounds.addFrame(this.transform, i, n, r, o)
|
|
}
|
|
},
|
|
e.prototype.containsPoint = function (t) {
|
|
return this.worldTransform.applyInverse(t, e._TEMP_POINT),
|
|
this.geometry.containsPoint(e._TEMP_POINT)
|
|
},
|
|
e.prototype.calculateTints = function () {
|
|
if (this.batchTint !== this.tint) {
|
|
this.batchTint = this.tint;
|
|
for (var t = (0, o.hex2rgb)(this.tint, P), e = 0; e < this.batches.length; e++) {
|
|
var i = this.batches[e],
|
|
n = i._batchRGB,
|
|
r = (t[0] * n[0] * 255 << 16) + (t[1] * n[1] * 255 << 8) + (0 | t[2] * n[2] * 255);
|
|
i._tintRGB = (r >> 16) + (65280 & r) + ((255 & r) << 16)
|
|
}
|
|
}
|
|
},
|
|
e.prototype.calculateVertices = function () {
|
|
if (this._transformID !== this.transform._worldID) {
|
|
this._transformID = this.transform._worldID;
|
|
for (var t = this.transform.worldTransform, e = t.a, i = t.b, n = t.c, r = t.d, o = t.tx, s = t.ty, a = this.geometry.points, h = this.vertexData, l = 0, u = 0; u < a.length; u += 2) {
|
|
var c = a[u],
|
|
p = a[u + 1];
|
|
h[l++] = e * c + n * p + o,
|
|
h[l++] = r * p + i * c + s
|
|
}
|
|
}
|
|
},
|
|
e.prototype.closePath = function () {
|
|
var t = this.currentPath;
|
|
return t && (t.closeStroke = !0),
|
|
this
|
|
},
|
|
e.prototype.setMatrix = function (t) {
|
|
return this._matrix = t,
|
|
this
|
|
},
|
|
e.prototype.beginHole = function () {
|
|
return this.finishPoly(),
|
|
this._holeMode = !0,
|
|
this
|
|
},
|
|
e.prototype.endHole = function () {
|
|
return this.finishPoly(),
|
|
this._holeMode = !1,
|
|
this
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
t.prototype.destroy.call(this, e),
|
|
this.geometry.refCount--,
|
|
0 === this.geometry.refCount && this.geometry.dispose(),
|
|
this._matrix = null,
|
|
this.currentPath = null,
|
|
this._lineStyle.destroy(),
|
|
this._lineStyle = null,
|
|
this._fillStyle.destroy(),
|
|
this._fillStyle = null,
|
|
this.geometry = null,
|
|
this.shader = null,
|
|
this.vertexData = null,
|
|
this.batches.length = 0,
|
|
this.batches = null,
|
|
t.prototype.destroy.call(this, e)
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(a.Container);
|
|
i.Graphics = R,
|
|
R._TEMP_POINT = new r.Point
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/constants": "R76a",
|
|
"@pixi/display": "LJAM"
|
|
}
|
|
],
|
|
vBI9: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.Sprite = void 0;
|
|
var n = t("@pixi/math"),
|
|
r = t("@pixi/utils"),
|
|
o = t("@pixi/core"),
|
|
s = t("@pixi/constants"),
|
|
a = t("@pixi/display"),
|
|
h = t("@pixi/settings"),
|
|
l = new n.Point,
|
|
u = new Uint16Array([0, 1, 2, 0, 2, 3]),
|
|
c = function (t) {
|
|
function e(e) {
|
|
t.call(this),
|
|
this._anchor = new n.ObservablePoint(this._onAnchorUpdate, this, e ? e.defaultAnchor.x : 0, e ? e.defaultAnchor.y : 0),
|
|
this._texture = null,
|
|
this._width = 0,
|
|
this._height = 0,
|
|
this._tint = null,
|
|
this._tintRGB = null,
|
|
this.tint = 16777215,
|
|
this.blendMode = s.BLEND_MODES.NORMAL,
|
|
this.shader = null,
|
|
this._cachedTint = 16777215,
|
|
this.uvs = null,
|
|
this.texture = e || o.Texture.EMPTY,
|
|
this.vertexData = new Float32Array(8),
|
|
this.vertexTrimmedData = null,
|
|
this._transformID = -1,
|
|
this._textureID = -1,
|
|
this._transformTrimmedID = -1,
|
|
this._textureTrimmedID = -1,
|
|
this.indices = u,
|
|
this.size = 4,
|
|
this.start = 0,
|
|
this.pluginName = "batch",
|
|
this.isSprite = !0,
|
|
this._roundPixels = h.settings.ROUND_PIXELS
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
roundPixels: {
|
|
configurable: !0
|
|
},
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
},
|
|
anchor: {
|
|
configurable: !0
|
|
},
|
|
tint: {
|
|
configurable: !0
|
|
},
|
|
texture: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype._onTextureUpdate = function () {
|
|
this._textureID = -1,
|
|
this._textureTrimmedID = -1,
|
|
this._cachedTint = 16777215,
|
|
this._width && (this.scale.x = (0, r.sign)(this.scale.x) * this._width / this._texture.orig.width),
|
|
this._height && (this.scale.y = (0, r.sign)(this.scale.y) * this._height / this._texture.orig.height)
|
|
},
|
|
e.prototype._onAnchorUpdate = function () {
|
|
this._transformID = -1,
|
|
this._transformTrimmedID = -1
|
|
},
|
|
e.prototype.calculateVertices = function () {
|
|
var t = this._texture;
|
|
if (this._transformID !== this.transform._worldID || this._textureID !== t._updateID) {
|
|
this._textureID !== t._updateID && (this.uvs = this._texture._uvs.uvsFloat32),
|
|
this._transformID = this.transform._worldID,
|
|
this._textureID = t._updateID;
|
|
var e = this.transform.worldTransform,
|
|
i = e.a,
|
|
n = e.b,
|
|
r = e.c,
|
|
o = e.d,
|
|
s = e.tx,
|
|
a = e.ty,
|
|
l = this.vertexData,
|
|
u = t.trim,
|
|
c = t.orig,
|
|
p = this._anchor,
|
|
d = 0,
|
|
f = 0,
|
|
_ = 0,
|
|
m = 0;
|
|
if (u ? (d = (f = u.x - p._x * c.width) + u.width, _ = (m = u.y - p._y * c.height) + u.height) : (d = (f = -p._x * c.width) + c.width, _ = (m = -p._y * c.height) + c.height), l[0] = i * f + r * m + s, l[1] = o * m + n * f + a, l[2] = i * d + r * m + s, l[3] = o * m + n * d + a, l[4] = i * d + r * _ + s, l[5] = o * _ + n * d + a, l[6] = i * f + r * _ + s, l[7] = o * _ + n * f + a, this._roundPixels)
|
|
for (var y = h.settings.RESOLUTION, g = 0; g < l.length; ++g)
|
|
l[g] = Math.round((l[g] * y | 0) / y)
|
|
}
|
|
},
|
|
e.prototype.calculateTrimmedVertices = function () {
|
|
if (this.vertexTrimmedData) {
|
|
if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID)
|
|
return
|
|
} else
|
|
this.vertexTrimmedData = new Float32Array(8);
|
|
this._transformTrimmedID = this.transform._worldID,
|
|
this._textureTrimmedID = this._texture._updateID;
|
|
var t = this._texture,
|
|
e = this.vertexTrimmedData,
|
|
i = t.orig,
|
|
n = this._anchor,
|
|
r = this.transform.worldTransform,
|
|
o = r.a,
|
|
s = r.b,
|
|
a = r.c,
|
|
h = r.d,
|
|
l = r.tx,
|
|
u = r.ty,
|
|
c = -n._x * i.width,
|
|
p = c + i.width,
|
|
d = -n._y * i.height,
|
|
f = d + i.height;
|
|
e[0] = o * c + a * d + l,
|
|
e[1] = h * d + s * c + u,
|
|
e[2] = o * p + a * d + l,
|
|
e[3] = h * d + s * p + u,
|
|
e[4] = o * p + a * f + l,
|
|
e[5] = h * f + s * p + u,
|
|
e[6] = o * c + a * f + l,
|
|
e[7] = h * f + s * c + u
|
|
},
|
|
e.prototype._render = function (t) {
|
|
this.calculateVertices(),
|
|
t.batch.setObjectRenderer(t.plugins[this.pluginName]),
|
|
t.plugins[this.pluginName].render(this)
|
|
},
|
|
e.prototype._calculateBounds = function () {
|
|
var t = this._texture.trim,
|
|
e = this._texture.orig;
|
|
!t || t.width === e.width && t.height === e.height ? (this.calculateVertices(), this._bounds.addQuad(this.vertexData)) : (this.calculateTrimmedVertices(), this._bounds.addQuad(this.vertexTrimmedData))
|
|
},
|
|
e.prototype.getLocalBounds = function (e) {
|
|
return 0 === this.children.length ? (this._bounds.minX = this._texture.orig.width * -this._anchor._x, this._bounds.minY = this._texture.orig.height * -this._anchor._y, this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x), this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._y), e || (this._localBoundsRect || (this._localBoundsRect = new n.Rectangle), e = this._localBoundsRect), this._bounds.getRectangle(e)) : t.prototype.getLocalBounds.call(this, e)
|
|
},
|
|
e.prototype.containsPoint = function (t) {
|
|
this.worldTransform.applyInverse(t, l);
|
|
var e = this._texture.orig.width,
|
|
i = this._texture.orig.height,
|
|
n = -e * this.anchor.x,
|
|
r = 0;
|
|
return l.x >= n && l.x < n + e && (r = -i * this.anchor.y, l.y >= r && l.y < r + i)
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
if (t.prototype.destroy.call(this, e), this._texture.off("update", this._onTextureUpdate, this), this._anchor = null, "boolean" == typeof e ? e : e && e.texture) {
|
|
var i = "boolean" == typeof e ? e : e && e.baseTexture;
|
|
this._texture.destroy(!!i)
|
|
}
|
|
this._texture = null,
|
|
this.shader = null
|
|
},
|
|
e.from = function (t, i) {
|
|
return new e(t instanceof o.Texture ? t : o.Texture.from(t, i))
|
|
},
|
|
i.roundPixels.set = function (t) {
|
|
this._roundPixels !== t && (this._transformID = -1),
|
|
this._roundPixels = t
|
|
},
|
|
i.roundPixels.get = function () {
|
|
return this._roundPixels
|
|
},
|
|
i.width.get = function () {
|
|
return Math.abs(this.scale.x) * this._texture.orig.width
|
|
},
|
|
i.width.set = function (t) {
|
|
var e = (0, r.sign)(this.scale.x) || 1;
|
|
this.scale.x = e * t / this._texture.orig.width,
|
|
this._width = t
|
|
},
|
|
i.height.get = function () {
|
|
return Math.abs(this.scale.y) * this._texture.orig.height
|
|
},
|
|
i.height.set = function (t) {
|
|
var e = (0, r.sign)(this.scale.y) || 1;
|
|
this.scale.y = e * t / this._texture.orig.height,
|
|
this._height = t
|
|
},
|
|
i.anchor.get = function () {
|
|
return this._anchor
|
|
},
|
|
i.anchor.set = function (t) {
|
|
this._anchor.copyFrom(t)
|
|
},
|
|
i.tint.get = function () {
|
|
return this._tint
|
|
},
|
|
i.tint.set = function (t) {
|
|
this._tint = t,
|
|
this._tintRGB = (t >> 16) + (65280 & t) + ((255 & t) << 16)
|
|
},
|
|
i.texture.get = function () {
|
|
return this._texture
|
|
},
|
|
i.texture.set = function (t) {
|
|
this._texture !== t && (this._texture && this._texture.off("update", this._onTextureUpdate, this), this._texture = t || o.Texture.EMPTY, this._cachedTint = 16777215, this._textureID = -1, this._textureTrimmedID = -1, t && (t.baseTexture.valid ? this._onTextureUpdate() : t.once("update", this._onTextureUpdate, this)))
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(a.Container);
|
|
i.Sprite = c
|
|
}, {
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/constants": "R76a",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/settings": "v11T"
|
|
}
|
|
],
|
|
LtEJ: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.TextStyle = i.TextMetrics = i.Text = i.TEXT_GRADIENT = void 0;
|
|
var n = t("@pixi/sprite"),
|
|
r = t("@pixi/core"),
|
|
o = t("@pixi/settings"),
|
|
s = t("@pixi/math"),
|
|
a = t("@pixi/utils"),
|
|
h = {
|
|
LINEAR_VERTICAL: 0,
|
|
LINEAR_HORIZONTAL: 1
|
|
};
|
|
i.TEXT_GRADIENT = h;
|
|
var l = {
|
|
align: "left",
|
|
breakWords: !1,
|
|
dropShadow: !1,
|
|
dropShadowAlpha: 1,
|
|
dropShadowAngle: Math.PI / 6,
|
|
dropShadowBlur: 0,
|
|
dropShadowColor: "black",
|
|
dropShadowDistance: 5,
|
|
fill: "black",
|
|
fillGradientType: h.LINEAR_VERTICAL,
|
|
fillGradientStops: [],
|
|
fontFamily: "Arial",
|
|
fontSize: 26,
|
|
fontStyle: "normal",
|
|
fontVariant: "normal",
|
|
fontWeight: "normal",
|
|
letterSpacing: 0,
|
|
lineHeight: 0,
|
|
lineJoin: "miter",
|
|
miterLimit: 10,
|
|
padding: 0,
|
|
stroke: "black",
|
|
strokeThickness: 0,
|
|
textBaseline: "alphabetic",
|
|
trim: !1,
|
|
whiteSpace: "pre",
|
|
wordWrap: !1,
|
|
wordWrapWidth: 100,
|
|
leading: 0
|
|
},
|
|
u = ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui"],
|
|
c = function (t) {
|
|
this.styleID = 0,
|
|
this.reset(),
|
|
_(this, t, t)
|
|
};
|
|
i.TextStyle = c;
|
|
var p = {
|
|
align: {
|
|
configurable: !0
|
|
},
|
|
breakWords: {
|
|
configurable: !0
|
|
},
|
|
dropShadow: {
|
|
configurable: !0
|
|
},
|
|
dropShadowAlpha: {
|
|
configurable: !0
|
|
},
|
|
dropShadowAngle: {
|
|
configurable: !0
|
|
},
|
|
dropShadowBlur: {
|
|
configurable: !0
|
|
},
|
|
dropShadowColor: {
|
|
configurable: !0
|
|
},
|
|
dropShadowDistance: {
|
|
configurable: !0
|
|
},
|
|
fill: {
|
|
configurable: !0
|
|
},
|
|
fillGradientType: {
|
|
configurable: !0
|
|
},
|
|
fillGradientStops: {
|
|
configurable: !0
|
|
},
|
|
fontFamily: {
|
|
configurable: !0
|
|
},
|
|
fontSize: {
|
|
configurable: !0
|
|
},
|
|
fontStyle: {
|
|
configurable: !0
|
|
},
|
|
fontVariant: {
|
|
configurable: !0
|
|
},
|
|
fontWeight: {
|
|
configurable: !0
|
|
},
|
|
letterSpacing: {
|
|
configurable: !0
|
|
},
|
|
lineHeight: {
|
|
configurable: !0
|
|
},
|
|
leading: {
|
|
configurable: !0
|
|
},
|
|
lineJoin: {
|
|
configurable: !0
|
|
},
|
|
miterLimit: {
|
|
configurable: !0
|
|
},
|
|
padding: {
|
|
configurable: !0
|
|
},
|
|
stroke: {
|
|
configurable: !0
|
|
},
|
|
strokeThickness: {
|
|
configurable: !0
|
|
},
|
|
textBaseline: {
|
|
configurable: !0
|
|
},
|
|
trim: {
|
|
configurable: !0
|
|
},
|
|
whiteSpace: {
|
|
configurable: !0
|
|
},
|
|
wordWrap: {
|
|
configurable: !0
|
|
},
|
|
wordWrapWidth: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
function d(t) {
|
|
return "number" == typeof t ? (0, a.hex2string)(t) : ("string" == typeof t && 0 === t.indexOf("0x") && (t = t.replace("0x", "#")), t)
|
|
}
|
|
function f(t) {
|
|
if (Array.isArray(t)) {
|
|
for (var e = 0; e < t.length; ++e)
|
|
t[e] = d(t[e]);
|
|
return t
|
|
}
|
|
return d(t)
|
|
}
|
|
function _(t, e, i) {
|
|
for (var n in i)
|
|
Array.isArray(e[n]) ? t[n] = e[n].slice() : t[n] = e[n]
|
|
}
|
|
c.prototype.clone = function () {
|
|
var t = {};
|
|
return _(t, this, l),
|
|
new c(t)
|
|
},
|
|
c.prototype.reset = function () {
|
|
_(this, l, l)
|
|
},
|
|
p.align.get = function () {
|
|
return this._align
|
|
},
|
|
p.align.set = function (t) {
|
|
this._align !== t && (this._align = t, this.styleID++)
|
|
},
|
|
p.breakWords.get = function () {
|
|
return this._breakWords
|
|
},
|
|
p.breakWords.set = function (t) {
|
|
this._breakWords !== t && (this._breakWords = t, this.styleID++)
|
|
},
|
|
p.dropShadow.get = function () {
|
|
return this._dropShadow
|
|
},
|
|
p.dropShadow.set = function (t) {
|
|
this._dropShadow !== t && (this._dropShadow = t, this.styleID++)
|
|
},
|
|
p.dropShadowAlpha.get = function () {
|
|
return this._dropShadowAlpha
|
|
},
|
|
p.dropShadowAlpha.set = function (t) {
|
|
this._dropShadowAlpha !== t && (this._dropShadowAlpha = t, this.styleID++)
|
|
},
|
|
p.dropShadowAngle.get = function () {
|
|
return this._dropShadowAngle
|
|
},
|
|
p.dropShadowAngle.set = function (t) {
|
|
this._dropShadowAngle !== t && (this._dropShadowAngle = t, this.styleID++)
|
|
},
|
|
p.dropShadowBlur.get = function () {
|
|
return this._dropShadowBlur
|
|
},
|
|
p.dropShadowBlur.set = function (t) {
|
|
this._dropShadowBlur !== t && (this._dropShadowBlur = t, this.styleID++)
|
|
},
|
|
p.dropShadowColor.get = function () {
|
|
return this._dropShadowColor
|
|
},
|
|
p.dropShadowColor.set = function (t) {
|
|
var e = f(t);
|
|
this._dropShadowColor !== e && (this._dropShadowColor = e, this.styleID++)
|
|
},
|
|
p.dropShadowDistance.get = function () {
|
|
return this._dropShadowDistance
|
|
},
|
|
p.dropShadowDistance.set = function (t) {
|
|
this._dropShadowDistance !== t && (this._dropShadowDistance = t, this.styleID++)
|
|
},
|
|
p.fill.get = function () {
|
|
return this._fill
|
|
},
|
|
p.fill.set = function (t) {
|
|
var e = f(t);
|
|
this._fill !== e && (this._fill = e, this.styleID++)
|
|
},
|
|
p.fillGradientType.get = function () {
|
|
return this._fillGradientType
|
|
},
|
|
p.fillGradientType.set = function (t) {
|
|
this._fillGradientType !== t && (this._fillGradientType = t, this.styleID++)
|
|
},
|
|
p.fillGradientStops.get = function () {
|
|
return this._fillGradientStops
|
|
},
|
|
p.fillGradientStops.set = function (t) {
|
|
(function (t, e) {
|
|
if (!Array.isArray(t) || !Array.isArray(e))
|
|
return !1;
|
|
if (t.length !== e.length)
|
|
return !1;
|
|
for (var i = 0; i < t.length; ++i)
|
|
if (t[i] !== e[i])
|
|
return !1;
|
|
return !0
|
|
})(this._fillGradientStops, t) || (this._fillGradientStops = t, this.styleID++)
|
|
},
|
|
p.fontFamily.get = function () {
|
|
return this._fontFamily
|
|
},
|
|
p.fontFamily.set = function (t) {
|
|
this.fontFamily !== t && (this._fontFamily = t, this.styleID++)
|
|
},
|
|
p.fontSize.get = function () {
|
|
return this._fontSize
|
|
},
|
|
p.fontSize.set = function (t) {
|
|
this._fontSize !== t && (this._fontSize = t, this.styleID++)
|
|
},
|
|
p.fontStyle.get = function () {
|
|
return this._fontStyle
|
|
},
|
|
p.fontStyle.set = function (t) {
|
|
this._fontStyle !== t && (this._fontStyle = t, this.styleID++)
|
|
},
|
|
p.fontVariant.get = function () {
|
|
return this._fontVariant
|
|
},
|
|
p.fontVariant.set = function (t) {
|
|
this._fontVariant !== t && (this._fontVariant = t, this.styleID++)
|
|
},
|
|
p.fontWeight.get = function () {
|
|
return this._fontWeight
|
|
},
|
|
p.fontWeight.set = function (t) {
|
|
this._fontWeight !== t && (this._fontWeight = t, this.styleID++)
|
|
},
|
|
p.letterSpacing.get = function () {
|
|
return this._letterSpacing
|
|
},
|
|
p.letterSpacing.set = function (t) {
|
|
this._letterSpacing !== t && (this._letterSpacing = t, this.styleID++)
|
|
},
|
|
p.lineHeight.get = function () {
|
|
return this._lineHeight
|
|
},
|
|
p.lineHeight.set = function (t) {
|
|
this._lineHeight !== t && (this._lineHeight = t, this.styleID++)
|
|
},
|
|
p.leading.get = function () {
|
|
return this._leading
|
|
},
|
|
p.leading.set = function (t) {
|
|
this._leading !== t && (this._leading = t, this.styleID++)
|
|
},
|
|
p.lineJoin.get = function () {
|
|
return this._lineJoin
|
|
},
|
|
p.lineJoin.set = function (t) {
|
|
this._lineJoin !== t && (this._lineJoin = t, this.styleID++)
|
|
},
|
|
p.miterLimit.get = function () {
|
|
return this._miterLimit
|
|
},
|
|
p.miterLimit.set = function (t) {
|
|
this._miterLimit !== t && (this._miterLimit = t, this.styleID++)
|
|
},
|
|
p.padding.get = function () {
|
|
return this._padding
|
|
},
|
|
p.padding.set = function (t) {
|
|
this._padding !== t && (this._padding = t, this.styleID++)
|
|
},
|
|
p.stroke.get = function () {
|
|
return this._stroke
|
|
},
|
|
p.stroke.set = function (t) {
|
|
var e = f(t);
|
|
this._stroke !== e && (this._stroke = e, this.styleID++)
|
|
},
|
|
p.strokeThickness.get = function () {
|
|
return this._strokeThickness
|
|
},
|
|
p.strokeThickness.set = function (t) {
|
|
this._strokeThickness !== t && (this._strokeThickness = t, this.styleID++)
|
|
},
|
|
p.textBaseline.get = function () {
|
|
return this._textBaseline
|
|
},
|
|
p.textBaseline.set = function (t) {
|
|
this._textBaseline !== t && (this._textBaseline = t, this.styleID++)
|
|
},
|
|
p.trim.get = function () {
|
|
return this._trim
|
|
},
|
|
p.trim.set = function (t) {
|
|
this._trim !== t && (this._trim = t, this.styleID++)
|
|
},
|
|
p.whiteSpace.get = function () {
|
|
return this._whiteSpace
|
|
},
|
|
p.whiteSpace.set = function (t) {
|
|
this._whiteSpace !== t && (this._whiteSpace = t, this.styleID++)
|
|
},
|
|
p.wordWrap.get = function () {
|
|
return this._wordWrap
|
|
},
|
|
p.wordWrap.set = function (t) {
|
|
this._wordWrap !== t && (this._wordWrap = t, this.styleID++)
|
|
},
|
|
p.wordWrapWidth.get = function () {
|
|
return this._wordWrapWidth
|
|
},
|
|
p.wordWrapWidth.set = function (t) {
|
|
this._wordWrapWidth !== t && (this._wordWrapWidth = t, this.styleID++)
|
|
},
|
|
c.prototype.toFontString = function () {
|
|
var t = "number" == typeof this.fontSize ? this.fontSize + "px" : this.fontSize,
|
|
e = this.fontFamily;
|
|
Array.isArray(this.fontFamily) || (e = this.fontFamily.split(","));
|
|
for (var i = e.length - 1; i >= 0; i--) {
|
|
var n = e[i].trim();
|
|
!/([\"\'])[^\'\"]+\1/.test(n) && u.indexOf(n) < 0 && (n = '"' + n + '"'),
|
|
e[i] = n
|
|
}
|
|
return this.fontStyle + " " + this.fontVariant + " " + this.fontWeight + " " + t + " " + e.join(",")
|
|
},
|
|
Object.defineProperties(c.prototype, p);
|
|
var m = function (t, e, i, n, r, o, s, a, h) {
|
|
this.text = t,
|
|
this.style = e,
|
|
this.width = i,
|
|
this.height = n,
|
|
this.lines = r,
|
|
this.lineWidths = o,
|
|
this.lineHeight = s,
|
|
this.maxLineWidth = a,
|
|
this.fontProperties = h
|
|
};
|
|
i.TextMetrics = m,
|
|
m.measureText = function (t, e, i, n) {
|
|
void 0 === n && (n = m._canvas),
|
|
i = null == i ? e.wordWrap : i;
|
|
var r = e.toFontString(),
|
|
o = m.measureFont(r);
|
|
0 === o.fontSize && (o.fontSize = e.fontSize, o.ascent = e.fontSize);
|
|
var s = n.getContext("2d");
|
|
s.font = r;
|
|
for (var a = (i ? m.wordWrap(t, e, n) : t).split(/(?:\r\n|\r|\n)/), h = new Array(a.length), l = 0, u = 0; u < a.length; u++) {
|
|
var c = s.measureText(a[u]).width + (a[u].length - 1) * e.letterSpacing;
|
|
h[u] = c,
|
|
l = Math.max(l, c)
|
|
}
|
|
var p = l + e.strokeThickness;
|
|
e.dropShadow && (p += e.dropShadowDistance);
|
|
var d = e.lineHeight || o.fontSize + e.strokeThickness,
|
|
f = Math.max(d, o.fontSize + e.strokeThickness) + (a.length - 1) * (d + e.leading);
|
|
return e.dropShadow && (f += e.dropShadowDistance),
|
|
new m(t, e, p, f, a, h, d + e.leading, l, o)
|
|
},
|
|
m.wordWrap = function (t, e, i) {
|
|
void 0 === i && (i = m._canvas);
|
|
for (var n = i.getContext("2d"), r = 0, o = "", s = "", a = {}, h = e.letterSpacing, l = e.whiteSpace, u = m.collapseSpaces(l), c = m.collapseNewlines(l), p = !u, d = e.wordWrapWidth + h, f = m.tokenize(t), _ = 0; _ < f.length; _++) {
|
|
var y = f[_];
|
|
if (m.isNewline(y)) {
|
|
if (!c) {
|
|
s += m.addLine(o),
|
|
p = !u,
|
|
o = "",
|
|
r = 0;
|
|
continue
|
|
}
|
|
y = " "
|
|
}
|
|
if (u) {
|
|
var g = m.isBreakingSpace(y),
|
|
v = m.isBreakingSpace(o[o.length - 1]);
|
|
if (g && v)
|
|
continue
|
|
}
|
|
var w = m.getFromCache(y, h, a, n);
|
|
if (w > d)
|
|
if ("" !== o && (s += m.addLine(o), o = "", r = 0), m.canBreakWords(y, e.breakWords))
|
|
for (var x = m.wordWrapSplit(y), b = 0; b < x.length; b++) {
|
|
for (var E = x[b], $ = 1; x[b + $]; ) {
|
|
var A = x[b + $],
|
|
S = E[E.length - 1];
|
|
if (m.canBreakChars(S, A, y, b, e.breakWords))
|
|
break;
|
|
E += A,
|
|
$++
|
|
}
|
|
b += E.length - 1;
|
|
var T = m.getFromCache(E, h, a, n);
|
|
T + r > d && (s += m.addLine(o), p = !1, o = "", r = 0),
|
|
o += E,
|
|
r += T
|
|
}
|
|
else {
|
|
o.length > 0 && (s += m.addLine(o), o = "", r = 0);
|
|
var C = _ === f.length - 1;
|
|
s += m.addLine(y, !C),
|
|
p = !1,
|
|
o = "",
|
|
r = 0
|
|
}
|
|
else
|
|
w + r > d && (p = !1, s += m.addLine(o), o = "", r = 0), (o.length > 0 || !m.isBreakingSpace(y) || p) && (o += y, r += w)
|
|
}
|
|
return s += m.addLine(o, !1)
|
|
},
|
|
m.addLine = function (t, e) {
|
|
return void 0 === e && (e = !0),
|
|
t = m.trimRight(t),
|
|
t = e ? t + "\n" : t
|
|
},
|
|
m.getFromCache = function (t, e, i, n) {
|
|
var r = i[t];
|
|
if (void 0 === r) {
|
|
var o = t.length * e;
|
|
r = n.measureText(t).width + o,
|
|
i[t] = r
|
|
}
|
|
return r
|
|
},
|
|
m.collapseSpaces = function (t) {
|
|
return "normal" === t || "pre-line" === t
|
|
},
|
|
m.collapseNewlines = function (t) {
|
|
return "normal" === t
|
|
},
|
|
m.trimRight = function (t) {
|
|
if ("string" != typeof t)
|
|
return "";
|
|
for (var e = t.length - 1; e >= 0; e--) {
|
|
var i = t[e];
|
|
if (!m.isBreakingSpace(i))
|
|
break;
|
|
t = t.slice(0, -1)
|
|
}
|
|
return t
|
|
},
|
|
m.isNewline = function (t) {
|
|
return "string" == typeof t && m._newlines.indexOf(t.charCodeAt(0)) >= 0
|
|
},
|
|
m.isBreakingSpace = function (t) {
|
|
return "string" == typeof t && m._breakingSpaces.indexOf(t.charCodeAt(0)) >= 0
|
|
},
|
|
m.tokenize = function (t) {
|
|
var e = [],
|
|
i = "";
|
|
if ("string" != typeof t)
|
|
return e;
|
|
for (var n = 0; n < t.length; n++) {
|
|
var r = t[n];
|
|
m.isBreakingSpace(r) || m.isNewline(r) ? ("" !== i && (e.push(i), i = ""), e.push(r)) : i += r
|
|
}
|
|
return "" !== i && e.push(i),
|
|
e
|
|
},
|
|
m.canBreakWords = function (t, e) {
|
|
return e
|
|
},
|
|
m.canBreakChars = function (t, e, i, n, r) {
|
|
return !0
|
|
},
|
|
m.wordWrapSplit = function (t) {
|
|
return t.split("")
|
|
},
|
|
m.measureFont = function (t) {
|
|
if (m._fonts[t])
|
|
return m._fonts[t];
|
|
var e = {},
|
|
i = m._canvas,
|
|
n = m._context;
|
|
n.font = t;
|
|
var r = m.METRICS_STRING + m.BASELINE_SYMBOL,
|
|
o = Math.ceil(n.measureText(r).width),
|
|
s = Math.ceil(n.measureText(m.BASELINE_SYMBOL).width),
|
|
a = 2 * s;
|
|
s = s * m.BASELINE_MULTIPLIER | 0,
|
|
i.width = o,
|
|
i.height = a,
|
|
n.fillStyle = "#f00",
|
|
n.fillRect(0, 0, o, a),
|
|
n.font = t,
|
|
n.textBaseline = "alphabetic",
|
|
n.fillStyle = "#000",
|
|
n.fillText(r, 0, s);
|
|
var h = n.getImageData(0, 0, o, a).data,
|
|
l = h.length,
|
|
u = 4 * o,
|
|
c = 0,
|
|
p = 0,
|
|
d = !1;
|
|
for (c = 0; c < s; ++c) {
|
|
for (var f = 0; f < u; f += 4)
|
|
if (255 !== h[p + f]) {
|
|
d = !0;
|
|
break
|
|
}
|
|
if (d)
|
|
break;
|
|
p += u
|
|
}
|
|
for (e.ascent = s - c, p = l - u, d = !1, c = a; c > s; --c) {
|
|
for (var _ = 0; _ < u; _ += 4)
|
|
if (255 !== h[p + _]) {
|
|
d = !0;
|
|
break
|
|
}
|
|
if (d)
|
|
break;
|
|
p -= u
|
|
}
|
|
return e.descent = c - s,
|
|
e.fontSize = e.ascent + e.descent,
|
|
m._fonts[t] = e,
|
|
e
|
|
},
|
|
m.clearMetrics = function (t) {
|
|
void 0 === t && (t = ""),
|
|
t ? delete m._fonts[t] : m._fonts = {}
|
|
};
|
|
var y = function () {
|
|
try {
|
|
var t = new OffscreenCanvas(0, 0),
|
|
e = t.getContext("2d");
|
|
return e && e.measureText ? t : document.createElement("canvas")
|
|
} catch (t) {
|
|
return document.createElement("canvas")
|
|
}
|
|
}
|
|
();
|
|
y.width = y.height = 10,
|
|
m._canvas = y,
|
|
m._context = y.getContext("2d"),
|
|
m._fonts = {},
|
|
m.METRICS_STRING = "|ÉqÅ",
|
|
m.BASELINE_SYMBOL = "M",
|
|
m.BASELINE_MULTIPLIER = 1.4,
|
|
m._newlines = [10, 13],
|
|
m._breakingSpaces = [9, 32, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8200, 8201, 8202, 8287, 12288];
|
|
var g = {
|
|
texture: !0,
|
|
children: !1,
|
|
baseTexture: !0
|
|
},
|
|
v = function (t) {
|
|
function e(e, i, n) {
|
|
(n = n || document.createElement("canvas")).width = 3,
|
|
n.height = 3;
|
|
var a = r.Texture.from(n);
|
|
a.orig = new s.Rectangle,
|
|
a.trim = new s.Rectangle,
|
|
t.call(this, a),
|
|
this.canvas = n,
|
|
this.context = this.canvas.getContext("2d"),
|
|
this._resolution = o.settings.RESOLUTION,
|
|
this._autoResolution = !0,
|
|
this._text = null,
|
|
this._style = null,
|
|
this._styleListener = null,
|
|
this._font = "",
|
|
this.text = e,
|
|
this.style = i,
|
|
this.localStyleID = -1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
},
|
|
style: {
|
|
configurable: !0
|
|
},
|
|
text: {
|
|
configurable: !0
|
|
},
|
|
resolution: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.updateText = function (t) {
|
|
var e = this._style;
|
|
if (this.localStyleID !== e.styleID && (this.dirty = !0, this.localStyleID = e.styleID), this.dirty || !t) {
|
|
this._font = this._style.toFontString();
|
|
var i,
|
|
n,
|
|
r = this.context,
|
|
o = m.measureText(this._text || " ", this._style, this._style.wordWrap, this.canvas),
|
|
s = o.width,
|
|
h = o.height,
|
|
l = o.lines,
|
|
u = o.lineHeight,
|
|
c = o.lineWidths,
|
|
p = o.maxLineWidth,
|
|
d = o.fontProperties;
|
|
this.canvas.width = Math.ceil((Math.max(1, s) + 2 * e.padding) * this._resolution),
|
|
this.canvas.height = Math.ceil((Math.max(1, h) + 2 * e.padding) * this._resolution),
|
|
r.scale(this._resolution, this._resolution),
|
|
r.clearRect(0, 0, this.canvas.width, this.canvas.height),
|
|
r.font = this._font,
|
|
r.lineWidth = e.strokeThickness,
|
|
r.textBaseline = e.textBaseline,
|
|
r.lineJoin = e.lineJoin,
|
|
r.miterLimit = e.miterLimit;
|
|
for (var f = e.dropShadow ? 2 : 1, _ = 0; _ < f; ++_) {
|
|
var y = e.dropShadow && 0 === _,
|
|
g = y ? 2 * h : 0,
|
|
v = g * this.resolution;
|
|
if (y) {
|
|
r.fillStyle = "black",
|
|
r.strokeStyle = "black";
|
|
var w = e.dropShadowColor,
|
|
x = (0, a.hex2rgb)("number" == typeof w ? w : (0, a.string2hex)(w));
|
|
r.shadowColor = "rgba(" + 255 * x[0] + "," + 255 * x[1] + "," + 255 * x[2] + "," + e.dropShadowAlpha + ")",
|
|
r.shadowBlur = e.dropShadowBlur,
|
|
r.shadowOffsetX = Math.cos(e.dropShadowAngle) * e.dropShadowDistance,
|
|
r.shadowOffsetY = Math.sin(e.dropShadowAngle) * e.dropShadowDistance + v
|
|
} else
|
|
r.fillStyle = this._generateFillStyle(e, l), r.strokeStyle = e.stroke, r.shadowColor = 0, r.shadowBlur = 0, r.shadowOffsetX = 0, r.shadowOffsetY = 0;
|
|
for (var b = 0; b < l.length; b++)
|
|
i = e.strokeThickness / 2, n = e.strokeThickness / 2 + b * u + d.ascent, "right" === e.align ? i += p - c[b] : "center" === e.align && (i += (p - c[b]) / 2), e.stroke && e.strokeThickness && this.drawLetterSpacing(l[b], i + e.padding, n + e.padding - g, !0), e.fill && this.drawLetterSpacing(l[b], i + e.padding, n + e.padding - g)
|
|
}
|
|
this.updateTexture()
|
|
}
|
|
},
|
|
e.prototype.drawLetterSpacing = function (t, e, i, n) {
|
|
void 0 === n && (n = !1);
|
|
var r = this._style.letterSpacing;
|
|
if (0 !== r)
|
|
for (var o = e, s = Array.from ? Array.from(t) : t.split(""), a = this.context.measureText(t).width, h = 0, l = 0; l < s.length; ++l) {
|
|
var u = s[l];
|
|
n ? this.context.strokeText(u, o, i) : this.context.fillText(u, o, i),
|
|
o += a - (h = this.context.measureText(t.substring(l + 1)).width) + r,
|
|
a = h
|
|
}
|
|
else
|
|
n ? this.context.strokeText(t, e, i) : this.context.fillText(t, e, i)
|
|
},
|
|
e.prototype.updateTexture = function () {
|
|
var t = this.canvas;
|
|
if (this._style.trim) {
|
|
var e = (0, a.trimCanvas)(t);
|
|
e.data && (t.width = e.width, t.height = e.height, this.context.putImageData(e.data, 0, 0))
|
|
}
|
|
var i = this._texture,
|
|
n = this._style,
|
|
r = n.trim ? 0 : n.padding,
|
|
o = i.baseTexture;
|
|
i.trim.width = i._frame.width = Math.ceil(t.width / this._resolution),
|
|
i.trim.height = i._frame.height = Math.ceil(t.height / this._resolution),
|
|
i.trim.x = -r,
|
|
i.trim.y = -r,
|
|
i.orig.width = i._frame.width - 2 * r,
|
|
i.orig.height = i._frame.height - 2 * r,
|
|
this._onTextureUpdate(),
|
|
o.setRealSize(t.width, t.height, this._resolution),
|
|
this.dirty = !1
|
|
},
|
|
e.prototype._render = function (e) {
|
|
this._autoResolution && this._resolution !== e.resolution && (this._resolution = e.resolution, this.dirty = !0),
|
|
this.updateText(!0),
|
|
t.prototype._render.call(this, e)
|
|
},
|
|
e.prototype.getLocalBounds = function (e) {
|
|
return this.updateText(!0),
|
|
t.prototype.getLocalBounds.call(this, e)
|
|
},
|
|
e.prototype._calculateBounds = function () {
|
|
this.updateText(!0),
|
|
this.calculateVertices(),
|
|
this._bounds.addQuad(this.vertexData)
|
|
},
|
|
e.prototype._onStyleChange = function () {
|
|
this.dirty = !0
|
|
},
|
|
e.prototype._generateFillStyle = function (t, e) {
|
|
if (!Array.isArray(t.fill))
|
|
return t.fill;
|
|
if (1 === t.fill.length)
|
|
return t.fill[0];
|
|
var i,
|
|
n,
|
|
r,
|
|
o,
|
|
s = t.dropShadow ? t.dropShadowDistance : 0,
|
|
a = Math.ceil(this.canvas.width / this._resolution) - s,
|
|
l = Math.ceil(this.canvas.height / this._resolution) - s,
|
|
u = t.fill.slice(),
|
|
c = t.fillGradientStops.slice();
|
|
if (!c.length)
|
|
for (var p = u.length + 1, d = 1; d < p; ++d)
|
|
c.push(d / p);
|
|
if (u.unshift(t.fill[0]), c.unshift(0), u.push(t.fill[t.fill.length - 1]), c.push(1), t.fillGradientType === h.LINEAR_VERTICAL) {
|
|
i = this.context.createLinearGradient(a / 2, 0, a / 2, l),
|
|
n = (u.length + 1) * e.length,
|
|
r = 0;
|
|
for (var f = 0; f < e.length; f++) {
|
|
r += 1;
|
|
for (var _ = 0; _ < u.length; _++)
|
|
o = "number" == typeof c[_] ? c[_] / e.length + f / e.length : r / n, i.addColorStop(o, u[_]), r++
|
|
}
|
|
} else {
|
|
i = this.context.createLinearGradient(0, l / 2, a, l / 2),
|
|
n = u.length + 1,
|
|
r = 1;
|
|
for (var m = 0; m < u.length; m++)
|
|
o = "number" == typeof c[m] ? c[m] : r / n, i.addColorStop(o, u[m]), r++
|
|
}
|
|
return i
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
"boolean" == typeof e && (e = {
|
|
children: e
|
|
}),
|
|
e = Object.assign({}, g, e),
|
|
t.prototype.destroy.call(this, e),
|
|
this.context = null,
|
|
this.canvas = null,
|
|
this._style = null
|
|
},
|
|
i.width.get = function () {
|
|
return this.updateText(!0),
|
|
Math.abs(this.scale.x) * this._texture.orig.width
|
|
},
|
|
i.width.set = function (t) {
|
|
this.updateText(!0);
|
|
var e = (0, a.sign)(this.scale.x) || 1;
|
|
this.scale.x = e * t / this._texture.orig.width,
|
|
this._width = t
|
|
},
|
|
i.height.get = function () {
|
|
return this.updateText(!0),
|
|
Math.abs(this.scale.y) * this._texture.orig.height
|
|
},
|
|
i.height.set = function (t) {
|
|
this.updateText(!0);
|
|
var e = (0, a.sign)(this.scale.y) || 1;
|
|
this.scale.y = e * t / this._texture.orig.height,
|
|
this._height = t
|
|
},
|
|
i.style.get = function () {
|
|
return this._style
|
|
},
|
|
i.style.set = function (t) {
|
|
t = t || {},
|
|
this._style = t instanceof c ? t : new c(t),
|
|
this.localStyleID = -1,
|
|
this.dirty = !0
|
|
},
|
|
i.text.get = function () {
|
|
return this._text
|
|
},
|
|
i.text.set = function (t) {
|
|
t = String(null == t ? "" : t),
|
|
this._text !== t && (this._text = t, this.dirty = !0)
|
|
},
|
|
i.resolution.get = function () {
|
|
return this._resolution
|
|
},
|
|
i.resolution.set = function (t) {
|
|
this._autoResolution = !1,
|
|
this._resolution !== t && (this._resolution = t, this.dirty = !0)
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Sprite);
|
|
i.Text = v
|
|
}, {
|
|
"@pixi/sprite": "vBI9",
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/settings": "v11T",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/utils": "x5Ec"
|
|
}
|
|
],
|
|
kdZ8: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.TimeLimiter = i.Prepare = i.CountLimiter = i.BasePrepare = void 0;
|
|
var n = t("@pixi/settings"),
|
|
r = t("@pixi/core"),
|
|
o = t("@pixi/graphics"),
|
|
s = t("@pixi/ticker"),
|
|
a = t("@pixi/display"),
|
|
h = t("@pixi/text");
|
|
/*!
|
|
* @pixi/prepare - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/prepare is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
n.settings.UPLOADS_PER_FRAME = 4;
|
|
var l = function (t) {
|
|
this.maxItemsPerFrame = t,
|
|
this.itemsLeft = 0
|
|
};
|
|
i.CountLimiter = l,
|
|
l.prototype.beginFrame = function () {
|
|
this.itemsLeft = this.maxItemsPerFrame
|
|
},
|
|
l.prototype.allowedToUpload = function () {
|
|
return this.itemsLeft-- > 0
|
|
};
|
|
var u = function (t) {
|
|
var e = this;
|
|
this.limiter = new l(n.settings.UPLOADS_PER_FRAME),
|
|
this.renderer = t,
|
|
this.uploadHookHelper = null,
|
|
this.queue = [],
|
|
this.addHooks = [],
|
|
this.uploadHooks = [],
|
|
this.completes = [],
|
|
this.ticking = !1,
|
|
this.delayedTick = function () {
|
|
e.queue && e.prepareItems()
|
|
},
|
|
this.registerFindHook(m),
|
|
this.registerFindHook(y),
|
|
this.registerFindHook(c),
|
|
this.registerFindHook(p),
|
|
this.registerFindHook(d),
|
|
this.registerUploadHook(f),
|
|
this.registerUploadHook(_)
|
|
};
|
|
function c(t, e) {
|
|
var i = !1;
|
|
if (t && t._textures && t._textures.length)
|
|
for (var n = 0; n < t._textures.length; n++)
|
|
if (t._textures[n]instanceof r.Texture) {
|
|
var o = t._textures[n].baseTexture;
|
|
-1 === e.indexOf(o) && (e.push(o), i = !0)
|
|
}
|
|
return i
|
|
}
|
|
function p(t, e) {
|
|
if (t.baseTexture instanceof r.BaseTexture) {
|
|
var i = t.baseTexture;
|
|
return -1 === e.indexOf(i) && e.push(i),
|
|
!0
|
|
}
|
|
return !1
|
|
}
|
|
function d(t, e) {
|
|
if (t._texture && t._texture instanceof r.Texture) {
|
|
var i = t._texture.baseTexture;
|
|
return -1 === e.indexOf(i) && e.push(i),
|
|
!0
|
|
}
|
|
return !1
|
|
}
|
|
function f(t, e) {
|
|
return e instanceof h.Text && (e.updateText(!0), !0)
|
|
}
|
|
function _(t, e) {
|
|
if (e instanceof h.TextStyle) {
|
|
var i = e.toFontString();
|
|
return h.TextMetrics.measureFont(i),
|
|
!0
|
|
}
|
|
return !1
|
|
}
|
|
function m(t, e) {
|
|
if (t instanceof h.Text) {
|
|
-1 === e.indexOf(t.style) && e.push(t.style),
|
|
-1 === e.indexOf(t) && e.push(t);
|
|
var i = t._texture.baseTexture;
|
|
return -1 === e.indexOf(i) && e.push(i),
|
|
!0
|
|
}
|
|
return !1
|
|
}
|
|
function y(t, e) {
|
|
return t instanceof h.TextStyle && (-1 === e.indexOf(t) && e.push(t), !0)
|
|
}
|
|
i.BasePrepare = u,
|
|
u.prototype.upload = function (t, e) {
|
|
"function" == typeof t && (e = t, t = null),
|
|
t && this.add(t),
|
|
this.queue.length ? (e && this.completes.push(e), this.ticking || (this.ticking = !0, s.Ticker.system.addOnce(this.tick, this, s.UPDATE_PRIORITY.UTILITY))) : e && e()
|
|
},
|
|
u.prototype.tick = function () {
|
|
setTimeout(this.delayedTick, 0)
|
|
},
|
|
u.prototype.prepareItems = function () {
|
|
for (this.limiter.beginFrame(); this.queue.length && this.limiter.allowedToUpload(); ) {
|
|
var t = this.queue[0],
|
|
e = !1;
|
|
if (t && !t._destroyed)
|
|
for (var i = 0, n = this.uploadHooks.length; i < n; i++)
|
|
if (this.uploadHooks[i](this.uploadHookHelper, t)) {
|
|
this.queue.shift(),
|
|
e = !0;
|
|
break
|
|
}
|
|
e || this.queue.shift()
|
|
}
|
|
if (this.queue.length)
|
|
s.Ticker.system.addOnce(this.tick, this, s.UPDATE_PRIORITY.UTILITY);
|
|
else {
|
|
this.ticking = !1;
|
|
var r = this.completes.slice(0);
|
|
this.completes.length = 0;
|
|
for (var o = 0, a = r.length; o < a; o++)
|
|
r[o]()
|
|
}
|
|
},
|
|
u.prototype.registerFindHook = function (t) {
|
|
return t && this.addHooks.push(t),
|
|
this
|
|
},
|
|
u.prototype.registerUploadHook = function (t) {
|
|
return t && this.uploadHooks.push(t),
|
|
this
|
|
},
|
|
u.prototype.add = function (t) {
|
|
for (var e = 0, i = this.addHooks.length; e < i && !this.addHooks[e](t, this.queue); e++);
|
|
if (t instanceof a.Container)
|
|
for (var n = t.children.length - 1; n >= 0; n--)
|
|
this.add(t.children[n]);
|
|
return this
|
|
},
|
|
u.prototype.destroy = function () {
|
|
this.ticking && s.Ticker.system.remove(this.tick, this),
|
|
this.ticking = !1,
|
|
this.addHooks = null,
|
|
this.uploadHooks = null,
|
|
this.renderer = null,
|
|
this.completes = null,
|
|
this.queue = null,
|
|
this.limiter = null,
|
|
this.uploadHookHelper = null
|
|
};
|
|
var g = function (t) {
|
|
function e(e) {
|
|
t.call(this, e),
|
|
this.uploadHookHelper = this.renderer,
|
|
this.registerFindHook(x),
|
|
this.registerUploadHook(v),
|
|
this.registerUploadHook(w)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(u);
|
|
function v(t, e) {
|
|
return e instanceof r.BaseTexture && (e._glTextures[t.CONTEXT_UID] || t.texture.bind(e), !0)
|
|
}
|
|
function w(t, e) {
|
|
if (!(e instanceof o.Graphics))
|
|
return !1;
|
|
var i = e.geometry;
|
|
e.finishPoly(),
|
|
i.updateBatches();
|
|
for (var n = i.batches, r = 0; r < n.length; r++) {
|
|
var s = n[r].style.texture;
|
|
s && v(t, s.baseTexture)
|
|
}
|
|
return i.batchable || t.geometry.bind(i, e._resolveDirectShader()),
|
|
!0
|
|
}
|
|
function x(t, e) {
|
|
return t instanceof o.Graphics && (e.push(t), !0)
|
|
}
|
|
i.Prepare = g;
|
|
var b = function (t) {
|
|
this.maxMilliseconds = t,
|
|
this.frameStart = 0
|
|
};
|
|
i.TimeLimiter = b,
|
|
b.prototype.beginFrame = function () {
|
|
this.frameStart = Date.now()
|
|
},
|
|
b.prototype.allowedToUpload = function () {
|
|
return Date.now() - this.frameStart < this.maxMilliseconds
|
|
}
|
|
}, {
|
|
"@pixi/settings": "v11T",
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/graphics": "uuMi",
|
|
"@pixi/ticker": "t27b",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/text": "LtEJ"
|
|
}
|
|
],
|
|
vMGq: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.SpritesheetLoader = i.Spritesheet = void 0;
|
|
var n = t("@pixi/math"),
|
|
r = t("@pixi/core"),
|
|
o = t("@pixi/utils"),
|
|
s = t("@pixi/loaders"),
|
|
a = function (t, e, i) {
|
|
void 0 === i && (i = null),
|
|
this.baseTexture = t,
|
|
this.textures = {},
|
|
this.animations = {},
|
|
this.data = e,
|
|
this.resolution = this._updateResolution(i || (this.baseTexture.resource ? this.baseTexture.resource.url : null)),
|
|
this._frames = this.data.frames,
|
|
this._frameKeys = Object.keys(this._frames),
|
|
this._batchIndex = 0,
|
|
this._callback = null
|
|
};
|
|
i.Spritesheet = a;
|
|
var h = {
|
|
BATCH_SIZE: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
h.BATCH_SIZE.get = function () {
|
|
return 1e3
|
|
},
|
|
a.prototype._updateResolution = function (t) {
|
|
var e = this.data.meta.scale,
|
|
i = (0, o.getResolutionOfUrl)(t, null);
|
|
return null === i && (i = void 0 !== e ? parseFloat(e) : 1),
|
|
1 !== i && this.baseTexture.setResolution(i),
|
|
i
|
|
},
|
|
a.prototype.parse = function (t) {
|
|
this._batchIndex = 0,
|
|
this._callback = t,
|
|
this._frameKeys.length <= a.BATCH_SIZE ? (this._processFrames(0), this._processAnimations(), this._parseComplete()) : this._nextBatch()
|
|
},
|
|
a.prototype._processFrames = function (t) {
|
|
for (var e = t, i = a.BATCH_SIZE; e - t < i && e < this._frameKeys.length; ) {
|
|
var o = this._frameKeys[e],
|
|
s = this._frames[o],
|
|
h = s.frame;
|
|
if (h) {
|
|
var l = null,
|
|
u = null,
|
|
c = !1 !== s.trimmed && s.sourceSize ? s.sourceSize : s.frame,
|
|
p = new n.Rectangle(0, 0, Math.floor(c.w) / this.resolution, Math.floor(c.h) / this.resolution);
|
|
l = s.rotated ? new n.Rectangle(Math.floor(h.x) / this.resolution, Math.floor(h.y) / this.resolution, Math.floor(h.h) / this.resolution, Math.floor(h.w) / this.resolution) : new n.Rectangle(Math.floor(h.x) / this.resolution, Math.floor(h.y) / this.resolution, Math.floor(h.w) / this.resolution, Math.floor(h.h) / this.resolution),
|
|
!1 !== s.trimmed && s.spriteSourceSize && (u = new n.Rectangle(Math.floor(s.spriteSourceSize.x) / this.resolution, Math.floor(s.spriteSourceSize.y) / this.resolution, Math.floor(h.w) / this.resolution, Math.floor(h.h) / this.resolution)),
|
|
this.textures[o] = new r.Texture(this.baseTexture, l, p, u, s.rotated ? 2 : 0, s.anchor),
|
|
r.Texture.addToCache(this.textures[o], o)
|
|
}
|
|
e++
|
|
}
|
|
},
|
|
a.prototype._processAnimations = function () {
|
|
var t = this.data.animations || {};
|
|
for (var e in t) {
|
|
this.animations[e] = [];
|
|
for (var i = 0; i < t[e].length; i++) {
|
|
var n = t[e][i];
|
|
this.animations[e].push(this.textures[n])
|
|
}
|
|
}
|
|
},
|
|
a.prototype._parseComplete = function () {
|
|
var t = this._callback;
|
|
this._callback = null,
|
|
this._batchIndex = 0,
|
|
t.call(this, this.textures)
|
|
},
|
|
a.prototype._nextBatch = function () {
|
|
var t = this;
|
|
this._processFrames(this._batchIndex * a.BATCH_SIZE),
|
|
this._batchIndex++,
|
|
setTimeout((function () {
|
|
t._batchIndex * a.BATCH_SIZE < t._frameKeys.length ? t._nextBatch() : (t._processAnimations(), t._parseComplete())
|
|
}), 0)
|
|
},
|
|
a.prototype.destroy = function (t) {
|
|
for (var e in void 0 === t && (t = !1), this.textures)
|
|
this.textures[e].destroy();
|
|
this._frames = null,
|
|
this._frameKeys = null,
|
|
this.data = null,
|
|
this.textures = null,
|
|
t && this.baseTexture.destroy(),
|
|
this.baseTexture = null
|
|
},
|
|
Object.defineProperties(a, h);
|
|
var l = function () {};
|
|
i.SpritesheetLoader = l,
|
|
l.use = function (t, e) {
|
|
var i = t.name + "_image";
|
|
if (t.data && t.type === s.LoaderResource.TYPE.JSON && t.data.frames && !this.resources[i]) {
|
|
var n = {
|
|
crossOrigin: t.crossOrigin,
|
|
metadata: t.metadata.imageMetadata,
|
|
parentResource: t
|
|
},
|
|
r = l.getResourcePath(t, this.baseUrl);
|
|
this.add(i, r, n, (function (i) {
|
|
if (i.error)
|
|
e(i.error);
|
|
else {
|
|
var n = new a(i.texture.baseTexture, t.data, t.url);
|
|
n.parse((function () {
|
|
t.spritesheet = n,
|
|
t.textures = n.textures,
|
|
e()
|
|
}))
|
|
}
|
|
}))
|
|
} else
|
|
e()
|
|
},
|
|
l.getResourcePath = function (t, e) {
|
|
return t.isDataUrl ? t.data.meta.image : o.url.resolve(t.url.replace(e, ""), t.data.meta.image)
|
|
}
|
|
}, {
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/loaders": "pAmg"
|
|
}
|
|
],
|
|
s11n: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.TilingSpriteRenderer = i.TilingSprite = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/math"),
|
|
o = t("@pixi/utils"),
|
|
s = t("@pixi/sprite"),
|
|
a = t("@pixi/constants"),
|
|
h = new r.Point,
|
|
l = function (t) {
|
|
function e(e, i, o) {
|
|
void 0 === i && (i = 100),
|
|
void 0 === o && (o = 100),
|
|
t.call(this, e),
|
|
this.tileTransform = new r.Transform,
|
|
this._width = i,
|
|
this._height = o,
|
|
this._canvasPattern = null,
|
|
this.uvMatrix = e.uvMatrix || new n.TextureMatrix(e),
|
|
this.pluginName = "tilingSprite",
|
|
this.uvRespectAnchor = !1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
clampMargin: {
|
|
configurable: !0
|
|
},
|
|
tileScale: {
|
|
configurable: !0
|
|
},
|
|
tilePosition: {
|
|
configurable: !0
|
|
},
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.clampMargin.get = function () {
|
|
return this.uvMatrix.clampMargin
|
|
},
|
|
i.clampMargin.set = function (t) {
|
|
this.uvMatrix.clampMargin = t,
|
|
this.uvMatrix.update(!0)
|
|
},
|
|
i.tileScale.get = function () {
|
|
return this.tileTransform.scale
|
|
},
|
|
i.tileScale.set = function (t) {
|
|
this.tileTransform.scale.copyFrom(t)
|
|
},
|
|
i.tilePosition.get = function () {
|
|
return this.tileTransform.position
|
|
},
|
|
i.tilePosition.set = function (t) {
|
|
this.tileTransform.position.copyFrom(t)
|
|
},
|
|
e.prototype._onTextureUpdate = function () {
|
|
this.uvMatrix && (this.uvMatrix.texture = this._texture),
|
|
this._cachedTint = 16777215
|
|
},
|
|
e.prototype._render = function (t) {
|
|
var e = this._texture;
|
|
e && e.valid && (this.tileTransform.updateLocalTransform(), this.uvMatrix.update(), t.batch.setObjectRenderer(t.plugins[this.pluginName]), t.plugins[this.pluginName].render(this))
|
|
},
|
|
e.prototype._calculateBounds = function () {
|
|
var t = this._width * -this._anchor._x,
|
|
e = this._height * -this._anchor._y,
|
|
i = this._width * (1 - this._anchor._x),
|
|
n = this._height * (1 - this._anchor._y);
|
|
this._bounds.addFrame(this.transform, t, e, i, n)
|
|
},
|
|
e.prototype.getLocalBounds = function (e) {
|
|
return 0 === this.children.length ? (this._bounds.minX = this._width * -this._anchor._x, this._bounds.minY = this._height * -this._anchor._y, this._bounds.maxX = this._width * (1 - this._anchor._x), this._bounds.maxY = this._height * (1 - this._anchor._y), e || (this._localBoundsRect || (this._localBoundsRect = new r.Rectangle), e = this._localBoundsRect), this._bounds.getRectangle(e)) : t.prototype.getLocalBounds.call(this, e)
|
|
},
|
|
e.prototype.containsPoint = function (t) {
|
|
this.worldTransform.applyInverse(t, h);
|
|
var e = this._width,
|
|
i = this._height,
|
|
n = -e * this.anchor._x;
|
|
if (h.x >= n && h.x < n + e) {
|
|
var r = -i * this.anchor._y;
|
|
if (h.y >= r && h.y < r + i)
|
|
return !0
|
|
}
|
|
return !1
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
t.prototype.destroy.call(this, e),
|
|
this.tileTransform = null,
|
|
this.uvMatrix = null
|
|
},
|
|
e.from = function (t, i, r) {
|
|
return new e(n.Texture.from(t), i, r)
|
|
},
|
|
e.fromFrame = function (t, i, n) {
|
|
var r = o.TextureCache[t];
|
|
if (!r)
|
|
throw new Error('The frameId "' + t + '" does not exist in the texture cache ' + this);
|
|
return new e(r, i, n)
|
|
},
|
|
e.fromImage = function (t, i, r, o) {
|
|
return o && "object" != typeof o && (o = {
|
|
scaleMode: arguments[4],
|
|
resourceOptions: {
|
|
crossorigin: arguments[3]
|
|
}
|
|
}),
|
|
new e(n.Texture.from(t, o), i, r)
|
|
},
|
|
i.width.get = function () {
|
|
return this._width
|
|
},
|
|
i.width.set = function (t) {
|
|
this._width = t
|
|
},
|
|
i.height.get = function () {
|
|
return this._height
|
|
},
|
|
i.height.set = function (t) {
|
|
this._height = t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(s.Sprite);
|
|
i.TilingSprite = l;
|
|
var u = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",
|
|
c = new r.Matrix,
|
|
p = function (t) {
|
|
function e(e) {
|
|
t.call(this, e);
|
|
var i = {
|
|
globals: this.renderer.globalUniforms
|
|
};
|
|
this.shader = n.Shader.from(u, "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - floor(vTextureCoord - uClampOffset);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n", i),
|
|
this.simpleShader = n.Shader.from(u, "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n", i),
|
|
this.quad = new n.QuadUv,
|
|
this.state = n.State.for2d()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.render = function (t) {
|
|
var e = this.renderer,
|
|
i = this.quad,
|
|
n = i.vertices;
|
|
n[0] = n[6] = t._width * -t.anchor.x,
|
|
n[1] = n[3] = t._height * -t.anchor.y,
|
|
n[2] = n[4] = t._width * (1 - t.anchor.x),
|
|
n[5] = n[7] = t._height * (1 - t.anchor.y),
|
|
t.uvRespectAnchor && ((n = i.uvs)[0] = n[6] = -t.anchor.x, n[1] = n[3] = -t.anchor.y, n[2] = n[4] = 1 - t.anchor.x, n[5] = n[7] = 1 - t.anchor.y),
|
|
i.invalidate();
|
|
var r = t._texture,
|
|
s = r.baseTexture,
|
|
h = t.tileTransform.localTransform,
|
|
l = t.uvMatrix,
|
|
u = s.isPowerOfTwo && r.frame.width === s.width && r.frame.height === s.height;
|
|
u && (s._glTextures[e.CONTEXT_UID] ? u = s.wrapMode !== a.WRAP_MODES.CLAMP : s.wrapMode === a.WRAP_MODES.CLAMP && (s.wrapMode = a.WRAP_MODES.REPEAT));
|
|
var p = u ? this.simpleShader : this.shader,
|
|
d = r.width,
|
|
f = r.height,
|
|
_ = t._width,
|
|
m = t._height;
|
|
c.set(h.a * d / _, h.b * d / m, h.c * f / _, h.d * f / m, h.tx / _, h.ty / m),
|
|
c.invert(),
|
|
u ? c.prepend(l.mapCoord) : (p.uniforms.uMapCoord = l.mapCoord.toArray(!0), p.uniforms.uClampFrame = l.uClampFrame, p.uniforms.uClampOffset = l.uClampOffset),
|
|
p.uniforms.uTransform = c.toArray(!0),
|
|
p.uniforms.uColor = (0, o.premultiplyTintToRgba)(t.tint, t.worldAlpha, p.uniforms.uColor, s.alphaMode),
|
|
p.uniforms.translationMatrix = t.transform.worldTransform.toArray(!0),
|
|
p.uniforms.uSampler = r,
|
|
e.shader.bind(p),
|
|
e.geometry.bind(i),
|
|
this.state.blendMode = (0, o.correctBlendMode)(t.blendMode, s.alphaMode),
|
|
e.state.set(this.state),
|
|
e.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0)
|
|
},
|
|
e
|
|
}
|
|
(n.ObjectRenderer);
|
|
i.TilingSpriteRenderer = p
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/sprite": "vBI9",
|
|
"@pixi/constants": "R76a"
|
|
}
|
|
],
|
|
mTlL: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.BitmapText = i.BitmapFontLoader = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/display"),
|
|
o = t("@pixi/math"),
|
|
s = t("@pixi/settings"),
|
|
a = t("@pixi/sprite"),
|
|
h = t("@pixi/utils"),
|
|
l = t("@pixi/loaders"),
|
|
u = function (t) {
|
|
function e(e, i) {
|
|
var n = this;
|
|
void 0 === i && (i = {}),
|
|
t.call(this),
|
|
this._textWidth = 0,
|
|
this._textHeight = 0,
|
|
this._glyphs = [],
|
|
this._font = {
|
|
tint: void 0 !== i.tint ? i.tint : 16777215,
|
|
align: i.align || "left",
|
|
name: null,
|
|
size: 0
|
|
},
|
|
this.font = i.font,
|
|
this._text = e,
|
|
this._maxWidth = 0,
|
|
this._maxLineHeight = 0,
|
|
this._letterSpacing = 0,
|
|
this._anchor = new o.ObservablePoint((function () {
|
|
n.dirty = !0
|
|
}), this, 0, 0),
|
|
this.dirty = !1,
|
|
this.roundPixels = s.settings.ROUND_PIXELS,
|
|
this.updateText()
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
tint: {
|
|
configurable: !0
|
|
},
|
|
align: {
|
|
configurable: !0
|
|
},
|
|
anchor: {
|
|
configurable: !0
|
|
},
|
|
font: {
|
|
configurable: !0
|
|
},
|
|
text: {
|
|
configurable: !0
|
|
},
|
|
maxWidth: {
|
|
configurable: !0
|
|
},
|
|
maxLineHeight: {
|
|
configurable: !0
|
|
},
|
|
textWidth: {
|
|
configurable: !0
|
|
},
|
|
letterSpacing: {
|
|
configurable: !0
|
|
},
|
|
textHeight: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.updateText = function () {
|
|
for (var t = e.fonts[this._font.name], i = this._font.size / t.size, n = new o.Point, r = [], s = [], l = this._text.replace(/(?:\r\n|\r)/g, "\n") || " ", u = l.length, c = this._maxWidth * t.size / this._font.size, p = null, d = 0, f = 0, _ = 0, m = -1, y = 0, g = 0, v = 0, w = 0; w < u; w++) {
|
|
var x = l.charCodeAt(w),
|
|
b = l.charAt(w);
|
|
if (/(?:\s)/.test(b) && (m = w, y = d), "\r" !== b && "\n" !== b) {
|
|
var E = t.chars[x];
|
|
E && (p && E.kerning[p] && (n.x += E.kerning[p]), r.push({
|
|
texture: E.texture,
|
|
line: _,
|
|
charCode: x,
|
|
position: new o.Point(n.x + E.xOffset + this._letterSpacing / 2, n.y + E.yOffset)
|
|
}), n.x += E.xAdvance + this._letterSpacing, d = n.x, v = Math.max(v, E.yOffset + E.texture.height), p = x, -1 !== m && c > 0 && n.x > c && (++g, (0, h.removeItems)(r, 1 + m - g, 1 + w - m), w = m, m = -1, s.push(y), f = Math.max(f, y), _++, n.x = 0, n.y += t.lineHeight, p = null))
|
|
} else
|
|
s.push(d), f = Math.max(f, d), ++_, ++g, n.x = 0, n.y += t.lineHeight, p = null
|
|
}
|
|
var $ = l.charAt(l.length - 1);
|
|
"\r" !== $ && "\n" !== $ && (/(?:\s)/.test($) && (d = y), s.push(d), f = Math.max(f, d));
|
|
for (var A = [], S = 0; S <= _; S++) {
|
|
var T = 0;
|
|
"right" === this._font.align ? T = f - s[S] : "center" === this._font.align && (T = (f - s[S]) / 2),
|
|
A.push(T)
|
|
}
|
|
for (var C = r.length, M = this.tint, I = 0; I < C; I++) {
|
|
var P = this._glyphs[I];
|
|
P ? P.texture = r[I].texture : ((P = new a.Sprite(r[I].texture)).roundPixels = this.roundPixels, this._glyphs.push(P)),
|
|
P.position.x = (r[I].position.x + A[r[I].line]) * i,
|
|
P.position.y = r[I].position.y * i,
|
|
P.scale.x = P.scale.y = i,
|
|
P.tint = M,
|
|
P.parent || this.addChild(P)
|
|
}
|
|
for (var O = C; O < this._glyphs.length; ++O)
|
|
this.removeChild(this._glyphs[O]);
|
|
if (this._textWidth = f * i, this._textHeight = (n.y + t.lineHeight) * i, 0 !== this.anchor.x || 0 !== this.anchor.y)
|
|
for (var R = 0; R < C; R++)
|
|
this._glyphs[R].x -= this._textWidth * this.anchor.x, this._glyphs[R].y -= this._textHeight * this.anchor.y;
|
|
this._maxLineHeight = v * i
|
|
},
|
|
e.prototype.updateTransform = function () {
|
|
this.validate(),
|
|
this.containerUpdateTransform()
|
|
},
|
|
e.prototype.getLocalBounds = function () {
|
|
return this.validate(),
|
|
t.prototype.getLocalBounds.call(this)
|
|
},
|
|
e.prototype.validate = function () {
|
|
this.dirty && (this.updateText(), this.dirty = !1)
|
|
},
|
|
i.tint.get = function () {
|
|
return this._font.tint
|
|
},
|
|
i.tint.set = function (t) {
|
|
this._font.tint = "number" == typeof t && t >= 0 ? t : 16777215,
|
|
this.dirty = !0
|
|
},
|
|
i.align.get = function () {
|
|
return this._font.align
|
|
},
|
|
i.align.set = function (t) {
|
|
this._font.align = t || "left",
|
|
this.dirty = !0
|
|
},
|
|
i.anchor.get = function () {
|
|
return this._anchor
|
|
},
|
|
i.anchor.set = function (t) {
|
|
"number" == typeof t ? this._anchor.set(t) : this._anchor.copyFrom(t)
|
|
},
|
|
i.font.get = function () {
|
|
return this._font
|
|
},
|
|
i.font.set = function (t) {
|
|
t && ("string" == typeof t ? (t = t.split(" "), this._font.name = 1 === t.length ? t[0] : t.slice(1).join(" "), this._font.size = t.length >= 2 ? parseInt(t[0], 10) : e.fonts[this._font.name].size) : (this._font.name = t.name, this._font.size = "number" == typeof t.size ? t.size : parseInt(t.size, 10)), this.dirty = !0)
|
|
},
|
|
i.text.get = function () {
|
|
return this._text
|
|
},
|
|
i.text.set = function (t) {
|
|
t = String(null == t ? "" : t),
|
|
this._text !== t && (this._text = t, this.dirty = !0)
|
|
},
|
|
i.maxWidth.get = function () {
|
|
return this._maxWidth
|
|
},
|
|
i.maxWidth.set = function (t) {
|
|
this._maxWidth !== t && (this._maxWidth = t, this.dirty = !0)
|
|
},
|
|
i.maxLineHeight.get = function () {
|
|
return this.validate(),
|
|
this._maxLineHeight
|
|
},
|
|
i.textWidth.get = function () {
|
|
return this.validate(),
|
|
this._textWidth
|
|
},
|
|
i.letterSpacing.get = function () {
|
|
return this._letterSpacing
|
|
},
|
|
i.letterSpacing.set = function (t) {
|
|
this._letterSpacing !== t && (this._letterSpacing = t, this.dirty = !0)
|
|
},
|
|
i.textHeight.get = function () {
|
|
return this.validate(),
|
|
this._textHeight
|
|
},
|
|
e.registerFont = function (t, i) {
|
|
var r = {},
|
|
a = t.getElementsByTagName("info")[0],
|
|
l = t.getElementsByTagName("common")[0],
|
|
u = t.getElementsByTagName("page"),
|
|
c = (0, h.getResolutionOfUrl)(u[0].getAttribute("file"), s.settings.RESOLUTION),
|
|
p = {};
|
|
r.font = a.getAttribute("face"),
|
|
r.size = parseInt(a.getAttribute("size"), 10),
|
|
r.lineHeight = parseInt(l.getAttribute("lineHeight"), 10) / c,
|
|
r.chars = {},
|
|
i instanceof n.Texture && (i = [i]);
|
|
for (var d = 0; d < u.length; d++) {
|
|
var f = u[d].getAttribute("id"),
|
|
_ = u[d].getAttribute("file");
|
|
p[f] = i instanceof Array ? i[d] : i[_]
|
|
}
|
|
for (var m = t.getElementsByTagName("char"), y = 0; y < m.length; y++) {
|
|
var g = m[y],
|
|
v = parseInt(g.getAttribute("id"), 10),
|
|
w = g.getAttribute("page") || 0,
|
|
x = new o.Rectangle(parseInt(g.getAttribute("x"), 10) / c + p[w].frame.x / c, parseInt(g.getAttribute("y"), 10) / c + p[w].frame.y / c, parseInt(g.getAttribute("width"), 10) / c, parseInt(g.getAttribute("height"), 10) / c);
|
|
r.chars[v] = {
|
|
xOffset: parseInt(g.getAttribute("xoffset"), 10) / c,
|
|
yOffset: parseInt(g.getAttribute("yoffset"), 10) / c,
|
|
xAdvance: parseInt(g.getAttribute("xadvance"), 10) / c,
|
|
kerning: {},
|
|
texture: new n.Texture(p[w].baseTexture, x),
|
|
page: w
|
|
}
|
|
}
|
|
for (var b = t.getElementsByTagName("kerning"), E = 0; E < b.length; E++) {
|
|
var $ = b[E],
|
|
A = parseInt($.getAttribute("first"), 10) / c,
|
|
S = parseInt($.getAttribute("second"), 10) / c,
|
|
T = parseInt($.getAttribute("amount"), 10) / c;
|
|
r.chars[S] && (r.chars[S].kerning[A] = T)
|
|
}
|
|
return e.fonts[r.font] = r,
|
|
r
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(r.Container);
|
|
i.BitmapText = u,
|
|
u.fonts = {};
|
|
var c = function () {};
|
|
i.BitmapFontLoader = c,
|
|
c.parse = function (t, e) {
|
|
t.bitmapFont = u.registerFont(t.data, e)
|
|
},
|
|
c.add = function () {
|
|
l.LoaderResource.setExtensionXhrType("fnt", l.LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT)
|
|
},
|
|
c.dirname = function (t) {
|
|
var e = t.replace(/\\/g, "/").replace(/\/$/, "").replace(/\/[^\/]*$/, "");
|
|
return e === t ? "." : "" === e ? "/" : e
|
|
},
|
|
c.use = function (t, e) {
|
|
if (t.data && t.type === l.LoaderResource.TYPE.XML)
|
|
if (0 !== t.data.getElementsByTagName("page").length && 0 !== t.data.getElementsByTagName("info").length && null !== t.data.getElementsByTagName("info")[0].getAttribute("face")) {
|
|
var i = t.isDataUrl ? "" : c.dirname(t.url);
|
|
t.isDataUrl && ("." === i && (i = ""), this.baseUrl && i && "/" === this.baseUrl.charAt(this.baseUrl.length - 1) && (i += "/")),
|
|
(i = i.replace(this.baseUrl, "")) && "/" !== i.charAt(i.length - 1) && (i += "/");
|
|
for (var n = t.data.getElementsByTagName("page"), r = {}, o = function (i) {
|
|
r[i.metadata.pageFile] = i.texture,
|
|
Object.keys(r).length === n.length && (c.parse(t, r), e())
|
|
}, s = 0; s < n.length; ++s) {
|
|
var a = n[s].getAttribute("file"),
|
|
h = i + a,
|
|
u = !1;
|
|
for (var p in this.resources) {
|
|
var d = this.resources[p];
|
|
if (d.url === h) {
|
|
d.metadata.pageFile = a,
|
|
d.texture ? o(d) : d.onAfterMiddleware.add(o),
|
|
u = !0;
|
|
break
|
|
}
|
|
}
|
|
if (!u) {
|
|
var f = {
|
|
crossOrigin: t.crossOrigin,
|
|
loadType: l.LoaderResource.LOAD_TYPE.IMAGE,
|
|
metadata: Object.assign({
|
|
pageFile: a
|
|
}, t.metadata.imageMetadata),
|
|
parentResource: t
|
|
};
|
|
this.add(h, f, o)
|
|
}
|
|
}
|
|
} else
|
|
e();
|
|
else
|
|
e()
|
|
}
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/settings": "v11T",
|
|
"@pixi/sprite": "vBI9",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/loaders": "pAmg"
|
|
}
|
|
],
|
|
SOHw: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.AlphaFilter = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = function (t) {
|
|
function e(e) {
|
|
void 0 === e && (e = 1),
|
|
t.call(this, n.defaultVertex, "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n", {
|
|
uAlpha: 1
|
|
}),
|
|
this.alpha = e
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
alpha: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.alpha.get = function () {
|
|
return this.uniforms.uAlpha
|
|
},
|
|
i.alpha.set = function (t) {
|
|
this.uniforms.uAlpha = t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Filter);
|
|
/*!
|
|
* @pixi/filter-alpha - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/filter-alpha is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
i.AlphaFilter = r
|
|
}, {
|
|
"@pixi/core": "qqf8"
|
|
}
|
|
],
|
|
zAmH: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.BlurFilterPass = i.BlurFilter = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/settings");
|
|
var o = {
|
|
5: [.153388, .221461, .250301],
|
|
7: [.071303, .131514, .189879, .214607],
|
|
9: [.028532, .067234, .124009, .179044, .20236],
|
|
11: [.0093, .028002, .065984, .121703, .175713, .198596],
|
|
13: [.002406, .009255, .027867, .065666, .121117, .174868, .197641],
|
|
15: [489e-6, .002403, .009246, .02784, .065602, .120999, .174697, .197448]
|
|
},
|
|
s = ["varying vec2 vBlurTexCoords[%size%];", "uniform sampler2D uSampler;", "void main(void)", "{", " gl_FragColor = vec4(0.0);", " %blur%", "}"].join("\n");
|
|
var a = function (t) {
|
|
function e(e, i, n, a, h) {
|
|
var l = function (t, e) {
|
|
var i,
|
|
n = Math.ceil(t / 2),
|
|
r = "\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",
|
|
o = "";
|
|
i = e ? "vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);" : "vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";
|
|
for (var s = 0; s < t; s++) {
|
|
var a = i.replace("%index%", s);
|
|
o += a = a.replace("%sampleIndex%", s - (n - 1) + ".0"),
|
|
o += "\n"
|
|
}
|
|
return r = (r = r.replace("%blur%", o)).replace("%size%", t)
|
|
}
|
|
(h = h || 5, e),
|
|
u = function (t) {
|
|
for (var e, i = o[t], n = i.length, r = s, a = "", h = 0; h < t; h++) {
|
|
var l = "gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%", h);
|
|
e = h,
|
|
h >= n && (e = t - h - 1),
|
|
a += l = l.replace("%value%", i[e]),
|
|
a += "\n"
|
|
}
|
|
return r = (r = r.replace("%blur%", a)).replace("%size%", t)
|
|
}
|
|
(h);
|
|
t.call(this, l, u),
|
|
this.horizontal = e,
|
|
this.resolution = a || r.settings.RESOLUTION,
|
|
this._quality = 0,
|
|
this.quality = n || 4,
|
|
this.blur = i || 8
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
blur: {
|
|
configurable: !0
|
|
},
|
|
quality: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.apply = function (t, e, i, n) {
|
|
if (i ? this.horizontal ? this.uniforms.strength = 1 / i.width * (i.width / e.width) : this.uniforms.strength = 1 / i.height * (i.height / e.height) : this.horizontal ? this.uniforms.strength = 1 / t.renderer.width * (t.renderer.width / e.width) : this.uniforms.strength = 1 / t.renderer.height * (t.renderer.height / e.height), this.uniforms.strength *= this.strength, this.uniforms.strength /= this.passes, 1 === this.passes)
|
|
t.applyFilter(this, e, i, n);
|
|
else {
|
|
var r = t.getFilterTexture(),
|
|
o = t.renderer,
|
|
s = e,
|
|
a = r;
|
|
this.state.blend = !1,
|
|
t.applyFilter(this, s, a, !0);
|
|
for (var h = 1; h < this.passes - 1; h++) {
|
|
o.renderTexture.bind(s, s.filterFrame),
|
|
this.uniforms.uSampler = a;
|
|
var l = a;
|
|
a = s,
|
|
s = l,
|
|
o.shader.bind(this),
|
|
o.geometry.draw(5)
|
|
}
|
|
this.state.blend = !0,
|
|
t.applyFilter(this, a, i, n),
|
|
t.returnFilterTexture(r)
|
|
}
|
|
},
|
|
i.blur.get = function () {
|
|
return this.strength
|
|
},
|
|
i.blur.set = function (t) {
|
|
this.padding = 1 + 2 * Math.abs(t),
|
|
this.strength = t
|
|
},
|
|
i.quality.get = function () {
|
|
return this._quality
|
|
},
|
|
i.quality.set = function (t) {
|
|
this._quality = t,
|
|
this.passes = t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Filter);
|
|
i.BlurFilterPass = a;
|
|
var h = function (t) {
|
|
function e(e, i, n, o) {
|
|
t.call(this),
|
|
this.blurXFilter = new a(!0, e, i, n, o),
|
|
this.blurYFilter = new a(!1, e, i, n, o),
|
|
this.resolution = n || r.settings.RESOLUTION,
|
|
this.quality = i || 4,
|
|
this.blur = e || 8,
|
|
this.repeatEdgePixels = !1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
blur: {
|
|
configurable: !0
|
|
},
|
|
quality: {
|
|
configurable: !0
|
|
},
|
|
blurX: {
|
|
configurable: !0
|
|
},
|
|
blurY: {
|
|
configurable: !0
|
|
},
|
|
blendMode: {
|
|
configurable: !0
|
|
},
|
|
repeatEdgePixels: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.apply = function (t, e, i, n) {
|
|
var r = Math.abs(this.blurXFilter.strength),
|
|
o = Math.abs(this.blurYFilter.strength);
|
|
if (r && o) {
|
|
var s = t.getFilterTexture();
|
|
this.blurXFilter.apply(t, e, s, !0),
|
|
this.blurYFilter.apply(t, s, i, n),
|
|
t.returnFilterTexture(s)
|
|
} else
|
|
o ? this.blurYFilter.apply(t, e, i, n) : this.blurXFilter.apply(t, e, i, n)
|
|
},
|
|
e.prototype.updatePadding = function () {
|
|
this._repeatEdgePixels ? this.padding = 0 : this.padding = 2 * Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength))
|
|
},
|
|
i.blur.get = function () {
|
|
return this.blurXFilter.blur
|
|
},
|
|
i.blur.set = function (t) {
|
|
this.blurXFilter.blur = this.blurYFilter.blur = t,
|
|
this.updatePadding()
|
|
},
|
|
i.quality.get = function () {
|
|
return this.blurXFilter.quality
|
|
},
|
|
i.quality.set = function (t) {
|
|
this.blurXFilter.quality = this.blurYFilter.quality = t
|
|
},
|
|
i.blurX.get = function () {
|
|
return this.blurXFilter.blur
|
|
},
|
|
i.blurX.set = function (t) {
|
|
this.blurXFilter.blur = t,
|
|
this.updatePadding()
|
|
},
|
|
i.blurY.get = function () {
|
|
return this.blurYFilter.blur
|
|
},
|
|
i.blurY.set = function (t) {
|
|
this.blurYFilter.blur = t,
|
|
this.updatePadding()
|
|
},
|
|
i.blendMode.get = function () {
|
|
return this.blurYFilter.blendMode
|
|
},
|
|
i.blendMode.set = function (t) {
|
|
this.blurYFilter.blendMode = t
|
|
},
|
|
i.repeatEdgePixels.get = function () {
|
|
return this._repeatEdgePixels
|
|
},
|
|
i.repeatEdgePixels.set = function (t) {
|
|
this._repeatEdgePixels = t,
|
|
this.updatePadding()
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Filter);
|
|
i.BlurFilter = h
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/settings": "v11T"
|
|
}
|
|
],
|
|
FZwX: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.ColorMatrixFilter = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = function (t) {
|
|
function e() {
|
|
var e = {
|
|
m: new Float32Array([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]),
|
|
uAlpha: 1
|
|
};
|
|
t.call(this, n.defaultFilterVertex, "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n", e),
|
|
this.alpha = 1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
matrix: {
|
|
configurable: !0
|
|
},
|
|
alpha: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype._loadMatrix = function (t, e) {
|
|
void 0 === e && (e = !1);
|
|
var i = t;
|
|
e && (this._multiply(i, this.uniforms.m, t), i = this._colorMatrix(i)),
|
|
this.uniforms.m = i
|
|
},
|
|
e.prototype._multiply = function (t, e, i) {
|
|
return t[0] = e[0] * i[0] + e[1] * i[5] + e[2] * i[10] + e[3] * i[15],
|
|
t[1] = e[0] * i[1] + e[1] * i[6] + e[2] * i[11] + e[3] * i[16],
|
|
t[2] = e[0] * i[2] + e[1] * i[7] + e[2] * i[12] + e[3] * i[17],
|
|
t[3] = e[0] * i[3] + e[1] * i[8] + e[2] * i[13] + e[3] * i[18],
|
|
t[4] = e[0] * i[4] + e[1] * i[9] + e[2] * i[14] + e[3] * i[19] + e[4],
|
|
t[5] = e[5] * i[0] + e[6] * i[5] + e[7] * i[10] + e[8] * i[15],
|
|
t[6] = e[5] * i[1] + e[6] * i[6] + e[7] * i[11] + e[8] * i[16],
|
|
t[7] = e[5] * i[2] + e[6] * i[7] + e[7] * i[12] + e[8] * i[17],
|
|
t[8] = e[5] * i[3] + e[6] * i[8] + e[7] * i[13] + e[8] * i[18],
|
|
t[9] = e[5] * i[4] + e[6] * i[9] + e[7] * i[14] + e[8] * i[19] + e[9],
|
|
t[10] = e[10] * i[0] + e[11] * i[5] + e[12] * i[10] + e[13] * i[15],
|
|
t[11] = e[10] * i[1] + e[11] * i[6] + e[12] * i[11] + e[13] * i[16],
|
|
t[12] = e[10] * i[2] + e[11] * i[7] + e[12] * i[12] + e[13] * i[17],
|
|
t[13] = e[10] * i[3] + e[11] * i[8] + e[12] * i[13] + e[13] * i[18],
|
|
t[14] = e[10] * i[4] + e[11] * i[9] + e[12] * i[14] + e[13] * i[19] + e[14],
|
|
t[15] = e[15] * i[0] + e[16] * i[5] + e[17] * i[10] + e[18] * i[15],
|
|
t[16] = e[15] * i[1] + e[16] * i[6] + e[17] * i[11] + e[18] * i[16],
|
|
t[17] = e[15] * i[2] + e[16] * i[7] + e[17] * i[12] + e[18] * i[17],
|
|
t[18] = e[15] * i[3] + e[16] * i[8] + e[17] * i[13] + e[18] * i[18],
|
|
t[19] = e[15] * i[4] + e[16] * i[9] + e[17] * i[14] + e[18] * i[19] + e[19],
|
|
t
|
|
},
|
|
e.prototype._colorMatrix = function (t) {
|
|
var e = new Float32Array(t);
|
|
return e[4] /= 255,
|
|
e[9] /= 255,
|
|
e[14] /= 255,
|
|
e[19] /= 255,
|
|
e
|
|
},
|
|
e.prototype.brightness = function (t, e) {
|
|
var i = [t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, 1, 0];
|
|
this._loadMatrix(i, e)
|
|
},
|
|
e.prototype.greyscale = function (t, e) {
|
|
var i = [t, t, t, 0, 0, t, t, t, 0, 0, t, t, t, 0, 0, 0, 0, 0, 1, 0];
|
|
this._loadMatrix(i, e)
|
|
},
|
|
e.prototype.blackAndWhite = function (t) {
|
|
this._loadMatrix([.3, .6, .1, 0, 0, .3, .6, .1, 0, 0, .3, .6, .1, 0, 0, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.hue = function (t, e) {
|
|
t = (t || 0) / 180 * Math.PI;
|
|
var i = Math.cos(t),
|
|
n = Math.sin(t),
|
|
r = 1 / 3,
|
|
o = (0, Math.sqrt)(r),
|
|
s = [i + (1 - i) * r, r * (1 - i) - o * n, r * (1 - i) + o * n, 0, 0, r * (1 - i) + o * n, i + r * (1 - i), r * (1 - i) - o * n, 0, 0, r * (1 - i) - o * n, r * (1 - i) + o * n, i + r * (1 - i), 0, 0, 0, 0, 0, 1, 0];
|
|
this._loadMatrix(s, e)
|
|
},
|
|
e.prototype.contrast = function (t, e) {
|
|
var i = (t || 0) + 1,
|
|
n = - .5 * (i - 1),
|
|
r = [i, 0, 0, 0, n, 0, i, 0, 0, n, 0, 0, i, 0, n, 0, 0, 0, 1, 0];
|
|
this._loadMatrix(r, e)
|
|
},
|
|
e.prototype.saturate = function (t, e) {
|
|
void 0 === t && (t = 0);
|
|
var i = 2 * t / 3 + 1,
|
|
n = - .5 * (i - 1),
|
|
r = [i, n, n, 0, 0, n, i, n, 0, 0, n, n, i, 0, 0, 0, 0, 0, 1, 0];
|
|
this._loadMatrix(r, e)
|
|
},
|
|
e.prototype.desaturate = function () {
|
|
this.saturate(-1)
|
|
},
|
|
e.prototype.negative = function (t) {
|
|
this._loadMatrix([-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.sepia = function (t) {
|
|
this._loadMatrix([.393, .7689999, .18899999, 0, 0, .349, .6859999, .16799999, 0, 0, .272, .5339999, .13099999, 0, 0, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.technicolor = function (t) {
|
|
this._loadMatrix([1.9125277891456083, - .8545344976951645, - .09155508482755585, 0, 11.793603434377337, - .3087833385928097, 1.7658908555458428, - .10601743074722245, 0, -70.35205161461398, - .231103377548616, - .7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.polaroid = function (t) {
|
|
this._loadMatrix([1.438, - .062, - .062, 0, 0, - .122, 1.378, - .122, 0, 0, - .016, - .016, 1.483, 0, 0, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.toBGR = function (t) {
|
|
this._loadMatrix([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.kodachrome = function (t) {
|
|
this._loadMatrix([1.1285582396593525, - .3967382283601348, - .03992559172921793, 0, 63.72958762196502, - .16404339962244616, 1.0835251566291304, - .05498805115633132, 0, 24.732407896706203, - .16786010706155763, - .5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.browni = function (t) {
|
|
this._loadMatrix([.5997023498159715, .34553243048391263, - .2708298674538042, 0, 47.43192855600873, - .037703249837783157, .8609577587992641, .15059552388459913, 0, -36.96841498319127, .24113635128153335, - .07441037908422492, .44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.vintage = function (t) {
|
|
this._loadMatrix([.6279345635605994, .3202183420819367, - .03965408211312453, 0, 9.651285835294123, .02578397704808868, .6441188644374771, .03259127616149294, 0, 7.462829176470591, .0466055556782719, - .0851232987247891, .5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.colorTone = function (t, e, i, n, r) {
|
|
var o = ((i = i || 16770432) >> 16 & 255) / 255,
|
|
s = (i >> 8 & 255) / 255,
|
|
a = (255 & i) / 255,
|
|
h = ((n = n || 3375104) >> 16 & 255) / 255,
|
|
l = (n >> 8 & 255) / 255,
|
|
u = (255 & n) / 255,
|
|
c = [.3, .59, .11, 0, 0, o, s, a, t = t || .2, 0, h, l, u, e = e || .15, 0, o - h, s - l, a - u, 0, 0];
|
|
this._loadMatrix(c, r)
|
|
},
|
|
e.prototype.night = function (t, e) {
|
|
var i = [-2 * (t = t || .1), -t, 0, 0, 0, -t, 0, t, 0, 0, 0, t, 2 * t, 0, 0, 0, 0, 0, 1, 0];
|
|
this._loadMatrix(i, e)
|
|
},
|
|
e.prototype.predator = function (t, e) {
|
|
var i = [11.224130630493164 * t, -4.794486999511719 * t, -2.8746118545532227 * t, 0 * t, .40342438220977783 * t, -3.6330697536468506 * t, 9.193157196044922 * t, -2.951810836791992 * t, 0 * t, -1.316135048866272 * t, -3.2184197902679443 * t, -4.2375030517578125 * t, 7.476448059082031 * t, 0 * t, .8044459223747253 * t, 0, 0, 0, 1, 0];
|
|
this._loadMatrix(i, e)
|
|
},
|
|
e.prototype.lsd = function (t) {
|
|
this._loadMatrix([2, - .4, .5, 0, 0, - .5, 2, - .4, 0, 0, - .4, - .5, 3, 0, 0, 0, 0, 0, 1, 0], t)
|
|
},
|
|
e.prototype.reset = function () {
|
|
this._loadMatrix([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], !1)
|
|
},
|
|
i.matrix.get = function () {
|
|
return this.uniforms.m
|
|
},
|
|
i.matrix.set = function (t) {
|
|
this.uniforms.m = t
|
|
},
|
|
i.alpha.get = function () {
|
|
return this.uniforms.uAlpha
|
|
},
|
|
i.alpha.set = function (t) {
|
|
this.uniforms.uAlpha = t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Filter);
|
|
/*!
|
|
* @pixi/filter-color-matrix - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/filter-color-matrix is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
i.ColorMatrixFilter = r,
|
|
r.prototype.grayscale = r.prototype.greyscale
|
|
}, {
|
|
"@pixi/core": "qqf8"
|
|
}
|
|
],
|
|
OThW: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.DisplacementFilter = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/math"),
|
|
o = function (t) {
|
|
function e(e, i) {
|
|
var n = new r.Matrix;
|
|
e.renderable = !1,
|
|
t.call(this, "attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n", "varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n", {
|
|
mapSampler: e._texture,
|
|
filterMatrix: n,
|
|
scale: {
|
|
x: 1,
|
|
y: 1
|
|
},
|
|
rotation: new Float32Array([1, 0, 0, 1])
|
|
}),
|
|
this.maskSprite = e,
|
|
this.maskMatrix = n,
|
|
null == i && (i = 20),
|
|
this.scale = new r.Point(i, i)
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
map: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.apply = function (t, e, i, n) {
|
|
this.uniforms.filterMatrix = t.calculateSpriteMatrix(this.maskMatrix, this.maskSprite),
|
|
this.uniforms.scale.x = this.scale.x,
|
|
this.uniforms.scale.y = this.scale.y;
|
|
var r = this.maskSprite.transform.worldTransform,
|
|
o = Math.sqrt(r.a * r.a + r.b * r.b),
|
|
s = Math.sqrt(r.c * r.c + r.d * r.d);
|
|
0 !== o && 0 !== s && (this.uniforms.rotation[0] = r.a / o, this.uniforms.rotation[1] = r.b / o, this.uniforms.rotation[2] = r.c / s, this.uniforms.rotation[3] = r.d / s),
|
|
t.applyFilter(this, e, i, n)
|
|
},
|
|
i.map.get = function () {
|
|
return this.uniforms.mapSampler
|
|
},
|
|
i.map.set = function (t) {
|
|
this.uniforms.mapSampler = t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Filter);
|
|
i.DisplacementFilter = o
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/math": "GTL5"
|
|
}
|
|
],
|
|
aTi1: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.FXAAFilter = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = function (t) {
|
|
function e() {
|
|
t.call(this, "\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n", 'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(n.Filter);
|
|
/*!
|
|
* @pixi/filter-fxaa - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/filter-fxaa is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
i.FXAAFilter = r
|
|
}, {
|
|
"@pixi/core": "qqf8"
|
|
}
|
|
],
|
|
jHvy: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.NoiseFilter = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = function (t) {
|
|
function e(e, i) {
|
|
void 0 === e && (e = .5),
|
|
void 0 === i && (i = Math.random()),
|
|
t.call(this, n.defaultFilterVertex, "precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n", {
|
|
uNoise: 0,
|
|
uSeed: 0
|
|
}),
|
|
this.noise = e,
|
|
this.seed = i
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
noise: {
|
|
configurable: !0
|
|
},
|
|
seed: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.noise.get = function () {
|
|
return this.uniforms.uNoise
|
|
},
|
|
i.noise.set = function (t) {
|
|
this.uniforms.uNoise = t
|
|
},
|
|
i.seed.get = function () {
|
|
return this.uniforms.uSeed
|
|
},
|
|
i.seed.set = function (t) {
|
|
this.uniforms.uSeed = t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Filter);
|
|
/*!
|
|
* @pixi/filter-noise - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/filter-noise is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
i.NoiseFilter = r
|
|
}, {
|
|
"@pixi/core": "qqf8"
|
|
}
|
|
],
|
|
wyPI: [function (t, e, i) {
|
|
"use strict";
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/sprite"),
|
|
o = t("@pixi/display"),
|
|
s = t("@pixi/math"),
|
|
a = t("@pixi/utils"),
|
|
h = t("@pixi/settings"),
|
|
l = new s.Matrix;
|
|
o.DisplayObject.prototype._cacheAsBitmap = !1,
|
|
o.DisplayObject.prototype._cacheData = !1;
|
|
var u = function () {
|
|
this.textureCacheId = null,
|
|
this.originalRender = null,
|
|
this.originalRenderCanvas = null,
|
|
this.originalCalculateBounds = null,
|
|
this.originalGetLocalBounds = null,
|
|
this.originalUpdateTransform = null,
|
|
this.originalHitTest = null,
|
|
this.originalDestroy = null,
|
|
this.originalMask = null,
|
|
this.originalFilterArea = null,
|
|
this.sprite = null
|
|
};
|
|
Object.defineProperties(o.DisplayObject.prototype, {
|
|
cacheAsBitmap: {
|
|
get: function () {
|
|
return this._cacheAsBitmap
|
|
},
|
|
set: function (t) {
|
|
var e;
|
|
this._cacheAsBitmap !== t && (this._cacheAsBitmap = t, t ? (this._cacheData || (this._cacheData = new u), (e = this._cacheData).originalRender = this.render, e.originalRenderCanvas = this.renderCanvas, e.originalUpdateTransform = this.updateTransform, e.originalCalculateBounds = this.calculateBounds, e.originalGetLocalBounds = this.getLocalBounds, e.originalDestroy = this.destroy, e.originalContainsPoint = this.containsPoint, e.originalMask = this._mask, e.originalFilterArea = this.filterArea, this.render = this._renderCached, this.renderCanvas = this._renderCachedCanvas, this.destroy = this._cacheAsBitmapDestroy) : ((e = this._cacheData).sprite && this._destroyCachedDisplayObject(), this.render = e.originalRender, this.renderCanvas = e.originalRenderCanvas, this.calculateBounds = e.originalCalculateBounds, this.getLocalBounds = e.originalGetLocalBounds, this.destroy = e.originalDestroy, this.updateTransform = e.originalUpdateTransform, this.containsPoint = e.originalContainsPoint, this._mask = e.originalMask, this.filterArea = e.originalFilterArea))
|
|
}
|
|
}
|
|
}),
|
|
o.DisplayObject.prototype._renderCached = function (t) {
|
|
!this.visible || this.worldAlpha <= 0 || !this.renderable || (this._initCachedDisplayObject(t), this._cacheData.sprite.transform._worldID = this.transform._worldID, this._cacheData.sprite.worldAlpha = this.worldAlpha, this._cacheData.sprite._render(t))
|
|
},
|
|
o.DisplayObject.prototype._initCachedDisplayObject = function (t) {
|
|
if (!this._cacheData || !this._cacheData.sprite) {
|
|
var e = this.alpha;
|
|
this.alpha = 1,
|
|
t.batch.flush();
|
|
var i = this.getLocalBounds().clone();
|
|
if (this.filters) {
|
|
var o = this.filters[0].padding;
|
|
i.pad(o)
|
|
}
|
|
i.ceil(h.settings.RESOLUTION);
|
|
var s = t.renderTexture.current,
|
|
u = t.renderTexture.sourceFrame,
|
|
c = t.projection.transform,
|
|
p = n.RenderTexture.create(i.width, i.height),
|
|
d = "cacheAsBitmap_" + (0, a.uid)();
|
|
this._cacheData.textureCacheId = d,
|
|
n.BaseTexture.addToCache(p.baseTexture, d),
|
|
n.Texture.addToCache(p, d);
|
|
var f = l;
|
|
f.tx = -i.x,
|
|
f.ty = -i.y,
|
|
this.transform.worldTransform.identity(),
|
|
this.render = this._cacheData.originalRender,
|
|
t.render(this, p, !0, f, !0),
|
|
t.projection.transform = c,
|
|
t.renderTexture.bind(s, u),
|
|
this.render = this._renderCached,
|
|
this.updateTransform = this.displayObjectUpdateTransform,
|
|
this.calculateBounds = this._calculateCachedBounds,
|
|
this.getLocalBounds = this._getCachedLocalBounds,
|
|
this._mask = null,
|
|
this.filterArea = null;
|
|
var _ = new r.Sprite(p);
|
|
_.transform.worldTransform = this.transform.worldTransform,
|
|
_.anchor.x = -i.x / i.width,
|
|
_.anchor.y = -i.y / i.height,
|
|
_.alpha = e,
|
|
_._bounds = this._bounds,
|
|
this._cacheData.sprite = _,
|
|
this.transform._parentID = -1,
|
|
this.parent ? this.updateTransform() : (this.parent = t._tempDisplayObjectParent, this.updateTransform(), this.parent = null),
|
|
this.containsPoint = _.containsPoint.bind(_)
|
|
}
|
|
},
|
|
o.DisplayObject.prototype._renderCachedCanvas = function (t) {
|
|
!this.visible || this.worldAlpha <= 0 || !this.renderable || (this._initCachedDisplayObjectCanvas(t), this._cacheData.sprite.worldAlpha = this.worldAlpha, this._cacheData.sprite._renderCanvas(t))
|
|
},
|
|
o.DisplayObject.prototype._initCachedDisplayObjectCanvas = function (t) {
|
|
if (!this._cacheData || !this._cacheData.sprite) {
|
|
var e = this.getLocalBounds(),
|
|
i = this.alpha;
|
|
this.alpha = 1;
|
|
var o = t.context;
|
|
e.ceil(h.settings.RESOLUTION);
|
|
var s = n.RenderTexture.create(e.width, e.height),
|
|
u = "cacheAsBitmap_" + (0, a.uid)();
|
|
this._cacheData.textureCacheId = u,
|
|
n.BaseTexture.addToCache(s.baseTexture, u),
|
|
n.Texture.addToCache(s, u);
|
|
var c = l;
|
|
this.transform.localTransform.copyTo(c),
|
|
c.invert(),
|
|
c.tx -= e.x,
|
|
c.ty -= e.y,
|
|
this.renderCanvas = this._cacheData.originalRenderCanvas,
|
|
t.render(this, s, !0, c, !1),
|
|
t.context = o,
|
|
this.renderCanvas = this._renderCachedCanvas,
|
|
this.updateTransform = this.displayObjectUpdateTransform,
|
|
this.calculateBounds = this._calculateCachedBounds,
|
|
this.getLocalBounds = this._getCachedLocalBounds,
|
|
this._mask = null,
|
|
this.filterArea = null;
|
|
var p = new r.Sprite(s);
|
|
p.transform.worldTransform = this.transform.worldTransform,
|
|
p.anchor.x = -e.x / e.width,
|
|
p.anchor.y = -e.y / e.height,
|
|
p.alpha = i,
|
|
p._bounds = this._bounds,
|
|
this._cacheData.sprite = p,
|
|
this.transform._parentID = -1,
|
|
this.parent ? this.updateTransform() : (this.parent = t._tempDisplayObjectParent, this.updateTransform(), this.parent = null),
|
|
this.containsPoint = p.containsPoint.bind(p)
|
|
}
|
|
},
|
|
o.DisplayObject.prototype._calculateCachedBounds = function () {
|
|
this._bounds.clear(),
|
|
this._cacheData.sprite.transform._worldID = this.transform._worldID,
|
|
this._cacheData.sprite._calculateBounds(),
|
|
this._lastBoundsID = this._boundsID
|
|
},
|
|
o.DisplayObject.prototype._getCachedLocalBounds = function () {
|
|
return this._cacheData.sprite.getLocalBounds()
|
|
},
|
|
o.DisplayObject.prototype._destroyCachedDisplayObject = function () {
|
|
this._cacheData.sprite._texture.destroy(!0),
|
|
this._cacheData.sprite = null,
|
|
n.BaseTexture.removeFromCache(this._cacheData.textureCacheId),
|
|
n.Texture.removeFromCache(this._cacheData.textureCacheId),
|
|
this._cacheData.textureCacheId = null
|
|
},
|
|
o.DisplayObject.prototype._cacheAsBitmapDestroy = function (t) {
|
|
this.cacheAsBitmap = !1,
|
|
this.destroy(t)
|
|
}
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/sprite": "vBI9",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/settings": "v11T"
|
|
}
|
|
],
|
|
FAue: [function (t, e, i) {
|
|
"use strict";
|
|
var n = t("@pixi/display");
|
|
/*!
|
|
* @pixi/mixin-get-child-by-name - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/mixin-get-child-by-name is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
n.DisplayObject.prototype.name = null,
|
|
n.Container.prototype.getChildByName = function (t) {
|
|
for (var e = 0; e < this.children.length; e++)
|
|
if (this.children[e].name === t)
|
|
return this.children[e];
|
|
return null
|
|
}
|
|
}, {
|
|
"@pixi/display": "LJAM"
|
|
}
|
|
],
|
|
UWgA: [function (t, e, i) {
|
|
"use strict";
|
|
var n = t("@pixi/display"),
|
|
r = t("@pixi/math");
|
|
/*!
|
|
* @pixi/mixin-get-global-position - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* @pixi/mixin-get-global-position is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
n.DisplayObject.prototype.getGlobalPosition = function (t, e) {
|
|
return void 0 === t && (t = new r.Point),
|
|
void 0 === e && (e = !1),
|
|
this.parent ? this.parent.toGlobal(this.position, t, e) : (t.x = this.position.x, t.y = this.position.y),
|
|
t
|
|
}
|
|
}, {
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/math": "GTL5"
|
|
}
|
|
],
|
|
fWSH: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.MeshMaterial = i.MeshGeometry = i.MeshBatchUvs = i.Mesh = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/math"),
|
|
o = t("@pixi/constants"),
|
|
s = t("@pixi/display"),
|
|
a = t("@pixi/settings"),
|
|
h = t("@pixi/utils"),
|
|
l = function (t, e) {
|
|
this.uvBuffer = t,
|
|
this.uvMatrix = e,
|
|
this.data = null,
|
|
this._bufferUpdateId = -1,
|
|
this._textureUpdateId = -1,
|
|
this._updateID = 0
|
|
};
|
|
i.MeshBatchUvs = l,
|
|
l.prototype.update = function (t) {
|
|
if (t || this._bufferUpdateId !== this.uvBuffer._updateID || this._textureUpdateId !== this.uvMatrix._updateID) {
|
|
this._bufferUpdateId = this.uvBuffer._updateID,
|
|
this._textureUpdateId = this.uvMatrix._updateID;
|
|
var e = this.uvBuffer.data;
|
|
this.data && this.data.length === e.length || (this.data = new Float32Array(e.length)),
|
|
this.uvMatrix.multiplyUvs(e, this.data),
|
|
this._updateID++
|
|
}
|
|
};
|
|
var u = new r.Point,
|
|
c = new r.Polygon,
|
|
p = function (t) {
|
|
function e(e, i, r, s) {
|
|
void 0 === s && (s = o.DRAW_MODES.TRIANGLES),
|
|
t.call(this),
|
|
this.geometry = e,
|
|
e.refCount++,
|
|
this.shader = i,
|
|
this.state = r || n.State.for2d(),
|
|
this.drawMode = s,
|
|
this.start = 0,
|
|
this.size = 0,
|
|
this.uvs = null,
|
|
this.indices = null,
|
|
this.vertexData = new Float32Array(1),
|
|
this.vertexDirty = 0,
|
|
this._transformID = -1,
|
|
this.tint = 16777215,
|
|
this.blendMode = o.BLEND_MODES.NORMAL,
|
|
this._roundPixels = a.settings.ROUND_PIXELS,
|
|
this.batchUvs = null
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
uvBuffer: {
|
|
configurable: !0
|
|
},
|
|
verticesBuffer: {
|
|
configurable: !0
|
|
},
|
|
material: {
|
|
configurable: !0
|
|
},
|
|
blendMode: {
|
|
configurable: !0
|
|
},
|
|
roundPixels: {
|
|
configurable: !0
|
|
},
|
|
tint: {
|
|
configurable: !0
|
|
},
|
|
texture: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.uvBuffer.get = function () {
|
|
return this.geometry.buffers[1]
|
|
},
|
|
i.verticesBuffer.get = function () {
|
|
return this.geometry.buffers[0]
|
|
},
|
|
i.material.set = function (t) {
|
|
this.shader = t
|
|
},
|
|
i.material.get = function () {
|
|
return this.shader
|
|
},
|
|
i.blendMode.set = function (t) {
|
|
this.state.blendMode = t
|
|
},
|
|
i.blendMode.get = function () {
|
|
return this.state.blendMode
|
|
},
|
|
i.roundPixels.set = function (t) {
|
|
this._roundPixels !== t && (this._transformID = -1),
|
|
this._roundPixels = t
|
|
},
|
|
i.roundPixels.get = function () {
|
|
return this._roundPixels
|
|
},
|
|
i.tint.get = function () {
|
|
return this.shader.tint
|
|
},
|
|
i.tint.set = function (t) {
|
|
this.shader.tint = t
|
|
},
|
|
i.texture.get = function () {
|
|
return this.shader.texture
|
|
},
|
|
i.texture.set = function (t) {
|
|
this.shader.texture = t
|
|
},
|
|
e.prototype._render = function (t) {
|
|
var i = this.geometry.buffers[0].data;
|
|
this.shader.batchable && this.drawMode === o.DRAW_MODES.TRIANGLES && i.length < 2 * e.BATCHABLE_SIZE ? this._renderToBatch(t) : this._renderDefault(t)
|
|
},
|
|
e.prototype._renderDefault = function (t) {
|
|
var e = this.shader;
|
|
e.alpha = this.worldAlpha,
|
|
e.update && e.update(),
|
|
t.batch.flush(),
|
|
e.program.uniformData.translationMatrix && (e.uniforms.translationMatrix = this.transform.worldTransform.toArray(!0)),
|
|
t.shader.bind(e),
|
|
t.state.set(this.state),
|
|
t.geometry.bind(this.geometry, e),
|
|
t.geometry.draw(this.drawMode, this.size, this.start, this.geometry.instanceCount)
|
|
},
|
|
e.prototype._renderToBatch = function (t) {
|
|
var e = this.geometry;
|
|
this.shader.uvMatrix && (this.shader.uvMatrix.update(), this.calculateUvs()),
|
|
this.calculateVertices(),
|
|
this.indices = e.indexBuffer.data,
|
|
this._tintRGB = this.shader._tintRGB,
|
|
this._texture = this.shader.texture;
|
|
var i = this.material.pluginName;
|
|
t.batch.setObjectRenderer(t.plugins[i]),
|
|
t.plugins[i].render(this)
|
|
},
|
|
e.prototype.calculateVertices = function () {
|
|
var t = this.geometry,
|
|
e = t.buffers[0].data;
|
|
if (t.vertexDirtyId !== this.vertexDirty || this._transformID !== this.transform._worldID) {
|
|
this._transformID = this.transform._worldID,
|
|
this.vertexData.length !== e.length && (this.vertexData = new Float32Array(e.length));
|
|
for (var i = this.transform.worldTransform, n = i.a, r = i.b, o = i.c, s = i.d, h = i.tx, l = i.ty, u = this.vertexData, c = 0; c < u.length / 2; c++) {
|
|
var p = e[2 * c],
|
|
d = e[2 * c + 1];
|
|
u[2 * c] = n * p + o * d + h,
|
|
u[2 * c + 1] = r * p + s * d + l
|
|
}
|
|
if (this._roundPixels)
|
|
for (var f = a.settings.RESOLUTION, _ = 0; _ < u.length; ++_)
|
|
u[_] = Math.round((u[_] * f | 0) / f);
|
|
this.vertexDirty = t.vertexDirtyId
|
|
}
|
|
},
|
|
e.prototype.calculateUvs = function () {
|
|
var t = this.geometry.buffers[1];
|
|
this.shader.uvMatrix.isSimple ? this.uvs = t.data : (this.batchUvs || (this.batchUvs = new l(t, this.shader.uvMatrix)), this.batchUvs.update(), this.uvs = this.batchUvs.data)
|
|
},
|
|
e.prototype._calculateBounds = function () {
|
|
this.calculateVertices(),
|
|
this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length)
|
|
},
|
|
e.prototype.containsPoint = function (t) {
|
|
if (!this.getBounds().contains(t.x, t.y))
|
|
return !1;
|
|
this.worldTransform.applyInverse(t, u);
|
|
for (var e = this.geometry.getBuffer("aVertexPosition").data, i = c.points, n = this.geometry.getIndex().data, r = n.length, o = 4 === this.drawMode ? 3 : 1, s = 0; s + 2 < r; s += o) {
|
|
var a = 2 * n[s],
|
|
h = 2 * n[s + 1],
|
|
l = 2 * n[s + 2];
|
|
if (i[0] = e[a], i[1] = e[a + 1], i[2] = e[h], i[3] = e[h + 1], i[4] = e[l], i[5] = e[l + 1], c.contains(u.x, u.y))
|
|
return !0
|
|
}
|
|
return !1
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
t.prototype.destroy.call(this, e),
|
|
this.geometry.refCount--,
|
|
0 === this.geometry.refCount && this.geometry.dispose(),
|
|
this.geometry = null,
|
|
this.shader = null,
|
|
this.state = null,
|
|
this.uvs = null,
|
|
this.indices = null,
|
|
this.vertexData = null
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(s.Container);
|
|
i.Mesh = p,
|
|
p.BATCHABLE_SIZE = 100;
|
|
var d = function (t) {
|
|
function e(e, i) {
|
|
var o = {
|
|
uSampler: e,
|
|
alpha: 1,
|
|
uTextureMatrix: r.Matrix.IDENTITY,
|
|
uColor: new Float32Array([1, 1, 1, 1])
|
|
};
|
|
(i = Object.assign({
|
|
tint: 16777215,
|
|
alpha: 1,
|
|
pluginName: "batch"
|
|
}, i)).uniforms && Object.assign(o, i.uniforms),
|
|
t.call(this, i.program || n.Program.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n", "varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"), o),
|
|
this._colorDirty = !1,
|
|
this.uvMatrix = new n.TextureMatrix(e),
|
|
this.batchable = void 0 === i.program,
|
|
this.pluginName = i.pluginName,
|
|
this.tint = i.tint,
|
|
this.alpha = i.alpha
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
texture: {
|
|
configurable: !0
|
|
},
|
|
alpha: {
|
|
configurable: !0
|
|
},
|
|
tint: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.texture.get = function () {
|
|
return this.uniforms.uSampler
|
|
},
|
|
i.texture.set = function (t) {
|
|
this.uniforms.uSampler !== t && (this.uniforms.uSampler = t, this.uvMatrix.texture = t)
|
|
},
|
|
i.alpha.set = function (t) {
|
|
t !== this._alpha && (this._alpha = t, this._colorDirty = !0)
|
|
},
|
|
i.alpha.get = function () {
|
|
return this._alpha
|
|
},
|
|
i.tint.set = function (t) {
|
|
t !== this._tint && (this._tint = t, this._tintRGB = (t >> 16) + (65280 & t) + ((255 & t) << 16), this._colorDirty = !0)
|
|
},
|
|
i.tint.get = function () {
|
|
return this._tint
|
|
},
|
|
e.prototype.update = function () {
|
|
if (this._colorDirty) {
|
|
this._colorDirty = !1;
|
|
var t = this.texture.baseTexture;
|
|
(0, h.premultiplyTintToRgba)(this._tint, this._alpha, this.uniforms.uColor, t.alphaMode)
|
|
}
|
|
this.uvMatrix.update() && (this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord)
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Shader);
|
|
i.MeshMaterial = d;
|
|
var f = function (t) {
|
|
function e(e, i, r) {
|
|
t.call(this);
|
|
var s = new n.Buffer(e),
|
|
a = new n.Buffer(i, !0),
|
|
h = new n.Buffer(r, !0, !0);
|
|
this.addAttribute("aVertexPosition", s, 2, !1, o.TYPES.FLOAT).addAttribute("aTextureCoord", a, 2, !1, o.TYPES.FLOAT).addIndex(h),
|
|
this._updateId = -1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
vertexDirtyId: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.vertexDirtyId.get = function () {
|
|
return this.buffers[0]._updateID
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Geometry);
|
|
i.MeshGeometry = f
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/constants": "R76a",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/settings": "v11T",
|
|
"@pixi/utils": "x5Ec"
|
|
}
|
|
],
|
|
tJ8P: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.SimpleRope = i.SimplePlane = i.SimpleMesh = i.RopeGeometry = i.PlaneGeometry = i.NineSlicePlane = void 0;
|
|
var n = t("@pixi/mesh"),
|
|
r = t("@pixi/constants"),
|
|
o = t("@pixi/core"),
|
|
s = function (t) {
|
|
function e(e, i, n, r) {
|
|
void 0 === e && (e = 100),
|
|
void 0 === i && (i = 100),
|
|
void 0 === n && (n = 10),
|
|
void 0 === r && (r = 10),
|
|
t.call(this),
|
|
this.segWidth = n,
|
|
this.segHeight = r,
|
|
this.width = e,
|
|
this.height = i,
|
|
this.build()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.build = function () {
|
|
for (var t = this.segWidth * this.segHeight, e = [], i = [], n = [], r = this.segWidth - 1, o = this.segHeight - 1, s = this.width / r, a = this.height / o, h = 0; h < t; h++) {
|
|
var l = h % this.segWidth,
|
|
u = h / this.segWidth | 0;
|
|
e.push(l * s, u * a),
|
|
i.push(l / r, u / o)
|
|
}
|
|
for (var c = r * o, p = 0; p < c; p++) {
|
|
var d = p % r,
|
|
f = p / r | 0,
|
|
_ = f * this.segWidth + d,
|
|
m = f * this.segWidth + d + 1,
|
|
y = (f + 1) * this.segWidth + d,
|
|
g = (f + 1) * this.segWidth + d + 1;
|
|
n.push(_, m, y, m, g, y)
|
|
}
|
|
this.buffers[0].data = new Float32Array(e),
|
|
this.buffers[1].data = new Float32Array(i),
|
|
this.indexBuffer.data = new Uint16Array(n),
|
|
this.buffers[0].update(),
|
|
this.buffers[1].update(),
|
|
this.indexBuffer.update()
|
|
},
|
|
e
|
|
}
|
|
(n.MeshGeometry);
|
|
i.PlaneGeometry = s;
|
|
var a = function (t) {
|
|
function e(e, i, n) {
|
|
void 0 === e && (e = 200),
|
|
void 0 === n && (n = 0),
|
|
t.call(this, new Float32Array(4 * i.length), new Float32Array(4 * i.length), new Uint16Array(6 * (i.length - 1))),
|
|
this.points = i,
|
|
this.width = e,
|
|
this.textureScale = n,
|
|
this.build()
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype.build = function () {
|
|
var t = this.points;
|
|
if (t) {
|
|
var e = this.getBuffer("aVertexPosition"),
|
|
i = this.getBuffer("aTextureCoord"),
|
|
n = this.getIndex();
|
|
if (!(t.length < 1)) {
|
|
e.data.length / 4 !== t.length && (e.data = new Float32Array(4 * t.length), i.data = new Float32Array(4 * t.length), n.data = new Uint16Array(6 * (t.length - 1)));
|
|
var r = i.data,
|
|
o = n.data;
|
|
r[0] = 0,
|
|
r[1] = 0,
|
|
r[2] = 0,
|
|
r[3] = 1;
|
|
for (var s = 0, a = t[0], h = this.width * this.textureScale, l = t.length, u = 0; u < l; u++) {
|
|
var c = 4 * u;
|
|
if (this.textureScale > 0) {
|
|
var p = a.x - t[u].x,
|
|
d = a.y - t[u].y,
|
|
f = Math.sqrt(p * p + d * d);
|
|
a = t[u],
|
|
s += f / h
|
|
} else
|
|
s = u / (l - 1);
|
|
r[c] = s,
|
|
r[c + 1] = 0,
|
|
r[c + 2] = s,
|
|
r[c + 3] = 1
|
|
}
|
|
for (var _ = 0, m = 0; m < l - 1; m++) {
|
|
var y = 2 * m;
|
|
o[_++] = y,
|
|
o[_++] = y + 1,
|
|
o[_++] = y + 2,
|
|
o[_++] = y + 2,
|
|
o[_++] = y + 1,
|
|
o[_++] = y + 3
|
|
}
|
|
i.update(),
|
|
n.update(),
|
|
this.updateVertices()
|
|
}
|
|
}
|
|
},
|
|
e.prototype.updateVertices = function () {
|
|
var t = this.points;
|
|
if (!(t.length < 1)) {
|
|
for (var e, i = t[0], n = 0, r = 0, o = this.buffers[0].data, s = t.length, a = 0; a < s; a++) {
|
|
var h = t[a],
|
|
l = 4 * a;
|
|
r = - ((e = a < t.length - 1 ? t[a + 1] : h).x - i.x),
|
|
n = e.y - i.y;
|
|
var u = Math.sqrt(n * n + r * r),
|
|
c = this.textureScale > 0 ? this.textureScale * this.width / 2 : this.width / 2;
|
|
n /= u,
|
|
r /= u,
|
|
n *= c,
|
|
r *= c,
|
|
o[l] = h.x + n,
|
|
o[l + 1] = h.y + r,
|
|
o[l + 2] = h.x - n,
|
|
o[l + 3] = h.y - r,
|
|
i = h
|
|
}
|
|
this.buffers[0].update()
|
|
}
|
|
},
|
|
e.prototype.update = function () {
|
|
this.textureScale > 0 ? this.build() : this.updateVertices()
|
|
},
|
|
e
|
|
}
|
|
(n.MeshGeometry);
|
|
i.RopeGeometry = a;
|
|
var h = function (t) {
|
|
function e(e, i, o) {
|
|
void 0 === o && (o = 0);
|
|
var s = new a(e.height, i, o),
|
|
h = new n.MeshMaterial(e);
|
|
o > 0 && (e.baseTexture.wrapMode = r.WRAP_MODES.REPEAT),
|
|
t.call(this, s, h),
|
|
this.autoUpdate = !0
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e.prototype._render = function (e) {
|
|
(this.autoUpdate || this.geometry.width !== this.shader.texture.height) && (this.geometry.width = this.shader.texture.height, this.geometry.update()),
|
|
t.prototype._render.call(this, e)
|
|
},
|
|
e
|
|
}
|
|
(n.Mesh);
|
|
i.SimpleRope = h;
|
|
var l = function (t) {
|
|
function e(e, i, r) {
|
|
var a = new s(e.width, e.height, i, r),
|
|
h = new n.MeshMaterial(o.Texture.WHITE);
|
|
t.call(this, a, h),
|
|
this.texture = e
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
texture: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.textureUpdated = function () {
|
|
this._textureID = this.shader.texture._updateID,
|
|
this.geometry.width = this.shader.texture.width,
|
|
this.geometry.height = this.shader.texture.height,
|
|
this.geometry.build()
|
|
},
|
|
i.texture.set = function (t) {
|
|
this.shader.texture !== t && (this.shader.texture = t, this._textureID = -1, t.baseTexture.valid ? this.textureUpdated() : t.once("update", this.textureUpdated, this))
|
|
},
|
|
i.texture.get = function () {
|
|
return this.shader.texture
|
|
},
|
|
e.prototype._render = function (e) {
|
|
this._textureID !== this.shader.texture._updateID && this.textureUpdated(),
|
|
t.prototype._render.call(this, e)
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Mesh);
|
|
i.SimplePlane = l;
|
|
var u = function (t) {
|
|
function e(e, i, r, s, a) {
|
|
void 0 === e && (e = o.Texture.EMPTY);
|
|
var h = new n.MeshGeometry(i, r, s);
|
|
h.getBuffer("aVertexPosition").static = !1;
|
|
var l = new n.MeshMaterial(e);
|
|
t.call(this, h, l, null, a),
|
|
this.autoUpdate = !0
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
vertices: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return i.vertices.get = function () {
|
|
return this.geometry.getBuffer("aVertexPosition").data
|
|
},
|
|
i.vertices.set = function (t) {
|
|
this.geometry.getBuffer("aVertexPosition").data = t
|
|
},
|
|
e.prototype._render = function (e) {
|
|
this.autoUpdate && this.geometry.getBuffer("aVertexPosition").update(),
|
|
t.prototype._render.call(this, e)
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(n.Mesh);
|
|
i.SimpleMesh = u;
|
|
var c = function (t) {
|
|
function e(e, i, n, r, s) {
|
|
t.call(this, o.Texture.WHITE, 4, 4),
|
|
this._origWidth = e.orig.width,
|
|
this._origHeight = e.orig.height,
|
|
this._width = this._origWidth,
|
|
this._height = this._origHeight,
|
|
this._leftWidth = void 0 !== i ? i : 10,
|
|
this._rightWidth = void 0 !== r ? r : 10,
|
|
this._topHeight = void 0 !== n ? n : 10,
|
|
this._bottomHeight = void 0 !== s ? s : 10,
|
|
this.texture = e
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
vertices: {
|
|
configurable: !0
|
|
},
|
|
width: {
|
|
configurable: !0
|
|
},
|
|
height: {
|
|
configurable: !0
|
|
},
|
|
leftWidth: {
|
|
configurable: !0
|
|
},
|
|
rightWidth: {
|
|
configurable: !0
|
|
},
|
|
topHeight: {
|
|
configurable: !0
|
|
},
|
|
bottomHeight: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.textureUpdated = function () {
|
|
this._textureID = this.shader.texture._updateID,
|
|
this._refresh()
|
|
},
|
|
i.vertices.get = function () {
|
|
return this.geometry.getBuffer("aVertexPosition").data
|
|
},
|
|
i.vertices.set = function (t) {
|
|
this.geometry.getBuffer("aVertexPosition").data = t
|
|
},
|
|
e.prototype.updateHorizontalVertices = function () {
|
|
var t = this.vertices,
|
|
e = this._getMinScale();
|
|
t[9] = t[11] = t[13] = t[15] = this._topHeight * e,
|
|
t[17] = t[19] = t[21] = t[23] = this._height - this._bottomHeight * e,
|
|
t[25] = t[27] = t[29] = t[31] = this._height
|
|
},
|
|
e.prototype.updateVerticalVertices = function () {
|
|
var t = this.vertices,
|
|
e = this._getMinScale();
|
|
t[2] = t[10] = t[18] = t[26] = this._leftWidth * e,
|
|
t[4] = t[12] = t[20] = t[28] = this._width - this._rightWidth * e,
|
|
t[6] = t[14] = t[22] = t[30] = this._width
|
|
},
|
|
e.prototype._getMinScale = function () {
|
|
var t = this._leftWidth + this._rightWidth,
|
|
e = this._width > t ? 1 : this._width / t,
|
|
i = this._topHeight + this._bottomHeight,
|
|
n = this._height > i ? 1 : this._height / i;
|
|
return Math.min(e, n)
|
|
},
|
|
i.width.get = function () {
|
|
return this._width
|
|
},
|
|
i.width.set = function (t) {
|
|
this._width = t,
|
|
this._refresh()
|
|
},
|
|
i.height.get = function () {
|
|
return this._height
|
|
},
|
|
i.height.set = function (t) {
|
|
this._height = t,
|
|
this._refresh()
|
|
},
|
|
i.leftWidth.get = function () {
|
|
return this._leftWidth
|
|
},
|
|
i.leftWidth.set = function (t) {
|
|
this._leftWidth = t,
|
|
this._refresh()
|
|
},
|
|
i.rightWidth.get = function () {
|
|
return this._rightWidth
|
|
},
|
|
i.rightWidth.set = function (t) {
|
|
this._rightWidth = t,
|
|
this._refresh()
|
|
},
|
|
i.topHeight.get = function () {
|
|
return this._topHeight
|
|
},
|
|
i.topHeight.set = function (t) {
|
|
this._topHeight = t,
|
|
this._refresh()
|
|
},
|
|
i.bottomHeight.get = function () {
|
|
return this._bottomHeight
|
|
},
|
|
i.bottomHeight.set = function (t) {
|
|
this._bottomHeight = t,
|
|
this._refresh()
|
|
},
|
|
e.prototype._refresh = function () {
|
|
var t = this.texture,
|
|
e = this.geometry.buffers[1].data;
|
|
this._origWidth = t.orig.width,
|
|
this._origHeight = t.orig.height;
|
|
var i = 1 / this._origWidth,
|
|
n = 1 / this._origHeight;
|
|
e[0] = e[8] = e[16] = e[24] = 0,
|
|
e[1] = e[3] = e[5] = e[7] = 0,
|
|
e[6] = e[14] = e[22] = e[30] = 1,
|
|
e[25] = e[27] = e[29] = e[31] = 1,
|
|
e[2] = e[10] = e[18] = e[26] = i * this._leftWidth,
|
|
e[4] = e[12] = e[20] = e[28] = 1 - i * this._rightWidth,
|
|
e[9] = e[11] = e[13] = e[15] = n * this._topHeight,
|
|
e[17] = e[19] = e[21] = e[23] = 1 - n * this._bottomHeight,
|
|
this.updateHorizontalVertices(),
|
|
this.updateVerticalVertices(),
|
|
this.geometry.buffers[0].update(),
|
|
this.geometry.buffers[1].update()
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(l);
|
|
i.NineSlicePlane = c
|
|
}, {
|
|
"@pixi/mesh": "fWSH",
|
|
"@pixi/constants": "R76a",
|
|
"@pixi/core": "qqf8"
|
|
}
|
|
],
|
|
S0oD: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
}),
|
|
i.AnimatedSprite = void 0;
|
|
var n = t("@pixi/core"),
|
|
r = t("@pixi/sprite"),
|
|
o = t("@pixi/ticker"),
|
|
s = function (t) {
|
|
function e(e, i) {
|
|
t.call(this, e[0]instanceof n.Texture ? e[0] : e[0].texture),
|
|
this._textures = null,
|
|
this._durations = null,
|
|
this.textures = e,
|
|
this._autoUpdate = !1 !== i,
|
|
this.animationSpeed = 1,
|
|
this.loop = !0,
|
|
this.updateAnchor = !1,
|
|
this.onComplete = null,
|
|
this.onFrameChange = null,
|
|
this.onLoop = null,
|
|
this._currentTime = 0,
|
|
this.playing = !1
|
|
}
|
|
t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e;
|
|
var i = {
|
|
totalFrames: {
|
|
configurable: !0
|
|
},
|
|
textures: {
|
|
configurable: !0
|
|
},
|
|
currentFrame: {
|
|
configurable: !0
|
|
}
|
|
};
|
|
return e.prototype.stop = function () {
|
|
this.playing && (this.playing = !1, this._autoUpdate && o.Ticker.shared.remove(this.update, this))
|
|
},
|
|
e.prototype.play = function () {
|
|
this.playing || (this.playing = !0, this._autoUpdate && o.Ticker.shared.add(this.update, this, o.UPDATE_PRIORITY.HIGH))
|
|
},
|
|
e.prototype.gotoAndStop = function (t) {
|
|
this.stop();
|
|
var e = this.currentFrame;
|
|
this._currentTime = t,
|
|
e !== this.currentFrame && this.updateTexture()
|
|
},
|
|
e.prototype.gotoAndPlay = function (t) {
|
|
var e = this.currentFrame;
|
|
this._currentTime = t,
|
|
e !== this.currentFrame && this.updateTexture(),
|
|
this.play()
|
|
},
|
|
e.prototype.update = function (t) {
|
|
var e = this.animationSpeed * t,
|
|
i = this.currentFrame;
|
|
if (null !== this._durations) {
|
|
var n = this._currentTime % 1 * this._durations[this.currentFrame];
|
|
for (n += e / 60 * 1e3; n < 0; )
|
|
this._currentTime--, n += this._durations[this.currentFrame];
|
|
var r = Math.sign(this.animationSpeed * t);
|
|
for (this._currentTime = Math.floor(this._currentTime); n >= this._durations[this.currentFrame]; )
|
|
n -= this._durations[this.currentFrame] * r, this._currentTime += r;
|
|
this._currentTime += n / this._durations[this.currentFrame]
|
|
} else
|
|
this._currentTime += e;
|
|
this._currentTime < 0 && !this.loop ? (this._currentTime = 0, this.stop(), this.onComplete && this.onComplete()) : this._currentTime >= this._textures.length && !this.loop ? (this._currentTime = this._textures.length - 1, this.stop(), this.onComplete && this.onComplete()) : i !== this.currentFrame && (this.loop && this.onLoop && (this.animationSpeed > 0 && this.currentFrame < i || this.animationSpeed < 0 && this.currentFrame > i) && this.onLoop(), this.updateTexture())
|
|
},
|
|
e.prototype.updateTexture = function () {
|
|
this._texture = this._textures[this.currentFrame],
|
|
this._textureID = -1,
|
|
this._textureTrimmedID = -1,
|
|
this._cachedTint = 16777215,
|
|
this.uvs = this._texture._uvs.uvsFloat32,
|
|
this.updateAnchor && this._anchor.copyFrom(this._texture.defaultAnchor),
|
|
this.onFrameChange && this.onFrameChange(this.currentFrame)
|
|
},
|
|
e.prototype.destroy = function (e) {
|
|
this.stop(),
|
|
t.prototype.destroy.call(this, e),
|
|
this.onComplete = null,
|
|
this.onFrameChange = null,
|
|
this.onLoop = null
|
|
},
|
|
e.fromFrames = function (t) {
|
|
for (var i = [], r = 0; r < t.length; ++r)
|
|
i.push(n.Texture.from(t[r]));
|
|
return new e(i)
|
|
},
|
|
e.fromImages = function (t) {
|
|
for (var i = [], r = 0; r < t.length; ++r)
|
|
i.push(n.Texture.from(t[r]));
|
|
return new e(i)
|
|
},
|
|
i.totalFrames.get = function () {
|
|
return this._textures.length
|
|
},
|
|
i.textures.get = function () {
|
|
return this._textures
|
|
},
|
|
i.textures.set = function (t) {
|
|
if (t[0]instanceof n.Texture)
|
|
this._textures = t, this._durations = null;
|
|
else {
|
|
this._textures = [],
|
|
this._durations = [];
|
|
for (var e = 0; e < t.length; e++)
|
|
this._textures.push(t[e].texture), this._durations.push(t[e].time)
|
|
}
|
|
this.gotoAndStop(0),
|
|
this.updateTexture()
|
|
},
|
|
i.currentFrame.get = function () {
|
|
var t = Math.floor(this._currentTime) % this._textures.length;
|
|
return t < 0 && (t += this._textures.length),
|
|
t
|
|
},
|
|
Object.defineProperties(e.prototype, i),
|
|
e
|
|
}
|
|
(r.Sprite);
|
|
i.AnimatedSprite = s
|
|
}, {
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/sprite": "vBI9",
|
|
"@pixi/ticker": "t27b"
|
|
}
|
|
],
|
|
DZG1: [function (t, e, i) {
|
|
"use strict";
|
|
Object.defineProperty(i, "__esModule", {
|
|
value: !0
|
|
});
|
|
var n = {
|
|
VERSION: !0,
|
|
filters: !0,
|
|
useDeprecated: !0,
|
|
accessibility: !0,
|
|
interaction: !0,
|
|
utils: !0
|
|
};
|
|
i.useDeprecated = function () {
|
|
var t = this;
|
|
Object.defineProperties(t, {
|
|
SVG_SIZE: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.utils.SVG_SIZE property has moved to PIXI.resources.SVGResource.SVG_SIZE"),
|
|
t.SVGResource.SVG_SIZE
|
|
}
|
|
},
|
|
TransformStatic: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.TransformStatic class has been removed, use PIXI.Transform"),
|
|
t.Transform
|
|
}
|
|
},
|
|
TransformBase: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.TransformBase class has been removed, use PIXI.Transform"),
|
|
t.Transform
|
|
}
|
|
},
|
|
TRANSFORM_MODE: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.TRANSFORM_MODE property has been removed"), {
|
|
STATIC: 0,
|
|
DYNAMIC: 1
|
|
}
|
|
}
|
|
},
|
|
WebGLRenderer: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.WebGLRenderer class has moved to PIXI.Renderer"),
|
|
t.Renderer
|
|
}
|
|
},
|
|
CanvasRenderTarget: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.CanvasRenderTarget class has moved to PIXI.utils.CanvasRenderTarget"),
|
|
t.utils.CanvasRenderTarget
|
|
}
|
|
},
|
|
loader: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.loader instance has moved to PIXI.Loader.shared"),
|
|
t.Loader.shared
|
|
}
|
|
},
|
|
FilterManager: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.FilterManager class has moved to PIXI.systems.FilterSystem"),
|
|
t.systems.FilterSystem
|
|
}
|
|
},
|
|
CanvasTinter: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.0", "PIXI.CanvasTinter namespace has moved to PIXI.canvasUtils"),
|
|
t.canvasUtils
|
|
}
|
|
},
|
|
GroupD8: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.0", "PIXI.GroupD8 namespace has moved to PIXI.groupD8"),
|
|
t.groupD8
|
|
}
|
|
}
|
|
}),
|
|
t.prepare = {},
|
|
Object.defineProperties(t.prepare, {
|
|
BasePrepare: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.1", "PIXI.prepare.BasePrepare moved to PIXI.BasePrepare"),
|
|
t.BasePrepare
|
|
}
|
|
},
|
|
Prepare: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.1", "PIXI.prepare.Prepare moved to PIXI.Prepare"),
|
|
t.Prepare
|
|
}
|
|
},
|
|
CanvasPrepare: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.1", "PIXI.prepare.CanvasPrepare moved to PIXI.CanvasPrepare"),
|
|
t.CanvasPrepare
|
|
}
|
|
}
|
|
}),
|
|
t.extract = {},
|
|
Object.defineProperties(t.extract, {
|
|
Extract: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.1", "PIXI.extract.Extract moved to PIXI.Extract"),
|
|
t.Extract
|
|
}
|
|
},
|
|
CanvasExtract: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.1", "PIXI.extract.CanvasExtract moved to PIXI.CanvasExtract"),
|
|
t.CanvasExtract
|
|
}
|
|
}
|
|
}),
|
|
t.extras = {},
|
|
Object.defineProperties(t.extras, {
|
|
TilingSprite: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.extras.TilingSprite class has moved to PIXI.TilingSprite"),
|
|
t.TilingSprite
|
|
}
|
|
},
|
|
TilingSpriteRenderer: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.extras.TilingSpriteRenderer class has moved to PIXI.TilingSpriteRenderer"),
|
|
t.TilingSpriteRenderer
|
|
}
|
|
},
|
|
AnimatedSprite: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.extras.AnimatedSprite class has moved to PIXI.AnimatedSprite"),
|
|
t.AnimatedSprite
|
|
}
|
|
},
|
|
BitmapText: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.extras.BitmapText class has moved to PIXI.BitmapText"),
|
|
t.BitmapText
|
|
}
|
|
}
|
|
}),
|
|
Object.defineProperties(t.utils, {
|
|
getSvgSize: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.utils.getSvgSize function has moved to PIXI.resources.SVGResource.getSize"),
|
|
t.SVGResource.getSize
|
|
}
|
|
}
|
|
}),
|
|
t.mesh = {},
|
|
Object.defineProperties(t.mesh, {
|
|
Mesh: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.mesh.Mesh class has moved to PIXI.SimpleMesh"),
|
|
t.SimpleMesh
|
|
}
|
|
},
|
|
NineSlicePlane: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.mesh.NineSlicePlane class has moved to PIXI.NineSlicePlane"),
|
|
t.NineSlicePlane
|
|
}
|
|
},
|
|
Plane: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.mesh.Plane class has moved to PIXI.SimplePlane"),
|
|
t.SimplePlane
|
|
}
|
|
},
|
|
Rope: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.mesh.Rope class has moved to PIXI.SimpleRope"),
|
|
t.SimpleRope
|
|
}
|
|
},
|
|
RawMesh: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.mesh.RawMesh class has moved to PIXI.Mesh"),
|
|
t.Mesh
|
|
}
|
|
},
|
|
CanvasMeshRenderer: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.mesh.CanvasMeshRenderer class has moved to PIXI.CanvasMeshRenderer"),
|
|
t.CanvasMeshRenderer
|
|
}
|
|
},
|
|
MeshRenderer: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.mesh.MeshRenderer class has moved to PIXI.MeshRenderer"),
|
|
t.MeshRenderer
|
|
}
|
|
}
|
|
}),
|
|
t.particles = {},
|
|
Object.defineProperties(t.particles, {
|
|
ParticleContainer: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.particles.ParticleContainer class has moved to PIXI.ParticleContainer"),
|
|
t.ParticleContainer
|
|
}
|
|
},
|
|
ParticleRenderer: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.particles.ParticleRenderer class has moved to PIXI.ParticleRenderer"),
|
|
t.ParticleRenderer
|
|
}
|
|
}
|
|
}),
|
|
t.ticker = {},
|
|
Object.defineProperties(t.ticker, {
|
|
Ticker: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.ticker.Ticker class has moved to PIXI.Ticker"),
|
|
t.Ticker
|
|
}
|
|
},
|
|
shared: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.ticker.shared instance has moved to PIXI.Ticker.shared"),
|
|
t.Ticker.shared
|
|
}
|
|
}
|
|
}),
|
|
t.loaders = {},
|
|
Object.defineProperties(t.loaders, {
|
|
Loader: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.loaders.Loader class has moved to PIXI.Loader"),
|
|
t.Loader
|
|
}
|
|
},
|
|
Resource: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.loaders.Resource class has moved to PIXI.LoaderResource"),
|
|
t.LoaderResource
|
|
}
|
|
},
|
|
bitmapFontParser: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.loaders.bitmapFontParser function has moved to PIXI.BitmapFontLoader.use"),
|
|
t.BitmapFontLoader.use
|
|
}
|
|
},
|
|
parseBitmapFontData: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.loaders.parseBitmapFontData function has moved to PIXI.BitmapFontLoader.parse"),
|
|
t.BitmapFontLoader.parse
|
|
}
|
|
},
|
|
spritesheetParser: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.loaders.spritesheetParser function has moved to PIXI.SpritesheetLoader.use"),
|
|
t.SpritesheetLoader.use
|
|
}
|
|
},
|
|
getResourcePath: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.loaders.getResourcePath property has moved to PIXI.SpritesheetLoader.getResourcePath"),
|
|
t.SpritesheetLoader.getResourcePath
|
|
}
|
|
}
|
|
}),
|
|
t.Loader.addPixiMiddleware = function (e) {
|
|
return (0, s.deprecation)(k, "PIXI.loaders.Loader.addPixiMiddleware function is deprecated, use PIXI.loaders.Loader.registerPlugin"),
|
|
t.loaders.Loader.registerPlugin({
|
|
use: e()
|
|
})
|
|
},
|
|
Object.defineProperty(t.extract, "WebGLExtract", {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.extract.WebGLExtract method has moved to PIXI.Extract"),
|
|
t.Extract
|
|
}
|
|
}),
|
|
Object.defineProperty(t.prepare, "WebGLPrepare", {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.prepare.WebGLPrepare class has moved to PIXI.Prepare"),
|
|
t.Prepare
|
|
}
|
|
}),
|
|
t.Container.prototype._renderWebGL = function (t) {
|
|
(0, s.deprecation)(k, "PIXI.Container._renderWebGL method has moved to PIXI.Container._render"),
|
|
this._render(t)
|
|
},
|
|
t.Container.prototype.renderWebGL = function (t) {
|
|
(0, s.deprecation)(k, "PIXI.Container.renderWebGL method has moved to PIXI.Container.render"),
|
|
this.render(t)
|
|
},
|
|
t.DisplayObject.prototype.renderWebGL = function (t) {
|
|
(0, s.deprecation)(k, "PIXI.DisplayObject.renderWebGL method has moved to PIXI.DisplayObject.render"),
|
|
this.render(t)
|
|
},
|
|
t.Container.prototype.renderAdvancedWebGL = function (t) {
|
|
(0, s.deprecation)(k, "PIXI.Container.renderAdvancedWebGL method has moved to PIXI.Container.renderAdvanced"),
|
|
this.renderAdvanced(t)
|
|
},
|
|
Object.defineProperties(t.settings, {
|
|
TRANSFORM_MODE: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.settings.TRANSFORM_MODE property has been removed"),
|
|
0
|
|
},
|
|
set: function () {
|
|
(0, s.deprecation)(k, "PIXI.settings.TRANSFORM_MODE property has been removed")
|
|
}
|
|
}
|
|
});
|
|
var e = t.BaseTexture;
|
|
e.prototype.loadSource = function (e) {
|
|
(0, s.deprecation)(k, "PIXI.BaseTexture.loadSource method has been deprecated");
|
|
var i = t.resources.autoDetectResource(e);
|
|
i.internal = !0,
|
|
this.setResource(i),
|
|
this.update()
|
|
};
|
|
var i = !1;
|
|
Object.defineProperties(e.prototype, {
|
|
hasLoaded: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.BaseTexture.hasLoaded property has been removed, use PIXI.BaseTexture.valid"),
|
|
this.valid
|
|
}
|
|
},
|
|
imageUrl: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url"),
|
|
this.resource && this.resource.url
|
|
},
|
|
set: function (t) {
|
|
(0, s.deprecation)(k, "PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url"),
|
|
this.resource && (this.resource.url = t)
|
|
}
|
|
},
|
|
source: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source`"),
|
|
this.resource && this.resource.source
|
|
},
|
|
set: function (t) {
|
|
(0, s.deprecation)(k, "PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source` if you want to set HTMLCanvasElement. Otherwise, create new BaseTexture."),
|
|
this.resource && (this.resource.source = t)
|
|
}
|
|
},
|
|
premultiplyAlpha: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.0", "PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),
|
|
0 !== this.alphaMode
|
|
},
|
|
set: function (t) {
|
|
(0, s.deprecation)("5.2.0", "PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),
|
|
this.alphaMode = Number(t)
|
|
}
|
|
},
|
|
_id: {
|
|
get: function () {
|
|
return i || ((0, s.deprecation)("5.2.0", "PIXI.BaseTexture._id batch local field has been changed to `_batchLocation`"), i = !0),
|
|
this._batchLocation
|
|
},
|
|
set: function (t) {
|
|
this._batchLocation = t
|
|
}
|
|
}
|
|
}),
|
|
e.fromImage = function (t, i, n, r) {
|
|
(0, s.deprecation)(k, "PIXI.BaseTexture.fromImage method has been replaced with PIXI.BaseTexture.from");
|
|
var o = {
|
|
scale: r,
|
|
crossorigin: i
|
|
};
|
|
return e.from(t, {
|
|
scaleMode: n,
|
|
resourceOptions: o
|
|
})
|
|
},
|
|
e.fromCanvas = function (t, i) {
|
|
return (0, s.deprecation)(k, "PIXI.BaseTexture.fromCanvas method has been replaced with PIXI.BaseTexture.from"),
|
|
e.from(t, {
|
|
scaleMode: i
|
|
})
|
|
},
|
|
e.fromSVG = function (t, i, n, r) {
|
|
(0, s.deprecation)(k, "PIXI.BaseTexture.fromSVG method has been replaced with PIXI.BaseTexture.from");
|
|
var o = {
|
|
scale: r,
|
|
crossorigin: i
|
|
};
|
|
return e.from(t, {
|
|
scaleMode: n,
|
|
resourceOptions: o
|
|
})
|
|
},
|
|
Object.defineProperties(t.resources.ImageResource.prototype, {
|
|
premultiplyAlpha: {
|
|
get: function () {
|
|
return (0, s.deprecation)("5.2.0", "PIXI.resources.ImageResource.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),
|
|
0 !== this.alphaMode
|
|
},
|
|
set: function (t) {
|
|
(0, s.deprecation)("5.2.0", "PIXI.resources.ImageResource.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),
|
|
this.alphaMode = Number(t)
|
|
}
|
|
}
|
|
}),
|
|
t.Point.prototype.copy = function (t) {
|
|
return (0, s.deprecation)(k, "PIXI.Point.copy method has been replaced with PIXI.Point.copyFrom"),
|
|
this.copyFrom(t)
|
|
},
|
|
t.ObservablePoint.prototype.copy = function (t) {
|
|
return (0, s.deprecation)(k, "PIXI.ObservablePoint.copy method has been replaced with PIXI.ObservablePoint.copyFrom"),
|
|
this.copyFrom(t)
|
|
},
|
|
t.Rectangle.prototype.copy = function (t) {
|
|
return (0, s.deprecation)(k, "PIXI.Rectangle.copy method has been replaced with PIXI.Rectangle.copyFrom"),
|
|
this.copyFrom(t)
|
|
},
|
|
t.Matrix.prototype.copy = function (t) {
|
|
return (0, s.deprecation)(k, "PIXI.Matrix.copy method has been replaced with PIXI.Matrix.copyTo"),
|
|
this.copyTo(t)
|
|
},
|
|
t.systems.StateSystem.prototype.setState = function (t) {
|
|
return (0, s.deprecation)("v5.1.0", "StateSystem.setState has been renamed to StateSystem.set"),
|
|
this.set(t)
|
|
},
|
|
Object.assign(t.systems.FilterSystem.prototype, {
|
|
getRenderTarget: function (t, e) {
|
|
return (0, s.deprecation)(k, "PIXI.FilterManager.getRenderTarget method has been replaced with PIXI.systems.FilterSystem#getFilterTexture"),
|
|
this.getFilterTexture(e)
|
|
},
|
|
returnRenderTarget: function (t) {
|
|
(0, s.deprecation)(k, "PIXI.FilterManager.returnRenderTarget method has been replaced with PIXI.systems.FilterSystem.returnFilterTexture"),
|
|
this.returnFilterTexture(t)
|
|
},
|
|
calculateScreenSpaceMatrix: function (t) {
|
|
(0, s.deprecation)(k, "PIXI.systems.FilterSystem.calculateScreenSpaceMatrix method is removed, use `(vTextureCoord * inputSize.xy) + outputFrame.xy` instead");
|
|
var e = t.identity(),
|
|
i = this.activeState,
|
|
n = i.sourceFrame,
|
|
r = i.destinationFrame;
|
|
return e.translate(n.x / r.width, n.y / r.height),
|
|
e.scale(r.width, r.height),
|
|
e
|
|
},
|
|
calculateNormalizedScreenSpaceMatrix: function (t) {
|
|
(0, s.deprecation)(k, "PIXI.systems.FilterManager.calculateNormalizedScreenSpaceMatrix method is removed, use `((vTextureCoord * inputSize.xy) + outputFrame.xy) / outputFrame.zw` instead.");
|
|
var e = this.activeState,
|
|
i = e.sourceFrame,
|
|
n = e.destinationFrame,
|
|
r = t.identity();
|
|
r.translate(i.x / n.width, i.y / n.height);
|
|
var o = n.width / i.width,
|
|
a = n.height / i.height;
|
|
return r.scale(o, a),
|
|
r
|
|
}
|
|
}),
|
|
Object.defineProperties(t.RenderTexture.prototype, {
|
|
sourceFrame: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.RenderTexture.sourceFrame property has been removed"),
|
|
this.filterFrame
|
|
}
|
|
},
|
|
size: {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.RenderTexture.size property has been removed"),
|
|
this._frame
|
|
}
|
|
}
|
|
});
|
|
var n = function (t) {
|
|
function e(e, i, n, r) {
|
|
(0, s.deprecation)(k, "PIXI.filters.BlurXFilter class is deprecated, use PIXI.filters.BlurFilterPass"),
|
|
t.call(this, !0, e, i, n, r)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(t.filters.BlurFilterPass),
|
|
r = function (t) {
|
|
function e(e, i, n, r) {
|
|
(0, s.deprecation)(k, "PIXI.filters.BlurYFilter class is deprecated, use PIXI.filters.BlurFilterPass"),
|
|
t.call(this, !1, e, i, n, r)
|
|
}
|
|
return t && (e.__proto__ = t),
|
|
e.prototype = Object.create(t && t.prototype),
|
|
e.prototype.constructor = e,
|
|
e
|
|
}
|
|
(t.filters.BlurFilterPass);
|
|
Object.assign(t.filters, {
|
|
BlurXFilter: n,
|
|
BlurYFilter: r
|
|
});
|
|
var o = t.Sprite,
|
|
a = t.Texture,
|
|
h = t.Graphics;
|
|
h.prototype.generateCanvasTexture || (h.prototype.generateCanvasTexture = function () {
|
|
(0, s.deprecation)(k, 'PIXI.Graphics.generateCanvasTexture method is only available in "pixi.js-legacy"')
|
|
});
|
|
function l(t, e, i, n) {
|
|
return (0, s.deprecation)(k, "PIXI.Sprite." + t + " method is deprecated, use PIXI.Sprite.from"),
|
|
o.from(e, {
|
|
resourceOptions: {
|
|
scale: n,
|
|
crossorigin: i
|
|
}
|
|
})
|
|
}
|
|
function u(t, e, i, n) {
|
|
return (0, s.deprecation)(k, "PIXI.Texture." + t + " method is deprecated, use PIXI.Texture.from"),
|
|
a.from(e, {
|
|
resourceOptions: {
|
|
scale: n,
|
|
crossorigin: i
|
|
}
|
|
})
|
|
}
|
|
Object.defineProperty(t.Graphics.prototype, "graphicsData", {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.Graphics.graphicsData property is deprecated, use PIXI.Graphics.geometry.graphicsData"),
|
|
this.geometry.graphicsData
|
|
}
|
|
}),
|
|
Object.defineProperty(t.SimpleRope.prototype, "points", {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.SimpleRope.points property is deprecated, use PIXI.SimpleRope.geometry.points"),
|
|
this.geometry.points
|
|
},
|
|
set: function (t) {
|
|
(0, s.deprecation)(k, "PIXI.SimpleRope.points property is deprecated, use PIXI.SimpleRope.geometry.points"),
|
|
this.geometry.points = t
|
|
}
|
|
}),
|
|
o.fromImage = l.bind(null, "fromImage"),
|
|
o.fromSVG = l.bind(null, "fromSVG"),
|
|
o.fromCanvas = l.bind(null, "fromCanvas"),
|
|
o.fromVideo = l.bind(null, "fromVideo"),
|
|
o.fromFrame = l.bind(null, "fromFrame"),
|
|
a.fromImage = u.bind(null, "fromImage"),
|
|
a.fromSVG = u.bind(null, "fromSVG"),
|
|
a.fromCanvas = u.bind(null, "fromCanvas"),
|
|
a.fromVideo = u.bind(null, "fromVideo"),
|
|
a.fromFrame = u.bind(null, "fromFrame"),
|
|
Object.defineProperty(t.AbstractRenderer.prototype, "autoResize", {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.AbstractRenderer.autoResize property is deprecated, use PIXI.AbstractRenderer.autoDensity"),
|
|
this.autoDensity
|
|
},
|
|
set: function (t) {
|
|
(0, s.deprecation)(k, "PIXI.AbstractRenderer.autoResize property is deprecated, use PIXI.AbstractRenderer.autoDensity"),
|
|
this.autoDensity = t
|
|
}
|
|
}),
|
|
Object.defineProperty(t.Renderer.prototype, "textureManager", {
|
|
get: function () {
|
|
return (0, s.deprecation)(k, "PIXI.Renderer.textureManager property is deprecated, use PIXI.Renderer.texture"),
|
|
this.texture
|
|
}
|
|
}),
|
|
t.utils.mixins = {
|
|
mixin: function () {
|
|
(0, s.deprecation)(k, "PIXI.utils.mixins.mixin function is no longer available")
|
|
},
|
|
delayMixin: function () {
|
|
(0, s.deprecation)(k, "PIXI.utils.mixins.delayMixin function is no longer available")
|
|
},
|
|
performMixins: function () {
|
|
(0, s.deprecation)(k, "PIXI.utils.mixins.performMixins function is no longer available")
|
|
}
|
|
}
|
|
},
|
|
i.utils = i.interaction = i.accessibility = i.filters = i.VERSION = void 0,
|
|
t("@pixi/polyfill");
|
|
var r = L(t("@pixi/accessibility"));
|
|
i.accessibility = r;
|
|
var o = L(t("@pixi/interaction"));
|
|
i.interaction = o;
|
|
var s = L(t("@pixi/utils"));
|
|
i.utils = s;
|
|
var a = t("@pixi/app");
|
|
Object.keys(a).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return a[t]
|
|
}
|
|
}))
|
|
}));
|
|
var h = t("@pixi/core");
|
|
Object.keys(h).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return h[t]
|
|
}
|
|
}))
|
|
}));
|
|
var l = t("@pixi/extract");
|
|
Object.keys(l).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return l[t]
|
|
}
|
|
}))
|
|
}));
|
|
var u = t("@pixi/loaders");
|
|
Object.keys(u).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return u[t]
|
|
}
|
|
}))
|
|
}));
|
|
var c = t("@pixi/particles");
|
|
Object.keys(c).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return c[t]
|
|
}
|
|
}))
|
|
}));
|
|
var p = t("@pixi/prepare");
|
|
Object.keys(p).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return p[t]
|
|
}
|
|
}))
|
|
}));
|
|
var d = t("@pixi/spritesheet");
|
|
Object.keys(d).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return d[t]
|
|
}
|
|
}))
|
|
}));
|
|
var f = t("@pixi/sprite-tiling");
|
|
Object.keys(f).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return f[t]
|
|
}
|
|
}))
|
|
}));
|
|
var _ = t("@pixi/text-bitmap");
|
|
Object.keys(_).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return _[t]
|
|
}
|
|
}))
|
|
}));
|
|
var m = t("@pixi/ticker");
|
|
Object.keys(m).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return m[t]
|
|
}
|
|
}))
|
|
}));
|
|
var y = t("@pixi/filter-alpha"),
|
|
g = t("@pixi/filter-blur"),
|
|
v = t("@pixi/filter-color-matrix"),
|
|
w = t("@pixi/filter-displacement"),
|
|
x = t("@pixi/filter-fxaa"),
|
|
b = t("@pixi/filter-noise");
|
|
t("@pixi/mixin-cache-as-bitmap"),
|
|
t("@pixi/mixin-get-child-by-name"),
|
|
t("@pixi/mixin-get-global-position");
|
|
var E = t("@pixi/constants");
|
|
Object.keys(E).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return E[t]
|
|
}
|
|
}))
|
|
}));
|
|
var $ = t("@pixi/display");
|
|
Object.keys($).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return $[t]
|
|
}
|
|
}))
|
|
}));
|
|
var A = t("@pixi/graphics");
|
|
Object.keys(A).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return A[t]
|
|
}
|
|
}))
|
|
}));
|
|
var S = t("@pixi/math");
|
|
Object.keys(S).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return S[t]
|
|
}
|
|
}))
|
|
}));
|
|
var T = t("@pixi/mesh");
|
|
Object.keys(T).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return T[t]
|
|
}
|
|
}))
|
|
}));
|
|
var C = t("@pixi/mesh-extras");
|
|
Object.keys(C).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return C[t]
|
|
}
|
|
}))
|
|
}));
|
|
var M = t("@pixi/runner");
|
|
Object.keys(M).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return M[t]
|
|
}
|
|
}))
|
|
}));
|
|
var I = t("@pixi/sprite");
|
|
Object.keys(I).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return I[t]
|
|
}
|
|
}))
|
|
}));
|
|
var P = t("@pixi/sprite-animated");
|
|
Object.keys(P).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return P[t]
|
|
}
|
|
}))
|
|
}));
|
|
var O = t("@pixi/text");
|
|
Object.keys(O).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return O[t]
|
|
}
|
|
}))
|
|
}));
|
|
var R = t("@pixi/settings");
|
|
function D() {
|
|
if ("function" != typeof WeakMap)
|
|
return null;
|
|
var t = new WeakMap;
|
|
return D = function () {
|
|
return t
|
|
},
|
|
t
|
|
}
|
|
function L(t) {
|
|
if (t && t.__esModule)
|
|
return t;
|
|
if (null === t || "object" != typeof t && "function" != typeof t)
|
|
return {
|
|
default:
|
|
t
|
|
};
|
|
var e = D();
|
|
if (e && e.has(t))
|
|
return e.get(t);
|
|
var i = {},
|
|
n = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var r in t)
|
|
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
var o = n ? Object.getOwnPropertyDescriptor(t, r) : null;
|
|
o && (o.get || o.set) ? Object.defineProperty(i, r, o) : i[r] = t[r]
|
|
}
|
|
return i.default = t,
|
|
e && e.set(t, i),
|
|
i
|
|
}
|
|
/*!
|
|
* pixi.js - v5.2.1
|
|
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
|
|
*
|
|
* pixi.js is licensed under the MIT License.
|
|
* http://www.opensource.org/licenses/mit-license
|
|
*/
|
|
Object.keys(R).forEach((function (t) {
|
|
"default" !== t && "__esModule" !== t && (Object.prototype.hasOwnProperty.call(n, t) || Object.defineProperty(i, t, {
|
|
enumerable: !0,
|
|
get: function () {
|
|
return R[t]
|
|
}
|
|
}))
|
|
}));
|
|
var k = "5.0.0";
|
|
h.Renderer.registerPlugin("accessibility", r.AccessibilityManager),
|
|
h.Renderer.registerPlugin("extract", l.Extract),
|
|
h.Renderer.registerPlugin("interaction", o.InteractionManager),
|
|
h.Renderer.registerPlugin("particle", c.ParticleRenderer),
|
|
h.Renderer.registerPlugin("prepare", p.Prepare),
|
|
h.Renderer.registerPlugin("batch", h.BatchRenderer),
|
|
h.Renderer.registerPlugin("tilingSprite", f.TilingSpriteRenderer),
|
|
u.Loader.registerPlugin(_.BitmapFontLoader),
|
|
u.Loader.registerPlugin(d.SpritesheetLoader),
|
|
a.Application.registerPlugin(m.TickerPlugin),
|
|
a.Application.registerPlugin(u.AppLoaderPlugin);
|
|
i.VERSION = "5.2.1";
|
|
var F = {
|
|
AlphaFilter: y.AlphaFilter,
|
|
BlurFilter: g.BlurFilter,
|
|
BlurFilterPass: g.BlurFilterPass,
|
|
ColorMatrixFilter: v.ColorMatrixFilter,
|
|
DisplacementFilter: w.DisplacementFilter,
|
|
FXAAFilter: x.FXAAFilter,
|
|
NoiseFilter: b.NoiseFilter
|
|
};
|
|
i.filters = F
|
|
}, {
|
|
"@pixi/polyfill": "AWY2",
|
|
"@pixi/accessibility": "jFkj",
|
|
"@pixi/interaction": "RmUs",
|
|
"@pixi/utils": "x5Ec",
|
|
"@pixi/app": "HdTX",
|
|
"@pixi/core": "qqf8",
|
|
"@pixi/extract": "lAKD",
|
|
"@pixi/loaders": "pAmg",
|
|
"@pixi/particles": "lXcw",
|
|
"@pixi/prepare": "kdZ8",
|
|
"@pixi/spritesheet": "vMGq",
|
|
"@pixi/sprite-tiling": "s11n",
|
|
"@pixi/text-bitmap": "mTlL",
|
|
"@pixi/ticker": "t27b",
|
|
"@pixi/filter-alpha": "SOHw",
|
|
"@pixi/filter-blur": "zAmH",
|
|
"@pixi/filter-color-matrix": "FZwX",
|
|
"@pixi/filter-displacement": "OThW",
|
|
"@pixi/filter-fxaa": "aTi1",
|
|
"@pixi/filter-noise": "jHvy",
|
|
"@pixi/mixin-cache-as-bitmap": "wyPI",
|
|
"@pixi/mixin-get-child-by-name": "FAue",
|
|
"@pixi/mixin-get-global-position": "UWgA",
|
|
"@pixi/constants": "R76a",
|
|
"@pixi/display": "LJAM",
|
|
"@pixi/graphics": "uuMi",
|
|
"@pixi/math": "GTL5",
|
|
"@pixi/mesh": "fWSH",
|
|
"@pixi/mesh-extras": "tJ8P",
|
|
"@pixi/runner": "jcTq",
|
|
"@pixi/sprite": "vBI9",
|
|
"@pixi/sprite-animated": "S0oD",
|
|
"@pixi/text": "LtEJ",
|
|
"@pixi/settings": "v11T"
|
|
}
|
|
],
|
|
AIIz: [function (t, e, i) {
|
|
"use strict";
|
|
var n = function (t) {
|
|
if (t && t.__esModule)
|
|
return t;
|
|
if (null === t || "object" != typeof t && "function" != typeof t)
|
|
return {
|
|
default:
|
|
t
|
|
};
|
|
var e = r();
|
|
if (e && e.has(t))
|
|
return e.get(t);
|
|
var i = {},
|
|
n = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var o in t)
|
|
if (Object.prototype.hasOwnProperty.call(t, o)) {
|
|
var s = n ? Object.getOwnPropertyDescriptor(t, o) : null;
|
|
s && (s.get || s.set) ? Object.defineProperty(i, o, s) : i[o] = t[o]
|
|
}
|
|
i.default = t,
|
|
e && e.set(t, i);
|
|
return i
|
|
}
|
|
(t("pixi.js"));
|
|
function r() {
|
|
if ("function" != typeof WeakMap)
|
|
return null;
|
|
var t = new WeakMap;
|
|
return r = function () {
|
|
return t
|
|
},
|
|
t
|
|
}
|
|
window.PIXI = n
|
|
}, {
|
|
"pixi.js": "DZG1"
|
|
}
|
|
],
|
|
d92s: [function (t, e, i) {
|
|
var n,
|
|
r,
|
|
o,
|
|
s = this && this.__extends || (n = function (t, e) {
|
|
return (n = Object.setPrototypeOf || {
|
|
__proto__: []
|
|
}
|
|
instanceof Array && function (t, e) {
|
|
t.__proto__ = e
|
|
}
|
|
|| function (t, e) {
|
|
for (var i in e)
|
|
e.hasOwnProperty(i) && (t[i] = e[i])
|
|
})(t, e)
|
|
}, function (t, e) {
|
|
function i() {
|
|
this.constructor = t
|
|
}
|
|
n(t, e),
|
|
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i)
|
|
});
|
|
!function (t) {
|
|
!function (t) {
|
|
var e,
|
|
i,
|
|
n,
|
|
r = function () {
|
|
function t(t, e, i) {
|
|
if (null == t)
|
|
throw new Error("name cannot be null.");
|
|
if (null == e)
|
|
throw new Error("timelines cannot be null.");
|
|
this.name = t,
|
|
this.timelines = e,
|
|
this.timelineIds = [];
|
|
for (var n = 0; n < e.length; n++)
|
|
this.timelineIds[e[n].getPropertyId()] = !0;
|
|
this.duration = i
|
|
}
|
|
return t.prototype.hasTimeline = function (t) {
|
|
return 1 == this.timelineIds[t]
|
|
},
|
|
t.prototype.apply = function (t, e, i, n, r, o, s, a) {
|
|
if (null == t)
|
|
throw new Error("skeleton cannot be null.");
|
|
n && 0 != this.duration && (i %= this.duration, e > 0 && (e %= this.duration));
|
|
for (var h = this.timelines, l = 0, u = h.length; l < u; l++)
|
|
h[l].apply(t, e, i, r, o, s, a)
|
|
},
|
|
t.binarySearch = function (t, e, i) {
|
|
void 0 === i && (i = 1);
|
|
var n = 0,
|
|
r = t.length / i - 2;
|
|
if (0 == r)
|
|
return i;
|
|
for (var o = r >>> 1; ; ) {
|
|
if (t[(o + 1) * i] <= e ? n = o + 1 : r = o, n == r)
|
|
return (n + 1) * i;
|
|
o = n + r >>> 1
|
|
}
|
|
},
|
|
t.linearSearch = function (t, e, i) {
|
|
for (var n = 0, r = t.length - i; n <= r; n += i)
|
|
if (t[n] > e)
|
|
return n;
|
|
return -1
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.Animation = r,
|
|
function (t) {
|
|
t[t.setup = 0] = "setup",
|
|
t[t.first = 1] = "first",
|
|
t[t.replace = 2] = "replace",
|
|
t[t.add = 3] = "add"
|
|
}
|
|
(e = t.MixBlend || (t.MixBlend = {})),
|
|
function (t) {
|
|
t[t.mixIn = 0] = "mixIn",
|
|
t[t.mixOut = 1] = "mixOut"
|
|
}
|
|
(i = t.MixDirection || (t.MixDirection = {})),
|
|
function (t) {
|
|
t[t.rotate = 0] = "rotate",
|
|
t[t.translate = 1] = "translate",
|
|
t[t.scale = 2] = "scale",
|
|
t[t.shear = 3] = "shear",
|
|
t[t.attachment = 4] = "attachment",
|
|
t[t.color = 5] = "color",
|
|
t[t.deform = 6] = "deform",
|
|
t[t.event = 7] = "event",
|
|
t[t.drawOrder = 8] = "drawOrder",
|
|
t[t.ikConstraint = 9] = "ikConstraint",
|
|
t[t.transformConstraint = 10] = "transformConstraint",
|
|
t[t.pathConstraintPosition = 11] = "pathConstraintPosition",
|
|
t[t.pathConstraintSpacing = 12] = "pathConstraintSpacing",
|
|
t[t.pathConstraintMix = 13] = "pathConstraintMix",
|
|
t[t.twoColor = 14] = "twoColor"
|
|
}
|
|
(n = t.TimelineType || (t.TimelineType = {}));
|
|
var o = function () {
|
|
function e(i) {
|
|
if (i <= 0)
|
|
throw new Error("frameCount must be > 0: " + i);
|
|
this.curves = t.Utils.newFloatArray((i - 1) * e.BEZIER_SIZE)
|
|
}
|
|
return e.prototype.getFrameCount = function () {
|
|
return this.curves.length / e.BEZIER_SIZE + 1
|
|
},
|
|
e.prototype.setLinear = function (t) {
|
|
this.curves[t * e.BEZIER_SIZE] = e.LINEAR
|
|
},
|
|
e.prototype.setStepped = function (t) {
|
|
this.curves[t * e.BEZIER_SIZE] = e.STEPPED
|
|
},
|
|
e.prototype.getCurveType = function (t) {
|
|
var i = t * e.BEZIER_SIZE;
|
|
if (i == this.curves.length)
|
|
return e.LINEAR;
|
|
var n = this.curves[i];
|
|
return n == e.LINEAR ? e.LINEAR : n == e.STEPPED ? e.STEPPED : e.BEZIER
|
|
},
|
|
e.prototype.setCurve = function (t, i, n, r, o) {
|
|
var s = .03 * (2 * -i + r),
|
|
a = .03 * (2 * -n + o),
|
|
h = .006 * (3 * (i - r) + 1),
|
|
l = .006 * (3 * (n - o) + 1),
|
|
u = 2 * s + h,
|
|
c = 2 * a + l,
|
|
p = .3 * i + s + .16666667 * h,
|
|
d = .3 * n + a + .16666667 * l,
|
|
f = t * e.BEZIER_SIZE,
|
|
_ = this.curves;
|
|
_[f++] = e.BEZIER;
|
|
for (var m = p, y = d, g = f + e.BEZIER_SIZE - 1; f < g; f += 2)
|
|
_[f] = m, _[f + 1] = y, p += u, d += c, u += h, c += l, m += p, y += d
|
|
},
|
|
e.prototype.getCurvePercent = function (i, n) {
|
|
n = t.MathUtils.clamp(n, 0, 1);
|
|
var r = this.curves,
|
|
o = i * e.BEZIER_SIZE,
|
|
s = r[o];
|
|
if (s == e.LINEAR)
|
|
return n;
|
|
if (s == e.STEPPED)
|
|
return 0;
|
|
for (var a = 0, h = ++o, l = o + e.BEZIER_SIZE - 1; o < l; o += 2)
|
|
if ((a = r[o]) >= n) {
|
|
var u = void 0,
|
|
c = void 0;
|
|
return o == h ? (u = 0, c = 0) : (u = r[o - 2], c = r[o - 1]),
|
|
c + (r[o + 1] - c) * (n - u) / (a - u)
|
|
}
|
|
var p = r[o - 1];
|
|
return p + (1 - p) * (n - a) / (1 - a)
|
|
},
|
|
e.LINEAR = 0,
|
|
e.STEPPED = 1,
|
|
e.BEZIER = 2,
|
|
e.BEZIER_SIZE = 19,
|
|
e
|
|
}
|
|
();
|
|
t.CurveTimeline = o;
|
|
var a = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e << 1),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.rotate << 24) + this.boneIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i) {
|
|
t <<= 1,
|
|
this.frames[t] = e,
|
|
this.frames[t + o.ROTATION] = i
|
|
},
|
|
o.prototype.apply = function (t, i, n, s, a, h, l) {
|
|
var u = this.frames,
|
|
c = t.bones[this.boneIndex];
|
|
if (c.active)
|
|
if (n < u[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return void(c.rotation = c.data.rotation);
|
|
case e.first:
|
|
var p = c.data.rotation - c.rotation;
|
|
c.rotation += (p - 360 * (16384 - (16384.499999999996 - p / 360 | 0))) * a
|
|
}
|
|
else if (n >= u[u.length - o.ENTRIES]) {
|
|
var d = u[u.length + o.PREV_ROTATION];
|
|
switch (h) {
|
|
case e.setup:
|
|
c.rotation = c.data.rotation + d * a;
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
d += c.data.rotation - c.rotation,
|
|
d -= 360 * (16384 - (16384.499999999996 - d / 360 | 0));
|
|
case e.add:
|
|
c.rotation += d * a
|
|
}
|
|
} else {
|
|
var f = r.binarySearch(u, n, o.ENTRIES),
|
|
_ = u[f + o.PREV_ROTATION],
|
|
m = u[f],
|
|
y = this.getCurvePercent((f >> 1) - 1, 1 - (n - m) / (u[f + o.PREV_TIME] - m)),
|
|
g = u[f + o.ROTATION] - _;
|
|
switch (g = _ + (g - 360 * (16384 - (16384.499999999996 - g / 360 | 0))) * y, h) {
|
|
case e.setup:
|
|
c.rotation = c.data.rotation + (g - 360 * (16384 - (16384.499999999996 - g / 360 | 0))) * a;
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
g += c.data.rotation - c.rotation;
|
|
case e.add:
|
|
c.rotation += (g - 360 * (16384 - (16384.499999999996 - g / 360 | 0))) * a
|
|
}
|
|
}
|
|
},
|
|
o.ENTRIES = 2,
|
|
o.PREV_TIME = -2,
|
|
o.PREV_ROTATION = -1,
|
|
o.ROTATION = 1,
|
|
o
|
|
}
|
|
(o);
|
|
t.RotateTimeline = a;
|
|
var h = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e * o.ENTRIES),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.translate << 24) + this.boneIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i, n) {
|
|
t *= o.ENTRIES,
|
|
this.frames[t] = e,
|
|
this.frames[t + o.X] = i,
|
|
this.frames[t + o.Y] = n
|
|
},
|
|
o.prototype.apply = function (t, i, n, s, a, h, l) {
|
|
var u = this.frames,
|
|
c = t.bones[this.boneIndex];
|
|
if (c.active)
|
|
if (n < u[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return c.x = c.data.x,
|
|
void(c.y = c.data.y);
|
|
case e.first:
|
|
c.x += (c.data.x - c.x) * a,
|
|
c.y += (c.data.y - c.y) * a
|
|
}
|
|
else {
|
|
var p = 0,
|
|
d = 0;
|
|
if (n >= u[u.length - o.ENTRIES])
|
|
p = u[u.length + o.PREV_X], d = u[u.length + o.PREV_Y];
|
|
else {
|
|
var f = r.binarySearch(u, n, o.ENTRIES);
|
|
p = u[f + o.PREV_X],
|
|
d = u[f + o.PREV_Y];
|
|
var _ = u[f],
|
|
m = this.getCurvePercent(f / o.ENTRIES - 1, 1 - (n - _) / (u[f + o.PREV_TIME] - _));
|
|
p += (u[f + o.X] - p) * m,
|
|
d += (u[f + o.Y] - d) * m
|
|
}
|
|
switch (h) {
|
|
case e.setup:
|
|
c.x = c.data.x + p * a,
|
|
c.y = c.data.y + d * a;
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
c.x += (c.data.x + p - c.x) * a,
|
|
c.y += (c.data.y + d - c.y) * a;
|
|
break;
|
|
case e.add:
|
|
c.x += p * a,
|
|
c.y += d * a
|
|
}
|
|
}
|
|
},
|
|
o.ENTRIES = 3,
|
|
o.PREV_TIME = -3,
|
|
o.PREV_X = -2,
|
|
o.PREV_Y = -1,
|
|
o.X = 1,
|
|
o.Y = 2,
|
|
o
|
|
}
|
|
(o);
|
|
t.TranslateTimeline = h;
|
|
var l = function (o) {
|
|
function a(t) {
|
|
return o.call(this, t) || this
|
|
}
|
|
return s(a, o),
|
|
a.prototype.getPropertyId = function () {
|
|
return (n.scale << 24) + this.boneIndex
|
|
},
|
|
a.prototype.apply = function (n, o, s, h, l, u, c) {
|
|
var p = this.frames,
|
|
d = n.bones[this.boneIndex];
|
|
if (d.active)
|
|
if (s < p[0])
|
|
switch (u) {
|
|
case e.setup:
|
|
return d.scaleX = d.data.scaleX,
|
|
void(d.scaleY = d.data.scaleY);
|
|
case e.first:
|
|
d.scaleX += (d.data.scaleX - d.scaleX) * l,
|
|
d.scaleY += (d.data.scaleY - d.scaleY) * l
|
|
}
|
|
else {
|
|
var f = 0,
|
|
_ = 0;
|
|
if (s >= p[p.length - a.ENTRIES])
|
|
f = p[p.length + a.PREV_X] * d.data.scaleX, _ = p[p.length + a.PREV_Y] * d.data.scaleY;
|
|
else {
|
|
var m = r.binarySearch(p, s, a.ENTRIES);
|
|
f = p[m + a.PREV_X],
|
|
_ = p[m + a.PREV_Y];
|
|
var y = p[m],
|
|
g = this.getCurvePercent(m / a.ENTRIES - 1, 1 - (s - y) / (p[m + a.PREV_TIME] - y));
|
|
f = (f + (p[m + a.X] - f) * g) * d.data.scaleX,
|
|
_ = (_ + (p[m + a.Y] - _) * g) * d.data.scaleY
|
|
}
|
|
if (1 == l)
|
|
u == e.add ? (d.scaleX += f - d.data.scaleX, d.scaleY += _ - d.data.scaleY) : (d.scaleX = f, d.scaleY = _);
|
|
else {
|
|
var v = 0,
|
|
w = 0;
|
|
if (c == i.mixOut)
|
|
switch (u) {
|
|
case e.setup:
|
|
v = d.data.scaleX,
|
|
w = d.data.scaleY,
|
|
d.scaleX = v + (Math.abs(f) * t.MathUtils.signum(v) - v) * l,
|
|
d.scaleY = w + (Math.abs(_) * t.MathUtils.signum(w) - w) * l;
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
v = d.scaleX,
|
|
w = d.scaleY,
|
|
d.scaleX = v + (Math.abs(f) * t.MathUtils.signum(v) - v) * l,
|
|
d.scaleY = w + (Math.abs(_) * t.MathUtils.signum(w) - w) * l;
|
|
break;
|
|
case e.add:
|
|
v = d.scaleX,
|
|
w = d.scaleY,
|
|
d.scaleX = v + (Math.abs(f) * t.MathUtils.signum(v) - d.data.scaleX) * l,
|
|
d.scaleY = w + (Math.abs(_) * t.MathUtils.signum(w) - d.data.scaleY) * l
|
|
}
|
|
else
|
|
switch (u) {
|
|
case e.setup:
|
|
v = Math.abs(d.data.scaleX) * t.MathUtils.signum(f),
|
|
w = Math.abs(d.data.scaleY) * t.MathUtils.signum(_),
|
|
d.scaleX = v + (f - v) * l,
|
|
d.scaleY = w + (_ - w) * l;
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
v = Math.abs(d.scaleX) * t.MathUtils.signum(f),
|
|
w = Math.abs(d.scaleY) * t.MathUtils.signum(_),
|
|
d.scaleX = v + (f - v) * l,
|
|
d.scaleY = w + (_ - w) * l;
|
|
break;
|
|
case e.add:
|
|
v = t.MathUtils.signum(f),
|
|
w = t.MathUtils.signum(_),
|
|
d.scaleX = Math.abs(d.scaleX) * v + (f - Math.abs(d.data.scaleX) * v) * l,
|
|
d.scaleY = Math.abs(d.scaleY) * w + (_ - Math.abs(d.data.scaleY) * w) * l
|
|
}
|
|
}
|
|
}
|
|
},
|
|
a
|
|
}
|
|
(h);
|
|
t.ScaleTimeline = l;
|
|
var u = function (t) {
|
|
function i(e) {
|
|
return t.call(this, e) || this
|
|
}
|
|
return s(i, t),
|
|
i.prototype.getPropertyId = function () {
|
|
return (n.shear << 24) + this.boneIndex
|
|
},
|
|
i.prototype.apply = function (t, n, o, s, a, h, l) {
|
|
var u = this.frames,
|
|
c = t.bones[this.boneIndex];
|
|
if (c.active)
|
|
if (o < u[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return c.shearX = c.data.shearX,
|
|
void(c.shearY = c.data.shearY);
|
|
case e.first:
|
|
c.shearX += (c.data.shearX - c.shearX) * a,
|
|
c.shearY += (c.data.shearY - c.shearY) * a
|
|
}
|
|
else {
|
|
var p = 0,
|
|
d = 0;
|
|
if (o >= u[u.length - i.ENTRIES])
|
|
p = u[u.length + i.PREV_X], d = u[u.length + i.PREV_Y];
|
|
else {
|
|
var f = r.binarySearch(u, o, i.ENTRIES);
|
|
p = u[f + i.PREV_X],
|
|
d = u[f + i.PREV_Y];
|
|
var _ = u[f],
|
|
m = this.getCurvePercent(f / i.ENTRIES - 1, 1 - (o - _) / (u[f + i.PREV_TIME] - _));
|
|
p += (u[f + i.X] - p) * m,
|
|
d += (u[f + i.Y] - d) * m
|
|
}
|
|
switch (h) {
|
|
case e.setup:
|
|
c.shearX = c.data.shearX + p * a,
|
|
c.shearY = c.data.shearY + d * a;
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
c.shearX += (c.data.shearX + p - c.shearX) * a,
|
|
c.shearY += (c.data.shearY + d - c.shearY) * a;
|
|
break;
|
|
case e.add:
|
|
c.shearX += p * a,
|
|
c.shearY += d * a
|
|
}
|
|
}
|
|
},
|
|
i
|
|
}
|
|
(h);
|
|
t.ShearTimeline = u;
|
|
var c = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e * o.ENTRIES),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.color << 24) + this.slotIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i, n, r, s) {
|
|
t *= o.ENTRIES,
|
|
this.frames[t] = e,
|
|
this.frames[t + o.R] = i,
|
|
this.frames[t + o.G] = n,
|
|
this.frames[t + o.B] = r,
|
|
this.frames[t + o.A] = s
|
|
},
|
|
o.prototype.apply = function (t, i, n, s, a, h, l) {
|
|
var u = t.slots[this.slotIndex];
|
|
if (u.bone.active) {
|
|
var c = this.frames;
|
|
if (n < c[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return void u.color.setFromColor(u.data.color);
|
|
case e.first:
|
|
var p = u.color,
|
|
d = u.data.color;
|
|
p.add((d.r - p.r) * a, (d.g - p.g) * a, (d.b - p.b) * a, (d.a - p.a) * a)
|
|
}
|
|
else {
|
|
var f = 0,
|
|
_ = 0,
|
|
m = 0,
|
|
y = 0;
|
|
if (n >= c[c.length - o.ENTRIES]) {
|
|
var g = c.length;
|
|
f = c[g + o.PREV_R],
|
|
_ = c[g + o.PREV_G],
|
|
m = c[g + o.PREV_B],
|
|
y = c[g + o.PREV_A]
|
|
} else {
|
|
var v = r.binarySearch(c, n, o.ENTRIES);
|
|
f = c[v + o.PREV_R],
|
|
_ = c[v + o.PREV_G],
|
|
m = c[v + o.PREV_B],
|
|
y = c[v + o.PREV_A];
|
|
var w = c[v],
|
|
x = this.getCurvePercent(v / o.ENTRIES - 1, 1 - (n - w) / (c[v + o.PREV_TIME] - w));
|
|
f += (c[v + o.R] - f) * x,
|
|
_ += (c[v + o.G] - _) * x,
|
|
m += (c[v + o.B] - m) * x,
|
|
y += (c[v + o.A] - y) * x
|
|
}
|
|
if (1 == a)
|
|
u.color.set(f, _, m, y);
|
|
else {
|
|
p = u.color;
|
|
h == e.setup && p.setFromColor(u.data.color),
|
|
p.add((f - p.r) * a, (_ - p.g) * a, (m - p.b) * a, (y - p.a) * a)
|
|
}
|
|
}
|
|
}
|
|
},
|
|
o.ENTRIES = 5,
|
|
o.PREV_TIME = -5,
|
|
o.PREV_R = -4,
|
|
o.PREV_G = -3,
|
|
o.PREV_B = -2,
|
|
o.PREV_A = -1,
|
|
o.R = 1,
|
|
o.G = 2,
|
|
o.B = 3,
|
|
o.A = 4,
|
|
o
|
|
}
|
|
(o);
|
|
t.ColorTimeline = c;
|
|
var p = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e * o.ENTRIES),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.twoColor << 24) + this.slotIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i, n, r, s, a, h, l) {
|
|
t *= o.ENTRIES,
|
|
this.frames[t] = e,
|
|
this.frames[t + o.R] = i,
|
|
this.frames[t + o.G] = n,
|
|
this.frames[t + o.B] = r,
|
|
this.frames[t + o.A] = s,
|
|
this.frames[t + o.R2] = a,
|
|
this.frames[t + o.G2] = h,
|
|
this.frames[t + o.B2] = l
|
|
},
|
|
o.prototype.apply = function (t, i, n, s, a, h, l) {
|
|
var u = t.slots[this.slotIndex];
|
|
if (u.bone.active) {
|
|
var c = this.frames;
|
|
if (n < c[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return u.color.setFromColor(u.data.color),
|
|
void u.darkColor.setFromColor(u.data.darkColor);
|
|
case e.first:
|
|
var p = u.color,
|
|
d = u.darkColor,
|
|
f = u.data.color,
|
|
_ = u.data.darkColor;
|
|
p.add((f.r - p.r) * a, (f.g - p.g) * a, (f.b - p.b) * a, (f.a - p.a) * a),
|
|
d.add((_.r - d.r) * a, (_.g - d.g) * a, (_.b - d.b) * a, 0)
|
|
}
|
|
else {
|
|
var m = 0,
|
|
y = 0,
|
|
g = 0,
|
|
v = 0,
|
|
w = 0,
|
|
x = 0,
|
|
b = 0;
|
|
if (n >= c[c.length - o.ENTRIES]) {
|
|
var E = c.length;
|
|
m = c[E + o.PREV_R],
|
|
y = c[E + o.PREV_G],
|
|
g = c[E + o.PREV_B],
|
|
v = c[E + o.PREV_A],
|
|
w = c[E + o.PREV_R2],
|
|
x = c[E + o.PREV_G2],
|
|
b = c[E + o.PREV_B2]
|
|
} else {
|
|
var $ = r.binarySearch(c, n, o.ENTRIES);
|
|
m = c[$ + o.PREV_R],
|
|
y = c[$ + o.PREV_G],
|
|
g = c[$ + o.PREV_B],
|
|
v = c[$ + o.PREV_A],
|
|
w = c[$ + o.PREV_R2],
|
|
x = c[$ + o.PREV_G2],
|
|
b = c[$ + o.PREV_B2];
|
|
var A = c[$],
|
|
S = this.getCurvePercent($ / o.ENTRIES - 1, 1 - (n - A) / (c[$ + o.PREV_TIME] - A));
|
|
m += (c[$ + o.R] - m) * S,
|
|
y += (c[$ + o.G] - y) * S,
|
|
g += (c[$ + o.B] - g) * S,
|
|
v += (c[$ + o.A] - v) * S,
|
|
w += (c[$ + o.R2] - w) * S,
|
|
x += (c[$ + o.G2] - x) * S,
|
|
b += (c[$ + o.B2] - b) * S
|
|
}
|
|
if (1 == a)
|
|
u.color.set(m, y, g, v), u.darkColor.set(w, x, b, 1);
|
|
else {
|
|
p = u.color,
|
|
d = u.darkColor;
|
|
h == e.setup && (p.setFromColor(u.data.color), d.setFromColor(u.data.darkColor)),
|
|
p.add((m - p.r) * a, (y - p.g) * a, (g - p.b) * a, (v - p.a) * a),
|
|
d.add((w - d.r) * a, (x - d.g) * a, (b - d.b) * a, 0)
|
|
}
|
|
}
|
|
}
|
|
},
|
|
o.ENTRIES = 8,
|
|
o.PREV_TIME = -8,
|
|
o.PREV_R = -7,
|
|
o.PREV_G = -6,
|
|
o.PREV_B = -5,
|
|
o.PREV_A = -4,
|
|
o.PREV_R2 = -3,
|
|
o.PREV_G2 = -2,
|
|
o.PREV_B2 = -1,
|
|
o.R = 1,
|
|
o.G = 2,
|
|
o.B = 3,
|
|
o.A = 4,
|
|
o.R2 = 5,
|
|
o.G2 = 6,
|
|
o.B2 = 7,
|
|
o
|
|
}
|
|
(o);
|
|
t.TwoColorTimeline = p;
|
|
var d = function () {
|
|
function o(e) {
|
|
this.frames = t.Utils.newFloatArray(e),
|
|
this.attachmentNames = new Array(e)
|
|
}
|
|
return o.prototype.getPropertyId = function () {
|
|
return (n.attachment << 24) + this.slotIndex
|
|
},
|
|
o.prototype.getFrameCount = function () {
|
|
return this.frames.length
|
|
},
|
|
o.prototype.setFrame = function (t, e, i) {
|
|
this.frames[t] = e,
|
|
this.attachmentNames[t] = i
|
|
},
|
|
o.prototype.apply = function (t, n, o, s, a, h, l) {
|
|
var u = t.slots[this.slotIndex];
|
|
if (u.bone.active)
|
|
if (l != i.mixOut || h != e.setup) {
|
|
var c = this.frames;
|
|
if (o < c[0]) {
|
|
if (h == e.setup || h == e.first) {
|
|
var p = u.data.attachmentName;
|
|
u.setAttachment(null == p ? null : t.getAttachment(this.slotIndex, p))
|
|
}
|
|
} else {
|
|
var d = 0;
|
|
d = o >= c[c.length - 1] ? c.length - 1 : r.binarySearch(c, o, 1) - 1;
|
|
var f = this.attachmentNames[d];
|
|
t.slots[this.slotIndex].setAttachment(null == f ? null : t.getAttachment(this.slotIndex, f))
|
|
}
|
|
} else {
|
|
var _ = u.data.attachmentName;
|
|
u.setAttachment(null == _ ? null : t.getAttachment(this.slotIndex, _))
|
|
}
|
|
},
|
|
o
|
|
}
|
|
();
|
|
t.AttachmentTimeline = d;
|
|
var f = null,
|
|
_ = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e),
|
|
n.frameVertices = new Array(e),
|
|
null == f && (f = t.Utils.newFloatArray(64)),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.deform << 27) + +this.attachment.id + this.slotIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i) {
|
|
this.frames[t] = e,
|
|
this.frameVertices[t] = i
|
|
},
|
|
o.prototype.apply = function (i, n, o, s, a, h, l) {
|
|
var u = i.slots[this.slotIndex];
|
|
if (u.bone.active) {
|
|
var c = u.getAttachment();
|
|
if (c instanceof t.VertexAttachment && c.deformAttachment == this.attachment) {
|
|
var p = u.deform;
|
|
0 == p.length && (h = e.setup);
|
|
var d = this.frameVertices,
|
|
f = d[0].length,
|
|
_ = this.frames;
|
|
if (o < _[0]) {
|
|
var m = c;
|
|
switch (h) {
|
|
case e.setup:
|
|
return void(p.length = 0);
|
|
case e.first:
|
|
if (1 == a) {
|
|
p.length = 0;
|
|
break
|
|
}
|
|
var y = t.Utils.setArraySize(p, f);
|
|
if (null == m.bones)
|
|
for (var g = m.vertices, v = 0; v < f; v++)
|
|
y[v] += (g[v] - y[v]) * a;
|
|
else {
|
|
a = 1 - a;
|
|
for (v = 0; v < f; v++)
|
|
y[v] *= a
|
|
}
|
|
}
|
|
} else {
|
|
var w = t.Utils.setArraySize(p, f);
|
|
if (o >= _[_.length - 1]) {
|
|
var x = d[_.length - 1];
|
|
if (1 == a)
|
|
if (h == e.add)
|
|
if (null == (m = c).bones) {
|
|
g = m.vertices;
|
|
for (var b = 0; b < f; b++)
|
|
w[b] += x[b] - g[b]
|
|
} else
|
|
for (var E = 0; E < f; E++)
|
|
w[E] += x[E];
|
|
else
|
|
t.Utils.arrayCopy(x, 0, w, 0, f);
|
|
else
|
|
switch (h) {
|
|
case e.setup:
|
|
var $ = c;
|
|
if (null == $.bones) {
|
|
g = $.vertices;
|
|
for (var A = 0; A < f; A++) {
|
|
var S = g[A];
|
|
w[A] = S + (x[A] - S) * a
|
|
}
|
|
} else
|
|
for (var T = 0; T < f; T++)
|
|
w[T] = x[T] * a;
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
for (var C = 0; C < f; C++)
|
|
w[C] += (x[C] - w[C]) * a;
|
|
break;
|
|
case e.add:
|
|
if (null == (m = c).bones) {
|
|
g = m.vertices;
|
|
for (var M = 0; M < f; M++)
|
|
w[M] += (x[M] - g[M]) * a
|
|
} else
|
|
for (var I = 0; I < f; I++)
|
|
w[I] += x[I] * a
|
|
}
|
|
} else {
|
|
var P = r.binarySearch(_, o),
|
|
O = d[P - 1],
|
|
R = d[P],
|
|
D = _[P],
|
|
L = this.getCurvePercent(P - 1, 1 - (o - D) / (_[P - 1] - D));
|
|
if (1 == a)
|
|
if (h == e.add)
|
|
if (null == (m = c).bones) {
|
|
g = m.vertices;
|
|
for (var k = 0; k < f; k++) {
|
|
var F = O[k];
|
|
w[k] += F + (R[k] - F) * L - g[k]
|
|
}
|
|
} else
|
|
for (var N = 0; N < f; N++) {
|
|
F = O[N];
|
|
w[N] += F + (R[N] - F) * L
|
|
}
|
|
else
|
|
for (var B = 0; B < f; B++) {
|
|
F = O[B];
|
|
w[B] = F + (R[B] - F) * L
|
|
}
|
|
else
|
|
switch (h) {
|
|
case e.setup:
|
|
var U = c;
|
|
if (null == U.bones) {
|
|
g = U.vertices;
|
|
for (var X = 0; X < f; X++) {
|
|
F = O[X],
|
|
S = g[X];
|
|
w[X] = S + (F + (R[X] - F) * L - S) * a
|
|
}
|
|
} else
|
|
for (var j = 0; j < f; j++) {
|
|
F = O[j];
|
|
w[j] = (F + (R[j] - F) * L) * a
|
|
}
|
|
break;
|
|
case e.first:
|
|
case e.replace:
|
|
for (var V = 0; V < f; V++) {
|
|
F = O[V];
|
|
w[V] += (F + (R[V] - F) * L - w[V]) * a
|
|
}
|
|
break;
|
|
case e.add:
|
|
if (null == (m = c).bones) {
|
|
g = m.vertices;
|
|
for (var H = 0; H < f; H++) {
|
|
F = O[H];
|
|
w[H] += (F + (R[H] - F) * L - g[H]) * a
|
|
}
|
|
} else
|
|
for (var G = 0; G < f; G++) {
|
|
F = O[G];
|
|
w[G] += (F + (R[G] - F) * L) * a
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
o
|
|
}
|
|
(o);
|
|
t.DeformTimeline = _;
|
|
var m = function () {
|
|
function e(e) {
|
|
this.frames = t.Utils.newFloatArray(e),
|
|
this.events = new Array(e)
|
|
}
|
|
return e.prototype.getPropertyId = function () {
|
|
return n.event << 24
|
|
},
|
|
e.prototype.getFrameCount = function () {
|
|
return this.frames.length
|
|
},
|
|
e.prototype.setFrame = function (t, e) {
|
|
this.frames[t] = e.time,
|
|
this.events[t] = e
|
|
},
|
|
e.prototype.apply = function (t, e, i, n, o, s, a) {
|
|
if (null != n) {
|
|
var h = this.frames,
|
|
l = this.frames.length;
|
|
if (e > i)
|
|
this.apply(t, e, Number.MAX_VALUE, n, o, s, a), e = -1;
|
|
else if (e >= h[l - 1])
|
|
return;
|
|
if (!(i < h[0])) {
|
|
var u = 0;
|
|
if (e < h[0])
|
|
u = 0;
|
|
else
|
|
for (var c = h[u = r.binarySearch(h, e)]; u > 0 && h[u - 1] == c; )
|
|
u--;
|
|
for (; u < l && i >= h[u]; u++)
|
|
n.push(this.events[u])
|
|
}
|
|
}
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.EventTimeline = m;
|
|
var y = function () {
|
|
function o(e) {
|
|
this.frames = t.Utils.newFloatArray(e),
|
|
this.drawOrders = new Array(e)
|
|
}
|
|
return o.prototype.getPropertyId = function () {
|
|
return n.drawOrder << 24
|
|
},
|
|
o.prototype.getFrameCount = function () {
|
|
return this.frames.length
|
|
},
|
|
o.prototype.setFrame = function (t, e, i) {
|
|
this.frames[t] = e,
|
|
this.drawOrders[t] = i
|
|
},
|
|
o.prototype.apply = function (n, o, s, a, h, l, u) {
|
|
var c = n.drawOrder,
|
|
p = n.slots;
|
|
if (u != i.mixOut || l != e.setup) {
|
|
var d = this.frames;
|
|
if (s < d[0])
|
|
l != e.setup && l != e.first || t.Utils.arrayCopy(n.slots, 0, n.drawOrder, 0, n.slots.length);
|
|
else {
|
|
var f = 0;
|
|
f = s >= d[d.length - 1] ? d.length - 1 : r.binarySearch(d, s) - 1;
|
|
var _ = this.drawOrders[f];
|
|
if (null == _)
|
|
t.Utils.arrayCopy(p, 0, c, 0, p.length);
|
|
else
|
|
for (var m = 0, y = _.length; m < y; m++)
|
|
c[m] = p[_[m]]
|
|
}
|
|
} else
|
|
t.Utils.arrayCopy(n.slots, 0, n.drawOrder, 0, n.slots.length)
|
|
},
|
|
o
|
|
}
|
|
();
|
|
t.DrawOrderTimeline = y;
|
|
var g = function (o) {
|
|
function a(e) {
|
|
var i = o.call(this, e) || this;
|
|
return i.frames = t.Utils.newFloatArray(e * a.ENTRIES),
|
|
i
|
|
}
|
|
return s(a, o),
|
|
a.prototype.getPropertyId = function () {
|
|
return (n.ikConstraint << 24) + this.ikConstraintIndex
|
|
},
|
|
a.prototype.setFrame = function (t, e, i, n, r, o, s) {
|
|
t *= a.ENTRIES,
|
|
this.frames[t] = e,
|
|
this.frames[t + a.MIX] = i,
|
|
this.frames[t + a.SOFTNESS] = n,
|
|
this.frames[t + a.BEND_DIRECTION] = r,
|
|
this.frames[t + a.COMPRESS] = o ? 1 : 0,
|
|
this.frames[t + a.STRETCH] = s ? 1 : 0
|
|
},
|
|
a.prototype.apply = function (t, n, o, s, h, l, u) {
|
|
var c = this.frames,
|
|
p = t.ikConstraints[this.ikConstraintIndex];
|
|
if (p.active)
|
|
if (o < c[0])
|
|
switch (l) {
|
|
case e.setup:
|
|
return p.mix = p.data.mix,
|
|
p.softness = p.data.softness,
|
|
p.bendDirection = p.data.bendDirection,
|
|
p.compress = p.data.compress,
|
|
void(p.stretch = p.data.stretch);
|
|
case e.first:
|
|
p.mix += (p.data.mix - p.mix) * h,
|
|
p.softness += (p.data.softness - p.softness) * h,
|
|
p.bendDirection = p.data.bendDirection,
|
|
p.compress = p.data.compress,
|
|
p.stretch = p.data.stretch
|
|
}
|
|
else if (o >= c[c.length - a.ENTRIES])
|
|
l == e.setup ? (p.mix = p.data.mix + (c[c.length + a.PREV_MIX] - p.data.mix) * h, p.softness = p.data.softness + (c[c.length + a.PREV_SOFTNESS] - p.data.softness) * h, u == i.mixOut ? (p.bendDirection = p.data.bendDirection, p.compress = p.data.compress, p.stretch = p.data.stretch) : (p.bendDirection = c[c.length + a.PREV_BEND_DIRECTION], p.compress = 0 != c[c.length + a.PREV_COMPRESS], p.stretch = 0 != c[c.length + a.PREV_STRETCH])) : (p.mix += (c[c.length + a.PREV_MIX] - p.mix) * h, p.softness += (c[c.length + a.PREV_SOFTNESS] - p.softness) * h, u == i.mixIn && (p.bendDirection = c[c.length + a.PREV_BEND_DIRECTION], p.compress = 0 != c[c.length + a.PREV_COMPRESS], p.stretch = 0 != c[c.length + a.PREV_STRETCH]));
|
|
else {
|
|
var d = r.binarySearch(c, o, a.ENTRIES),
|
|
f = c[d + a.PREV_MIX],
|
|
_ = c[d + a.PREV_SOFTNESS],
|
|
m = c[d],
|
|
y = this.getCurvePercent(d / a.ENTRIES - 1, 1 - (o - m) / (c[d + a.PREV_TIME] - m));
|
|
l == e.setup ? (p.mix = p.data.mix + (f + (c[d + a.MIX] - f) * y - p.data.mix) * h, p.softness = p.data.softness + (_ + (c[d + a.SOFTNESS] - _) * y - p.data.softness) * h, u == i.mixOut ? (p.bendDirection = p.data.bendDirection, p.compress = p.data.compress, p.stretch = p.data.stretch) : (p.bendDirection = c[d + a.PREV_BEND_DIRECTION], p.compress = 0 != c[d + a.PREV_COMPRESS], p.stretch = 0 != c[d + a.PREV_STRETCH])) : (p.mix += (f + (c[d + a.MIX] - f) * y - p.mix) * h, p.softness += (_ + (c[d + a.SOFTNESS] - _) * y - p.softness) * h, u == i.mixIn && (p.bendDirection = c[d + a.PREV_BEND_DIRECTION], p.compress = 0 != c[d + a.PREV_COMPRESS], p.stretch = 0 != c[d + a.PREV_STRETCH]))
|
|
}
|
|
},
|
|
a.ENTRIES = 6,
|
|
a.PREV_TIME = -6,
|
|
a.PREV_MIX = -5,
|
|
a.PREV_SOFTNESS = -4,
|
|
a.PREV_BEND_DIRECTION = -3,
|
|
a.PREV_COMPRESS = -2,
|
|
a.PREV_STRETCH = -1,
|
|
a.MIX = 1,
|
|
a.SOFTNESS = 2,
|
|
a.BEND_DIRECTION = 3,
|
|
a.COMPRESS = 4,
|
|
a.STRETCH = 5,
|
|
a
|
|
}
|
|
(o);
|
|
t.IkConstraintTimeline = g;
|
|
var v = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e * o.ENTRIES),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.transformConstraint << 24) + this.transformConstraintIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i, n, r, s) {
|
|
t *= o.ENTRIES,
|
|
this.frames[t] = e,
|
|
this.frames[t + o.ROTATE] = i,
|
|
this.frames[t + o.TRANSLATE] = n,
|
|
this.frames[t + o.SCALE] = r,
|
|
this.frames[t + o.SHEAR] = s
|
|
},
|
|
o.prototype.apply = function (t, i, n, s, a, h, l) {
|
|
var u = this.frames,
|
|
c = t.transformConstraints[this.transformConstraintIndex];
|
|
if (c.active)
|
|
if (n < u[0]) {
|
|
var p = c.data;
|
|
switch (h) {
|
|
case e.setup:
|
|
return c.rotateMix = p.rotateMix,
|
|
c.translateMix = p.translateMix,
|
|
c.scaleMix = p.scaleMix,
|
|
void(c.shearMix = p.shearMix);
|
|
case e.first:
|
|
c.rotateMix += (p.rotateMix - c.rotateMix) * a,
|
|
c.translateMix += (p.translateMix - c.translateMix) * a,
|
|
c.scaleMix += (p.scaleMix - c.scaleMix) * a,
|
|
c.shearMix += (p.shearMix - c.shearMix) * a
|
|
}
|
|
} else {
|
|
var d = 0,
|
|
f = 0,
|
|
_ = 0,
|
|
m = 0;
|
|
if (n >= u[u.length - o.ENTRIES]) {
|
|
var y = u.length;
|
|
d = u[y + o.PREV_ROTATE],
|
|
f = u[y + o.PREV_TRANSLATE],
|
|
_ = u[y + o.PREV_SCALE],
|
|
m = u[y + o.PREV_SHEAR]
|
|
} else {
|
|
var g = r.binarySearch(u, n, o.ENTRIES);
|
|
d = u[g + o.PREV_ROTATE],
|
|
f = u[g + o.PREV_TRANSLATE],
|
|
_ = u[g + o.PREV_SCALE],
|
|
m = u[g + o.PREV_SHEAR];
|
|
var v = u[g],
|
|
w = this.getCurvePercent(g / o.ENTRIES - 1, 1 - (n - v) / (u[g + o.PREV_TIME] - v));
|
|
d += (u[g + o.ROTATE] - d) * w,
|
|
f += (u[g + o.TRANSLATE] - f) * w,
|
|
_ += (u[g + o.SCALE] - _) * w,
|
|
m += (u[g + o.SHEAR] - m) * w
|
|
}
|
|
if (h == e.setup) {
|
|
p = c.data;
|
|
c.rotateMix = p.rotateMix + (d - p.rotateMix) * a,
|
|
c.translateMix = p.translateMix + (f - p.translateMix) * a,
|
|
c.scaleMix = p.scaleMix + (_ - p.scaleMix) * a,
|
|
c.shearMix = p.shearMix + (m - p.shearMix) * a
|
|
} else
|
|
c.rotateMix += (d - c.rotateMix) * a, c.translateMix += (f - c.translateMix) * a, c.scaleMix += (_ - c.scaleMix) * a, c.shearMix += (m - c.shearMix) * a
|
|
}
|
|
},
|
|
o.ENTRIES = 5,
|
|
o.PREV_TIME = -5,
|
|
o.PREV_ROTATE = -4,
|
|
o.PREV_TRANSLATE = -3,
|
|
o.PREV_SCALE = -2,
|
|
o.PREV_SHEAR = -1,
|
|
o.ROTATE = 1,
|
|
o.TRANSLATE = 2,
|
|
o.SCALE = 3,
|
|
o.SHEAR = 4,
|
|
o
|
|
}
|
|
(o);
|
|
t.TransformConstraintTimeline = v;
|
|
var w = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e * o.ENTRIES),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.pathConstraintPosition << 24) + this.pathConstraintIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i) {
|
|
t *= o.ENTRIES,
|
|
this.frames[t] = e,
|
|
this.frames[t + o.VALUE] = i
|
|
},
|
|
o.prototype.apply = function (t, i, n, s, a, h, l) {
|
|
var u = this.frames,
|
|
c = t.pathConstraints[this.pathConstraintIndex];
|
|
if (c.active)
|
|
if (n < u[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return void(c.position = c.data.position);
|
|
case e.first:
|
|
c.position += (c.data.position - c.position) * a
|
|
}
|
|
else {
|
|
var p = 0;
|
|
if (n >= u[u.length - o.ENTRIES])
|
|
p = u[u.length + o.PREV_VALUE];
|
|
else {
|
|
var d = r.binarySearch(u, n, o.ENTRIES);
|
|
p = u[d + o.PREV_VALUE];
|
|
var f = u[d],
|
|
_ = this.getCurvePercent(d / o.ENTRIES - 1, 1 - (n - f) / (u[d + o.PREV_TIME] - f));
|
|
p += (u[d + o.VALUE] - p) * _
|
|
}
|
|
h == e.setup ? c.position = c.data.position + (p - c.data.position) * a : c.position += (p - c.position) * a
|
|
}
|
|
},
|
|
o.ENTRIES = 2,
|
|
o.PREV_TIME = -2,
|
|
o.PREV_VALUE = -1,
|
|
o.VALUE = 1,
|
|
o
|
|
}
|
|
(o);
|
|
t.PathConstraintPositionTimeline = w;
|
|
var x = function (t) {
|
|
function i(e) {
|
|
return t.call(this, e) || this
|
|
}
|
|
return s(i, t),
|
|
i.prototype.getPropertyId = function () {
|
|
return (n.pathConstraintSpacing << 24) + this.pathConstraintIndex
|
|
},
|
|
i.prototype.apply = function (t, n, o, s, a, h, l) {
|
|
var u = this.frames,
|
|
c = t.pathConstraints[this.pathConstraintIndex];
|
|
if (c.active)
|
|
if (o < u[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return void(c.spacing = c.data.spacing);
|
|
case e.first:
|
|
c.spacing += (c.data.spacing - c.spacing) * a
|
|
}
|
|
else {
|
|
var p = 0;
|
|
if (o >= u[u.length - i.ENTRIES])
|
|
p = u[u.length + i.PREV_VALUE];
|
|
else {
|
|
var d = r.binarySearch(u, o, i.ENTRIES);
|
|
p = u[d + i.PREV_VALUE];
|
|
var f = u[d],
|
|
_ = this.getCurvePercent(d / i.ENTRIES - 1, 1 - (o - f) / (u[d + i.PREV_TIME] - f));
|
|
p += (u[d + i.VALUE] - p) * _
|
|
}
|
|
h == e.setup ? c.spacing = c.data.spacing + (p - c.data.spacing) * a : c.spacing += (p - c.spacing) * a
|
|
}
|
|
},
|
|
i
|
|
}
|
|
(w);
|
|
t.PathConstraintSpacingTimeline = x;
|
|
var b = function (i) {
|
|
function o(e) {
|
|
var n = i.call(this, e) || this;
|
|
return n.frames = t.Utils.newFloatArray(e * o.ENTRIES),
|
|
n
|
|
}
|
|
return s(o, i),
|
|
o.prototype.getPropertyId = function () {
|
|
return (n.pathConstraintMix << 24) + this.pathConstraintIndex
|
|
},
|
|
o.prototype.setFrame = function (t, e, i, n) {
|
|
t *= o.ENTRIES,
|
|
this.frames[t] = e,
|
|
this.frames[t + o.ROTATE] = i,
|
|
this.frames[t + o.TRANSLATE] = n
|
|
},
|
|
o.prototype.apply = function (t, i, n, s, a, h, l) {
|
|
var u = this.frames,
|
|
c = t.pathConstraints[this.pathConstraintIndex];
|
|
if (c.active)
|
|
if (n < u[0])
|
|
switch (h) {
|
|
case e.setup:
|
|
return c.rotateMix = c.data.rotateMix,
|
|
void(c.translateMix = c.data.translateMix);
|
|
case e.first:
|
|
c.rotateMix += (c.data.rotateMix - c.rotateMix) * a,
|
|
c.translateMix += (c.data.translateMix - c.translateMix) * a
|
|
}
|
|
else {
|
|
var p = 0,
|
|
d = 0;
|
|
if (n >= u[u.length - o.ENTRIES])
|
|
p = u[u.length + o.PREV_ROTATE], d = u[u.length + o.PREV_TRANSLATE];
|
|
else {
|
|
var f = r.binarySearch(u, n, o.ENTRIES);
|
|
p = u[f + o.PREV_ROTATE],
|
|
d = u[f + o.PREV_TRANSLATE];
|
|
var _ = u[f],
|
|
m = this.getCurvePercent(f / o.ENTRIES - 1, 1 - (n - _) / (u[f + o.PREV_TIME] - _));
|
|
p += (u[f + o.ROTATE] - p) * m,
|
|
d += (u[f + o.TRANSLATE] - d) * m
|
|
}
|
|
h == e.setup ? (c.rotateMix = c.data.rotateMix + (p - c.data.rotateMix) * a, c.translateMix = c.data.translateMix + (d - c.data.translateMix) * a) : (c.rotateMix += (p - c.rotateMix) * a, c.translateMix += (d - c.translateMix) * a)
|
|
}
|
|
},
|
|
o.ENTRIES = 3,
|
|
o.PREV_TIME = -3,
|
|
o.PREV_ROTATE = -2,
|
|
o.PREV_TRANSLATE = -1,
|
|
o.ROTATE = 1,
|
|
o.TRANSLATE = 2,
|
|
o
|
|
}
|
|
(o);
|
|
t.PathConstraintMixTimeline = b
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(e) {
|
|
this.tracks = new Array,
|
|
this.timeScale = 1,
|
|
this.events = new Array,
|
|
this.listeners = new Array,
|
|
this.queue = new r(this),
|
|
this.propertyIDs = new t.IntSet,
|
|
this.animationsChanged = !1,
|
|
this.trackEntryPool = new t.Pool((function () {
|
|
return new i
|
|
})),
|
|
this.data = e
|
|
}
|
|
return e.prototype.update = function (t) {
|
|
t *= this.timeScale;
|
|
for (var e = this.tracks, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (null != r) {
|
|
r.animationLast = r.nextAnimationLast,
|
|
r.trackLast = r.nextTrackLast;
|
|
var o = t * r.timeScale;
|
|
if (r.delay > 0) {
|
|
if (r.delay -= o, r.delay > 0)
|
|
continue;
|
|
o = -r.delay,
|
|
r.delay = 0
|
|
}
|
|
var s = r.next;
|
|
if (null != s) {
|
|
var a = r.trackLast - s.delay;
|
|
if (a >= 0) {
|
|
for (s.delay = 0, s.trackTime += 0 == r.timeScale ? 0 : (a / r.timeScale + t) * s.timeScale, r.trackTime += o, this.setCurrent(i, s, !0); null != s.mixingFrom; )
|
|
s.mixTime += t, s = s.mixingFrom;
|
|
continue
|
|
}
|
|
} else if (r.trackLast >= r.trackEnd && null == r.mixingFrom) {
|
|
e[i] = null,
|
|
this.queue.end(r),
|
|
this.disposeNext(r);
|
|
continue
|
|
}
|
|
if (null != r.mixingFrom && this.updateMixingFrom(r, t)) {
|
|
var h = r.mixingFrom;
|
|
for (r.mixingFrom = null, null != h && (h.mixingTo = null); null != h; )
|
|
this.queue.end(h), h = h.mixingFrom
|
|
}
|
|
r.trackTime += o
|
|
}
|
|
}
|
|
this.queue.drain()
|
|
},
|
|
e.prototype.updateMixingFrom = function (t, e) {
|
|
var i = t.mixingFrom;
|
|
if (null == i)
|
|
return !0;
|
|
var n = this.updateMixingFrom(i, e);
|
|
return i.animationLast = i.nextAnimationLast,
|
|
i.trackLast = i.nextTrackLast,
|
|
t.mixTime > 0 && t.mixTime >= t.mixDuration ? (0 != i.totalAlpha && 0 != t.mixDuration || (t.mixingFrom = i.mixingFrom, null != i.mixingFrom && (i.mixingFrom.mixingTo = t), t.interruptAlpha = i.interruptAlpha, this.queue.end(i)), n) : (i.trackTime += e * i.timeScale, t.mixTime += e, !1)
|
|
},
|
|
e.prototype.apply = function (i) {
|
|
if (null == i)
|
|
throw new Error("skeleton cannot be null.");
|
|
this.animationsChanged && this._animationsChanged();
|
|
for (var n = this.events, r = this.tracks, o = !1, s = 0, a = r.length; s < a; s++) {
|
|
var h = r[s];
|
|
if (!(null == h || h.delay > 0)) {
|
|
o = !0;
|
|
var l = 0 == s ? t.MixBlend.first : h.mixBlend,
|
|
u = h.alpha;
|
|
null != h.mixingFrom ? u *= this.applyMixingFrom(h, i, l) : h.trackTime >= h.trackEnd && null == h.next && (u = 0);
|
|
var c = h.animationLast,
|
|
p = h.getAnimationTime(),
|
|
d = h.animation.timelines.length,
|
|
f = h.animation.timelines;
|
|
if (0 == s && 1 == u || l == t.MixBlend.add)
|
|
for (var _ = 0; _ < d; _++)
|
|
t.Utils.webkit602BugfixHelper(u, l), f[_].apply(i, c, p, n, u, l, t.MixDirection.mixIn);
|
|
else {
|
|
var m = h.timelineMode,
|
|
y = 0 == h.timelinesRotation.length;
|
|
y && t.Utils.setArraySize(h.timelinesRotation, d << 1, null);
|
|
var g = h.timelinesRotation;
|
|
for (_ = 0; _ < d; _++) {
|
|
var v = f[_],
|
|
w = (m[_] & e.NOT_LAST - 1) == e.SUBSEQUENT ? l : t.MixBlend.setup;
|
|
v instanceof t.RotateTimeline ? this.applyRotateTimeline(v, i, p, u, w, g, _ << 1, y) : (t.Utils.webkit602BugfixHelper(u, l), v.apply(i, c, p, n, u, w, t.MixDirection.mixIn))
|
|
}
|
|
}
|
|
this.queueEvents(h, p),
|
|
n.length = 0,
|
|
h.nextAnimationLast = p,
|
|
h.nextTrackLast = h.trackTime
|
|
}
|
|
}
|
|
return this.queue.drain(),
|
|
o
|
|
},
|
|
e.prototype.applyMixingFrom = function (i, n, r) {
|
|
var o = i.mixingFrom;
|
|
null != o.mixingFrom && this.applyMixingFrom(o, n, r);
|
|
var s = 0;
|
|
0 == i.mixDuration ? (s = 1, r == t.MixBlend.first && (r = t.MixBlend.setup)) : ((s = i.mixTime / i.mixDuration) > 1 && (s = 1), r != t.MixBlend.first && (r = o.mixBlend));
|
|
var a = s < o.eventThreshold ? this.events : null,
|
|
h = s < o.attachmentThreshold,
|
|
l = s < o.drawOrderThreshold,
|
|
u = o.animationLast,
|
|
c = o.getAnimationTime(),
|
|
p = o.animation.timelines.length,
|
|
d = o.animation.timelines,
|
|
f = o.alpha * i.interruptAlpha,
|
|
_ = f * (1 - s);
|
|
if (r == t.MixBlend.add)
|
|
for (var m = 0; m < p; m++)
|
|
d[m].apply(n, u, c, a, _, r, t.MixDirection.mixOut);
|
|
else {
|
|
var y = o.timelineMode,
|
|
g = o.timelineHoldMix,
|
|
v = 0 == o.timelinesRotation.length;
|
|
v && t.Utils.setArraySize(o.timelinesRotation, p << 1, null);
|
|
var w = o.timelinesRotation;
|
|
o.totalAlpha = 0;
|
|
for (m = 0; m < p; m++) {
|
|
var x = d[m],
|
|
b = t.MixDirection.mixOut,
|
|
E = void 0,
|
|
$ = 0;
|
|
switch (y[m] & e.NOT_LAST - 1) {
|
|
case e.SUBSEQUENT:
|
|
if (E = r, !h && x instanceof t.AttachmentTimeline) {
|
|
if ((y[m] & e.NOT_LAST) == e.NOT_LAST)
|
|
continue;
|
|
E = t.MixBlend.setup
|
|
}
|
|
if (!l && x instanceof t.DrawOrderTimeline)
|
|
continue;
|
|
$ = _;
|
|
break;
|
|
case e.FIRST:
|
|
E = t.MixBlend.setup,
|
|
$ = _;
|
|
break;
|
|
case e.HOLD:
|
|
E = t.MixBlend.setup,
|
|
$ = f;
|
|
break;
|
|
default:
|
|
E = t.MixBlend.setup;
|
|
var A = g[m];
|
|
$ = f * Math.max(0, 1 - A.mixTime / A.mixDuration)
|
|
}
|
|
o.totalAlpha += $,
|
|
x instanceof t.RotateTimeline ? this.applyRotateTimeline(x, n, c, $, E, w, m << 1, v) : (t.Utils.webkit602BugfixHelper($, r), E == t.MixBlend.setup && (x instanceof t.AttachmentTimeline ? (h || (y[m] & e.NOT_LAST) == e.NOT_LAST) && (b = t.MixDirection.mixIn) : x instanceof t.DrawOrderTimeline && l && (b = t.MixDirection.mixIn)), x.apply(n, u, c, a, $, E, b))
|
|
}
|
|
}
|
|
return i.mixDuration > 0 && this.queueEvents(o, c),
|
|
this.events.length = 0,
|
|
o.nextAnimationLast = c,
|
|
o.nextTrackLast = o.trackTime,
|
|
s
|
|
},
|
|
e.prototype.applyRotateTimeline = function (e, i, n, r, o, s, a, h) {
|
|
if (h && (s[a] = 0), 1 != r) {
|
|
var l = e,
|
|
u = l.frames,
|
|
c = i.bones[l.boneIndex];
|
|
if (c.active) {
|
|
var p = 0,
|
|
d = 0;
|
|
if (n < u[0])
|
|
switch (o) {
|
|
case t.MixBlend.setup:
|
|
c.rotation = c.data.rotation;
|
|
default:
|
|
return;
|
|
case t.MixBlend.first:
|
|
p = c.rotation,
|
|
d = c.data.rotation
|
|
}
|
|
else if (p = o == t.MixBlend.setup ? c.data.rotation : c.rotation, n >= u[u.length - t.RotateTimeline.ENTRIES])
|
|
d = c.data.rotation + u[u.length + t.RotateTimeline.PREV_ROTATION];
|
|
else {
|
|
var f = t.Animation.binarySearch(u, n, t.RotateTimeline.ENTRIES),
|
|
_ = u[f + t.RotateTimeline.PREV_ROTATION],
|
|
m = u[f],
|
|
y = l.getCurvePercent((f >> 1) - 1, 1 - (n - m) / (u[f + t.RotateTimeline.PREV_TIME] - m));
|
|
d = u[f + t.RotateTimeline.ROTATION] - _,
|
|
d = _ + (d -= 360 * (16384 - (16384.499999999996 - d / 360 | 0))) * y + c.data.rotation,
|
|
d -= 360 * (16384 - (16384.499999999996 - d / 360 | 0))
|
|
}
|
|
var g = 0,
|
|
v = d - p;
|
|
if (0 == (v -= 360 * (16384 - (16384.499999999996 - v / 360 | 0))))
|
|
g = s[a];
|
|
else {
|
|
var w = 0,
|
|
x = 0;
|
|
h ? (w = 0, x = v) : (w = s[a], x = s[a + 1]);
|
|
var b = v > 0,
|
|
E = w >= 0;
|
|
t.MathUtils.signum(x) != t.MathUtils.signum(v) && Math.abs(x) <= 90 && (Math.abs(w) > 180 && (w += 360 * t.MathUtils.signum(w)), E = b),
|
|
g = v + w - w % 360,
|
|
E != b && (g += 360 * t.MathUtils.signum(w)),
|
|
s[a] = g
|
|
}
|
|
s[a + 1] = v,
|
|
p += g * r,
|
|
c.rotation = p - 360 * (16384 - (16384.499999999996 - p / 360 | 0))
|
|
}
|
|
} else
|
|
e.apply(i, 0, n, null, 1, o, t.MixDirection.mixIn)
|
|
},
|
|
e.prototype.queueEvents = function (t, e) {
|
|
for (var i = t.animationStart, n = t.animationEnd, r = n - i, o = t.trackLast % r, s = this.events, a = 0, h = s.length; a < h; a++) {
|
|
var l = s[a];
|
|
if (l.time < o)
|
|
break;
|
|
l.time > n || this.queue.event(t, l)
|
|
}
|
|
for ((t.loop ? 0 == r || o > t.trackTime % r : e >= n && t.animationLast < n) && this.queue.complete(t); a < h; a++) {
|
|
s[a].time < i || this.queue.event(t, s[a])
|
|
}
|
|
},
|
|
e.prototype.clearTracks = function () {
|
|
var t = this.queue.drainDisabled;
|
|
this.queue.drainDisabled = !0;
|
|
for (var e = 0, i = this.tracks.length; e < i; e++)
|
|
this.clearTrack(e);
|
|
this.tracks.length = 0,
|
|
this.queue.drainDisabled = t,
|
|
this.queue.drain()
|
|
},
|
|
e.prototype.clearTrack = function (t) {
|
|
if (!(t >= this.tracks.length)) {
|
|
var e = this.tracks[t];
|
|
if (null != e) {
|
|
this.queue.end(e),
|
|
this.disposeNext(e);
|
|
for (var i = e; ; ) {
|
|
var n = i.mixingFrom;
|
|
if (null == n)
|
|
break;
|
|
this.queue.end(n),
|
|
i.mixingFrom = null,
|
|
i.mixingTo = null,
|
|
i = n
|
|
}
|
|
this.tracks[e.trackIndex] = null,
|
|
this.queue.drain()
|
|
}
|
|
}
|
|
},
|
|
e.prototype.setCurrent = function (t, e, i) {
|
|
var n = this.expandToIndex(t);
|
|
this.tracks[t] = e,
|
|
null != n && (i && this.queue.interrupt(n), e.mixingFrom = n, n.mixingTo = e, e.mixTime = 0, null != n.mixingFrom && n.mixDuration > 0 && (e.interruptAlpha *= Math.min(1, n.mixTime / n.mixDuration)), n.timelinesRotation.length = 0),
|
|
this.queue.start(e)
|
|
},
|
|
e.prototype.setAnimation = function (t, e, i) {
|
|
var n = this.data.skeletonData.findAnimation(e);
|
|
if (null == n)
|
|
throw new Error("Animation not found: " + e);
|
|
return this.setAnimationWith(t, n, i)
|
|
},
|
|
e.prototype.setAnimationWith = function (t, e, i) {
|
|
if (null == e)
|
|
throw new Error("animation cannot be null.");
|
|
var n = !0,
|
|
r = this.expandToIndex(t);
|
|
null != r && (-1 == r.nextTrackLast ? (this.tracks[t] = r.mixingFrom, this.queue.interrupt(r), this.queue.end(r), this.disposeNext(r), r = r.mixingFrom, n = !1) : this.disposeNext(r));
|
|
var o = this.trackEntry(t, e, i, r);
|
|
return this.setCurrent(t, o, n),
|
|
this.queue.drain(),
|
|
o
|
|
},
|
|
e.prototype.addAnimation = function (t, e, i, n) {
|
|
var r = this.data.skeletonData.findAnimation(e);
|
|
if (null == r)
|
|
throw new Error("Animation not found: " + e);
|
|
return this.addAnimationWith(t, r, i, n)
|
|
},
|
|
e.prototype.addAnimationWith = function (t, e, i, n) {
|
|
if (null == e)
|
|
throw new Error("animation cannot be null.");
|
|
var r = this.expandToIndex(t);
|
|
if (null != r)
|
|
for (; null != r.next; )
|
|
r = r.next;
|
|
var o = this.trackEntry(t, e, i, r);
|
|
if (null == r)
|
|
this.setCurrent(t, o, !0), this.queue.drain();
|
|
else if (r.next = o, n <= 0) {
|
|
var s = r.animationEnd - r.animationStart;
|
|
0 != s ? (r.loop ? n += s * (1 + (r.trackTime / s | 0)) : n += Math.max(s, r.trackTime), n -= this.data.getMix(r.animation, e)) : n = r.trackTime
|
|
}
|
|
return o.delay = n,
|
|
o
|
|
},
|
|
e.prototype.setEmptyAnimation = function (t, i) {
|
|
var n = this.setAnimationWith(t, e.emptyAnimation, !1);
|
|
return n.mixDuration = i,
|
|
n.trackEnd = i,
|
|
n
|
|
},
|
|
e.prototype.addEmptyAnimation = function (t, i, n) {
|
|
n <= 0 && (n -= i);
|
|
var r = this.addAnimationWith(t, e.emptyAnimation, !1, n);
|
|
return r.mixDuration = i,
|
|
r.trackEnd = i,
|
|
r
|
|
},
|
|
e.prototype.setEmptyAnimations = function (t) {
|
|
var e = this.queue.drainDisabled;
|
|
this.queue.drainDisabled = !0;
|
|
for (var i = 0, n = this.tracks.length; i < n; i++) {
|
|
var r = this.tracks[i];
|
|
null != r && this.setEmptyAnimation(r.trackIndex, t)
|
|
}
|
|
this.queue.drainDisabled = e,
|
|
this.queue.drain()
|
|
},
|
|
e.prototype.expandToIndex = function (e) {
|
|
return e < this.tracks.length ? this.tracks[e] : (t.Utils.ensureArrayCapacity(this.tracks, e + 1, null), this.tracks.length = e + 1, null)
|
|
},
|
|
e.prototype.trackEntry = function (e, i, n, r) {
|
|
var o = this.trackEntryPool.obtain();
|
|
return o.trackIndex = e,
|
|
o.animation = i,
|
|
o.loop = n,
|
|
o.holdPrevious = !1,
|
|
o.eventThreshold = 0,
|
|
o.attachmentThreshold = 0,
|
|
o.drawOrderThreshold = 0,
|
|
o.animationStart = 0,
|
|
o.animationEnd = i.duration,
|
|
o.animationLast = -1,
|
|
o.nextAnimationLast = -1,
|
|
o.delay = 0,
|
|
o.trackTime = 0,
|
|
o.trackLast = -1,
|
|
o.nextTrackLast = -1,
|
|
o.trackEnd = Number.MAX_VALUE,
|
|
o.timeScale = 1,
|
|
o.alpha = 1,
|
|
o.interruptAlpha = 1,
|
|
o.mixTime = 0,
|
|
o.mixDuration = null == r ? 0 : this.data.getMix(r.animation, i),
|
|
o.mixBlend = t.MixBlend.replace,
|
|
o
|
|
},
|
|
e.prototype.disposeNext = function (t) {
|
|
for (var e = t.next; null != e; )
|
|
this.queue.dispose(e), e = e.next;
|
|
t.next = null
|
|
},
|
|
e.prototype._animationsChanged = function () {
|
|
this.animationsChanged = !1,
|
|
this.propertyIDs.clear();
|
|
for (var e = 0, i = this.tracks.length; e < i; e++) {
|
|
if (null != (n = this.tracks[e])) {
|
|
for (; null != n.mixingFrom; )
|
|
n = n.mixingFrom;
|
|
do {
|
|
null != n.mixingFrom && n.mixBlend == t.MixBlend.add || this.computeHold(n),
|
|
n = n.mixingTo
|
|
} while (null != n)
|
|
}
|
|
}
|
|
this.propertyIDs.clear();
|
|
for (e = this.tracks.length - 1; e >= 0; e--)
|
|
for (var n = this.tracks[e]; null != n; )
|
|
this.computeNotLast(n), n = n.mixingFrom
|
|
},
|
|
e.prototype.computeHold = function (i) {
|
|
var n = i.mixingTo,
|
|
r = i.animation.timelines,
|
|
o = i.animation.timelines.length,
|
|
s = t.Utils.setArraySize(i.timelineMode, o);
|
|
i.timelineHoldMix.length = 0;
|
|
var a = t.Utils.setArraySize(i.timelineHoldMix, o),
|
|
h = this.propertyIDs;
|
|
if (null != n && n.holdPrevious)
|
|
for (var l = 0; l < o; l++)
|
|
h.add(r[l].getPropertyId()), s[l] = e.HOLD;
|
|
else
|
|
t: for (l = 0; l < o; l++) {
|
|
var u = r[l],
|
|
c = u.getPropertyId();
|
|
if (h.add(c))
|
|
if (null == n || u instanceof t.AttachmentTimeline || u instanceof t.DrawOrderTimeline || u instanceof t.EventTimeline || !n.animation.hasTimeline(c))
|
|
s[l] = e.FIRST;
|
|
else {
|
|
for (var p = n.mixingTo; null != p; p = p.mixingTo)
|
|
if (!p.animation.hasTimeline(c)) {
|
|
if (i.mixDuration > 0) {
|
|
s[l] = e.HOLD_MIX,
|
|
a[l] = p;
|
|
continue t
|
|
}
|
|
break
|
|
}
|
|
s[l] = e.HOLD
|
|
}
|
|
else
|
|
s[l] = e.SUBSEQUENT
|
|
}
|
|
},
|
|
e.prototype.computeNotLast = function (i) {
|
|
for (var n = i.animation.timelines, r = i.animation.timelines.length, o = i.timelineMode, s = this.propertyIDs, a = 0; a < r; a++)
|
|
if (n[a]instanceof t.AttachmentTimeline) {
|
|
var h = n[a];
|
|
s.add(h.slotIndex) || (o[a] |= e.NOT_LAST)
|
|
}
|
|
},
|
|
e.prototype.getCurrent = function (t) {
|
|
return t >= this.tracks.length ? null : this.tracks[t]
|
|
},
|
|
e.prototype.addListener = function (t) {
|
|
if (null == t)
|
|
throw new Error("listener cannot be null.");
|
|
this.listeners.push(t)
|
|
},
|
|
e.prototype.removeListener = function (t) {
|
|
var e = this.listeners.indexOf(t);
|
|
e >= 0 && this.listeners.splice(e, 1)
|
|
},
|
|
e.prototype.clearListeners = function () {
|
|
this.listeners.length = 0
|
|
},
|
|
e.prototype.clearListenerNotifications = function () {
|
|
this.queue.clear()
|
|
},
|
|
e.prototype.setAnimationByName = function (t, i, n) {
|
|
e.deprecatedWarning1 || (e.deprecatedWarning1 = !0, console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),
|
|
this.setAnimation(t, i, n)
|
|
},
|
|
e.prototype.addAnimationByName = function (t, i, n, r) {
|
|
e.deprecatedWarning2 || (e.deprecatedWarning2 = !0, console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),
|
|
this.addAnimation(t, i, n, r)
|
|
},
|
|
e.prototype.hasAnimation = function (t) {
|
|
return null !== this.data.skeletonData.findAnimation(t)
|
|
},
|
|
e.prototype.hasAnimationByName = function (t) {
|
|
return e.deprecatedWarning3 || (e.deprecatedWarning3 = !0, console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),
|
|
this.hasAnimation(t)
|
|
},
|
|
e.emptyAnimation = new t.Animation("<empty>", [], 0),
|
|
e.SUBSEQUENT = 0,
|
|
e.FIRST = 1,
|
|
e.HOLD = 2,
|
|
e.HOLD_MIX = 3,
|
|
e.NOT_LAST = 4,
|
|
e.deprecatedWarning1 = !1,
|
|
e.deprecatedWarning2 = !1,
|
|
e.deprecatedWarning3 = !1,
|
|
e
|
|
}
|
|
();
|
|
t.AnimationState = e;
|
|
var i = function () {
|
|
function e() {
|
|
this.mixBlend = t.MixBlend.replace,
|
|
this.timelineMode = new Array,
|
|
this.timelineHoldMix = new Array,
|
|
this.timelinesRotation = new Array
|
|
}
|
|
return e.prototype.reset = function () {
|
|
this.next = null,
|
|
this.mixingFrom = null,
|
|
this.mixingTo = null,
|
|
this.animation = null,
|
|
this.listener = null,
|
|
this.timelineMode.length = 0,
|
|
this.timelineHoldMix.length = 0,
|
|
this.timelinesRotation.length = 0
|
|
},
|
|
e.prototype.getAnimationTime = function () {
|
|
if (this.loop) {
|
|
var t = this.animationEnd - this.animationStart;
|
|
return 0 == t ? this.animationStart : this.trackTime % t + this.animationStart
|
|
}
|
|
return Math.min(this.trackTime + this.animationStart, this.animationEnd)
|
|
},
|
|
e.prototype.setAnimationLast = function (t) {
|
|
this.animationLast = t,
|
|
this.nextAnimationLast = t
|
|
},
|
|
e.prototype.isComplete = function () {
|
|
return this.trackTime >= this.animationEnd - this.animationStart
|
|
},
|
|
e.prototype.resetRotationDirections = function () {
|
|
this.timelinesRotation.length = 0
|
|
},
|
|
Object.defineProperty(e.prototype, "time", {
|
|
get: function () {
|
|
return e.deprecatedWarning1 || (e.deprecatedWarning1 = !0, console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),
|
|
this.trackTime
|
|
},
|
|
set: function (t) {
|
|
e.deprecatedWarning1 || (e.deprecatedWarning1 = !0, console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),
|
|
this.trackTime = t
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(e.prototype, "endTime", {
|
|
get: function () {
|
|
return e.deprecatedWarning2 || (e.deprecatedWarning2 = !0, console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),
|
|
this.trackTime
|
|
},
|
|
set: function (t) {
|
|
e.deprecatedWarning2 || (e.deprecatedWarning2 = !0, console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),
|
|
this.trackTime = t
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
e.prototype.loopsCount = function () {
|
|
return Math.floor(this.trackTime / this.trackEnd)
|
|
},
|
|
e.deprecatedWarning1 = !1,
|
|
e.deprecatedWarning2 = !1,
|
|
e
|
|
}
|
|
();
|
|
t.TrackEntry = i;
|
|
var n,
|
|
r = function () {
|
|
function e(t) {
|
|
this.objects = [],
|
|
this.drainDisabled = !1,
|
|
this.animState = t
|
|
}
|
|
return e.prototype.start = function (t) {
|
|
this.objects.push(n.start),
|
|
this.objects.push(t),
|
|
this.animState.animationsChanged = !0
|
|
},
|
|
e.prototype.interrupt = function (t) {
|
|
this.objects.push(n.interrupt),
|
|
this.objects.push(t)
|
|
},
|
|
e.prototype.end = function (t) {
|
|
this.objects.push(n.end),
|
|
this.objects.push(t),
|
|
this.animState.animationsChanged = !0
|
|
},
|
|
e.prototype.dispose = function (t) {
|
|
this.objects.push(n.dispose),
|
|
this.objects.push(t)
|
|
},
|
|
e.prototype.complete = function (t) {
|
|
this.objects.push(n.complete),
|
|
this.objects.push(t)
|
|
},
|
|
e.prototype.event = function (t, e) {
|
|
this.objects.push(n.event),
|
|
this.objects.push(t),
|
|
this.objects.push(e)
|
|
},
|
|
e.prototype.deprecateStuff = function () {
|
|
return e.deprecatedWarning1 || (e.deprecatedWarning1 = !0, console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),
|
|
!0
|
|
},
|
|
e.prototype.drain = function () {
|
|
if (!this.drainDisabled) {
|
|
this.drainDisabled = !0;
|
|
for (var e = this.objects, i = this.animState.listeners, r = 0; r < e.length; r += 2) {
|
|
var o = e[r],
|
|
s = e[r + 1];
|
|
switch (o) {
|
|
case n.start:
|
|
null != s.listener && s.listener.start && s.listener.start(s);
|
|
for (var a = 0; a < i.length; a++)
|
|
i[a].start && i[a].start(s);
|
|
s.onStart && this.deprecateStuff() && s.onStart(s.trackIndex),
|
|
this.animState.onStart && this.deprecateStuff() && this.deprecateStuff && this.animState.onStart(s.trackIndex);
|
|
break;
|
|
case n.interrupt:
|
|
null != s.listener && s.listener.interrupt && s.listener.interrupt(s);
|
|
for (a = 0; a < i.length; a++)
|
|
i[a].interrupt && i[a].interrupt(s);
|
|
break;
|
|
case n.end:
|
|
null != s.listener && s.listener.end && s.listener.end(s);
|
|
for (a = 0; a < i.length; a++)
|
|
i[a].end && i[a].end(s);
|
|
s.onEnd && this.deprecateStuff() && s.onEnd(s.trackIndex),
|
|
this.animState.onEnd && this.deprecateStuff() && this.animState.onEnd(s.trackIndex);
|
|
case n.dispose:
|
|
null != s.listener && s.listener.dispose && s.listener.dispose(s);
|
|
for (a = 0; a < i.length; a++)
|
|
i[a].dispose && i[a].dispose(s);
|
|
this.animState.trackEntryPool.free(s);
|
|
break;
|
|
case n.complete:
|
|
null != s.listener && s.listener.complete && s.listener.complete(s);
|
|
for (a = 0; a < i.length; a++)
|
|
i[a].complete && i[a].complete(s);
|
|
var h = t.MathUtils.toInt(s.loopsCount());
|
|
s.onComplete && this.deprecateStuff() && s.onComplete(s.trackIndex, h),
|
|
this.animState.onComplete && this.deprecateStuff() && this.animState.onComplete(s.trackIndex, h);
|
|
break;
|
|
case n.event:
|
|
var l = e[2 + r++];
|
|
null != s.listener && s.listener.event && s.listener.event(s, l);
|
|
for (a = 0; a < i.length; a++)
|
|
i[a].event && i[a].event(s, l);
|
|
s.onEvent && this.deprecateStuff() && s.onEvent(s.trackIndex, l),
|
|
this.animState.onEvent && this.deprecateStuff() && this.animState.onEvent(s.trackIndex, l)
|
|
}
|
|
}
|
|
this.clear(),
|
|
this.drainDisabled = !1
|
|
}
|
|
},
|
|
e.prototype.clear = function () {
|
|
this.objects.length = 0
|
|
},
|
|
e.deprecatedWarning1 = !1,
|
|
e
|
|
}
|
|
();
|
|
t.EventQueue = r,
|
|
function (t) {
|
|
t[t.start = 0] = "start",
|
|
t[t.interrupt = 1] = "interrupt",
|
|
t[t.end = 2] = "end",
|
|
t[t.dispose = 3] = "dispose",
|
|
t[t.complete = 4] = "complete",
|
|
t[t.event = 5] = "event"
|
|
}
|
|
(n = t.EventType || (t.EventType = {}));
|
|
var o = function () {
|
|
function t() {}
|
|
return t.prototype.start = function (t) {},
|
|
t.prototype.interrupt = function (t) {},
|
|
t.prototype.end = function (t) {},
|
|
t.prototype.dispose = function (t) {},
|
|
t.prototype.complete = function (t) {},
|
|
t.prototype.event = function (t, e) {},
|
|
t
|
|
}
|
|
();
|
|
t.AnimationStateAdapter = o
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function t(t) {
|
|
if (this.animationToMixTime = {}, this.defaultMix = 0, null == t)
|
|
throw new Error("skeletonData cannot be null.");
|
|
this.skeletonData = t
|
|
}
|
|
return t.prototype.setMix = function (t, e, i) {
|
|
var n = this.skeletonData.findAnimation(t);
|
|
if (null == n)
|
|
throw new Error("Animation not found: " + t);
|
|
var r = this.skeletonData.findAnimation(e);
|
|
if (null == r)
|
|
throw new Error("Animation not found: " + e);
|
|
this.setMixWith(n, r, i)
|
|
},
|
|
t.prototype.setMixByName = function (e, i, n) {
|
|
t.deprecatedWarning1 || (t.deprecatedWarning1 = !0, console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),
|
|
this.setMix(e, i, n)
|
|
},
|
|
t.prototype.setMixWith = function (t, e, i) {
|
|
if (null == t)
|
|
throw new Error("from cannot be null.");
|
|
if (null == e)
|
|
throw new Error("to cannot be null.");
|
|
var n = t.name + "." + e.name;
|
|
this.animationToMixTime[n] = i
|
|
},
|
|
t.prototype.getMix = function (t, e) {
|
|
var i = t.name + "." + e.name,
|
|
n = this.animationToMixTime[i];
|
|
return void 0 === n ? this.defaultMix : n
|
|
},
|
|
t.deprecatedWarning1 = !1,
|
|
t
|
|
}
|
|
();
|
|
t.AnimationStateData = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t) {
|
|
this.atlas = t
|
|
}
|
|
return e.prototype.newRegionAttachment = function (e, i, n) {
|
|
var r = this.atlas.findRegion(n);
|
|
if (null == r)
|
|
throw new Error("Region not found in atlas: " + n + " (region attachment: " + i + ")");
|
|
var o = new t.RegionAttachment(i);
|
|
return o.region = r,
|
|
o
|
|
},
|
|
e.prototype.newMeshAttachment = function (e, i, n) {
|
|
var r = this.atlas.findRegion(n);
|
|
if (null == r)
|
|
throw new Error("Region not found in atlas: " + n + " (mesh attachment: " + i + ")");
|
|
var o = new t.MeshAttachment(i);
|
|
return o.region = r,
|
|
o
|
|
},
|
|
e.prototype.newBoundingBoxAttachment = function (e, i) {
|
|
return new t.BoundingBoxAttachment(i)
|
|
},
|
|
e.prototype.newPathAttachment = function (e, i) {
|
|
return new t.PathAttachment(i)
|
|
},
|
|
e.prototype.newPointAttachment = function (e, i) {
|
|
return new t.PointAttachment(i)
|
|
},
|
|
e.prototype.newClippingAttachment = function (e, i) {
|
|
return new t.ClippingAttachment(i)
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.AtlasAttachmentLoader = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
!function (t) {
|
|
t[t.Normal = 0] = "Normal",
|
|
t[t.Additive = 1] = "Additive",
|
|
t[t.Multiply = 2] = "Multiply",
|
|
t[t.Screen = 3] = "Screen"
|
|
}
|
|
(t.BlendMode || (t.BlendMode = {}))
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t, e, i) {
|
|
if (this.matrix = new PIXI.Matrix, this.children = new Array, this.x = 0, this.y = 0, this.rotation = 0, this.scaleX = 0, this.scaleY = 0, this.shearX = 0, this.shearY = 0, this.ax = 0, this.ay = 0, this.arotation = 0, this.ascaleX = 0, this.ascaleY = 0, this.ashearX = 0, this.ashearY = 0, this.appliedValid = !1, this.sorted = !1, this.active = !1, null == t)
|
|
throw new Error("data cannot be null.");
|
|
if (null == e)
|
|
throw new Error("skeleton cannot be null.");
|
|
this.data = t,
|
|
this.skeleton = e,
|
|
this.parent = i,
|
|
this.setToSetupPose()
|
|
}
|
|
return Object.defineProperty(e.prototype, "worldX", {
|
|
get: function () {
|
|
return this.matrix.tx
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(e.prototype, "worldY", {
|
|
get: function () {
|
|
return this.matrix.ty
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
e.prototype.isActive = function () {
|
|
return this.active
|
|
},
|
|
e.prototype.update = function () {
|
|
this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY)
|
|
},
|
|
e.prototype.updateWorldTransform = function () {
|
|
this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY)
|
|
},
|
|
e.prototype.updateWorldTransformWith = function (i, n, r, o, s, a, h) {
|
|
this.ax = i,
|
|
this.ay = n,
|
|
this.arotation = r,
|
|
this.ascaleX = o,
|
|
this.ascaleY = s,
|
|
this.ashearX = a,
|
|
this.ashearY = h,
|
|
this.appliedValid = !0;
|
|
var l = this.parent,
|
|
u = this.matrix,
|
|
c = this.skeleton.scaleX,
|
|
p = e.yDown ? -this.skeleton.scaleY : this.skeleton.scaleY;
|
|
if (null == l) {
|
|
var d = this.skeleton,
|
|
f = r + 90 + h;
|
|
return u.a = t.MathUtils.cosDeg(r + a) * o * c,
|
|
u.c = t.MathUtils.cosDeg(f) * s * c,
|
|
u.b = t.MathUtils.sinDeg(r + a) * o * p,
|
|
u.d = t.MathUtils.sinDeg(f) * s * p,
|
|
u.tx = i * c + d.x,
|
|
void(u.ty = n * p + d.y)
|
|
}
|
|
var _ = l.matrix.a,
|
|
m = l.matrix.c,
|
|
y = l.matrix.b,
|
|
g = l.matrix.d;
|
|
switch (u.tx = _ * i + m * n + l.matrix.tx, u.ty = y * i + g * n + l.matrix.ty, this.data.transformMode) {
|
|
case t.TransformMode.Normal:
|
|
f = r + 90 + h;
|
|
var v = t.MathUtils.cosDeg(r + a) * o,
|
|
w = t.MathUtils.cosDeg(f) * s,
|
|
x = t.MathUtils.sinDeg(r + a) * o,
|
|
b = t.MathUtils.sinDeg(f) * s;
|
|
return u.a = _ * v + m * x,
|
|
u.c = _ * w + m * b,
|
|
u.b = y * v + g * x,
|
|
void(u.d = y * w + g * b);
|
|
case t.TransformMode.OnlyTranslation:
|
|
f = r + 90 + h;
|
|
u.a = t.MathUtils.cosDeg(r + a) * o,
|
|
u.c = t.MathUtils.cosDeg(f) * s,
|
|
u.b = t.MathUtils.sinDeg(r + a) * o,
|
|
u.d = t.MathUtils.sinDeg(f) * s;
|
|
break;
|
|
case t.TransformMode.NoRotationOrReflection:
|
|
var E = 0;
|
|
(S = _ * _ + y * y) > 1e-4 ? (m = y * (S = Math.abs(_ * g - m * y) / S), g = _ * S, E = Math.atan2(y, _) * t.MathUtils.radDeg) : (_ = 0, y = 0, E = 90 - Math.atan2(g, m) * t.MathUtils.radDeg);
|
|
var $ = r + a - E,
|
|
A = r + h - E + 90;
|
|
v = t.MathUtils.cosDeg($) * o,
|
|
w = t.MathUtils.cosDeg(A) * s,
|
|
x = t.MathUtils.sinDeg($) * o,
|
|
b = t.MathUtils.sinDeg(A) * s;
|
|
u.a = _ * v - m * x,
|
|
u.c = _ * w - m * b,
|
|
u.b = y * v + g * x,
|
|
u.d = y * w + g * b;
|
|
break;
|
|
case t.TransformMode.NoScale:
|
|
case t.TransformMode.NoScaleOrReflection:
|
|
var S,
|
|
T = t.MathUtils.cosDeg(r),
|
|
C = t.MathUtils.sinDeg(r),
|
|
M = (_ * T + m * C) / c,
|
|
I = (y * T + g * C) / p;
|
|
(S = Math.sqrt(M * M + I * I)) > 1e-5 && (S = 1 / S),
|
|
M *= S,
|
|
I *= S,
|
|
S = Math.sqrt(M * M + I * I),
|
|
this.data.transformMode == t.TransformMode.NoScale && _ * g - m * y < 0 != (e.yDown ? this.skeleton.scaleX < 0 != this.skeleton.scaleY > 0 : this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0) && (S = -S);
|
|
var P = Math.PI / 2 + Math.atan2(I, M),
|
|
O = Math.cos(P) * S,
|
|
R = Math.sin(P) * S;
|
|
v = t.MathUtils.cosDeg(a) * o,
|
|
w = t.MathUtils.cosDeg(90 + h) * s,
|
|
x = t.MathUtils.sinDeg(a) * o,
|
|
b = t.MathUtils.sinDeg(90 + h) * s;
|
|
u.a = M * v + O * x,
|
|
u.c = M * w + O * b,
|
|
u.b = I * v + R * x,
|
|
u.d = I * w + R * b
|
|
}
|
|
u.a *= c,
|
|
u.c *= c,
|
|
u.b *= p,
|
|
u.d *= p
|
|
},
|
|
e.prototype.setToSetupPose = function () {
|
|
var t = this.data;
|
|
this.x = t.x,
|
|
this.y = t.y,
|
|
this.rotation = t.rotation,
|
|
this.scaleX = t.scaleX,
|
|
this.scaleY = t.scaleY,
|
|
this.shearX = t.shearX,
|
|
this.shearY = t.shearY
|
|
},
|
|
e.prototype.getWorldRotationX = function () {
|
|
return Math.atan2(this.matrix.b, this.matrix.a) * t.MathUtils.radDeg
|
|
},
|
|
e.prototype.getWorldRotationY = function () {
|
|
return Math.atan2(this.matrix.d, this.matrix.c) * t.MathUtils.radDeg
|
|
},
|
|
e.prototype.getWorldScaleX = function () {
|
|
var t = this.matrix;
|
|
return Math.sqrt(t.a * t.a + t.c * t.c)
|
|
},
|
|
e.prototype.getWorldScaleY = function () {
|
|
var t = this.matrix;
|
|
return Math.sqrt(t.b * t.b + t.d * t.d)
|
|
},
|
|
e.prototype.updateAppliedTransform = function () {
|
|
this.appliedValid = !0;
|
|
var e = this.parent,
|
|
i = this.matrix;
|
|
if (null == e)
|
|
return this.ax = i.tx, this.ay = i.ty, this.arotation = Math.atan2(i.b, i.a) * t.MathUtils.radDeg, this.ascaleX = Math.sqrt(i.a * i.a + i.b * i.b), this.ascaleY = Math.sqrt(i.c * i.c + i.d * i.d), this.ashearX = 0, void(this.ashearY = Math.atan2(i.a * i.c + i.b * i.d, i.a * i.d - i.b * i.c) * t.MathUtils.radDeg);
|
|
var n = e.matrix,
|
|
r = 1 / (n.a * n.d - n.b * n.c),
|
|
o = i.tx - n.tx,
|
|
s = i.ty - n.ty;
|
|
this.ax = o * n.d * r - s * n.c * r,
|
|
this.ay = s * n.a * r - o * n.b * r;
|
|
var a = r * n.d,
|
|
h = r * n.a,
|
|
l = r * n.c,
|
|
u = r * n.b,
|
|
c = a * i.a - l * i.b,
|
|
p = a * i.c - l * i.d,
|
|
d = h * i.b - u * i.a,
|
|
f = h * i.d - u * i.c;
|
|
if (this.ashearX = 0, this.ascaleX = Math.sqrt(c * c + d * d), this.ascaleX > 1e-4) {
|
|
var _ = c * f - p * d;
|
|
this.ascaleY = _ / this.ascaleX,
|
|
this.ashearY = Math.atan2(c * p + d * f, _) * t.MathUtils.radDeg,
|
|
this.arotation = Math.atan2(d, c) * t.MathUtils.radDeg
|
|
} else
|
|
this.ascaleX = 0, this.ascaleY = Math.sqrt(p * p + f * f), this.ashearY = 0, this.arotation = 90 - Math.atan2(f, p) * t.MathUtils.radDeg
|
|
},
|
|
e.prototype.worldToLocal = function (t) {
|
|
var e = this.matrix,
|
|
i = e.a,
|
|
n = e.c,
|
|
r = e.b,
|
|
o = e.d,
|
|
s = 1 / (i * o - n * r),
|
|
a = t.x - e.tx,
|
|
h = t.y - e.ty;
|
|
return t.x = a * o * s - h * n * s,
|
|
t.y = h * i * s - a * r * s,
|
|
t
|
|
},
|
|
e.prototype.localToWorld = function (t) {
|
|
var e = this.matrix,
|
|
i = t.x,
|
|
n = t.y;
|
|
return t.x = i * e.a + n * e.c + e.tx,
|
|
t.y = i * e.b + n * e.d + e.ty,
|
|
t
|
|
},
|
|
e.prototype.worldToLocalRotation = function (e) {
|
|
var i = t.MathUtils.sinDeg(e),
|
|
n = t.MathUtils.cosDeg(e),
|
|
r = this.matrix;
|
|
return Math.atan2(r.a * i - r.b * n, r.d * n - r.c * i) * t.MathUtils.radDeg
|
|
},
|
|
e.prototype.localToWorldRotation = function (e) {
|
|
var i = t.MathUtils.sinDeg(e),
|
|
n = t.MathUtils.cosDeg(e),
|
|
r = this.matrix;
|
|
return Math.atan2(n * r.b + i * r.d, n * r.a + i * r.c) * t.MathUtils.radDeg
|
|
},
|
|
e.prototype.rotateWorld = function (e) {
|
|
var i = this.matrix,
|
|
n = i.a,
|
|
r = i.c,
|
|
o = i.b,
|
|
s = i.d,
|
|
a = t.MathUtils.cosDeg(e),
|
|
h = t.MathUtils.sinDeg(e);
|
|
i.a = a * n - h * o,
|
|
i.c = a * r - h * s,
|
|
i.b = h * n + a * o,
|
|
i.d = h * r + a * s,
|
|
this.appliedValid = !1
|
|
},
|
|
e.yDown = !1,
|
|
e
|
|
}
|
|
();
|
|
t.Bone = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e,
|
|
i = function (i, n, r) {
|
|
if (this.x = 0, this.y = 0, this.rotation = 0, this.scaleX = 1, this.scaleY = 1, this.shearX = 0, this.shearY = 0, this.transformMode = e.Normal, this.skinRequired = !1, this.color = new t.Color, i < 0)
|
|
throw new Error("index must be >= 0.");
|
|
if (null == n)
|
|
throw new Error("name cannot be null.");
|
|
this.index = i,
|
|
this.name = n,
|
|
this.parent = r
|
|
};
|
|
t.BoneData = i,
|
|
function (t) {
|
|
t[t.Normal = 0] = "Normal",
|
|
t[t.OnlyTranslation = 1] = "OnlyTranslation",
|
|
t[t.NoRotationOrReflection = 2] = "NoRotationOrReflection",
|
|
t[t.NoScale = 3] = "NoScale",
|
|
t[t.NoScaleOrReflection = 4] = "NoScaleOrReflection"
|
|
}
|
|
(e = t.TransformMode || (t.TransformMode = {}))
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t, e, i) {
|
|
this.name = t,
|
|
this.order = e,
|
|
this.skinRequired = i
|
|
};
|
|
t.ConstraintData = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t, e) {
|
|
if (null == e)
|
|
throw new Error("data cannot be null.");
|
|
this.time = t,
|
|
this.data = e
|
|
};
|
|
t.Event = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t) {
|
|
this.name = t
|
|
};
|
|
t.EventData = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t, e) {
|
|
if (this.bendDirection = 0, this.compress = !1, this.stretch = !1, this.mix = 1, this.softness = 0, this.active = !1, null == t)
|
|
throw new Error("data cannot be null.");
|
|
if (null == e)
|
|
throw new Error("skeleton cannot be null.");
|
|
this.data = t,
|
|
this.mix = t.mix,
|
|
this.softness = t.softness,
|
|
this.bendDirection = t.bendDirection,
|
|
this.compress = t.compress,
|
|
this.stretch = t.stretch,
|
|
this.bones = new Array;
|
|
for (var i = 0; i < t.bones.length; i++)
|
|
this.bones.push(e.findBone(t.bones[i].name));
|
|
this.target = e.findBone(t.target.name)
|
|
}
|
|
return e.prototype.isActive = function () {
|
|
return this.active
|
|
},
|
|
e.prototype.apply = function () {
|
|
this.update()
|
|
},
|
|
e.prototype.update = function () {
|
|
var t = this.target,
|
|
e = this.bones;
|
|
switch (e.length) {
|
|
case 1:
|
|
this.apply1(e[0], t.worldX, t.worldY, this.compress, this.stretch, this.data.uniform, this.mix);
|
|
break;
|
|
case 2:
|
|
this.apply2(e[0], e[1], t.worldX, t.worldY, this.bendDirection, this.stretch, this.softness, this.mix)
|
|
}
|
|
},
|
|
e.prototype.apply1 = function (e, i, n, r, o, s, a) {
|
|
e.appliedValid || e.updateAppliedTransform();
|
|
var h = e.parent.matrix,
|
|
l = 1 / (h.a * h.d - h.b * h.c),
|
|
u = i - h.tx,
|
|
c = n - h.ty,
|
|
p = (u * h.d - c * h.c) * l - e.ax,
|
|
d = (c * h.a - u * h.b) * l - e.ay,
|
|
f = Math.atan2(d, p) * t.MathUtils.radDeg - e.ashearX - e.arotation;
|
|
e.ascaleX < 0 && (f += 180),
|
|
f > 180 ? f -= 360 : f < -180 && (f += 360);
|
|
var _ = e.ascaleX,
|
|
m = e.ascaleY;
|
|
if (r || o) {
|
|
var y = e.data.length * _,
|
|
g = Math.sqrt(p * p + d * d);
|
|
if (r && g < y || o && g > y && y > 1e-4) {
|
|
var v = (g / y - 1) * a + 1;
|
|
_ *= v,
|
|
s && (m *= v)
|
|
}
|
|
}
|
|
e.updateWorldTransformWith(e.ax, e.ay, e.arotation + f * a, _, m, e.ashearX, e.ashearY)
|
|
},
|
|
e.prototype.apply2 = function (e, i, n, r, o, s, a, h) {
|
|
if (0 != h) {
|
|
e.appliedValid || e.updateAppliedTransform(),
|
|
i.appliedValid || i.updateAppliedTransform();
|
|
var l = e.ax,
|
|
u = e.ay,
|
|
c = e.ascaleX,
|
|
p = c,
|
|
d = e.ascaleY,
|
|
f = i.ascaleX,
|
|
_ = e.matrix,
|
|
m = 0,
|
|
y = 0,
|
|
g = 0;
|
|
c < 0 ? (c = -c, m = 180, g = -1) : (m = 0, g = 1),
|
|
d < 0 && (d = -d, g = -g),
|
|
f < 0 ? (f = -f, y = 180) : y = 0;
|
|
var v = i.ax,
|
|
w = 0,
|
|
x = 0,
|
|
b = 0,
|
|
E = _.a,
|
|
$ = _.c,
|
|
A = _.b,
|
|
S = _.d,
|
|
T = Math.abs(c - d) <= 1e-4;
|
|
T ? (x = E * v + $ * (w = i.ay) + _.tx, b = A * v + S * w + _.ty) : (w = 0, x = E * v + _.tx, b = A * v + _.ty);
|
|
var C = e.parent.matrix;
|
|
E = C.a,
|
|
$ = C.c,
|
|
A = C.b;
|
|
var M,
|
|
I,
|
|
P = 1 / (E * (S = C.d) - $ * A),
|
|
O = x - C.tx,
|
|
R = b - C.ty,
|
|
D = (O * S - R * $) * P - l,
|
|
L = (R * E - O * A) * P - u,
|
|
k = Math.sqrt(D * D + L * L),
|
|
F = i.data.length * f;
|
|
if (k < 1e-4)
|
|
return this.apply1(e, n, r, !1, s, !1, h), void i.updateWorldTransformWith(v, w, 0, i.ascaleX, i.ascaleY, i.ashearX, i.ashearY);
|
|
var N = ((O = n - C.tx) * S - (R = r - C.ty) * $) * P - l,
|
|
B = (R * E - O * A) * P - u,
|
|
U = N * N + B * B;
|
|
if (0 != a) {
|
|
a *= c * (f + 1) / 2;
|
|
var X = Math.sqrt(U),
|
|
j = X - k - F * c + a;
|
|
if (j > 0) {
|
|
var V = Math.min(1, j / (2 * a)) - 1;
|
|
U = (N -= (V = (j - a * (1 - V * V)) / X) * N) * N + (B -= V * B) * B
|
|
}
|
|
}
|
|
t: if (T) {
|
|
var H = (U - k * k - (F *= c) * F) / (2 * k * F);
|
|
H < -1 ? H = -1 : H > 1 && (H = 1, s && (p *= (Math.sqrt(U) / (k + F) - 1) * h + 1)),
|
|
I = Math.acos(H) * o,
|
|
E = k + F * H,
|
|
$ = F * Math.sin(I),
|
|
M = Math.atan2(B * E - N * $, N * E + B * $)
|
|
} else {
|
|
var G = (E = c * F) * E,
|
|
Y = ($ = d * F) * $,
|
|
W = Math.atan2(B, N),
|
|
z = -2 * Y * k,
|
|
q = Y - G;
|
|
if ((S = z * z - 4 * q * (A = Y * k * k + G * U - G * Y)) >= 0) {
|
|
var J = Math.sqrt(S);
|
|
z < 0 && (J = -J);
|
|
var K = (J = - (z + J) / 2) / q,
|
|
Z = A / J,
|
|
Q = Math.abs(K) < Math.abs(Z) ? K : Z;
|
|
if (Q * Q <= U) {
|
|
R = Math.sqrt(U - Q * Q) * o,
|
|
M = W - Math.atan2(R, Q),
|
|
I = Math.atan2(R / d, (Q - k) / c);
|
|
break t
|
|
}
|
|
}
|
|
var tt = t.MathUtils.PI,
|
|
et = k - E,
|
|
it = et * et,
|
|
nt = 0,
|
|
rt = 0,
|
|
ot = k + E,
|
|
st = ot * ot,
|
|
at = 0;
|
|
(A = -E * k / (G - Y)) >= -1 && A <= 1 && (A = Math.acos(A), (S = (O = E * Math.cos(A) + k) * O + (R = $ * Math.sin(A)) * R) < it && (tt = A, it = S, et = O, nt = R), S > st && (rt = A, st = S, ot = O, at = R)),
|
|
U <= (it + st) / 2 ? (M = W - Math.atan2(nt * o, et), I = tt * o) : (M = W - Math.atan2(at * o, ot), I = rt * o)
|
|
}
|
|
var ht = Math.atan2(w, v) * g,
|
|
lt = e.arotation;
|
|
(M = (M - ht) * t.MathUtils.radDeg + m - lt) > 180 ? M -= 360 : M < -180 && (M += 360),
|
|
e.updateWorldTransformWith(l, u, lt + M * h, p, e.ascaleY, 0, 0),
|
|
lt = i.arotation,
|
|
(I = ((I + ht) * t.MathUtils.radDeg - i.ashearX) * g + y - lt) > 180 ? I -= 360 : I < -180 && (I += 360),
|
|
i.updateWorldTransformWith(v, w, lt + I * h, i.ascaleX, i.ascaleY, i.ashearX, i.ashearY)
|
|
} else
|
|
i.updateWorldTransform()
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.IkConstraint = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t) {
|
|
function e(e) {
|
|
var i = t.call(this, e, 0, !1) || this;
|
|
return i.bones = new Array,
|
|
i.bendDirection = 1,
|
|
i.compress = !1,
|
|
i.stretch = !1,
|
|
i.uniform = !1,
|
|
i.mix = 1,
|
|
i.softness = 0,
|
|
i
|
|
}
|
|
return s(e, t),
|
|
e
|
|
}
|
|
(t.ConstraintData);
|
|
t.IkConstraintData = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t, e) {
|
|
if (this.position = 0, this.spacing = 0, this.rotateMix = 0, this.translateMix = 0, this.spaces = new Array, this.positions = new Array, this.world = new Array, this.curves = new Array, this.lengths = new Array, this.segments = new Array, this.active = !1, null == t)
|
|
throw new Error("data cannot be null.");
|
|
if (null == e)
|
|
throw new Error("skeleton cannot be null.");
|
|
this.data = t,
|
|
this.bones = new Array;
|
|
for (var i = 0, n = t.bones.length; i < n; i++)
|
|
this.bones.push(e.findBone(t.bones[i].name));
|
|
this.target = e.findSlot(t.target.name),
|
|
this.position = t.position,
|
|
this.spacing = t.spacing,
|
|
this.rotateMix = t.rotateMix,
|
|
this.translateMix = t.translateMix
|
|
}
|
|
return e.prototype.isActive = function () {
|
|
return this.active
|
|
},
|
|
e.prototype.apply = function () {
|
|
this.update()
|
|
},
|
|
e.prototype.update = function () {
|
|
var i = this.target.getAttachment();
|
|
if (i instanceof t.PathAttachment) {
|
|
var n = this.rotateMix,
|
|
r = this.translateMix,
|
|
o = n > 0;
|
|
if (r > 0 || o) {
|
|
var s = this.data,
|
|
a = s.spacingMode,
|
|
h = a == t.SpacingMode.Length,
|
|
l = s.rotateMode,
|
|
u = l == t.RotateMode.Tangent,
|
|
c = l == t.RotateMode.ChainScale,
|
|
p = this.bones.length,
|
|
d = u ? p : p + 1,
|
|
f = this.bones,
|
|
_ = t.Utils.setArraySize(this.spaces, d),
|
|
m = null,
|
|
y = this.spacing;
|
|
if (c || h) {
|
|
c && (m = t.Utils.setArraySize(this.lengths, p));
|
|
for (var g = 0, v = d - 1; g < v; ) {
|
|
var w = (I = f[g]).data.length;
|
|
if (w < e.epsilon)
|
|
c && (m[g] = 0), _[++g] = 0;
|
|
else {
|
|
var x = w * I.matrix.a,
|
|
b = w * I.matrix.b,
|
|
E = Math.sqrt(x * x + b * b);
|
|
c && (m[g] = E),
|
|
_[++g] = (h ? w + y : y) * E / w
|
|
}
|
|
}
|
|
} else
|
|
for (g = 1; g < d; g++)
|
|
_[g] = y;
|
|
var $ = this.computeWorldPositions(i, d, u, s.positionMode == t.PositionMode.Percent, a == t.SpacingMode.Percent),
|
|
A = $[0],
|
|
S = $[1],
|
|
T = s.offsetRotation,
|
|
C = !1;
|
|
if (0 == T)
|
|
C = l == t.RotateMode.Chain;
|
|
else
|
|
C = !1, T *= (M = this.target.bone.matrix).a * M.d - M.b * M.c > 0 ? t.MathUtils.degRad : -t.MathUtils.degRad;
|
|
g = 0;
|
|
for (var M = 3; g < p; g++, M += 3) {
|
|
var I,
|
|
P = (I = f[g]).matrix;
|
|
P.tx += (A - P.tx) * r,
|
|
P.ty += (S - P.ty) * r;
|
|
var O = (x = $[M]) - A,
|
|
R = (b = $[M + 1]) - S;
|
|
if (c) {
|
|
var D = m[g];
|
|
if (0 != D) {
|
|
var L = (Math.sqrt(O * O + R * R) / D - 1) * n + 1;
|
|
P.a *= L,
|
|
P.b *= L
|
|
}
|
|
}
|
|
if (A = x, S = b, o) {
|
|
var k = P.a,
|
|
F = P.c,
|
|
N = P.b,
|
|
B = P.d,
|
|
U = 0,
|
|
X = 0,
|
|
j = 0;
|
|
if (U = u ? $[M - 1] : 0 == _[g + 1] ? $[M + 2] : Math.atan2(R, O), U -= Math.atan2(N, k), C) {
|
|
X = Math.cos(U),
|
|
j = Math.sin(U);
|
|
var V = I.data.length;
|
|
A += (V * (X * k - j * N) - O) * n,
|
|
S += (V * (j * k + X * N) - R) * n
|
|
} else
|
|
U += T;
|
|
U > t.MathUtils.PI ? U -= t.MathUtils.PI2 : U < -t.MathUtils.PI && (U += t.MathUtils.PI2),
|
|
U *= n,
|
|
X = Math.cos(U),
|
|
j = Math.sin(U),
|
|
P.a = X * k - j * N,
|
|
P.c = X * F - j * B,
|
|
P.b = j * k + X * N,
|
|
P.d = j * F + X * B
|
|
}
|
|
I.appliedValid = !1
|
|
}
|
|
}
|
|
}
|
|
},
|
|
e.prototype.computeWorldPositions = function (i, n, r, o, s) {
|
|
var a = this.target,
|
|
h = this.position,
|
|
l = this.spaces,
|
|
u = t.Utils.setArraySize(this.positions, 3 * n + 2),
|
|
c = null,
|
|
p = i.closed,
|
|
d = i.worldVerticesLength,
|
|
f = d / 6,
|
|
_ = e.NONE;
|
|
if (!i.constantSpeed) {
|
|
var m = i.lengths,
|
|
y = m[f -= p ? 1 : 2];
|
|
if (o && (h *= y), s)
|
|
for (var g = 0; g < n; g++)
|
|
l[g] *= y;
|
|
c = t.Utils.setArraySize(this.world, 8);
|
|
g = 0;
|
|
for (var v = 0, w = 0; g < n; g++, v += 3) {
|
|
var x = h += G = l[g];
|
|
if (p)
|
|
(x %= y) < 0 && (x += y), w = 0;
|
|
else {
|
|
if (x < 0) {
|
|
_ != e.BEFORE && (_ = e.BEFORE, i.computeWorldVertices(a, 2, 4, c, 0, 2)),
|
|
this.addBeforePosition(x, c, 0, u, v);
|
|
continue
|
|
}
|
|
if (x > y) {
|
|
_ != e.AFTER && (_ = e.AFTER, i.computeWorldVertices(a, d - 6, 4, c, 0, 2)),
|
|
this.addAfterPosition(x - y, c, 0, u, v);
|
|
continue
|
|
}
|
|
}
|
|
for (; ; w++) {
|
|
var b = m[w];
|
|
if (!(x > b)) {
|
|
if (0 == w)
|
|
x /= b;
|
|
else
|
|
x = (x - (q = m[w - 1])) / (b - q);
|
|
break
|
|
}
|
|
}
|
|
w != _ && (_ = w, p && w == f ? (i.computeWorldVertices(a, d - 4, 4, c, 0, 2), i.computeWorldVertices(a, 0, 4, c, 4, 2)) : i.computeWorldVertices(a, 6 * w + 2, 8, c, 0, 2)),
|
|
this.addCurvePosition(x, c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], u, v, r || g > 0 && 0 == G)
|
|
}
|
|
return u
|
|
}
|
|
p ? (d += 2, c = t.Utils.setArraySize(this.world, d), i.computeWorldVertices(a, 2, d - 4, c, 0, 2), i.computeWorldVertices(a, 0, 2, c, d - 4, 2), c[d - 2] = c[0], c[d - 1] = c[1]) : (f--, d -= 4, c = t.Utils.setArraySize(this.world, d), i.computeWorldVertices(a, 2, d, c, 0, 2));
|
|
for (var E = t.Utils.setArraySize(this.curves, f), $ = 0, A = c[0], S = c[1], T = 0, C = 0, M = 0, I = 0, P = 0, O = 0, R = 0, D = 0, L = 0, k = 0, F = 0, N = 0, B = 0, U = 0, X = (g = 0, 2); g < f; g++, X += 6)
|
|
T = c[X], C = c[X + 1], M = c[X + 2], I = c[X + 3], F = 2 * (R = .1875 * (A - 2 * T + M)) + (L = .09375 * (3 * (T - M) - A + (P = c[X + 4]))), N = 2 * (D = .1875 * (S - 2 * C + I)) + (k = .09375 * (3 * (C - I) - S + (O = c[X + 5]))), B = .75 * (T - A) + R + .16666667 * L, U = .75 * (C - S) + D + .16666667 * k, $ += Math.sqrt(B * B + U * U), B += F, U += N, F += L, N += k, $ += Math.sqrt(B * B + U * U), B += F, U += N, $ += Math.sqrt(B * B + U * U), B += F + L, U += N + k, $ += Math.sqrt(B * B + U * U), E[g] = $, A = P, S = O;
|
|
if (o && (h *= $), s)
|
|
for (g = 0; g < n; g++)
|
|
l[g] *= $;
|
|
for (var j = this.segments, V = 0, H = (g = 0, v = 0, w = 0, 0); g < n; g++, v += 3) {
|
|
var G;
|
|
x = h += G = l[g];
|
|
if (p)
|
|
(x %= $) < 0 && (x += $), w = 0;
|
|
else {
|
|
if (x < 0) {
|
|
this.addBeforePosition(x, c, 0, u, v);
|
|
continue
|
|
}
|
|
if (x > $) {
|
|
this.addAfterPosition(x - $, c, d - 4, u, v);
|
|
continue
|
|
}
|
|
}
|
|
for (; ; w++) {
|
|
var Y = E[w];
|
|
if (!(x > Y)) {
|
|
if (0 == w)
|
|
x /= Y;
|
|
else
|
|
x = (x - (q = E[w - 1])) / (Y - q);
|
|
break
|
|
}
|
|
}
|
|
if (w != _) {
|
|
_ = w;
|
|
var W = 6 * w;
|
|
for (A = c[W], S = c[W + 1], T = c[W + 2], C = c[W + 3], M = c[W + 4], I = c[W + 5], F = 2 * (R = .03 * (A - 2 * T + M)) + (L = .006 * (3 * (T - M) - A + (P = c[W + 6]))), N = 2 * (D = .03 * (S - 2 * C + I)) + (k = .006 * (3 * (C - I) - S + (O = c[W + 7]))), B = .3 * (T - A) + R + .16666667 * L, U = .3 * (C - S) + D + .16666667 * k, V = Math.sqrt(B * B + U * U), j[0] = V, W = 1; W < 8; W++)
|
|
B += F, U += N, F += L, N += k, V += Math.sqrt(B * B + U * U), j[W] = V;
|
|
B += F,
|
|
U += N,
|
|
V += Math.sqrt(B * B + U * U),
|
|
j[8] = V,
|
|
B += F + L,
|
|
U += N + k,
|
|
V += Math.sqrt(B * B + U * U),
|
|
j[9] = V,
|
|
H = 0
|
|
}
|
|
for (x *= V; ; H++) {
|
|
var z = j[H];
|
|
if (!(x > z)) {
|
|
var q;
|
|
if (0 == H)
|
|
x /= z;
|
|
else
|
|
x = H + (x - (q = j[H - 1])) / (z - q);
|
|
break
|
|
}
|
|
}
|
|
this.addCurvePosition(.1 * x, A, S, T, C, M, I, P, O, u, v, r || g > 0 && 0 == G)
|
|
}
|
|
return u
|
|
},
|
|
e.prototype.addBeforePosition = function (t, e, i, n, r) {
|
|
var o = e[i],
|
|
s = e[i + 1],
|
|
a = e[i + 2] - o,
|
|
h = e[i + 3] - s,
|
|
l = Math.atan2(h, a);
|
|
n[r] = o + t * Math.cos(l),
|
|
n[r + 1] = s + t * Math.sin(l),
|
|
n[r + 2] = l
|
|
},
|
|
e.prototype.addAfterPosition = function (t, e, i, n, r) {
|
|
var o = e[i + 2],
|
|
s = e[i + 3],
|
|
a = o - e[i],
|
|
h = s - e[i + 1],
|
|
l = Math.atan2(h, a);
|
|
n[r] = o + t * Math.cos(l),
|
|
n[r + 1] = s + t * Math.sin(l),
|
|
n[r + 2] = l
|
|
},
|
|
e.prototype.addCurvePosition = function (t, e, i, n, r, o, s, a, h, l, u, c) {
|
|
(0 == t || isNaN(t)) && (t = 1e-4);
|
|
var p = t * t,
|
|
d = p * t,
|
|
f = 1 - t,
|
|
_ = f * f,
|
|
m = _ * f,
|
|
y = f * t,
|
|
g = 3 * y,
|
|
v = f * g,
|
|
w = g * t,
|
|
x = e * m + n * v + o * w + a * d,
|
|
b = i * m + r * v + s * w + h * d;
|
|
l[u] = x,
|
|
l[u + 1] = b,
|
|
c && (l[u + 2] = Math.atan2(b - (i * _ + r * y * 2 + s * p), x - (e * _ + n * y * 2 + o * p)))
|
|
},
|
|
e.NONE = -1,
|
|
e.BEFORE = -2,
|
|
e.AFTER = -3,
|
|
e.epsilon = 1e-5,
|
|
e
|
|
}
|
|
();
|
|
t.PathConstraint = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t) {
|
|
function e(e) {
|
|
var i = t.call(this, e, 0, !1) || this;
|
|
return i.bones = new Array,
|
|
i
|
|
}
|
|
return s(e, t),
|
|
e
|
|
}
|
|
(t.ConstraintData);
|
|
t.PathConstraintData = e,
|
|
function (t) {
|
|
t[t.Fixed = 0] = "Fixed",
|
|
t[t.Percent = 1] = "Percent"
|
|
}
|
|
(t.PositionMode || (t.PositionMode = {})),
|
|
function (t) {
|
|
t[t.Length = 0] = "Length",
|
|
t[t.Fixed = 1] = "Fixed",
|
|
t[t.Percent = 2] = "Percent"
|
|
}
|
|
(t.SpacingMode || (t.SpacingMode = {})),
|
|
function (t) {
|
|
t[t.Tangent = 0] = "Tangent",
|
|
t[t.Chain = 1] = "Chain",
|
|
t[t.ChainScale = 2] = "ChainScale"
|
|
}
|
|
(t.RotateMode || (t.RotateMode = {}))
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(e) {
|
|
if (this._updateCache = new Array, this.updateCacheReset = new Array, this.time = 0, this.scaleX = 1, this.scaleY = 1, this.x = 0, this.y = 0, null == e)
|
|
throw new Error("data cannot be null.");
|
|
this.data = e,
|
|
this.bones = new Array;
|
|
for (var i = 0; i < e.bones.length; i++) {
|
|
var n = e.bones[i],
|
|
r = void 0;
|
|
if (null == n.parent)
|
|
r = new t.Bone(n, this, null);
|
|
else {
|
|
var o = this.bones[n.parent.index];
|
|
r = new t.Bone(n, this, o),
|
|
o.children.push(r)
|
|
}
|
|
this.bones.push(r)
|
|
}
|
|
this.slots = new Array,
|
|
this.drawOrder = new Array;
|
|
for (i = 0; i < e.slots.length; i++) {
|
|
var s = e.slots[i],
|
|
a = (r = this.bones[s.boneData.index], new t.Slot(s, r));
|
|
this.slots.push(a),
|
|
this.drawOrder.push(a)
|
|
}
|
|
this.ikConstraints = new Array;
|
|
for (i = 0; i < e.ikConstraints.length; i++) {
|
|
var h = e.ikConstraints[i];
|
|
this.ikConstraints.push(new t.IkConstraint(h, this))
|
|
}
|
|
this.transformConstraints = new Array;
|
|
for (i = 0; i < e.transformConstraints.length; i++) {
|
|
var l = e.transformConstraints[i];
|
|
this.transformConstraints.push(new t.TransformConstraint(l, this))
|
|
}
|
|
this.pathConstraints = new Array;
|
|
for (i = 0; i < e.pathConstraints.length; i++) {
|
|
var u = e.pathConstraints[i];
|
|
this.pathConstraints.push(new t.PathConstraint(u, this))
|
|
}
|
|
this.color = new t.Color(1, 1, 1, 1),
|
|
this.updateCache()
|
|
}
|
|
return e.prototype.updateCache = function () {
|
|
this._updateCache.length = 0,
|
|
this.updateCacheReset.length = 0;
|
|
for (var t = this.bones, e = 0, i = t.length; e < i; e++) {
|
|
(r = t[e]).sorted = r.data.skinRequired,
|
|
r.active = !r.sorted
|
|
}
|
|
if (null != this.skin) {
|
|
var n = this.skin.bones;
|
|
for (e = 0, i = this.skin.bones.length; e < i; e++) {
|
|
var r = this.bones[n[e].index];
|
|
do {
|
|
r.sorted = !1,
|
|
r.active = !0,
|
|
r = r.parent
|
|
} while (null != r)
|
|
}
|
|
}
|
|
var o = this.ikConstraints,
|
|
s = this.transformConstraints,
|
|
a = this.pathConstraints,
|
|
h = o.length,
|
|
l = s.length,
|
|
u = a.length,
|
|
c = h + l + u;
|
|
t: for (e = 0; e < c; e++) {
|
|
for (var p = 0; p < h; p++) {
|
|
if ((d = o[p]).data.order == e) {
|
|
this.sortIkConstraint(d);
|
|
continue t
|
|
}
|
|
}
|
|
for (p = 0; p < l; p++) {
|
|
if ((d = s[p]).data.order == e) {
|
|
this.sortTransformConstraint(d);
|
|
continue t
|
|
}
|
|
}
|
|
for (p = 0; p < u; p++) {
|
|
var d;
|
|
if ((d = a[p]).data.order == e) {
|
|
this.sortPathConstraint(d);
|
|
continue t
|
|
}
|
|
}
|
|
}
|
|
for (e = 0, i = t.length; e < i; e++)
|
|
this.sortBone(t[e])
|
|
},
|
|
e.prototype.sortIkConstraint = function (e) {
|
|
if (e.active = e.target.isActive() && (!e.data.skinRequired || null != this.skin && t.Utils.contains(this.skin.constraints, e.data, !0)), e.active) {
|
|
var i = e.target;
|
|
this.sortBone(i);
|
|
var n = e.bones,
|
|
r = n[0];
|
|
if (this.sortBone(r), n.length > 1) {
|
|
var o = n[n.length - 1];
|
|
this._updateCache.indexOf(o) > -1 || this.updateCacheReset.push(o)
|
|
}
|
|
this._updateCache.push(e),
|
|
this.sortReset(r.children),
|
|
n[n.length - 1].sorted = !0
|
|
}
|
|
},
|
|
e.prototype.sortPathConstraint = function (e) {
|
|
if (e.active = e.target.bone.isActive() && (!e.data.skinRequired || null != this.skin && t.Utils.contains(this.skin.constraints, e.data, !0)), e.active) {
|
|
var i = e.target,
|
|
n = i.data.index,
|
|
r = i.bone;
|
|
null != this.skin && this.sortPathConstraintAttachment(this.skin, n, r),
|
|
null != this.data.defaultSkin && this.data.defaultSkin != this.skin && this.sortPathConstraintAttachment(this.data.defaultSkin, n, r);
|
|
for (var o = 0, s = this.data.skins.length; o < s; o++)
|
|
this.sortPathConstraintAttachment(this.data.skins[o], n, r);
|
|
var a = i.getAttachment();
|
|
a instanceof t.PathAttachment && this.sortPathConstraintAttachmentWith(a, r);
|
|
var h = e.bones,
|
|
l = h.length;
|
|
for (o = 0; o < l; o++)
|
|
this.sortBone(h[o]);
|
|
this._updateCache.push(e);
|
|
for (o = 0; o < l; o++)
|
|
this.sortReset(h[o].children);
|
|
for (o = 0; o < l; o++)
|
|
h[o].sorted = !0
|
|
}
|
|
},
|
|
e.prototype.sortTransformConstraint = function (e) {
|
|
if (e.active = e.target.isActive() && (!e.data.skinRequired || null != this.skin && t.Utils.contains(this.skin.constraints, e.data, !0)), e.active) {
|
|
this.sortBone(e.target);
|
|
var i = e.bones,
|
|
n = i.length;
|
|
if (e.data.local)
|
|
for (var r = 0; r < n; r++) {
|
|
var o = i[r];
|
|
this.sortBone(o.parent),
|
|
this._updateCache.indexOf(o) > -1 || this.updateCacheReset.push(o)
|
|
}
|
|
else
|
|
for (r = 0; r < n; r++)
|
|
this.sortBone(i[r]);
|
|
this._updateCache.push(e);
|
|
for (var s = 0; s < n; s++)
|
|
this.sortReset(i[s].children);
|
|
for (s = 0; s < n; s++)
|
|
i[s].sorted = !0
|
|
}
|
|
},
|
|
e.prototype.sortPathConstraintAttachment = function (t, e, i) {
|
|
var n = t.attachments[e];
|
|
if (n)
|
|
for (var r in n)
|
|
this.sortPathConstraintAttachmentWith(n[r], i)
|
|
},
|
|
e.prototype.sortPathConstraintAttachmentWith = function (e, i) {
|
|
if (e instanceof t.PathAttachment) {
|
|
var n = e.bones;
|
|
if (null == n)
|
|
this.sortBone(i);
|
|
else
|
|
for (var r = this.bones, o = 0; o < n.length; )
|
|
for (var s = n[o++], a = o + s; o < a; o++) {
|
|
var h = n[o];
|
|
this.sortBone(r[h])
|
|
}
|
|
}
|
|
},
|
|
e.prototype.sortBone = function (t) {
|
|
if (!t.sorted) {
|
|
var e = t.parent;
|
|
null != e && this.sortBone(e),
|
|
t.sorted = !0,
|
|
this._updateCache.push(t)
|
|
}
|
|
},
|
|
e.prototype.sortReset = function (t) {
|
|
for (var e = 0, i = t.length; e < i; e++) {
|
|
var n = t[e];
|
|
n.active && (n.sorted && this.sortReset(n.children), n.sorted = !1)
|
|
}
|
|
},
|
|
e.prototype.updateWorldTransform = function () {
|
|
for (var t = this.updateCacheReset, e = 0, i = t.length; e < i; e++) {
|
|
var n = t[e];
|
|
n.ax = n.x,
|
|
n.ay = n.y,
|
|
n.arotation = n.rotation,
|
|
n.ascaleX = n.scaleX,
|
|
n.ascaleY = n.scaleY,
|
|
n.ashearX = n.shearX,
|
|
n.ashearY = n.shearY,
|
|
n.appliedValid = !0
|
|
}
|
|
var r = this._updateCache;
|
|
for (e = 0, i = r.length; e < i; e++)
|
|
r[e].update()
|
|
},
|
|
e.prototype.setToSetupPose = function () {
|
|
this.setBonesToSetupPose(),
|
|
this.setSlotsToSetupPose()
|
|
},
|
|
e.prototype.setBonesToSetupPose = function () {
|
|
for (var t = this.bones, e = 0, i = t.length; e < i; e++)
|
|
t[e].setToSetupPose();
|
|
var n = this.ikConstraints;
|
|
for (e = 0, i = n.length; e < i; e++) {
|
|
(a = n[e]).mix = a.data.mix,
|
|
a.softness = a.data.softness,
|
|
a.bendDirection = a.data.bendDirection,
|
|
a.compress = a.data.compress,
|
|
a.stretch = a.data.stretch
|
|
}
|
|
var r = this.transformConstraints;
|
|
for (e = 0, i = r.length; e < i; e++) {
|
|
var o = (a = r[e]).data;
|
|
a.rotateMix = o.rotateMix,
|
|
a.translateMix = o.translateMix,
|
|
a.scaleMix = o.scaleMix,
|
|
a.shearMix = o.shearMix
|
|
}
|
|
var s = this.pathConstraints;
|
|
for (e = 0, i = s.length; e < i; e++) {
|
|
var a;
|
|
o = (a = s[e]).data;
|
|
a.position = o.position,
|
|
a.spacing = o.spacing,
|
|
a.rotateMix = o.rotateMix,
|
|
a.translateMix = o.translateMix
|
|
}
|
|
},
|
|
e.prototype.setSlotsToSetupPose = function () {
|
|
var e = this.slots;
|
|
t.Utils.arrayCopy(e, 0, this.drawOrder, 0, e.length);
|
|
for (var i = 0, n = e.length; i < n; i++)
|
|
e[i].setToSetupPose()
|
|
},
|
|
e.prototype.getRootBone = function () {
|
|
return 0 == this.bones.length ? null : this.bones[0]
|
|
},
|
|
e.prototype.findBone = function (t) {
|
|
if (null == t)
|
|
throw new Error("boneName cannot be null.");
|
|
for (var e = this.bones, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.data.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
e.prototype.findBoneIndex = function (t) {
|
|
if (null == t)
|
|
throw new Error("boneName cannot be null.");
|
|
for (var e = this.bones, i = 0, n = e.length; i < n; i++)
|
|
if (e[i].data.name == t)
|
|
return i;
|
|
return -1
|
|
},
|
|
e.prototype.findSlot = function (t) {
|
|
if (null == t)
|
|
throw new Error("slotName cannot be null.");
|
|
for (var e = this.slots, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.data.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
e.prototype.findSlotIndex = function (t) {
|
|
if (null == t)
|
|
throw new Error("slotName cannot be null.");
|
|
for (var e = this.slots, i = 0, n = e.length; i < n; i++)
|
|
if (e[i].data.name == t)
|
|
return i;
|
|
return -1
|
|
},
|
|
e.prototype.setSkinByName = function (t) {
|
|
var e = this.data.findSkin(t);
|
|
if (null == e)
|
|
throw new Error("Skin not found: " + t);
|
|
this.setSkin(e)
|
|
},
|
|
e.prototype.setSkin = function (t) {
|
|
if (t != this.skin) {
|
|
if (null != t)
|
|
if (null != this.skin)
|
|
t.attachAll(this, this.skin);
|
|
else
|
|
for (var e = this.slots, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i],
|
|
o = r.data.attachmentName;
|
|
if (null != o) {
|
|
var s = t.getAttachment(i, o);
|
|
null != s && r.setAttachment(s)
|
|
}
|
|
}
|
|
this.skin = t,
|
|
this.updateCache()
|
|
}
|
|
},
|
|
e.prototype.getAttachmentByName = function (t, e) {
|
|
return this.getAttachment(this.data.findSlotIndex(t), e)
|
|
},
|
|
e.prototype.getAttachment = function (t, e) {
|
|
if (null == e)
|
|
throw new Error("attachmentName cannot be null.");
|
|
if (null != this.skin) {
|
|
var i = this.skin.getAttachment(t, e);
|
|
if (null != i)
|
|
return i
|
|
}
|
|
return null != this.data.defaultSkin ? this.data.defaultSkin.getAttachment(t, e) : null
|
|
},
|
|
e.prototype.setAttachment = function (t, e) {
|
|
if (null == t)
|
|
throw new Error("slotName cannot be null.");
|
|
for (var i = this.slots, n = 0, r = i.length; n < r; n++) {
|
|
var o = i[n];
|
|
if (o.data.name == t) {
|
|
var s = null;
|
|
if (null != e && null == (s = this.getAttachment(n, e)))
|
|
throw new Error("Attachment not found: " + e + ", for slot: " + t);
|
|
return void o.setAttachment(s)
|
|
}
|
|
}
|
|
throw new Error("Slot not found: " + t)
|
|
},
|
|
e.prototype.findIkConstraint = function (t) {
|
|
if (null == t)
|
|
throw new Error("constraintName cannot be null.");
|
|
for (var e = this.ikConstraints, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.data.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
e.prototype.findTransformConstraint = function (t) {
|
|
if (null == t)
|
|
throw new Error("constraintName cannot be null.");
|
|
for (var e = this.transformConstraints, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.data.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
e.prototype.findPathConstraint = function (t) {
|
|
if (null == t)
|
|
throw new Error("constraintName cannot be null.");
|
|
for (var e = this.pathConstraints, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.data.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
e.prototype.getBounds = function (e, i, n) {
|
|
if (void 0 === n && (n = new Array(2)), null == e)
|
|
throw new Error("offset cannot be null.");
|
|
if (null == i)
|
|
throw new Error("size cannot be null.");
|
|
for (var r = this.drawOrder, o = Number.POSITIVE_INFINITY, s = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY, h = Number.NEGATIVE_INFINITY, l = 0, u = r.length; l < u; l++) {
|
|
var c = r[l];
|
|
if (c.bone.active) {
|
|
var p = 0,
|
|
d = null,
|
|
f = c.getAttachment();
|
|
if (f instanceof t.RegionAttachment)
|
|
p = 8, d = t.Utils.setArraySize(n, p, 0), f.computeWorldVertices(c.bone, d, 0, 2);
|
|
else if (f instanceof t.MeshAttachment) {
|
|
var _ = f;
|
|
p = _.worldVerticesLength,
|
|
d = t.Utils.setArraySize(n, p, 0),
|
|
_.computeWorldVertices(c, 0, p, d, 0, 2)
|
|
}
|
|
if (null != d)
|
|
for (var m = 0, y = d.length; m < y; m += 2) {
|
|
var g = d[m],
|
|
v = d[m + 1];
|
|
o = Math.min(o, g),
|
|
s = Math.min(s, v),
|
|
a = Math.max(a, g),
|
|
h = Math.max(h, v)
|
|
}
|
|
}
|
|
}
|
|
e.set(o, s),
|
|
i.set(a - o, h - s)
|
|
},
|
|
e.prototype.update = function (t) {
|
|
this.time += t
|
|
},
|
|
Object.defineProperty(e.prototype, "flipX", {
|
|
get: function () {
|
|
return -1 == this.scaleX
|
|
},
|
|
set: function (t) {
|
|
e.deprecatedWarning1 || (e.deprecatedWarning1 = !0, console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),
|
|
this.scaleX = t ? 1 : -1
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(e.prototype, "flipY", {
|
|
get: function () {
|
|
return -1 == this.scaleY
|
|
},
|
|
set: function (t) {
|
|
e.deprecatedWarning1 || (e.deprecatedWarning1 = !0, console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),
|
|
this.scaleY = t ? 1 : -1
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
e.deprecatedWarning1 = !1,
|
|
e
|
|
}
|
|
();
|
|
t.Skeleton = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t) {
|
|
this.scale = 1,
|
|
this.linkedMeshes = new Array,
|
|
this.attachmentLoader = t
|
|
}
|
|
return e.prototype.readSkeletonData = function (n) {
|
|
var r = this.scale,
|
|
o = new t.SkeletonData;
|
|
o.name = "";
|
|
var s = new i(n);
|
|
o.hash = s.readString(),
|
|
o.version = s.readString(),
|
|
o.x = s.readFloat(),
|
|
o.y = s.readFloat(),
|
|
o.width = s.readFloat(),
|
|
o.height = s.readFloat();
|
|
var a = s.readBoolean();
|
|
a && (o.fps = s.readFloat(), o.imagesPath = s.readString(), o.audioPath = s.readString());
|
|
var h = 0;
|
|
h = s.readInt(!0);
|
|
for (var l = 0; l < h; l++)
|
|
s.strings.push(s.readString());
|
|
h = s.readInt(!0);
|
|
for (l = 0; l < h; l++) {
|
|
var u = s.readString(),
|
|
c = 0 == l ? null : o.bones[s.readInt(!0)];
|
|
(f = new t.BoneData(l, u, c)).rotation = s.readFloat(),
|
|
f.x = s.readFloat() * r,
|
|
f.y = s.readFloat() * r,
|
|
f.scaleX = s.readFloat(),
|
|
f.scaleY = s.readFloat(),
|
|
f.shearX = s.readFloat(),
|
|
f.shearY = s.readFloat(),
|
|
f.length = s.readFloat() * r,
|
|
f.transformMode = e.TransformModeValues[s.readInt(!0)],
|
|
f.skinRequired = s.readBoolean(),
|
|
a && t.Color.rgba8888ToColor(f.color, s.readInt32()),
|
|
o.bones.push(f)
|
|
}
|
|
h = s.readInt(!0);
|
|
for (l = 0; l < h; l++) {
|
|
var p = s.readString(),
|
|
d = o.bones[s.readInt(!0)],
|
|
f = new t.SlotData(l, p, d);
|
|
t.Color.rgba8888ToColor(f.color, s.readInt32());
|
|
var _ = s.readInt32();
|
|
-1 != _ && t.Color.rgb888ToColor(f.darkColor = new t.Color, _),
|
|
f.attachmentName = s.readStringRef(),
|
|
f.blendMode = e.BlendModeValues[s.readInt(!0)],
|
|
o.slots.push(f)
|
|
}
|
|
h = s.readInt(!0);
|
|
l = 0;
|
|
for (var m = void 0; l < h; l++) {
|
|
(f = new t.IkConstraintData(s.readString())).order = s.readInt(!0),
|
|
f.skinRequired = s.readBoolean(),
|
|
m = s.readInt(!0);
|
|
for (var y = 0; y < m; y++)
|
|
f.bones.push(o.bones[s.readInt(!0)]);
|
|
f.target = o.bones[s.readInt(!0)],
|
|
f.mix = s.readFloat(),
|
|
f.softness = s.readFloat() * r,
|
|
f.bendDirection = s.readByte(),
|
|
f.compress = s.readBoolean(),
|
|
f.stretch = s.readBoolean(),
|
|
f.uniform = s.readBoolean(),
|
|
o.ikConstraints.push(f)
|
|
}
|
|
h = s.readInt(!0);
|
|
for (l = 0, m = void 0; l < h; l++) {
|
|
(f = new t.TransformConstraintData(s.readString())).order = s.readInt(!0),
|
|
f.skinRequired = s.readBoolean(),
|
|
m = s.readInt(!0);
|
|
for (y = 0; y < m; y++)
|
|
f.bones.push(o.bones[s.readInt(!0)]);
|
|
f.target = o.bones[s.readInt(!0)],
|
|
f.local = s.readBoolean(),
|
|
f.relative = s.readBoolean(),
|
|
f.offsetRotation = s.readFloat(),
|
|
f.offsetX = s.readFloat() * r,
|
|
f.offsetY = s.readFloat() * r,
|
|
f.offsetScaleX = s.readFloat(),
|
|
f.offsetScaleY = s.readFloat(),
|
|
f.offsetShearY = s.readFloat(),
|
|
f.rotateMix = s.readFloat(),
|
|
f.translateMix = s.readFloat(),
|
|
f.scaleMix = s.readFloat(),
|
|
f.shearMix = s.readFloat(),
|
|
o.transformConstraints.push(f)
|
|
}
|
|
h = s.readInt(!0);
|
|
for (l = 0, m = void 0; l < h; l++) {
|
|
(f = new t.PathConstraintData(s.readString())).order = s.readInt(!0),
|
|
f.skinRequired = s.readBoolean(),
|
|
m = s.readInt(!0);
|
|
for (y = 0; y < m; y++)
|
|
f.bones.push(o.bones[s.readInt(!0)]);
|
|
f.target = o.slots[s.readInt(!0)],
|
|
f.positionMode = e.PositionModeValues[s.readInt(!0)],
|
|
f.spacingMode = e.SpacingModeValues[s.readInt(!0)],
|
|
f.rotateMode = e.RotateModeValues[s.readInt(!0)],
|
|
f.offsetRotation = s.readFloat(),
|
|
f.position = s.readFloat(),
|
|
f.positionMode == t.PositionMode.Fixed && (f.position *= r),
|
|
f.spacing = s.readFloat(),
|
|
f.spacingMode != t.SpacingMode.Length && f.spacingMode != t.SpacingMode.Fixed || (f.spacing *= r),
|
|
f.rotateMix = s.readFloat(),
|
|
f.translateMix = s.readFloat(),
|
|
o.pathConstraints.push(f)
|
|
}
|
|
var g = this.readSkin(s, o, !0, a);
|
|
null != g && (o.defaultSkin = g, o.skins.push(g));
|
|
l = o.skins.length;
|
|
for (t.Utils.setArraySize(o.skins, h = l + s.readInt(!0)); l < h; l++)
|
|
o.skins[l] = this.readSkin(s, o, !1, a);
|
|
h = this.linkedMeshes.length;
|
|
for (l = 0; l < h; l++) {
|
|
var v = this.linkedMeshes[l],
|
|
w = null == v.skin ? o.defaultSkin : o.findSkin(v.skin);
|
|
if (null == w)
|
|
throw new Error("Skin not found: " + v.skin);
|
|
var x = w.getAttachment(v.slotIndex, v.parent);
|
|
if (null == x)
|
|
throw new Error("Parent mesh not found: " + v.parent);
|
|
v.mesh.deformAttachment = v.inheritDeform ? x : v.mesh,
|
|
v.mesh.setParentMesh(x)
|
|
}
|
|
this.linkedMeshes.length = 0,
|
|
h = s.readInt(!0);
|
|
for (l = 0; l < h; l++) {
|
|
(f = new t.EventData(s.readStringRef())).intValue = s.readInt(!1),
|
|
f.floatValue = s.readFloat(),
|
|
f.stringValue = s.readString(),
|
|
f.audioPath = s.readString(),
|
|
null != f.audioPath && (f.volume = s.readFloat(), f.balance = s.readFloat()),
|
|
o.events.push(f)
|
|
}
|
|
h = s.readInt(!0);
|
|
for (l = 0; l < h; l++)
|
|
o.animations.push(this.readAnimation(s, s.readString(), o));
|
|
return o
|
|
},
|
|
e.prototype.readSkin = function (e, i, n, r) {
|
|
var o = null,
|
|
s = 0;
|
|
if (n) {
|
|
if (0 == (s = e.readInt(!0)))
|
|
return null;
|
|
o = new t.Skin("default")
|
|
} else {
|
|
(o = new t.Skin(e.readStringRef())).bones.length = e.readInt(!0);
|
|
for (var a = 0, h = o.bones.length; a < h; a++)
|
|
o.bones[a] = i.bones[e.readInt(!0)];
|
|
for (a = 0, h = e.readInt(!0); a < h; a++)
|
|
o.constraints.push(i.ikConstraints[e.readInt(!0)]);
|
|
for (a = 0, h = e.readInt(!0); a < h; a++)
|
|
o.constraints.push(i.transformConstraints[e.readInt(!0)]);
|
|
for (a = 0, h = e.readInt(!0); a < h; a++)
|
|
o.constraints.push(i.pathConstraints[e.readInt(!0)]);
|
|
s = e.readInt(!0)
|
|
}
|
|
for (a = 0; a < s; a++)
|
|
for (var l = e.readInt(!0), u = 0, c = e.readInt(!0); u < c; u++) {
|
|
var p = e.readStringRef(),
|
|
d = this.readAttachment(e, i, o, l, p, r);
|
|
null != d && o.setAttachment(l, p, d)
|
|
}
|
|
return o
|
|
},
|
|
e.prototype.readAttachment = function (i, r, o, s, a, h) {
|
|
var l = this.scale,
|
|
u = i.readStringRef();
|
|
null == u && (u = a);
|
|
var c = i.readByte();
|
|
switch (e.AttachmentTypeValues[c]) {
|
|
case t.AttachmentType.Region:
|
|
var p = i.readStringRef(),
|
|
d = i.readFloat(),
|
|
f = i.readFloat(),
|
|
_ = i.readFloat(),
|
|
m = i.readFloat(),
|
|
y = i.readFloat(),
|
|
g = i.readFloat(),
|
|
v = i.readFloat(),
|
|
w = i.readInt32();
|
|
null == p && (p = u);
|
|
var x = this.attachmentLoader.newRegionAttachment(o, u, p);
|
|
return null == x ? null : (x.path = p, x.x = f * l, x.y = _ * l, x.scaleX = m, x.scaleY = y, x.rotation = d, x.width = g * l, x.height = v * l, t.Color.rgba8888ToColor(x.color, w), x);
|
|
case t.AttachmentType.BoundingBox:
|
|
var b = i.readInt(!0),
|
|
E = this.readVertices(i, b),
|
|
$ = (w = h ? i.readInt32() : 0, this.attachmentLoader.newBoundingBoxAttachment(o, u));
|
|
return null == $ ? null : ($.worldVerticesLength = b << 1, $.vertices = E.vertices, $.bones = E.bones, h && t.Color.rgba8888ToColor($.color, w), $);
|
|
case t.AttachmentType.Mesh:
|
|
p = i.readStringRef(),
|
|
w = i.readInt32(),
|
|
b = i.readInt(!0);
|
|
var A = this.readFloatArray(i, b << 1, 1),
|
|
S = this.readShortArray(i),
|
|
T = (E = this.readVertices(i, b), i.readInt(!0)),
|
|
C = null;
|
|
g = 0,
|
|
v = 0;
|
|
return h && (C = this.readShortArray(i), g = i.readFloat(), v = i.readFloat()),
|
|
null == p && (p = u),
|
|
null == (M = this.attachmentLoader.newMeshAttachment(o, u, p)) ? null : (M.path = p, t.Color.rgba8888ToColor(M.color, w), M.bones = E.bones, M.vertices = E.vertices, M.worldVerticesLength = b << 1, M.triangles = S, M.regionUVs = new Float32Array(A), M.hullLength = T << 1, h && (M.edges = C, M.width = g * l, M.height = v * l), M);
|
|
case t.AttachmentType.LinkedMesh:
|
|
p = i.readStringRef(),
|
|
w = i.readInt32();
|
|
var M,
|
|
I = i.readStringRef(),
|
|
P = i.readStringRef(),
|
|
O = i.readBoolean();
|
|
g = 0,
|
|
v = 0;
|
|
return h && (g = i.readFloat(), v = i.readFloat()),
|
|
null == p && (p = u),
|
|
null == (M = this.attachmentLoader.newMeshAttachment(o, u, p)) ? null : (M.path = p, t.Color.rgba8888ToColor(M.color, w), h && (M.width = g * l, M.height = v * l), this.linkedMeshes.push(new n(M, I, s, P, O)), M);
|
|
case t.AttachmentType.Path:
|
|
for (var R = i.readBoolean(), D = i.readBoolean(), L = (b = i.readInt(!0), E = this.readVertices(i, b), t.Utils.newArray(b / 3, 0)), k = 0, F = L.length; k < F; k++)
|
|
L[k] = i.readFloat() * l;
|
|
w = h ? i.readInt32() : 0;
|
|
return null == (p = this.attachmentLoader.newPathAttachment(o, u)) ? null : (p.closed = R, p.constantSpeed = D, p.worldVerticesLength = b << 1, p.vertices = E.vertices, p.bones = E.bones, p.lengths = L, h && t.Color.rgba8888ToColor(p.color, w), p);
|
|
case t.AttachmentType.Point:
|
|
d = i.readFloat(),
|
|
f = i.readFloat(),
|
|
_ = i.readFloat(),
|
|
w = h ? i.readInt32() : 0;
|
|
var N = this.attachmentLoader.newPointAttachment(o, u);
|
|
return null == N ? null : (N.x = f * l, N.y = _ * l, N.rotation = d, h && t.Color.rgba8888ToColor(N.color, w), N);
|
|
case t.AttachmentType.Clipping:
|
|
var B = i.readInt(!0),
|
|
U = (b = i.readInt(!0), E = this.readVertices(i, b), w = h ? i.readInt32() : 0, this.attachmentLoader.newClippingAttachment(o, u));
|
|
return null == U ? null : (U.endSlot = r.slots[B], U.worldVerticesLength = b << 1, U.vertices = E.vertices, U.bones = E.bones, h && t.Color.rgba8888ToColor(U.color, w), U)
|
|
}
|
|
return null
|
|
},
|
|
e.prototype.readVertices = function (e, i) {
|
|
var n = i << 1,
|
|
o = new r,
|
|
s = this.scale;
|
|
if (!e.readBoolean())
|
|
return o.vertices = this.readFloatArray(e, n, s), o;
|
|
for (var a = new Array, h = new Array, l = 0; l < i; l++) {
|
|
var u = e.readInt(!0);
|
|
h.push(u);
|
|
for (var c = 0; c < u; c++)
|
|
h.push(e.readInt(!0)), a.push(e.readFloat() * s), a.push(e.readFloat() * s), a.push(e.readFloat())
|
|
}
|
|
return o.vertices = t.Utils.toFloatArray(a),
|
|
o.bones = h,
|
|
o
|
|
},
|
|
e.prototype.readFloatArray = function (t, e, i) {
|
|
var n = new Array(e);
|
|
if (1 == i)
|
|
for (var r = 0; r < e; r++)
|
|
n[r] = t.readFloat();
|
|
else
|
|
for (r = 0; r < e; r++)
|
|
n[r] = t.readFloat() * i;
|
|
return n
|
|
},
|
|
e.prototype.readShortArray = function (t) {
|
|
for (var e = t.readInt(!0), i = new Array(e), n = 0; n < e; n++)
|
|
i[n] = t.readShort();
|
|
return i
|
|
},
|
|
e.prototype.readAnimation = function (i, n, r) {
|
|
for (var o = new Array, s = this.scale, a = 0, h = new t.Color, l = new t.Color, u = 0, c = i.readInt(!0); u < c; u++)
|
|
for (var p = i.readInt(!0), d = 0, f = i.readInt(!0); d < f; d++) {
|
|
var _ = i.readByte(),
|
|
m = i.readInt(!0);
|
|
switch (_) {
|
|
case e.SLOT_ATTACHMENT:
|
|
(w = new t.AttachmentTimeline(m)).slotIndex = p;
|
|
for (var y = 0; y < m; y++)
|
|
w.setFrame(y, i.readFloat(), i.readStringRef());
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[m - 1]);
|
|
break;
|
|
case e.SLOT_COLOR:
|
|
(w = new t.ColorTimeline(m)).slotIndex = p;
|
|
for (y = 0; y < m; y++) {
|
|
var g = i.readFloat();
|
|
t.Color.rgba8888ToColor(h, i.readInt32()),
|
|
w.setFrame(y, g, h.r, h.g, h.b, h.a),
|
|
y < m - 1 && this.readCurve(i, y, w)
|
|
}
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.ColorTimeline.ENTRIES]);
|
|
break;
|
|
case e.SLOT_TWO_COLOR:
|
|
(w = new t.TwoColorTimeline(m)).slotIndex = p;
|
|
for (y = 0; y < m; y++) {
|
|
g = i.readFloat();
|
|
t.Color.rgba8888ToColor(h, i.readInt32()),
|
|
t.Color.rgb888ToColor(l, i.readInt32()),
|
|
w.setFrame(y, g, h.r, h.g, h.b, h.a, l.r, l.g, l.b),
|
|
y < m - 1 && this.readCurve(i, y, w)
|
|
}
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.TwoColorTimeline.ENTRIES])
|
|
}
|
|
}
|
|
for (u = 0, c = i.readInt(!0); u < c; u++) {
|
|
var v = i.readInt(!0);
|
|
for (d = 0, f = i.readInt(!0); d < f; d++) {
|
|
_ = i.readByte(),
|
|
m = i.readInt(!0);
|
|
switch (_) {
|
|
case e.BONE_ROTATE:
|
|
(w = new t.RotateTimeline(m)).boneIndex = v;
|
|
for (y = 0; y < m; y++)
|
|
w.setFrame(y, i.readFloat(), i.readFloat()), y < m - 1 && this.readCurve(i, y, w);
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.RotateTimeline.ENTRIES]);
|
|
break;
|
|
case e.BONE_TRANSLATE:
|
|
case e.BONE_SCALE:
|
|
case e.BONE_SHEAR:
|
|
var w = void 0,
|
|
x = 1;
|
|
_ == e.BONE_SCALE ? w = new t.ScaleTimeline(m) : _ == e.BONE_SHEAR ? w = new t.ShearTimeline(m) : (w = new t.TranslateTimeline(m), x = s),
|
|
w.boneIndex = v;
|
|
for (y = 0; y < m; y++)
|
|
w.setFrame(y, i.readFloat(), i.readFloat() * x, i.readFloat() * x), y < m - 1 && this.readCurve(i, y, w);
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.TranslateTimeline.ENTRIES])
|
|
}
|
|
}
|
|
}
|
|
for (u = 0, c = i.readInt(!0); u < c; u++) {
|
|
var b = i.readInt(!0);
|
|
m = i.readInt(!0);
|
|
(w = new t.IkConstraintTimeline(m)).ikConstraintIndex = b;
|
|
for (y = 0; y < m; y++)
|
|
w.setFrame(y, i.readFloat(), i.readFloat(), i.readFloat() * s, i.readByte(), i.readBoolean(), i.readBoolean()), y < m - 1 && this.readCurve(i, y, w);
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.IkConstraintTimeline.ENTRIES])
|
|
}
|
|
for (u = 0, c = i.readInt(!0); u < c; u++) {
|
|
b = i.readInt(!0),
|
|
m = i.readInt(!0);
|
|
(w = new t.TransformConstraintTimeline(m)).transformConstraintIndex = b;
|
|
for (y = 0; y < m; y++)
|
|
w.setFrame(y, i.readFloat(), i.readFloat(), i.readFloat(), i.readFloat(), i.readFloat()), y < m - 1 && this.readCurve(i, y, w);
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.TransformConstraintTimeline.ENTRIES])
|
|
}
|
|
for (u = 0, c = i.readInt(!0); u < c; u++) {
|
|
b = i.readInt(!0);
|
|
var E = r.pathConstraints[b];
|
|
for (d = 0, f = i.readInt(!0); d < f; d++) {
|
|
_ = i.readByte(),
|
|
m = i.readInt(!0);
|
|
switch (_) {
|
|
case e.PATH_POSITION:
|
|
case e.PATH_SPACING:
|
|
w = void 0,
|
|
x = 1;
|
|
_ == e.PATH_SPACING ? (w = new t.PathConstraintSpacingTimeline(m), E.spacingMode != t.SpacingMode.Length && E.spacingMode != t.SpacingMode.Fixed || (x = s)) : (w = new t.PathConstraintPositionTimeline(m), E.positionMode == t.PositionMode.Fixed && (x = s)),
|
|
w.pathConstraintIndex = b;
|
|
for (y = 0; y < m; y++)
|
|
w.setFrame(y, i.readFloat(), i.readFloat() * x), y < m - 1 && this.readCurve(i, y, w);
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.PathConstraintPositionTimeline.ENTRIES]);
|
|
break;
|
|
case e.PATH_MIX:
|
|
(w = new t.PathConstraintMixTimeline(m)).pathConstraintIndex = b;
|
|
for (y = 0; y < m; y++)
|
|
w.setFrame(y, i.readFloat(), i.readFloat(), i.readFloat()), y < m - 1 && this.readCurve(i, y, w);
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[(m - 1) * t.PathConstraintMixTimeline.ENTRIES])
|
|
}
|
|
}
|
|
}
|
|
for (u = 0, c = i.readInt(!0); u < c; u++) {
|
|
var $ = r.skins[i.readInt(!0)];
|
|
for (d = 0, f = i.readInt(!0); d < f; d++) {
|
|
p = i.readInt(!0);
|
|
for (var A = 0, S = i.readInt(!0); A < S; A++) {
|
|
var T = $.getAttachment(p, i.readStringRef()),
|
|
C = null != T.bones,
|
|
M = T.vertices,
|
|
I = C ? M.length / 3 * 2 : M.length;
|
|
m = i.readInt(!0);
|
|
(w = new t.DeformTimeline(m)).slotIndex = p,
|
|
w.attachment = T;
|
|
for (y = 0; y < m; y++) {
|
|
g = i.readFloat();
|
|
var P = void 0,
|
|
O = i.readInt(!0);
|
|
if (0 == O)
|
|
P = C ? t.Utils.newFloatArray(I) : M;
|
|
else {
|
|
P = t.Utils.newFloatArray(I);
|
|
var R = i.readInt(!0);
|
|
if (O += R, 1 == s)
|
|
for (var D = R; D < O; D++)
|
|
P[D] = i.readFloat();
|
|
else
|
|
for (D = R; D < O; D++)
|
|
P[D] = i.readFloat() * s;
|
|
if (!C) {
|
|
D = 0;
|
|
for (var L = P.length; D < L; D++)
|
|
P[D] += M[D]
|
|
}
|
|
}
|
|
w.setFrame(y, g, P),
|
|
y < m - 1 && this.readCurve(i, y, w)
|
|
}
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[m - 1])
|
|
}
|
|
}
|
|
}
|
|
var k = i.readInt(!0);
|
|
if (k > 0) {
|
|
w = new t.DrawOrderTimeline(k);
|
|
var F = r.slots.length;
|
|
for (u = 0; u < k; u++) {
|
|
g = i.readFloat();
|
|
var N = i.readInt(!0),
|
|
B = t.Utils.newArray(F, 0);
|
|
for (d = F - 1; d >= 0; d--)
|
|
B[d] = -1;
|
|
var U = t.Utils.newArray(F - N, 0),
|
|
X = 0,
|
|
j = 0;
|
|
for (d = 0; d < N; d++) {
|
|
for (p = i.readInt(!0); X != p; )
|
|
U[j++] = X++;
|
|
B[X + i.readInt(!0)] = X++
|
|
}
|
|
for (; X < F; )
|
|
U[j++] = X++;
|
|
for (d = F - 1; d >= 0; d--)
|
|
- 1 == B[d] && (B[d] = U[--j]);
|
|
w.setFrame(u, g, B)
|
|
}
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[k - 1])
|
|
}
|
|
var V = i.readInt(!0);
|
|
if (V > 0) {
|
|
for (w = new t.EventTimeline(V), u = 0; u < V; u++) {
|
|
g = i.readFloat();
|
|
var H = r.events[i.readInt(!0)],
|
|
G = new t.Event(g, H);
|
|
G.intValue = i.readInt(!1),
|
|
G.floatValue = i.readFloat(),
|
|
G.stringValue = i.readBoolean() ? i.readString() : H.stringValue,
|
|
null != G.data.audioPath && (G.volume = i.readFloat(), G.balance = i.readFloat()),
|
|
w.setFrame(u, G)
|
|
}
|
|
o.push(w),
|
|
a = Math.max(a, w.frames[V - 1])
|
|
}
|
|
return new t.Animation(n, o, a)
|
|
},
|
|
e.prototype.readCurve = function (t, i, n) {
|
|
switch (t.readByte()) {
|
|
case e.CURVE_STEPPED:
|
|
n.setStepped(i);
|
|
break;
|
|
case e.CURVE_BEZIER:
|
|
this.setCurve(n, i, t.readFloat(), t.readFloat(), t.readFloat(), t.readFloat())
|
|
}
|
|
},
|
|
e.prototype.setCurve = function (t, e, i, n, r, o) {
|
|
t.setCurve(e, i, n, r, o)
|
|
},
|
|
e.AttachmentTypeValues = [0, 1, 2, 3, 4, 5, 6],
|
|
e.TransformModeValues = [t.TransformMode.Normal, t.TransformMode.OnlyTranslation, t.TransformMode.NoRotationOrReflection, t.TransformMode.NoScale, t.TransformMode.NoScaleOrReflection],
|
|
e.PositionModeValues = [t.PositionMode.Fixed, t.PositionMode.Percent],
|
|
e.SpacingModeValues = [t.SpacingMode.Length, t.SpacingMode.Fixed, t.SpacingMode.Percent],
|
|
e.RotateModeValues = [t.RotateMode.Tangent, t.RotateMode.Chain, t.RotateMode.ChainScale],
|
|
e.BlendModeValues = [t.BlendMode.Normal, t.BlendMode.Additive, t.BlendMode.Multiply, t.BlendMode.Screen],
|
|
e.BONE_ROTATE = 0,
|
|
e.BONE_TRANSLATE = 1,
|
|
e.BONE_SCALE = 2,
|
|
e.BONE_SHEAR = 3,
|
|
e.SLOT_ATTACHMENT = 0,
|
|
e.SLOT_COLOR = 1,
|
|
e.SLOT_TWO_COLOR = 2,
|
|
e.PATH_POSITION = 0,
|
|
e.PATH_SPACING = 1,
|
|
e.PATH_MIX = 2,
|
|
e.CURVE_LINEAR = 0,
|
|
e.CURVE_STEPPED = 1,
|
|
e.CURVE_BEZIER = 2,
|
|
e
|
|
}
|
|
();
|
|
t.SkeletonBinary = e;
|
|
var i = function () {
|
|
function t(t, e, i, n) {
|
|
void 0 === e && (e = new Array),
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = new DataView(t.buffer)),
|
|
this.strings = e,
|
|
this.index = i,
|
|
this.buffer = n
|
|
}
|
|
return t.prototype.readByte = function () {
|
|
return this.buffer.getInt8(this.index++)
|
|
},
|
|
t.prototype.readShort = function () {
|
|
var t = this.buffer.getInt16(this.index);
|
|
return this.index += 2,
|
|
t
|
|
},
|
|
t.prototype.readInt32 = function () {
|
|
var t = this.buffer.getInt32(this.index);
|
|
return this.index += 4,
|
|
t
|
|
},
|
|
t.prototype.readInt = function (t) {
|
|
var e = this.readByte(),
|
|
i = 127 & e;
|
|
return 0 != (128 & e) && (i |= (127 & (e = this.readByte())) << 7, 0 != (128 & e) && (i |= (127 & (e = this.readByte())) << 14, 0 != (128 & e) && (i |= (127 & (e = this.readByte())) << 21, 0 != (128 & e) && (i |= (127 & (e = this.readByte())) << 28)))),
|
|
t ? i : i >>> 1 ^ - (1 & i)
|
|
},
|
|
t.prototype.readStringRef = function () {
|
|
var t = this.readInt(!0);
|
|
return 0 == t ? null : this.strings[t - 1]
|
|
},
|
|
t.prototype.readString = function () {
|
|
var t = this.readInt(!0);
|
|
switch (t) {
|
|
case 0:
|
|
return null;
|
|
case 1:
|
|
return ""
|
|
}
|
|
t--;
|
|
for (var e = "", i = 0; i < t; ) {
|
|
var n = this.readByte();
|
|
switch (n >> 4) {
|
|
case 12:
|
|
case 13:
|
|
e += String.fromCharCode((31 & n) << 6 | 63 & this.readByte()),
|
|
i += 2;
|
|
break;
|
|
case 14:
|
|
e += String.fromCharCode((15 & n) << 12 | (63 & this.readByte()) << 6 | 63 & this.readByte()),
|
|
i += 3;
|
|
break;
|
|
default:
|
|
e += String.fromCharCode(n),
|
|
i++
|
|
}
|
|
}
|
|
return e
|
|
},
|
|
t.prototype.readFloat = function () {
|
|
var t = this.buffer.getFloat32(this.index);
|
|
return this.index += 4,
|
|
t
|
|
},
|
|
t.prototype.readBoolean = function () {
|
|
return 0 != this.readByte()
|
|
},
|
|
t
|
|
}
|
|
(),
|
|
n = function (t, e, i, n, r) {
|
|
this.mesh = t,
|
|
this.skin = e,
|
|
this.slotIndex = i,
|
|
this.parent = n,
|
|
this.inheritDeform = r
|
|
},
|
|
r = function (t, e) {
|
|
void 0 === t && (t = null),
|
|
void 0 === e && (e = null),
|
|
this.bones = t,
|
|
this.vertices = e
|
|
}
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e() {
|
|
this.minX = 0,
|
|
this.minY = 0,
|
|
this.maxX = 0,
|
|
this.maxY = 0,
|
|
this.boundingBoxes = new Array,
|
|
this.polygons = new Array,
|
|
this.polygonPool = new t.Pool((function () {
|
|
return t.Utils.newFloatArray(16)
|
|
}))
|
|
}
|
|
return e.prototype.update = function (e, i) {
|
|
if (null == e)
|
|
throw new Error("skeleton cannot be null.");
|
|
var n = this.boundingBoxes,
|
|
r = this.polygons,
|
|
o = this.polygonPool,
|
|
s = e.slots,
|
|
a = s.length;
|
|
n.length = 0,
|
|
o.freeAll(r),
|
|
r.length = 0;
|
|
for (var h = 0; h < a; h++) {
|
|
var l = s[h];
|
|
if (l.bone.active) {
|
|
var u = l.getAttachment();
|
|
if (u instanceof t.BoundingBoxAttachment) {
|
|
var c = u;
|
|
n.push(c);
|
|
var p = o.obtain();
|
|
p.length != c.worldVerticesLength && (p = t.Utils.newFloatArray(c.worldVerticesLength)),
|
|
r.push(p),
|
|
c.computeWorldVertices(l, 0, c.worldVerticesLength, p, 0, 2)
|
|
}
|
|
}
|
|
}
|
|
i ? this.aabbCompute() : (this.minX = Number.POSITIVE_INFINITY, this.minY = Number.POSITIVE_INFINITY, this.maxX = Number.NEGATIVE_INFINITY, this.maxY = Number.NEGATIVE_INFINITY)
|
|
},
|
|
e.prototype.aabbCompute = function () {
|
|
for (var t = Number.POSITIVE_INFINITY, e = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY, n = Number.NEGATIVE_INFINITY, r = this.polygons, o = 0, s = r.length; o < s; o++)
|
|
for (var a = r[o], h = a, l = 0, u = a.length; l < u; l += 2) {
|
|
var c = h[l],
|
|
p = h[l + 1];
|
|
t = Math.min(t, c),
|
|
e = Math.min(e, p),
|
|
i = Math.max(i, c),
|
|
n = Math.max(n, p)
|
|
}
|
|
this.minX = t,
|
|
this.minY = e,
|
|
this.maxX = i,
|
|
this.maxY = n
|
|
},
|
|
e.prototype.aabbContainsPoint = function (t, e) {
|
|
return t >= this.minX && t <= this.maxX && e >= this.minY && e <= this.maxY
|
|
},
|
|
e.prototype.aabbIntersectsSegment = function (t, e, i, n) {
|
|
var r = this.minX,
|
|
o = this.minY,
|
|
s = this.maxX,
|
|
a = this.maxY;
|
|
if (t <= r && i <= r || e <= o && n <= o || t >= s && i >= s || e >= a && n >= a)
|
|
return !1;
|
|
var h = (n - e) / (i - t),
|
|
l = h * (r - t) + e;
|
|
if (l > o && l < a)
|
|
return !0;
|
|
if ((l = h * (s - t) + e) > o && l < a)
|
|
return !0;
|
|
var u = (o - e) / h + t;
|
|
return u > r && u < s || (u = (a - e) / h + t) > r && u < s
|
|
},
|
|
e.prototype.aabbIntersectsSkeleton = function (t) {
|
|
return this.minX < t.maxX && this.maxX > t.minX && this.minY < t.maxY && this.maxY > t.minY
|
|
},
|
|
e.prototype.containsPoint = function (t, e) {
|
|
for (var i = this.polygons, n = 0, r = i.length; n < r; n++)
|
|
if (this.containsPointPolygon(i[n], t, e))
|
|
return this.boundingBoxes[n];
|
|
return null
|
|
},
|
|
e.prototype.containsPointPolygon = function (t, e, i) {
|
|
for (var n = t, r = t.length, o = r - 2, s = !1, a = 0; a < r; a += 2) {
|
|
var h = n[a + 1],
|
|
l = n[o + 1];
|
|
if (h < i && l >= i || l < i && h >= i) {
|
|
var u = n[a];
|
|
u + (i - h) / (l - h) * (n[o] - u) < e && (s = !s)
|
|
}
|
|
o = a
|
|
}
|
|
return s
|
|
},
|
|
e.prototype.intersectsSegment = function (t, e, i, n) {
|
|
for (var r = this.polygons, o = 0, s = r.length; o < s; o++)
|
|
if (this.intersectsSegmentPolygon(r[o], t, e, i, n))
|
|
return this.boundingBoxes[o];
|
|
return null
|
|
},
|
|
e.prototype.intersectsSegmentPolygon = function (t, e, i, n, r) {
|
|
for (var o = t, s = t.length, a = e - n, h = i - r, l = e * r - i * n, u = o[s - 2], c = o[s - 1], p = 0; p < s; p += 2) {
|
|
var d = o[p],
|
|
f = o[p + 1],
|
|
_ = u * f - c * d,
|
|
m = u - d,
|
|
y = c - f,
|
|
g = a * y - h * m,
|
|
v = (l * m - a * _) / g;
|
|
if ((v >= u && v <= d || v >= d && v <= u) && (v >= e && v <= n || v >= n && v <= e)) {
|
|
var w = (l * y - h * _) / g;
|
|
if ((w >= c && w <= f || w >= f && w <= c) && (w >= i && w <= r || w >= r && w <= i))
|
|
return !0
|
|
}
|
|
u = d,
|
|
c = f
|
|
}
|
|
return !1
|
|
},
|
|
e.prototype.getPolygon = function (t) {
|
|
if (null == t)
|
|
throw new Error("boundingBox cannot be null.");
|
|
var e = this.boundingBoxes.indexOf(t);
|
|
return -1 == e ? null : this.polygons[e]
|
|
},
|
|
e.prototype.getWidth = function () {
|
|
return this.maxX - this.minX
|
|
},
|
|
e.prototype.getHeight = function () {
|
|
return this.maxY - this.minY
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.SkeletonBounds = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e() {
|
|
this.triangulator = new t.Triangulator,
|
|
this.clippingPolygon = new Array,
|
|
this.clipOutput = new Array,
|
|
this.clippedVertices = new Array,
|
|
this.clippedTriangles = new Array,
|
|
this.scratch = new Array
|
|
}
|
|
return e.prototype.clipStart = function (i, n) {
|
|
if (null != this.clipAttachment)
|
|
return 0;
|
|
this.clipAttachment = n;
|
|
var r = n.worldVerticesLength,
|
|
o = t.Utils.setArraySize(this.clippingPolygon, r);
|
|
n.computeWorldVertices(i, 0, r, o, 0, 2);
|
|
var s = this.clippingPolygon;
|
|
e.makeClockwise(s);
|
|
for (var a = this.clippingPolygons = this.triangulator.decompose(s, this.triangulator.triangulate(s)), h = 0, l = a.length; h < l; h++) {
|
|
var u = a[h];
|
|
e.makeClockwise(u),
|
|
u.push(u[0]),
|
|
u.push(u[1])
|
|
}
|
|
return a.length
|
|
},
|
|
e.prototype.clipEndWithSlot = function (t) {
|
|
null != this.clipAttachment && this.clipAttachment.endSlot == t.data && this.clipEnd()
|
|
},
|
|
e.prototype.clipEnd = function () {
|
|
null != this.clipAttachment && (this.clipAttachment = null, this.clippingPolygons = null, this.clippedVertices.length = 0, this.clippedTriangles.length = 0, this.clippingPolygon.length = 0)
|
|
},
|
|
e.prototype.isClipping = function () {
|
|
return null != this.clipAttachment
|
|
},
|
|
e.prototype.clipTriangles = function (e, i, n, r, o, s, a, h) {
|
|
var l = this.clipOutput,
|
|
u = this.clippedVertices,
|
|
c = this.clippedTriangles,
|
|
p = this.clippingPolygons,
|
|
d = this.clippingPolygons.length,
|
|
f = h ? 12 : 8,
|
|
_ = 0;
|
|
u.length = 0,
|
|
c.length = 0;
|
|
t: for (var m = 0; m < r; m += 3)
|
|
for (var y = n[m] << 1, g = e[y], v = e[y + 1], w = o[y], x = o[y + 1], b = e[y = n[m + 1] << 1], E = e[y + 1], $ = o[y], A = o[y + 1], S = e[y = n[m + 2] << 1], T = e[y + 1], C = o[y], M = o[y + 1], I = 0; I < d; I++) {
|
|
var P = u.length;
|
|
if (!this.clip(g, v, b, E, S, T, p[I], l)) {
|
|
(U = t.Utils.setArraySize(u, P + 3 * f))[P] = g,
|
|
U[P + 1] = v,
|
|
U[P + 2] = s.r,
|
|
U[P + 3] = s.g,
|
|
U[P + 4] = s.b,
|
|
U[P + 5] = s.a,
|
|
h ? (U[P + 6] = w, U[P + 7] = x, U[P + 8] = a.r, U[P + 9] = a.g, U[P + 10] = a.b, U[P + 11] = a.a, U[P + 12] = b, U[P + 13] = E, U[P + 14] = s.r, U[P + 15] = s.g, U[P + 16] = s.b, U[P + 17] = s.a, U[P + 18] = $, U[P + 19] = A, U[P + 20] = a.r, U[P + 21] = a.g, U[P + 22] = a.b, U[P + 23] = a.a, U[P + 24] = S, U[P + 25] = T, U[P + 26] = s.r, U[P + 27] = s.g, U[P + 28] = s.b, U[P + 29] = s.a, U[P + 30] = C, U[P + 31] = M, U[P + 32] = a.r, U[P + 33] = a.g, U[P + 34] = a.b, U[P + 35] = a.a) : (U[P + 6] = w, U[P + 7] = x, U[P + 8] = b, U[P + 9] = E, U[P + 10] = s.r, U[P + 11] = s.g, U[P + 12] = s.b, U[P + 13] = s.a, U[P + 14] = $, U[P + 15] = A, U[P + 16] = S, U[P + 17] = T, U[P + 18] = s.r, U[P + 19] = s.g, U[P + 20] = s.b, U[P + 21] = s.a, U[P + 22] = C, U[P + 23] = M),
|
|
P = c.length,
|
|
(q = t.Utils.setArraySize(c, P + 3))[P] = _,
|
|
q[P + 1] = _ + 1,
|
|
q[P + 2] = _ + 2,
|
|
_ += 3;
|
|
continue t
|
|
}
|
|
var O = l.length;
|
|
if (0 != O) {
|
|
for (var R = E - T, D = S - b, L = g - S, k = T - v, F = 1 / (R * L + D * (v - T)), N = O >> 1, B = this.clipOutput, U = t.Utils.setArraySize(u, P + N * f), X = 0; X < O; X += 2) {
|
|
var j = B[X],
|
|
V = B[X + 1];
|
|
U[P] = j,
|
|
U[P + 1] = V,
|
|
U[P + 2] = s.r,
|
|
U[P + 3] = s.g,
|
|
U[P + 4] = s.b,
|
|
U[P + 5] = s.a;
|
|
var H = j - S,
|
|
G = V - T,
|
|
Y = (R * H + D * G) * F,
|
|
W = (k * H + L * G) * F,
|
|
z = 1 - Y - W;
|
|
U[P + 6] = w * Y + $ * W + C * z,
|
|
U[P + 7] = x * Y + A * W + M * z,
|
|
h && (U[P + 8] = a.r, U[P + 9] = a.g, U[P + 10] = a.b, U[P + 11] = a.a),
|
|
P += f
|
|
}
|
|
P = c.length;
|
|
var q = t.Utils.setArraySize(c, P + 3 * (N - 2));
|
|
N--;
|
|
for (X = 1; X < N; X++)
|
|
q[P] = _, q[P + 1] = _ + X, q[P + 2] = _ + X + 1, P += 3;
|
|
_ += N + 1
|
|
}
|
|
}
|
|
},
|
|
e.prototype.clip = function (t, e, i, n, r, o, s, a) {
|
|
var h = a,
|
|
l = !1,
|
|
u = null;
|
|
s.length % 4 >= 2 ? (u = a, a = this.scratch) : u = this.scratch,
|
|
u.length = 0,
|
|
u.push(t),
|
|
u.push(e),
|
|
u.push(i),
|
|
u.push(n),
|
|
u.push(r),
|
|
u.push(o),
|
|
u.push(t),
|
|
u.push(e),
|
|
a.length = 0;
|
|
for (var c = s, p = s.length - 4, d = 0; ; d += 2) {
|
|
for (var f = c[d], _ = c[d + 1], m = c[d + 2], y = c[d + 3], g = f - m, v = _ - y, w = u, x = u.length - 2, b = a.length, E = 0; E < x; E += 2) {
|
|
var $ = w[E],
|
|
A = w[E + 1],
|
|
S = w[E + 2],
|
|
T = w[E + 3],
|
|
C = g * (T - y) - v * (S - m) > 0;
|
|
if (g * (A - y) - v * ($ - m) > 0) {
|
|
if (C) {
|
|
a.push(S),
|
|
a.push(T);
|
|
continue
|
|
}
|
|
var M = ((P = S - $) * (_ - A) - (I = T - A) * (f - $)) / (I * (m - f) - P * (y - _));
|
|
a.push(f + (m - f) * M),
|
|
a.push(_ + (y - _) * M)
|
|
} else if (C) {
|
|
var I,
|
|
P;
|
|
M = ((P = S - $) * (_ - A) - (I = T - A) * (f - $)) / (I * (m - f) - P * (y - _));
|
|
a.push(f + (m - f) * M),
|
|
a.push(_ + (y - _) * M),
|
|
a.push(S),
|
|
a.push(T)
|
|
}
|
|
l = !0
|
|
}
|
|
if (b == a.length)
|
|
return h.length = 0, !0;
|
|
if (a.push(a[0]), a.push(a[1]), d == p)
|
|
break;
|
|
var O = a;
|
|
(a = u).length = 0,
|
|
u = O
|
|
}
|
|
if (h != a) {
|
|
h.length = 0;
|
|
d = 0;
|
|
for (var R = a.length - 2; d < R; d++)
|
|
h[d] = a[d]
|
|
} else
|
|
h.length = h.length - 2;
|
|
return l
|
|
},
|
|
e.makeClockwise = function (t) {
|
|
for (var e = t, i = t.length, n = e[i - 2] * e[1] - e[0] * e[i - 1], r = 0, o = 0, s = 0, a = 0, h = i - 3; a < h; a += 2)
|
|
r = e[a], o = e[a + 1], s = e[a + 2], n += r * e[a + 3] - s * o;
|
|
if (!(n < 0)) {
|
|
a = 0;
|
|
var l = i - 2;
|
|
for (h = i >> 1; a < h; a += 2) {
|
|
var u = e[a],
|
|
c = e[a + 1],
|
|
p = l - a;
|
|
e[a] = e[p],
|
|
e[a + 1] = e[p + 1],
|
|
e[p] = u,
|
|
e[p + 1] = c
|
|
}
|
|
}
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.SkeletonClipping = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function t() {
|
|
this.bones = new Array,
|
|
this.slots = new Array,
|
|
this.skins = new Array,
|
|
this.events = new Array,
|
|
this.animations = new Array,
|
|
this.ikConstraints = new Array,
|
|
this.transformConstraints = new Array,
|
|
this.pathConstraints = new Array,
|
|
this.fps = 0
|
|
}
|
|
return t.prototype.findBone = function (t) {
|
|
if (null == t)
|
|
throw new Error("boneName cannot be null.");
|
|
for (var e = this.bones, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findBoneIndex = function (t) {
|
|
if (null == t)
|
|
throw new Error("boneName cannot be null.");
|
|
for (var e = this.bones, i = 0, n = e.length; i < n; i++)
|
|
if (e[i].name == t)
|
|
return i;
|
|
return -1
|
|
},
|
|
t.prototype.findSlot = function (t) {
|
|
if (null == t)
|
|
throw new Error("slotName cannot be null.");
|
|
for (var e = this.slots, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findSlotIndex = function (t) {
|
|
if (null == t)
|
|
throw new Error("slotName cannot be null.");
|
|
for (var e = this.slots, i = 0, n = e.length; i < n; i++)
|
|
if (e[i].name == t)
|
|
return i;
|
|
return -1
|
|
},
|
|
t.prototype.findSkin = function (t) {
|
|
if (null == t)
|
|
throw new Error("skinName cannot be null.");
|
|
for (var e = this.skins, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findEvent = function (t) {
|
|
if (null == t)
|
|
throw new Error("eventDataName cannot be null.");
|
|
for (var e = this.events, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findAnimation = function (t) {
|
|
if (null == t)
|
|
throw new Error("animationName cannot be null.");
|
|
for (var e = this.animations, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findIkConstraint = function (t) {
|
|
if (null == t)
|
|
throw new Error("constraintName cannot be null.");
|
|
for (var e = this.ikConstraints, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findTransformConstraint = function (t) {
|
|
if (null == t)
|
|
throw new Error("constraintName cannot be null.");
|
|
for (var e = this.transformConstraints, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findPathConstraint = function (t) {
|
|
if (null == t)
|
|
throw new Error("constraintName cannot be null.");
|
|
for (var e = this.pathConstraints, i = 0, n = e.length; i < n; i++) {
|
|
var r = e[i];
|
|
if (r.name == t)
|
|
return r
|
|
}
|
|
return null
|
|
},
|
|
t.prototype.findPathConstraintIndex = function (t) {
|
|
if (null == t)
|
|
throw new Error("pathConstraintName cannot be null.");
|
|
for (var e = this.pathConstraints, i = 0, n = e.length; i < n; i++)
|
|
if (e[i].name == t)
|
|
return i;
|
|
return -1
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.SkeletonData = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
t.FAIL_ON_NON_EXISTING_SKIN = !1;
|
|
var e = function () {
|
|
function e(t) {
|
|
this.scale = 1,
|
|
this.linkedMeshes = new Array,
|
|
this.attachmentLoader = t
|
|
}
|
|
return e.prototype.readSkeletonData = function (i) {
|
|
var n = this.scale,
|
|
r = new t.SkeletonData,
|
|
o = "string" == typeof i ? JSON.parse(i) : i,
|
|
s = o.skeleton;
|
|
if (null != s) {
|
|
if (r.hash = s.hash, r.version = s.spine, "3.8" !== s.spine.substr(0, 3)) {
|
|
var a = "PixiJS Spine plugin supports only format for Spine 3.8. Your model has version " + s.spine + ". Please look in pixi-spine repository README for another branch.";
|
|
console.error(a)
|
|
}
|
|
r.x = s.x,
|
|
r.y = s.y,
|
|
r.width = s.width,
|
|
r.height = s.height,
|
|
r.fps = s.fps,
|
|
r.imagesPath = s.images
|
|
}
|
|
if (o.bones)
|
|
for (var h = 0; h < o.bones.length; h++) {
|
|
var l = o.bones[h],
|
|
u = null,
|
|
c = this.getValue(l, "parent", null);
|
|
if (null != c && null == (u = r.findBone(c)))
|
|
throw new Error("Parent bone not found: " + c);
|
|
(_ = new t.BoneData(r.bones.length, l.name, u)).length = this.getValue(l, "length", 0) * n,
|
|
_.x = this.getValue(l, "x", 0) * n,
|
|
_.y = this.getValue(l, "y", 0) * n,
|
|
_.rotation = this.getValue(l, "rotation", 0),
|
|
_.scaleX = this.getValue(l, "scaleX", 1),
|
|
_.scaleY = this.getValue(l, "scaleY", 1),
|
|
_.shearX = this.getValue(l, "shearX", 0),
|
|
_.shearY = this.getValue(l, "shearY", 0),
|
|
_.transformMode = e.transformModeFromString(this.getValue(l, "transform", "normal")),
|
|
_.skinRequired = this.getValue(l, "skin", !1),
|
|
r.bones.push(_)
|
|
}
|
|
if (o.slots)
|
|
for (h = 0; h < o.slots.length; h++) {
|
|
var p = (T = o.slots[h]).name,
|
|
d = T.bone,
|
|
f = r.findBone(d);
|
|
if (null == f)
|
|
throw new Error("Slot bone not found: " + d);
|
|
var _ = new t.SlotData(r.slots.length, p, f),
|
|
m = this.getValue(T, "color", null);
|
|
null != m && _.color.setFromString(m);
|
|
var y = this.getValue(T, "dark", null);
|
|
null != y && (_.darkColor = new t.Color(1, 1, 1, 1), _.darkColor.setFromString(y)),
|
|
_.attachmentName = this.getValue(T, "attachment", null),
|
|
_.blendMode = e.blendModeFromString(this.getValue(T, "blend", "normal")),
|
|
r.slots.push(_)
|
|
}
|
|
if (o.ik)
|
|
for (h = 0; h < o.ik.length; h++) {
|
|
var g = o.ik[h];
|
|
(_ = new t.IkConstraintData(g.name)).order = this.getValue(g, "order", 0),
|
|
_.skinRequired = this.getValue(g, "skin", !1);
|
|
for (var v = 0; v < g.bones.length; v++) {
|
|
d = g.bones[v];
|
|
if (null == ($ = r.findBone(d)))
|
|
throw new Error("IK bone not found: " + d);
|
|
_.bones.push($)
|
|
}
|
|
var w = g.target;
|
|
if (_.target = r.findBone(w), null == _.target)
|
|
throw new Error("IK target bone not found: " + w);
|
|
_.mix = this.getValue(g, "mix", 1),
|
|
_.softness = this.getValue(g, "softness", 0) * n,
|
|
_.bendDirection = this.getValue(g, "bendPositive", !0) ? 1 : -1,
|
|
_.compress = this.getValue(g, "compress", !1),
|
|
_.stretch = this.getValue(g, "stretch", !1),
|
|
_.uniform = this.getValue(g, "uniform", !1),
|
|
r.ikConstraints.push(_)
|
|
}
|
|
if (o.transform)
|
|
for (h = 0; h < o.transform.length; h++) {
|
|
g = o.transform[h];
|
|
(_ = new t.TransformConstraintData(g.name)).order = this.getValue(g, "order", 0),
|
|
_.skinRequired = this.getValue(g, "skin", !1);
|
|
for (v = 0; v < g.bones.length; v++) {
|
|
d = g.bones[v];
|
|
if (null == ($ = r.findBone(d)))
|
|
throw new Error("Transform constraint bone not found: " + d);
|
|
_.bones.push($)
|
|
}
|
|
w = g.target;
|
|
if (_.target = r.findBone(w), null == _.target)
|
|
throw new Error("Transform constraint target bone not found: " + w);
|
|
_.local = this.getValue(g, "local", !1),
|
|
_.relative = this.getValue(g, "relative", !1),
|
|
_.offsetRotation = this.getValue(g, "rotation", 0),
|
|
_.offsetX = this.getValue(g, "x", 0) * n,
|
|
_.offsetY = this.getValue(g, "y", 0) * n,
|
|
_.offsetScaleX = this.getValue(g, "scaleX", 0),
|
|
_.offsetScaleY = this.getValue(g, "scaleY", 0),
|
|
_.offsetShearY = this.getValue(g, "shearY", 0),
|
|
_.rotateMix = this.getValue(g, "rotateMix", 1),
|
|
_.translateMix = this.getValue(g, "translateMix", 1),
|
|
_.scaleMix = this.getValue(g, "scaleMix", 1),
|
|
_.shearMix = this.getValue(g, "shearMix", 1),
|
|
r.transformConstraints.push(_)
|
|
}
|
|
if (o.path)
|
|
for (h = 0; h < o.path.length; h++) {
|
|
g = o.path[h];
|
|
(_ = new t.PathConstraintData(g.name)).order = this.getValue(g, "order", 0),
|
|
_.skinRequired = this.getValue(g, "skin", !1);
|
|
for (v = 0; v < g.bones.length; v++) {
|
|
d = g.bones[v];
|
|
if (null == ($ = r.findBone(d)))
|
|
throw new Error("Transform constraint bone not found: " + d);
|
|
_.bones.push($)
|
|
}
|
|
w = g.target;
|
|
if (_.target = r.findSlot(w), null == _.target)
|
|
throw new Error("Path target slot not found: " + w);
|
|
_.positionMode = e.positionModeFromString(this.getValue(g, "positionMode", "percent")),
|
|
_.spacingMode = e.spacingModeFromString(this.getValue(g, "spacingMode", "length")),
|
|
_.rotateMode = e.rotateModeFromString(this.getValue(g, "rotateMode", "tangent")),
|
|
_.offsetRotation = this.getValue(g, "rotation", 0),
|
|
_.position = this.getValue(g, "position", 0),
|
|
_.positionMode == t.PositionMode.Fixed && (_.position *= n),
|
|
_.spacing = this.getValue(g, "spacing", 0),
|
|
_.spacingMode != t.SpacingMode.Length && _.spacingMode != t.SpacingMode.Fixed || (_.spacing *= n),
|
|
_.rotateMix = this.getValue(g, "rotateMix", 1),
|
|
_.translateMix = this.getValue(g, "translateMix", 1),
|
|
r.pathConstraints.push(_)
|
|
}
|
|
if (o.skins)
|
|
for (h = 0; h < o.skins.length; h++) {
|
|
var x = o.skins[h],
|
|
b = new t.Skin(x.name);
|
|
if (x.bones)
|
|
for (var E = 0; E < x.bones.length; E++) {
|
|
var $;
|
|
if (null == ($ = r.findBone(x.bones[E])))
|
|
throw new Error("Skin bone not found: " + x.bones[h]);
|
|
b.bones.push($)
|
|
}
|
|
if (x.ik)
|
|
for (E = 0; E < x.ik.length; E++) {
|
|
if (null == (A = r.findIkConstraint(x.ik[E])))
|
|
throw new Error("Skin IK constraint not found: " + x.ik[h]);
|
|
b.constraints.push(A)
|
|
}
|
|
if (x.transform)
|
|
for (E = 0; E < x.transform.length; E++) {
|
|
if (null == (A = r.findTransformConstraint(x.transform[E])))
|
|
throw new Error("Skin transform constraint not found: " + x.transform[h]);
|
|
b.constraints.push(A)
|
|
}
|
|
if (x.path)
|
|
for (E = 0; E < x.path.length; E++) {
|
|
var A;
|
|
if (null == (A = r.findPathConstraint(x.path[E])))
|
|
throw new Error("Skin path constraint not found: " + x.path[h]);
|
|
b.constraints.push(A)
|
|
}
|
|
for (var p in x.attachments) {
|
|
var S = r.findSlot(p);
|
|
if (null == S)
|
|
throw new Error("Slot not found: " + p);
|
|
var T = x.attachments[p];
|
|
for (var C in T) {
|
|
var M = this.readAttachment(T[C], b, S.index, C, r);
|
|
null != M && b.setAttachment(S.index, C, M)
|
|
}
|
|
}
|
|
r.skins.push(b),
|
|
"default" == b.name && (r.defaultSkin = b)
|
|
}
|
|
h = 0;
|
|
for (var I = this.linkedMeshes.length; h < I; h++) {
|
|
var P = this.linkedMeshes[h];
|
|
if (null == (b = null == P.skin ? r.defaultSkin : r.findSkin(P.skin)))
|
|
throw new Error("Skin not found: " + P.skin);
|
|
var O = b.getAttachment(P.slotIndex, P.parent);
|
|
if (null == O)
|
|
throw new Error("Parent mesh not found: " + P.parent);
|
|
P.mesh.deformAttachment = P.inheritDeform ? O : P.mesh,
|
|
P.mesh.setParentMesh(O)
|
|
}
|
|
if (this.linkedMeshes.length = 0, o.events)
|
|
for (var R in o.events) {
|
|
var D = o.events[R];
|
|
(_ = new t.EventData(R)).intValue = this.getValue(D, "int", 0),
|
|
_.floatValue = this.getValue(D, "float", 0),
|
|
_.stringValue = this.getValue(D, "string", ""),
|
|
_.audioPath = this.getValue(D, "audio", null),
|
|
null != _.audioPath && (_.volume = this.getValue(D, "volume", 1), _.balance = this.getValue(D, "balance", 0)),
|
|
r.events.push(_)
|
|
}
|
|
if (o.animations)
|
|
for (var L in o.animations) {
|
|
var k = o.animations[L];
|
|
this.readAnimation(k, L, r)
|
|
}
|
|
return r
|
|
},
|
|
e.prototype.readAttachment = function (e, n, r, o, s) {
|
|
var a = this.scale;
|
|
switch (o = this.getValue(e, "name", o), this.getValue(e, "type", "region")) {
|
|
case "region":
|
|
var h = this.getValue(e, "path", o),
|
|
l = this.attachmentLoader.newRegionAttachment(n, o, h);
|
|
return null == l ? null : (l.path = h, l.x = this.getValue(e, "x", 0) * a, l.y = this.getValue(e, "y", 0) * a, l.scaleX = this.getValue(e, "scaleX", 1), l.scaleY = this.getValue(e, "scaleY", 1), l.rotation = this.getValue(e, "rotation", 0), l.width = e.width * a, l.height = e.height * a, null != (x = this.getValue(e, "color", null)) && l.color.setFromString(x), l);
|
|
case "boundingbox":
|
|
var u = this.attachmentLoader.newBoundingBoxAttachment(n, o);
|
|
return null == u ? null : (this.readVertices(e, u, e.vertexCount << 1), null != (x = this.getValue(e, "color", null)) && u.color.setFromString(x), u);
|
|
case "mesh":
|
|
case "linkedmesh":
|
|
h = this.getValue(e, "path", o);
|
|
var c = this.attachmentLoader.newMeshAttachment(n, o, h);
|
|
if (null == c)
|
|
return null;
|
|
c.path = h,
|
|
null != (x = this.getValue(e, "color", null)) && c.color.setFromString(x),
|
|
c.width = this.getValue(e, "width", 0) * a,
|
|
c.height = this.getValue(e, "height", 0) * a;
|
|
var p = this.getValue(e, "parent", null);
|
|
if (null != p)
|
|
return this.linkedMeshes.push(new i(c, this.getValue(e, "skin", null), r, p, this.getValue(e, "deform", !0))), c;
|
|
var d = e.uvs;
|
|
return this.readVertices(e, c, d.length),
|
|
c.triangles = e.triangles,
|
|
c.regionUVs = new Float32Array(d),
|
|
c.edges = this.getValue(e, "edges", null),
|
|
c.hullLength = 2 * this.getValue(e, "hull", 0),
|
|
c;
|
|
case "path":
|
|
if (null == (h = this.attachmentLoader.newPathAttachment(n, o)))
|
|
return null;
|
|
h.closed = this.getValue(e, "closed", !1),
|
|
h.constantSpeed = this.getValue(e, "constantSpeed", !0);
|
|
var f = e.vertexCount;
|
|
this.readVertices(e, h, f << 1);
|
|
for (var _ = t.Utils.newArray(f / 3, 0), m = 0; m < e.lengths.length; m++)
|
|
_[m] = e.lengths[m] * a;
|
|
return h.lengths = _,
|
|
null != (x = this.getValue(e, "color", null)) && h.color.setFromString(x),
|
|
h;
|
|
case "point":
|
|
var y = this.attachmentLoader.newPointAttachment(n, o);
|
|
return null == y ? null : (y.x = this.getValue(e, "x", 0) * a, y.y = this.getValue(e, "y", 0) * a, y.rotation = this.getValue(e, "rotation", 0), null != (x = this.getValue(e, "color", null)) && y.color.setFromString(x), y);
|
|
case "clipping":
|
|
var g = this.attachmentLoader.newClippingAttachment(n, o);
|
|
if (null == g)
|
|
return null;
|
|
var v = this.getValue(e, "end", null);
|
|
if (null != v) {
|
|
var w = s.findSlot(v);
|
|
if (null == w)
|
|
throw new Error("Clipping end slot not found: " + v);
|
|
g.endSlot = w
|
|
}
|
|
var x;
|
|
f = e.vertexCount;
|
|
return this.readVertices(e, g, f << 1),
|
|
null != (x = this.getValue(e, "color", null)) && g.color.setFromString(x),
|
|
g
|
|
}
|
|
return null
|
|
},
|
|
e.prototype.readVertices = function (e, i, n) {
|
|
var r = this.scale;
|
|
i.worldVerticesLength = n;
|
|
var o = e.vertices;
|
|
if (n != o.length) {
|
|
var s = new Array,
|
|
a = new Array;
|
|
for (c = 0, p = o.length; c < p; ) {
|
|
var h = o[c++];
|
|
a.push(h);
|
|
for (var l = c + 4 * h; c < l; c += 4)
|
|
a.push(o[c]), s.push(o[c + 1] * r), s.push(o[c + 2] * r), s.push(o[c + 3])
|
|
}
|
|
i.bones = a,
|
|
i.vertices = t.Utils.toFloatArray(s)
|
|
} else {
|
|
var u = t.Utils.toFloatArray(o);
|
|
if (1 != r)
|
|
for (var c = 0, p = o.length; c < p; c++)
|
|
u[c] *= r;
|
|
i.vertices = u
|
|
}
|
|
},
|
|
e.prototype.readAnimation = function (e, i, n) {
|
|
var r = this.scale,
|
|
o = new Array,
|
|
s = 0;
|
|
if (e.slots)
|
|
for (var a in e.slots) {
|
|
var h = e.slots[a];
|
|
if (-1 == (J = n.findSlotIndex(a)))
|
|
throw new Error("Slot not found: " + a);
|
|
for (var l in h) {
|
|
var u = h[l];
|
|
if ("attachment" == l) {
|
|
(w = new t.AttachmentTimeline(u.length)).slotIndex = J;
|
|
for (var c = 0, p = 0; p < u.length; p++) {
|
|
var d = u[p];
|
|
w.setFrame(c++, this.getValue(d, "time", 0), d.name)
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[w.getFrameCount() - 1])
|
|
} else if ("color" == l) {
|
|
(w = new t.ColorTimeline(u.length)).slotIndex = J;
|
|
for (c = 0, p = 0; p < u.length; p++) {
|
|
d = u[p];
|
|
var f = new t.Color;
|
|
f.setFromString(d.color || "ffffffff"),
|
|
w.setFrame(c, this.getValue(d, "time", 0), f.r, f.g, f.b, f.a),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.ColorTimeline.ENTRIES])
|
|
} else {
|
|
if ("twoColor" != l)
|
|
throw new Error("Invalid timeline type for a slot: " + l + " (" + a + ")");
|
|
(w = new t.TwoColorTimeline(u.length)).slotIndex = J;
|
|
for (c = 0, p = 0; p < u.length; p++) {
|
|
d = u[p];
|
|
var _ = new t.Color,
|
|
m = new t.Color;
|
|
_.setFromString(d.light),
|
|
m.setFromString(d.dark),
|
|
w.setFrame(c, this.getValue(d, "time", 0), _.r, _.g, _.b, _.a, m.r, m.g, m.b),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.TwoColorTimeline.ENTRIES])
|
|
}
|
|
}
|
|
}
|
|
if (e.bones)
|
|
for (var y in e.bones) {
|
|
var g = e.bones[y],
|
|
v = n.findBoneIndex(y);
|
|
if (-1 == v)
|
|
throw new Error("Bone not found: " + y);
|
|
for (var l in g) {
|
|
u = g[l];
|
|
if ("rotate" === l) {
|
|
(w = new t.RotateTimeline(u.length)).boneIndex = v;
|
|
for (c = 0, p = 0; p < u.length; p++) {
|
|
d = u[p];
|
|
w.setFrame(c, this.getValue(d, "time", 0), this.getValue(d, "angle", 0)),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.RotateTimeline.ENTRIES])
|
|
} else {
|
|
if ("translate" !== l && "scale" !== l && "shear" !== l)
|
|
throw new Error("Invalid timeline type for a bone: " + l + " (" + y + ")");
|
|
var w = null,
|
|
x = 1,
|
|
b = 0;
|
|
"scale" === l ? (w = new t.ScaleTimeline(u.length), b = 1) : "shear" === l ? w = new t.ShearTimeline(u.length) : (w = new t.TranslateTimeline(u.length), x = r),
|
|
w.boneIndex = v;
|
|
for (c = 0, p = 0; p < u.length; p++) {
|
|
d = u[p];
|
|
var E = this.getValue(d, "x", b),
|
|
$ = this.getValue(d, "y", b);
|
|
w.setFrame(c, this.getValue(d, "time", 0), E * x, $ * x),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.TranslateTimeline.ENTRIES])
|
|
}
|
|
}
|
|
}
|
|
if (e.ik)
|
|
for (var A in e.ik) {
|
|
var S = e.ik[A],
|
|
T = n.findIkConstraint(A);
|
|
(w = new t.IkConstraintTimeline(S.length)).ikConstraintIndex = n.ikConstraints.indexOf(T);
|
|
for (c = 0, p = 0; p < S.length; p++) {
|
|
d = S[p];
|
|
w.setFrame(c, this.getValue(d, "time", 0), this.getValue(d, "mix", 1), this.getValue(d, "softness", 0) * r, this.getValue(d, "bendPositive", !0) ? 1 : -1, this.getValue(d, "compress", !1), this.getValue(d, "stretch", !1)),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.IkConstraintTimeline.ENTRIES])
|
|
}
|
|
if (e.transform)
|
|
for (var A in e.transform) {
|
|
S = e.transform[A],
|
|
T = n.findTransformConstraint(A);
|
|
(w = new t.TransformConstraintTimeline(S.length)).transformConstraintIndex = n.transformConstraints.indexOf(T);
|
|
for (c = 0, p = 0; p < S.length; p++) {
|
|
d = S[p];
|
|
w.setFrame(c, this.getValue(d, "time", 0), this.getValue(d, "rotateMix", 1), this.getValue(d, "translateMix", 1), this.getValue(d, "scaleMix", 1), this.getValue(d, "shearMix", 1)),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.TransformConstraintTimeline.ENTRIES])
|
|
}
|
|
if (e.path)
|
|
for (var A in e.path) {
|
|
S = e.path[A];
|
|
var C = n.findPathConstraintIndex(A);
|
|
if (-1 == C)
|
|
throw new Error("Path constraint not found: " + A);
|
|
var M = n.pathConstraints[C];
|
|
for (var l in S) {
|
|
u = S[l];
|
|
if ("position" === l || "spacing" === l) {
|
|
w = null,
|
|
x = 1;
|
|
"spacing" === l ? (w = new t.PathConstraintSpacingTimeline(u.length), M.spacingMode != t.SpacingMode.Length && M.spacingMode != t.SpacingMode.Fixed || (x = r)) : (w = new t.PathConstraintPositionTimeline(u.length), M.positionMode == t.PositionMode.Fixed && (x = r)),
|
|
w.pathConstraintIndex = C;
|
|
for (c = 0, p = 0; p < u.length; p++) {
|
|
d = u[p];
|
|
w.setFrame(c, this.getValue(d, "time", 0), this.getValue(d, l, 0) * x),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.PathConstraintPositionTimeline.ENTRIES])
|
|
} else if ("mix" === l) {
|
|
(w = new t.PathConstraintMixTimeline(u.length)).pathConstraintIndex = C;
|
|
for (c = 0, p = 0; p < u.length; p++) {
|
|
d = u[p];
|
|
w.setFrame(c, this.getValue(d, "time", 0), this.getValue(d, "rotateMix", 1), this.getValue(d, "translateMix", 1)),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[(w.getFrameCount() - 1) * t.PathConstraintMixTimeline.ENTRIES])
|
|
}
|
|
}
|
|
}
|
|
if (e.deform)
|
|
for (var I in e.deform) {
|
|
var P = e.deform[I],
|
|
O = n.findSkin(I);
|
|
if (null != O)
|
|
for (var a in P) {
|
|
h = P[a];
|
|
if (-1 == (J = n.findSlotIndex(a)))
|
|
throw new Error("Slot not found: " + h.name);
|
|
for (var l in h) {
|
|
u = h[l];
|
|
var R = O.getAttachment(J, l);
|
|
if (null == R)
|
|
throw new Error("Deform attachment not found: " + u.name);
|
|
var D = null != R.bones,
|
|
L = R.vertices,
|
|
k = D ? L.length / 3 * 2 : L.length;
|
|
(w = new t.DeformTimeline(u.length)).slotIndex = J,
|
|
w.attachment = R;
|
|
c = 0;
|
|
for (var F = 0; F < u.length; F++) {
|
|
d = u[F];
|
|
var N = void 0,
|
|
B = this.getValue(d, "vertices", null);
|
|
if (null == B)
|
|
N = D ? t.Utils.newFloatArray(k) : L;
|
|
else {
|
|
N = t.Utils.newFloatArray(k);
|
|
var U = this.getValue(d, "offset", 0);
|
|
if (t.Utils.arrayCopy(B, 0, N, U, B.length), 1 != r)
|
|
for (var X = (p = U) + B.length; p < X; p++)
|
|
N[p] *= r;
|
|
if (!D)
|
|
for (p = 0; p < k; p++)
|
|
N[p] += L[p]
|
|
}
|
|
w.setFrame(c, this.getValue(d, "time", 0), N),
|
|
this.readCurve(d, w, c),
|
|
c++
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[w.getFrameCount() - 1])
|
|
}
|
|
}
|
|
else if (t.FAIL_ON_NON_EXISTING_SKIN)
|
|
throw new Error("Skin not found: " + I)
|
|
}
|
|
var j = e.drawOrder;
|
|
if (null == j && (j = e.draworder), null != j) {
|
|
w = new t.DrawOrderTimeline(j.length);
|
|
var V = n.slots.length;
|
|
for (c = 0, F = 0; F < j.length; F++) {
|
|
var H = j[F],
|
|
G = null,
|
|
Y = this.getValue(H, "offsets", null);
|
|
if (null != Y) {
|
|
G = t.Utils.newArray(V, -1);
|
|
var W = t.Utils.newArray(V - Y.length, 0),
|
|
z = 0,
|
|
q = 0;
|
|
for (p = 0; p < Y.length; p++) {
|
|
var J,
|
|
K = Y[p];
|
|
if (-1 == (J = n.findSlotIndex(K.slot)))
|
|
throw new Error("Slot not found: " + K.slot);
|
|
for (; z != J; )
|
|
W[q++] = z++;
|
|
G[z + K.offset] = z++
|
|
}
|
|
for (; z < V; )
|
|
W[q++] = z++;
|
|
for (p = V - 1; p >= 0; p--)
|
|
- 1 == G[p] && (G[p] = W[--q])
|
|
}
|
|
w.setFrame(c++, this.getValue(H, "time", 0), G)
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[w.getFrameCount() - 1])
|
|
}
|
|
if (e.events) {
|
|
for (w = new t.EventTimeline(e.events.length), c = 0, p = 0; p < e.events.length; p++) {
|
|
var Z = e.events[p],
|
|
Q = n.findEvent(Z.name);
|
|
if (null == Q)
|
|
throw new Error("Event not found: " + Z.name);
|
|
var tt = new t.Event(t.Utils.toSinglePrecision(this.getValue(Z, "time", 0)), Q);
|
|
tt.intValue = this.getValue(Z, "int", Q.intValue),
|
|
tt.floatValue = this.getValue(Z, "float", Q.floatValue),
|
|
tt.stringValue = this.getValue(Z, "string", Q.stringValue),
|
|
null != tt.data.audioPath && (tt.volume = this.getValue(Z, "volume", 1), tt.balance = this.getValue(Z, "balance", 0)),
|
|
w.setFrame(c++, tt)
|
|
}
|
|
o.push(w),
|
|
s = Math.max(s, w.frames[w.getFrameCount() - 1])
|
|
}
|
|
if (isNaN(s))
|
|
throw new Error("Error while parsing animation, duration is NaN");
|
|
n.animations.push(new t.Animation(i, o, s))
|
|
},
|
|
e.prototype.readCurve = function (t, e, i) {
|
|
if (t.hasOwnProperty("curve"))
|
|
if ("stepped" === t.curve)
|
|
e.setStepped(i);
|
|
else {
|
|
var n = t.curve;
|
|
e.setCurve(i, n, this.getValue(t, "c2", 0), this.getValue(t, "c3", 1), this.getValue(t, "c4", 1))
|
|
}
|
|
},
|
|
e.prototype.getValue = function (t, e, i) {
|
|
return void 0 !== t[e] ? t[e] : i
|
|
},
|
|
e.blendModeFromString = function (e) {
|
|
if ("normal" == (e = e.toLowerCase()))
|
|
return t.BlendMode.Normal;
|
|
if ("additive" == e)
|
|
return t.BlendMode.Additive;
|
|
if ("multiply" == e)
|
|
return t.BlendMode.Multiply;
|
|
if ("screen" == e)
|
|
return t.BlendMode.Screen;
|
|
throw new Error("Unknown blend mode: " + e)
|
|
},
|
|
e.positionModeFromString = function (e) {
|
|
if ("fixed" == (e = e.toLowerCase()))
|
|
return t.PositionMode.Fixed;
|
|
if ("percent" == e)
|
|
return t.PositionMode.Percent;
|
|
throw new Error("Unknown position mode: " + e)
|
|
},
|
|
e.spacingModeFromString = function (e) {
|
|
if ("length" == (e = e.toLowerCase()))
|
|
return t.SpacingMode.Length;
|
|
if ("fixed" == e)
|
|
return t.SpacingMode.Fixed;
|
|
if ("percent" == e)
|
|
return t.SpacingMode.Percent;
|
|
throw new Error("Unknown position mode: " + e)
|
|
},
|
|
e.rotateModeFromString = function (e) {
|
|
if ("tangent" == (e = e.toLowerCase()))
|
|
return t.RotateMode.Tangent;
|
|
if ("chain" == e)
|
|
return t.RotateMode.Chain;
|
|
if ("chainscale" == e)
|
|
return t.RotateMode.ChainScale;
|
|
throw new Error("Unknown rotate mode: " + e)
|
|
},
|
|
e.transformModeFromString = function (e) {
|
|
if ("normal" == (e = e.toLowerCase()))
|
|
return t.TransformMode.Normal;
|
|
if ("onlytranslation" == e)
|
|
return t.TransformMode.OnlyTranslation;
|
|
if ("norotationorreflection" == e)
|
|
return t.TransformMode.NoRotationOrReflection;
|
|
if ("noscale" == e)
|
|
return t.TransformMode.NoScale;
|
|
if ("noscaleorreflection" == e)
|
|
return t.TransformMode.NoScaleOrReflection;
|
|
throw new Error("Unknown transform mode: " + e)
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.SkeletonJson = e;
|
|
var i = function (t, e, i, n, r) {
|
|
this.mesh = t,
|
|
this.skin = e,
|
|
this.slotIndex = i,
|
|
this.parent = n,
|
|
this.inheritDeform = r
|
|
}
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t, e, i) {
|
|
this.slotIndex = t,
|
|
this.name = e,
|
|
this.attachment = i
|
|
};
|
|
t.SkinEntry = e;
|
|
var i = function () {
|
|
function i(t) {
|
|
if (this.attachments = new Array, this.bones = Array(), this.constraints = new Array, null == t)
|
|
throw new Error("name cannot be null.");
|
|
this.name = t
|
|
}
|
|
return i.prototype.setAttachment = function (t, e, i) {
|
|
if (null == i)
|
|
throw new Error("attachment cannot be null.");
|
|
var n = this.attachments;
|
|
t >= n.length && (n.length = t + 1),
|
|
n[t] || (n[t] = {}),
|
|
n[t][e] = i
|
|
},
|
|
i.prototype.addSkin = function (t) {
|
|
for (var e = 0; e < t.bones.length; e++) {
|
|
for (var i = t.bones[e], n = !1, r = 0; r < this.bones.length; r++)
|
|
if (this.bones[r] == i) {
|
|
n = !0;
|
|
break
|
|
}
|
|
n || this.bones.push(i)
|
|
}
|
|
for (e = 0; e < t.constraints.length; e++) {
|
|
var o = t.constraints[e];
|
|
for (n = !1, r = 0; r < this.constraints.length; r++)
|
|
if (this.constraints[r] == o) {
|
|
n = !0;
|
|
break
|
|
}
|
|
n || this.constraints.push(o)
|
|
}
|
|
var s = t.getAttachments();
|
|
for (e = 0; e < s.length; e++) {
|
|
var a = s[e];
|
|
this.setAttachment(a.slotIndex, a.name, a.attachment)
|
|
}
|
|
},
|
|
i.prototype.copySkin = function (e) {
|
|
for (var i = 0; i < e.bones.length; i++) {
|
|
for (var n = e.bones[i], r = !1, o = 0; o < this.bones.length; o++)
|
|
if (this.bones[o] == n) {
|
|
r = !0;
|
|
break
|
|
}
|
|
r || this.bones.push(n)
|
|
}
|
|
for (i = 0; i < e.constraints.length; i++) {
|
|
var s = e.constraints[i];
|
|
for (r = !1, o = 0; o < this.constraints.length; o++)
|
|
if (this.constraints[o] == s) {
|
|
r = !0;
|
|
break
|
|
}
|
|
r || this.constraints.push(s)
|
|
}
|
|
var a = e.getAttachments();
|
|
for (i = 0; i < a.length; i++) {
|
|
var h = a[i];
|
|
null != h.attachment && (h.attachment instanceof t.MeshAttachment ? (h.attachment = h.attachment.newLinkedMesh(), this.setAttachment(h.slotIndex, h.name, h.attachment)) : (h.attachment = h.attachment.copy(), this.setAttachment(h.slotIndex, h.name, h.attachment)))
|
|
}
|
|
},
|
|
i.prototype.getAttachment = function (t, e) {
|
|
var i = this.attachments[t];
|
|
return i ? i[e] : null
|
|
},
|
|
i.prototype.removeAttachment = function (t, e) {
|
|
var i = this.attachments[t];
|
|
i && (i[e] = null)
|
|
},
|
|
i.prototype.getAttachments = function () {
|
|
for (var t = new Array, i = 0; i < this.attachments.length; i++) {
|
|
var n = this.attachments[i];
|
|
if (n)
|
|
for (var r in n) {
|
|
var o = n[r];
|
|
o && t.push(new e(i, r, o))
|
|
}
|
|
}
|
|
return t
|
|
},
|
|
i.prototype.getAttachmentsForSlot = function (t, i) {
|
|
var n = this.attachments[t];
|
|
if (n)
|
|
for (var r in n) {
|
|
var o = n[r];
|
|
o && i.push(new e(t, r, o))
|
|
}
|
|
},
|
|
i.prototype.clear = function () {
|
|
this.attachments.length = 0,
|
|
this.bones.length = 0,
|
|
this.constraints.length = 0
|
|
},
|
|
i.prototype.attachAll = function (t, e) {
|
|
for (var i = 0, n = 0; n < t.slots.length; n++) {
|
|
var r = t.slots[n],
|
|
o = r.getAttachment();
|
|
if (o && i < e.attachments.length) {
|
|
var s = e.attachments[i];
|
|
for (var a in s) {
|
|
if (o == s[a]) {
|
|
var h = this.getAttachment(i, a);
|
|
null != h && r.setAttachment(h);
|
|
break
|
|
}
|
|
}
|
|
}
|
|
i++
|
|
}
|
|
},
|
|
i
|
|
}
|
|
();
|
|
t.Skin = i
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(e, i) {
|
|
if (this.deform = new Array, null == e)
|
|
throw new Error("data cannot be null.");
|
|
if (null == i)
|
|
throw new Error("bone cannot be null.");
|
|
this.data = e,
|
|
this.bone = i,
|
|
this.color = new t.Color,
|
|
this.darkColor = null == e.darkColor ? null : new t.Color,
|
|
this.setToSetupPose(),
|
|
this.blendMode = this.data.blendMode
|
|
}
|
|
return e.prototype.getAttachment = function () {
|
|
return this.attachment
|
|
},
|
|
e.prototype.setAttachment = function (t) {
|
|
this.attachment != t && (this.attachment = t, this.attachmentTime = this.bone.skeleton.time, this.deform.length = 0)
|
|
},
|
|
e.prototype.setAttachmentTime = function (t) {
|
|
this.attachmentTime = this.bone.skeleton.time - t
|
|
},
|
|
e.prototype.getAttachmentTime = function () {
|
|
return this.bone.skeleton.time - this.attachmentTime
|
|
},
|
|
e.prototype.setToSetupPose = function () {
|
|
this.color.setFromColor(this.data.color),
|
|
null != this.darkColor && this.darkColor.setFromColor(this.data.darkColor),
|
|
null == this.data.attachmentName ? this.attachment = null : (this.attachment = null, this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)))
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.Slot = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (e, i, n) {
|
|
if (this.color = new t.Color(1, 1, 1, 1), e < 0)
|
|
throw new Error("index must be >= 0.");
|
|
if (null == i)
|
|
throw new Error("name cannot be null.");
|
|
if (null == n)
|
|
throw new Error("boneData cannot be null.");
|
|
this.index = e,
|
|
this.name = i,
|
|
this.boneData = n
|
|
};
|
|
t.SlotData = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e,
|
|
i,
|
|
n = function () {
|
|
function t(t) {
|
|
this._image = t
|
|
}
|
|
return t.prototype.getImage = function () {
|
|
return this._image
|
|
},
|
|
t.filterFromString = function (t) {
|
|
switch (t.toLowerCase()) {
|
|
case "nearest":
|
|
return e.Nearest;
|
|
case "linear":
|
|
return e.Linear;
|
|
case "mipmap":
|
|
return e.MipMap;
|
|
case "mipmapnearestnearest":
|
|
return e.MipMapNearestNearest;
|
|
case "mipmaplinearnearest":
|
|
return e.MipMapLinearNearest;
|
|
case "mipmapnearestlinear":
|
|
return e.MipMapNearestLinear;
|
|
case "mipmaplinearlinear":
|
|
return e.MipMapLinearLinear;
|
|
default:
|
|
throw new Error("Unknown texture filter " + t)
|
|
}
|
|
},
|
|
t.wrapFromString = function (t) {
|
|
switch (t.toLowerCase()) {
|
|
case "mirroredtepeat":
|
|
return i.MirroredRepeat;
|
|
case "clamptoedge":
|
|
return i.ClampToEdge;
|
|
case "repeat":
|
|
return i.Repeat;
|
|
default:
|
|
throw new Error("Unknown texture wrap " + t)
|
|
}
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.Texture = n,
|
|
function (t) {
|
|
t[t.Nearest = 9728] = "Nearest",
|
|
t[t.Linear = 9729] = "Linear",
|
|
t[t.MipMap = 9987] = "MipMap",
|
|
t[t.MipMapNearestNearest = 9984] = "MipMapNearestNearest",
|
|
t[t.MipMapLinearNearest = 9985] = "MipMapLinearNearest",
|
|
t[t.MipMapNearestLinear = 9986] = "MipMapNearestLinear",
|
|
t[t.MipMapLinearLinear = 9987] = "MipMapLinearLinear"
|
|
}
|
|
(e = t.TextureFilter || (t.TextureFilter = {})),
|
|
function (t) {
|
|
t[t.MirroredRepeat = 33648] = "MirroredRepeat",
|
|
t[t.ClampToEdge = 33071] = "ClampToEdge",
|
|
t[t.Repeat = 10497] = "Repeat"
|
|
}
|
|
(i = t.TextureWrap || (t.TextureWrap = {}));
|
|
var r = function () {
|
|
function t() {
|
|
this.size = null
|
|
}
|
|
return Object.defineProperty(t.prototype, "width", {
|
|
get: function () {
|
|
var t = this.texture;
|
|
return "3" == PIXI.VERSION[0] ? t.crop.width : t.trim ? t.trim.width : t.orig.width
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "height", {
|
|
get: function () {
|
|
var t = this.texture;
|
|
return "3" == PIXI.VERSION[0] ? t.crop.height : t.trim ? t.trim.height : t.orig.height
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "u", {
|
|
get: function () {
|
|
return this.texture._uvs.x0
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "v", {
|
|
get: function () {
|
|
return this.texture._uvs.y0
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "u2", {
|
|
get: function () {
|
|
return this.texture._uvs.x2
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "v2", {
|
|
get: function () {
|
|
return this.texture._uvs.y2
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "offsetX", {
|
|
get: function () {
|
|
var t = this.texture;
|
|
return t.trim ? t.trim.x : 0
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "offsetY", {
|
|
get: function () {
|
|
return console.warn("Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on."),
|
|
this.spineOffsetY
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "pixiOffsetY", {
|
|
get: function () {
|
|
var t = this.texture;
|
|
return t.trim ? t.trim.y : 0
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "spineOffsetY", {
|
|
get: function () {
|
|
var t = this.texture;
|
|
return this.originalHeight - this.height - (t.trim ? t.trim.y : 0)
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "originalWidth", {
|
|
get: function () {
|
|
var t = this.texture;
|
|
return "3" == PIXI.VERSION[0] ? t.trim ? t.trim.width : t.crop.width : t.orig.width
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "originalHeight", {
|
|
get: function () {
|
|
var t = this.texture;
|
|
return "3" == PIXI.VERSION[0] ? t.trim ? t.trim.height : t.crop.height : t.orig.height
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "x", {
|
|
get: function () {
|
|
return this.texture.frame.x
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "y", {
|
|
get: function () {
|
|
return this.texture.frame.y
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(t.prototype, "rotate", {
|
|
get: function () {
|
|
return 0 !== this.texture.rotate
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
t
|
|
}
|
|
();
|
|
t.TextureRegion = r
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t, e, i) {
|
|
this.pages = new Array,
|
|
this.regions = new Array,
|
|
t && this.addSpineAtlas(t, e, i)
|
|
}
|
|
return e.prototype.addTexture = function (e, i) {
|
|
for (var o = this.pages, s = null, a = 0; a < o.length; a++)
|
|
if (o[a].baseTexture === i.baseTexture) {
|
|
s = o[a];
|
|
break
|
|
}
|
|
if (null === s) {
|
|
(s = new n).name = "texturePage";
|
|
var h = i.baseTexture;
|
|
s.width = h.realWidth,
|
|
s.height = h.realHeight,
|
|
s.baseTexture = h,
|
|
s.minFilter = s.magFilter = t.TextureFilter.Nearest,
|
|
s.uWrap = t.TextureWrap.ClampToEdge,
|
|
s.vWrap = t.TextureWrap.ClampToEdge,
|
|
o.push(s)
|
|
}
|
|
var l = new r;
|
|
return l.name = e,
|
|
l.page = s,
|
|
l.texture = i,
|
|
l.index = -1,
|
|
this.regions.push(l),
|
|
l
|
|
},
|
|
e.prototype.addTextureHash = function (t, e) {
|
|
for (var i in t)
|
|
t.hasOwnProperty(i) && this.addTexture(e && -1 !== i.indexOf(".") ? i.substr(0, i.lastIndexOf(".")) : i, t[i])
|
|
},
|
|
e.prototype.addSpineAtlas = function (t, e, i) {
|
|
return this.load(t, e, i)
|
|
},
|
|
e.prototype.load = function (e, o, s) {
|
|
var a = this;
|
|
if (null == o)
|
|
throw new Error("textureLoader cannot be null.");
|
|
var h = new i(e),
|
|
l = new Array(4),
|
|
u = null,
|
|
c = function () {
|
|
for (; ; ) {
|
|
var e = h.readLine();
|
|
if (null == e)
|
|
return s && s(a);
|
|
if (0 == (e = e.trim()).length)
|
|
u = null;
|
|
else {
|
|
if (!u) {
|
|
(u = new n).name = e,
|
|
2 == h.readTuple(l) && (u.width = parseInt(l[0]), u.height = parseInt(l[1]), h.readTuple(l)),
|
|
h.readTuple(l),
|
|
u.minFilter = t.Texture.filterFromString(l[0]),
|
|
u.magFilter = t.Texture.filterFromString(l[1]);
|
|
var i = h.readValue();
|
|
u.uWrap = t.TextureWrap.ClampToEdge,
|
|
u.vWrap = t.TextureWrap.ClampToEdge,
|
|
"x" == i ? u.uWrap = t.TextureWrap.Repeat : "y" == i ? u.vWrap = t.TextureWrap.Repeat : "xy" == i && (u.uWrap = u.vWrap = t.TextureWrap.Repeat),
|
|
o(e, (function (t) {
|
|
if (null === t)
|
|
return a.pages.splice(a.pages.indexOf(u), 1), s && s(null);
|
|
u.baseTexture = t,
|
|
t.valid || t.setSize(u.width, u.height),
|
|
a.pages.push(u),
|
|
u.setFilters(),
|
|
u.width && u.height || (u.width = t.realWidth, u.height = t.realHeight, u.width && u.height || console.log("ERROR spine atlas page " + u.name + ": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)")),
|
|
c()
|
|
})),
|
|
a.pages.push(u);
|
|
break
|
|
}
|
|
var p = new r;
|
|
p.name = e,
|
|
p.page = u;
|
|
var d = h.readValue(),
|
|
f = 0;
|
|
f = "true" == d.toLocaleLowerCase() ? 6 : "false" == d.toLocaleLowerCase() ? 0 : (720 - parseFloat(d)) % 360 / 45,
|
|
h.readTuple(l);
|
|
var _ = parseInt(l[0]),
|
|
m = parseInt(l[1]);
|
|
h.readTuple(l);
|
|
var y = parseInt(l[0]),
|
|
g = parseInt(l[1]),
|
|
v = u.baseTexture.resolution;
|
|
_ /= v,
|
|
m /= v,
|
|
y /= v,
|
|
g /= v;
|
|
var w = new PIXI.Rectangle(_, m, f ? g : y, f ? y : g);
|
|
4 == h.readTuple(l) && 4 == h.readTuple(l) && h.readTuple(l);
|
|
var x = parseInt(l[0]) / v,
|
|
b = parseInt(l[1]) / v;
|
|
h.readTuple(l);
|
|
var E = parseInt(l[0]) / v,
|
|
$ = parseInt(l[1]) / v,
|
|
A = new PIXI.Rectangle(0, 0, x, b),
|
|
S = new PIXI.Rectangle(E, b - g - $, y, g);
|
|
if ("3" != PIXI.VERSION[0])
|
|
p.texture = new PIXI.Texture(p.page.baseTexture, w, A, S, f);
|
|
else {
|
|
var T = new PIXI.Rectangle(_, m, y, g),
|
|
C = T.clone();
|
|
S.width = x,
|
|
S.height = b,
|
|
p.texture = new PIXI.Texture(p.page.baseTexture, T, C, S, f)
|
|
}
|
|
p.index = parseInt(h.readValue()),
|
|
p.texture.updateUvs(),
|
|
a.regions.push(p)
|
|
}
|
|
}
|
|
};
|
|
c()
|
|
},
|
|
e.prototype.findRegion = function (t) {
|
|
for (var e = 0; e < this.regions.length; e++)
|
|
if (this.regions[e].name == t)
|
|
return this.regions[e];
|
|
return null
|
|
},
|
|
e.prototype.dispose = function () {
|
|
for (var t = 0; t < this.pages.length; t++)
|
|
this.pages[t].baseTexture.dispose()
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.TextureAtlas = e;
|
|
var i = function () {
|
|
function t(t) {
|
|
this.index = 0,
|
|
this.lines = t.split(/\r\n|\r|\n/)
|
|
}
|
|
return t.prototype.readLine = function () {
|
|
return this.index >= this.lines.length ? null : this.lines[this.index++]
|
|
},
|
|
t.prototype.readValue = function () {
|
|
var t = this.readLine(),
|
|
e = t.indexOf(":");
|
|
if (-1 == e)
|
|
throw new Error("Invalid line: " + t);
|
|
return t.substring(e + 1).trim()
|
|
},
|
|
t.prototype.readTuple = function (t) {
|
|
var e = this.readLine(),
|
|
i = e.indexOf(":");
|
|
if (-1 == i)
|
|
throw new Error("Invalid line: " + e);
|
|
for (var n = 0, r = i + 1; n < 3; n++) {
|
|
var o = e.indexOf(",", r);
|
|
if (-1 == o)
|
|
break;
|
|
t[n] = e.substr(r, o - r).trim(),
|
|
r = o + 1
|
|
}
|
|
return t[n] = e.substring(r).trim(),
|
|
n + 1
|
|
},
|
|
t
|
|
}
|
|
(),
|
|
n = function () {
|
|
function e() {}
|
|
return e.prototype.setFilters = function () {
|
|
var e = this.baseTexture,
|
|
i = this.minFilter;
|
|
i == t.TextureFilter.Linear ? e.scaleMode = PIXI.SCALE_MODES.LINEAR : this.minFilter == t.TextureFilter.Nearest ? e.scaleMode = PIXI.SCALE_MODES.NEAREST : (e.mipmap = PIXI.MIPMAP_MODES.POW2, i == t.TextureFilter.MipMapNearestNearest ? e.scaleMode = PIXI.SCALE_MODES.NEAREST : e.scaleMode = PIXI.SCALE_MODES.LINEAR)
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.TextureAtlasPage = n;
|
|
var r = function (t) {
|
|
function e() {
|
|
return null !== t && t.apply(this, arguments) || this
|
|
}
|
|
return s(e, t),
|
|
e
|
|
}
|
|
(t.TextureRegion);
|
|
t.TextureAtlasRegion = r
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(e, i) {
|
|
if (this.rotateMix = 0, this.translateMix = 0, this.scaleMix = 0, this.shearMix = 0, this.temp = new t.Vector2, this.active = !1, null == e)
|
|
throw new Error("data cannot be null.");
|
|
if (null == i)
|
|
throw new Error("skeleton cannot be null.");
|
|
this.data = e,
|
|
this.rotateMix = e.rotateMix,
|
|
this.translateMix = e.translateMix,
|
|
this.scaleMix = e.scaleMix,
|
|
this.shearMix = e.shearMix,
|
|
this.bones = new Array;
|
|
for (var n = 0; n < e.bones.length; n++)
|
|
this.bones.push(i.findBone(e.bones[n].name));
|
|
this.target = i.findBone(e.target.name)
|
|
}
|
|
return e.prototype.isActive = function () {
|
|
return this.active
|
|
},
|
|
e.prototype.apply = function () {
|
|
this.update()
|
|
},
|
|
e.prototype.update = function () {
|
|
this.data.local ? this.data.relative ? this.applyRelativeLocal() : this.applyAbsoluteLocal() : this.data.relative ? this.applyRelativeWorld() : this.applyAbsoluteWorld()
|
|
},
|
|
e.prototype.applyAbsoluteWorld = function () {
|
|
for (var e = this.rotateMix, i = this.translateMix, n = this.scaleMix, r = this.shearMix, o = this.target, s = o.matrix, a = s.a, h = s.c, l = s.b, u = s.d, c = a * u - h * l > 0 ? t.MathUtils.degRad : -t.MathUtils.degRad, p = this.data.offsetRotation * c, d = this.data.offsetShearY * c, f = this.bones, _ = 0, m = f.length; _ < m; _++) {
|
|
var y = f[_],
|
|
g = !1,
|
|
v = y.matrix;
|
|
if (0 != e) {
|
|
var w = v.a,
|
|
x = v.c,
|
|
b = v.b,
|
|
E = v.d;
|
|
(M = Math.atan2(l, a) - Math.atan2(b, w) + p) > t.MathUtils.PI ? M -= t.MathUtils.PI2 : M < -t.MathUtils.PI && (M += t.MathUtils.PI2),
|
|
M *= e;
|
|
var $ = Math.cos(M),
|
|
A = Math.sin(M);
|
|
v.a = $ * w - A * b,
|
|
v.c = $ * x - A * E,
|
|
v.b = A * w + $ * b,
|
|
v.d = A * x + $ * E,
|
|
g = !0
|
|
}
|
|
if (0 != i) {
|
|
var S = this.temp;
|
|
o.localToWorld(S.set(this.data.offsetX, this.data.offsetY)),
|
|
v.tx += (S.x - v.tx) * i,
|
|
v.ty += (S.y - v.ty) * i,
|
|
g = !0
|
|
}
|
|
if (n > 0) {
|
|
var T = Math.sqrt(v.a * v.a + v.b * v.b),
|
|
C = Math.sqrt(a * a + l * l);
|
|
T > 1e-5 && (T = (T + (C - T + this.data.offsetScaleX) * n) / T),
|
|
v.a *= T,
|
|
v.b *= T,
|
|
T = Math.sqrt(v.c * v.c + v.d * v.d),
|
|
C = Math.sqrt(h * h + u * u),
|
|
T > 1e-5 && (T = (T + (C - T + this.data.offsetScaleY) * n) / T),
|
|
v.c *= T,
|
|
v.d *= T,
|
|
g = !0
|
|
}
|
|
if (r > 0) {
|
|
x = v.c,
|
|
E = v.d;
|
|
var M,
|
|
I = Math.atan2(E, x);
|
|
(M = Math.atan2(u, h) - Math.atan2(l, a) - (I - Math.atan2(v.b, v.a))) > t.MathUtils.PI ? M -= t.MathUtils.PI2 : M < -t.MathUtils.PI && (M += t.MathUtils.PI2),
|
|
M = I + (M + d) * r;
|
|
T = Math.sqrt(x * x + E * E);
|
|
v.c = Math.cos(M) * T,
|
|
v.d = Math.sin(M) * T,
|
|
g = !0
|
|
}
|
|
g && (y.appliedValid = !1)
|
|
}
|
|
},
|
|
e.prototype.applyRelativeWorld = function () {
|
|
for (var e = this.rotateMix, i = this.translateMix, n = this.scaleMix, r = this.shearMix, o = this.target, s = o.matrix, a = s.a, h = s.c, l = s.b, u = s.d, c = a * u - h * l > 0 ? t.MathUtils.degRad : -t.MathUtils.degRad, p = this.data.offsetRotation * c, d = this.data.offsetShearY * c, f = this.bones, _ = 0, m = f.length; _ < m; _++) {
|
|
var y = f[_],
|
|
g = !1,
|
|
v = y.matrix;
|
|
if (0 != e) {
|
|
var w = v.a,
|
|
x = v.c,
|
|
b = v.b,
|
|
E = v.d;
|
|
(C = Math.atan2(l, a) + p) > t.MathUtils.PI ? C -= t.MathUtils.PI2 : C < -t.MathUtils.PI && (C += t.MathUtils.PI2),
|
|
C *= e;
|
|
var $ = Math.cos(C),
|
|
A = Math.sin(C);
|
|
v.a = $ * w - A * b,
|
|
v.c = $ * x - A * E,
|
|
v.b = A * w + $ * b,
|
|
v.d = A * x + $ * E,
|
|
g = !0
|
|
}
|
|
if (0 != i) {
|
|
var S = this.temp;
|
|
o.localToWorld(S.set(this.data.offsetX, this.data.offsetY)),
|
|
v.tx += S.x * i,
|
|
v.ty += S.y * i,
|
|
g = !0
|
|
}
|
|
if (n > 0) {
|
|
var T = (Math.sqrt(a * a + l * l) - 1 + this.data.offsetScaleX) * n + 1;
|
|
v.a *= T,
|
|
v.b *= T,
|
|
T = (Math.sqrt(h * h + u * u) - 1 + this.data.offsetScaleY) * n + 1,
|
|
v.c *= T,
|
|
v.d *= T,
|
|
g = !0
|
|
}
|
|
if (r > 0) {
|
|
var C;
|
|
(C = Math.atan2(u, h) - Math.atan2(l, a)) > t.MathUtils.PI ? C -= t.MathUtils.PI2 : C < -t.MathUtils.PI && (C += t.MathUtils.PI2);
|
|
x = v.c,
|
|
E = v.d;
|
|
C = Math.atan2(E, x) + (C - t.MathUtils.PI / 2 + d) * r;
|
|
T = Math.sqrt(x * x + E * E);
|
|
v.c = Math.cos(C) * T,
|
|
v.d = Math.sin(C) * T,
|
|
g = !0
|
|
}
|
|
g && (y.appliedValid = !1)
|
|
}
|
|
},
|
|
e.prototype.applyAbsoluteLocal = function () {
|
|
var t = this.rotateMix,
|
|
e = this.translateMix,
|
|
i = this.scaleMix,
|
|
n = this.shearMix,
|
|
r = this.target;
|
|
r.appliedValid || r.updateAppliedTransform();
|
|
for (var o = this.bones, s = 0, a = o.length; s < a; s++) {
|
|
var h = o[s];
|
|
h.appliedValid || h.updateAppliedTransform();
|
|
var l = h.arotation;
|
|
if (0 != t) {
|
|
var u = r.arotation - l + this.data.offsetRotation;
|
|
l += (u -= 360 * (16384 - (16384.499999999996 - u / 360 | 0))) * t
|
|
}
|
|
var c = h.ax,
|
|
p = h.ay;
|
|
0 != e && (c += (r.ax - c + this.data.offsetX) * e, p += (r.ay - p + this.data.offsetY) * e);
|
|
var d = h.ascaleX,
|
|
f = h.ascaleY;
|
|
i > 0 && (d > 1e-5 && (d = (d + (r.ascaleX - d + this.data.offsetScaleX) * i) / d), f > 1e-5 && (f = (f + (r.ascaleY - f + this.data.offsetScaleY) * i) / f));
|
|
var _ = h.ashearY;
|
|
if (n > 0) {
|
|
u = r.ashearY - _ + this.data.offsetShearY;
|
|
u -= 360 * (16384 - (16384.499999999996 - u / 360 | 0)),
|
|
h.shearY += u * n
|
|
}
|
|
h.updateWorldTransformWith(c, p, l, d, f, h.ashearX, _)
|
|
}
|
|
},
|
|
e.prototype.applyRelativeLocal = function () {
|
|
var t = this.rotateMix,
|
|
e = this.translateMix,
|
|
i = this.scaleMix,
|
|
n = this.shearMix,
|
|
r = this.target;
|
|
r.appliedValid || r.updateAppliedTransform();
|
|
for (var o = this.bones, s = 0, a = o.length; s < a; s++) {
|
|
var h = o[s];
|
|
h.appliedValid || h.updateAppliedTransform();
|
|
var l = h.arotation;
|
|
0 != t && (l += (r.arotation + this.data.offsetRotation) * t);
|
|
var u = h.ax,
|
|
c = h.ay;
|
|
0 != e && (u += (r.ax + this.data.offsetX) * e, c += (r.ay + this.data.offsetY) * e);
|
|
var p = h.ascaleX,
|
|
d = h.ascaleY;
|
|
i > 0 && (p > 1e-5 && (p *= (r.ascaleX - 1 + this.data.offsetScaleX) * i + 1), d > 1e-5 && (d *= (r.ascaleY - 1 + this.data.offsetScaleY) * i + 1));
|
|
var f = h.ashearY;
|
|
n > 0 && (f += (r.ashearY + this.data.offsetShearY) * n),
|
|
h.updateWorldTransformWith(u, c, l, p, d, h.ashearX, f)
|
|
}
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.TransformConstraint = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t) {
|
|
function e(e) {
|
|
var i = t.call(this, e, 0, !1) || this;
|
|
return i.bones = new Array,
|
|
i.rotateMix = 0,
|
|
i.translateMix = 0,
|
|
i.scaleMix = 0,
|
|
i.shearMix = 0,
|
|
i.offsetRotation = 0,
|
|
i.offsetX = 0,
|
|
i.offsetY = 0,
|
|
i.offsetScaleX = 0,
|
|
i.offsetScaleY = 0,
|
|
i.offsetShearY = 0,
|
|
i.relative = !1,
|
|
i.local = !1,
|
|
i
|
|
}
|
|
return s(e, t),
|
|
e
|
|
}
|
|
(t.ConstraintData);
|
|
t.TransformConstraintData = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e() {
|
|
this.convexPolygons = new Array,
|
|
this.convexPolygonsIndices = new Array,
|
|
this.indicesArray = new Array,
|
|
this.isConcaveArray = new Array,
|
|
this.triangles = new Array,
|
|
this.polygonPool = new t.Pool((function () {
|
|
return new Array
|
|
})),
|
|
this.polygonIndicesPool = new t.Pool((function () {
|
|
return new Array
|
|
}))
|
|
}
|
|
return e.prototype.triangulate = function (t) {
|
|
var i = t,
|
|
n = t.length >> 1,
|
|
r = this.indicesArray;
|
|
r.length = 0;
|
|
for (var o = 0; o < n; o++)
|
|
r[o] = o;
|
|
var s = this.isConcaveArray;
|
|
s.length = 0;
|
|
o = 0;
|
|
for (var a = n; o < a; ++o)
|
|
s[o] = e.isConcave(o, n, i, r);
|
|
var h = this.triangles;
|
|
for (h.length = 0; n > 3; ) {
|
|
for (var l = n - 1, u = (o = 0, 1); ; ) {
|
|
t: if (!s[o]) {
|
|
for (var c = r[l] << 1, p = r[o] << 1, d = r[u] << 1, f = i[c], _ = i[c + 1], m = i[p], y = i[p + 1], g = i[d], v = i[d + 1], w = (u + 1) % n; w != l; w = (w + 1) % n)
|
|
if (s[w]) {
|
|
var x = r[w] << 1,
|
|
b = i[x],
|
|
E = i[x + 1];
|
|
if (e.positiveArea(g, v, f, _, b, E) && e.positiveArea(f, _, m, y, b, E) && e.positiveArea(m, y, g, v, b, E))
|
|
break t
|
|
}
|
|
break
|
|
}
|
|
if (0 == u) {
|
|
do {
|
|
if (!s[o])
|
|
break;
|
|
o--
|
|
} while (o > 0);
|
|
break
|
|
}
|
|
l = o,
|
|
o = u,
|
|
u = (u + 1) % n
|
|
}
|
|
h.push(r[(n + o - 1) % n]),
|
|
h.push(r[o]),
|
|
h.push(r[(o + 1) % n]),
|
|
r.splice(o, 1),
|
|
s.splice(o, 1);
|
|
var $ = (--n + o - 1) % n,
|
|
A = o == n ? 0 : o;
|
|
s[$] = e.isConcave($, n, i, r),
|
|
s[A] = e.isConcave(A, n, i, r)
|
|
}
|
|
return 3 == n && (h.push(r[2]), h.push(r[0]), h.push(r[1])),
|
|
h
|
|
},
|
|
e.prototype.decompose = function (t, i) {
|
|
var n = t,
|
|
r = this.convexPolygons;
|
|
this.polygonPool.freeAll(r),
|
|
r.length = 0;
|
|
var o = this.convexPolygonsIndices;
|
|
this.polygonIndicesPool.freeAll(o),
|
|
o.length = 0;
|
|
var s = this.polygonIndicesPool.obtain();
|
|
s.length = 0;
|
|
var a = this.polygonPool.obtain();
|
|
a.length = 0;
|
|
for (var h = -1, l = 0, u = 0, c = i.length; u < c; u += 3) {
|
|
var p = i[u] << 1,
|
|
d = i[u + 1] << 1,
|
|
f = i[u + 2] << 1,
|
|
_ = n[p],
|
|
m = n[p + 1],
|
|
y = n[d],
|
|
g = n[d + 1],
|
|
v = n[f],
|
|
w = n[f + 1],
|
|
x = !1;
|
|
if (h == p) {
|
|
var b = a.length - 4,
|
|
E = e.winding(a[b], a[b + 1], a[b + 2], a[b + 3], v, w),
|
|
$ = e.winding(v, w, a[0], a[1], a[2], a[3]);
|
|
E == l && $ == l && (a.push(v), a.push(w), s.push(f), x = !0)
|
|
}
|
|
x || (a.length > 0 ? (r.push(a), o.push(s)) : (this.polygonPool.free(a), this.polygonIndicesPool.free(s)), (a = this.polygonPool.obtain()).length = 0, a.push(_), a.push(m), a.push(y), a.push(g), a.push(v), a.push(w), (s = this.polygonIndicesPool.obtain()).length = 0, s.push(p), s.push(d), s.push(f), l = e.winding(_, m, y, g, v, w), h = p)
|
|
}
|
|
a.length > 0 && (r.push(a), o.push(s));
|
|
for (u = 0, c = r.length; u < c; u++)
|
|
if (0 != (s = o[u]).length)
|
|
for (var A = s[0], S = s[s.length - 1], T = (a = r[u])[b = a.length - 4], C = a[b + 1], M = a[b + 2], I = a[b + 3], P = a[0], O = a[1], R = a[2], D = a[3], L = e.winding(T, C, M, I, P, O), k = 0; k < c; k++)
|
|
if (k != u) {
|
|
var F = o[k];
|
|
if (3 == F.length) {
|
|
var N = F[0],
|
|
B = F[1],
|
|
U = F[2],
|
|
X = r[k];
|
|
v = X[X.length - 2],
|
|
w = X[X.length - 1];
|
|
if (N == A && B == S) {
|
|
E = e.winding(T, C, M, I, v, w),
|
|
$ = e.winding(v, w, P, O, R, D);
|
|
E == L && $ == L && (X.length = 0, F.length = 0, a.push(v), a.push(w), s.push(U), T = M, C = I, M = v, I = w, k = 0)
|
|
}
|
|
}
|
|
}
|
|
for (u = r.length - 1; u >= 0; u--)
|
|
0 == (a = r[u]).length && (r.splice(u, 1), this.polygonPool.free(a), s = o[u], o.splice(u, 1), this.polygonIndicesPool.free(s));
|
|
return r
|
|
},
|
|
e.isConcave = function (t, e, i, n) {
|
|
var r = n[(e + t - 1) % e] << 1,
|
|
o = n[t] << 1,
|
|
s = n[(t + 1) % e] << 1;
|
|
return !this.positiveArea(i[r], i[r + 1], i[o], i[o + 1], i[s], i[s + 1])
|
|
},
|
|
e.positiveArea = function (t, e, i, n, r, o) {
|
|
return t * (o - n) + i * (e - o) + r * (n - e) >= 0
|
|
},
|
|
e.winding = function (t, e, i, n, r, o) {
|
|
var s = i - t,
|
|
a = n - e;
|
|
return r * a - o * s + s * e - t * a >= 0 ? 1 : -1
|
|
},
|
|
e
|
|
}
|
|
();
|
|
t.Triangulator = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function t() {
|
|
this.array = new Array
|
|
}
|
|
return t.prototype.add = function (t) {
|
|
var e = this.contains(t);
|
|
return this.array[0 | t] = 0 | t,
|
|
!e
|
|
},
|
|
t.prototype.contains = function (t) {
|
|
return null != this.array[0 | t]
|
|
},
|
|
t.prototype.remove = function (t) {
|
|
this.array[0 | t] = void 0
|
|
},
|
|
t.prototype.clear = function () {
|
|
this.array.length = 0
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.IntSet = e;
|
|
var i = function () {
|
|
function t(t, e, i, n) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
void 0 === i && (i = 0),
|
|
void 0 === n && (n = 0),
|
|
this.r = t,
|
|
this.g = e,
|
|
this.b = i,
|
|
this.a = n
|
|
}
|
|
return t.prototype.set = function (t, e, i, n) {
|
|
return this.r = t,
|
|
this.g = e,
|
|
this.b = i,
|
|
this.a = n,
|
|
this.clamp(),
|
|
this
|
|
},
|
|
t.prototype.setFromColor = function (t) {
|
|
return this.r = t.r,
|
|
this.g = t.g,
|
|
this.b = t.b,
|
|
this.a = t.a,
|
|
this
|
|
},
|
|
t.prototype.setFromString = function (t) {
|
|
return t = "#" == t.charAt(0) ? t.substr(1) : t,
|
|
this.r = parseInt(t.substr(0, 2), 16) / 255,
|
|
this.g = parseInt(t.substr(2, 2), 16) / 255,
|
|
this.b = parseInt(t.substr(4, 2), 16) / 255,
|
|
this.a = (8 != t.length ? 255 : parseInt(t.substr(6, 2), 16)) / 255,
|
|
this
|
|
},
|
|
t.prototype.add = function (t, e, i, n) {
|
|
return this.r += t,
|
|
this.g += e,
|
|
this.b += i,
|
|
this.a += n,
|
|
this.clamp(),
|
|
this
|
|
},
|
|
t.prototype.clamp = function () {
|
|
return this.r < 0 ? this.r = 0 : this.r > 1 && (this.r = 1),
|
|
this.g < 0 ? this.g = 0 : this.g > 1 && (this.g = 1),
|
|
this.b < 0 ? this.b = 0 : this.b > 1 && (this.b = 1),
|
|
this.a < 0 ? this.a = 0 : this.a > 1 && (this.a = 1),
|
|
this
|
|
},
|
|
t.rgba8888ToColor = function (t, e) {
|
|
t.r = ((4278190080 & e) >>> 24) / 255,
|
|
t.g = ((16711680 & e) >>> 16) / 255,
|
|
t.b = ((65280 & e) >>> 8) / 255,
|
|
t.a = (255 & e) / 255
|
|
},
|
|
t.rgb888ToColor = function (t, e) {
|
|
t.r = ((16711680 & e) >>> 16) / 255,
|
|
t.g = ((65280 & e) >>> 8) / 255,
|
|
t.b = (255 & e) / 255
|
|
},
|
|
t.WHITE = new t(1, 1, 1, 1),
|
|
t.RED = new t(1, 0, 0, 1),
|
|
t.GREEN = new t(0, 1, 0, 1),
|
|
t.BLUE = new t(0, 0, 1, 1),
|
|
t.MAGENTA = new t(1, 0, 1, 1),
|
|
t
|
|
}
|
|
();
|
|
t.Color = i;
|
|
var n = function () {
|
|
function t() {}
|
|
return t.clamp = function (t, e, i) {
|
|
return t < e ? e : t > i ? i : t
|
|
},
|
|
t.cosDeg = function (e) {
|
|
return Math.cos(e * t.degRad)
|
|
},
|
|
t.sinDeg = function (e) {
|
|
return Math.sin(e * t.degRad)
|
|
},
|
|
t.signum = function (t) {
|
|
return t > 0 ? 1 : t < 0 ? -1 : 0
|
|
},
|
|
t.toInt = function (t) {
|
|
return t > 0 ? Math.floor(t) : Math.ceil(t)
|
|
},
|
|
t.cbrt = function (t) {
|
|
var e = Math.pow(Math.abs(t), 1 / 3);
|
|
return t < 0 ? -e : e
|
|
},
|
|
t.randomTriangular = function (e, i) {
|
|
return t.randomTriangularWith(e, i, .5 * (e + i))
|
|
},
|
|
t.randomTriangularWith = function (t, e, i) {
|
|
var n = Math.random(),
|
|
r = e - t;
|
|
return n <= (i - t) / r ? t + Math.sqrt(n * r * (i - t)) : e - Math.sqrt((1 - n) * r * (e - i))
|
|
},
|
|
t.PI = 3.1415927,
|
|
t.PI2 = 2 * t.PI,
|
|
t.radiansToDegrees = 180 / t.PI,
|
|
t.radDeg = t.radiansToDegrees,
|
|
t.degreesToRadians = t.PI / 180,
|
|
t.degRad = t.degreesToRadians,
|
|
t
|
|
}
|
|
();
|
|
t.MathUtils = n;
|
|
var r = function () {
|
|
function t() {}
|
|
return t.prototype.apply = function (t, e, i) {
|
|
return t + (e - t) * this.applyInternal(i)
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.Interpolation = r;
|
|
var o = function (t) {
|
|
function e(e) {
|
|
var i = t.call(this) || this;
|
|
return i.power = 2,
|
|
i.power = e,
|
|
i
|
|
}
|
|
return s(e, t),
|
|
e.prototype.applyInternal = function (t) {
|
|
return t <= .5 ? Math.pow(2 * t, this.power) / 2 : Math.pow(2 * (t - 1), this.power) / (this.power % 2 == 0 ? -2 : 2) + 1
|
|
},
|
|
e
|
|
}
|
|
(r);
|
|
t.Pow = o;
|
|
var a = function (t) {
|
|
function e(e) {
|
|
return t.call(this, e) || this
|
|
}
|
|
return s(e, t),
|
|
e.prototype.applyInternal = function (t) {
|
|
return Math.pow(t - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1
|
|
},
|
|
e
|
|
}
|
|
(o);
|
|
t.PowOut = a;
|
|
var h = function () {
|
|
function t() {}
|
|
return t.arrayCopy = function (t, e, i, n, r) {
|
|
for (var o = e, s = n; o < e + r; o++, s++)
|
|
i[s] = t[o]
|
|
},
|
|
t.setArraySize = function (t, e, i) {
|
|
void 0 === i && (i = 0);
|
|
var n = t.length;
|
|
if (n == e)
|
|
return t;
|
|
if (t.length = e, n < e)
|
|
for (var r = n; r < e; r++)
|
|
t[r] = i;
|
|
return t
|
|
},
|
|
t.ensureArrayCapacity = function (e, i, n) {
|
|
return void 0 === n && (n = 0),
|
|
e.length >= i ? e : t.setArraySize(e, i, n)
|
|
},
|
|
t.newArray = function (t, e) {
|
|
for (var i = new Array(t), n = 0; n < t; n++)
|
|
i[n] = e;
|
|
return i
|
|
},
|
|
t.newFloatArray = function (e) {
|
|
if (t.SUPPORTS_TYPED_ARRAYS)
|
|
return new Float32Array(e);
|
|
for (var i = new Array(e), n = 0; n < i.length; n++)
|
|
i[n] = 0;
|
|
return i
|
|
},
|
|
t.newShortArray = function (e) {
|
|
if (t.SUPPORTS_TYPED_ARRAYS)
|
|
return new Int16Array(e);
|
|
for (var i = new Array(e), n = 0; n < i.length; n++)
|
|
i[n] = 0;
|
|
return i
|
|
},
|
|
t.toFloatArray = function (e) {
|
|
return t.SUPPORTS_TYPED_ARRAYS ? new Float32Array(e) : e
|
|
},
|
|
t.toSinglePrecision = function (e) {
|
|
return t.SUPPORTS_TYPED_ARRAYS ? Math.fround(e) : e
|
|
},
|
|
t.webkit602BugfixHelper = function (t, e) {},
|
|
t.contains = function (t, e, i) {
|
|
void 0 === i && (i = !0);
|
|
for (var n = 0; n < t.length; n++)
|
|
if (t[n] == e)
|
|
return !0;
|
|
return !1
|
|
},
|
|
t.SUPPORTS_TYPED_ARRAYS = "undefined" != typeof Float32Array,
|
|
t
|
|
}
|
|
();
|
|
t.Utils = h;
|
|
var l = function () {
|
|
function t() {}
|
|
return t.logBones = function (t) {
|
|
for (var e = 0; e < t.bones.length; e++) {
|
|
var i = t.bones[e],
|
|
n = i.matrix;
|
|
console.log(i.data.name + ", " + n.a + ", " + n.b + ", " + n.c + ", " + n.d + ", " + n.tx + ", " + n.ty)
|
|
}
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.DebugUtils = l;
|
|
var u = function () {
|
|
function t(t) {
|
|
this.items = new Array,
|
|
this.instantiator = t
|
|
}
|
|
return t.prototype.obtain = function () {
|
|
return this.items.length > 0 ? this.items.pop() : this.instantiator()
|
|
},
|
|
t.prototype.free = function (t) {
|
|
t.reset && t.reset(),
|
|
this.items.push(t)
|
|
},
|
|
t.prototype.freeAll = function (t) {
|
|
for (var e = 0; e < t.length; e++)
|
|
t[e].reset && t[e].reset(), this.items[e] = t[e]
|
|
},
|
|
t.prototype.clear = function () {
|
|
this.items.length = 0
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.Pool = u;
|
|
var c = function () {
|
|
function t(t, e) {
|
|
void 0 === t && (t = 0),
|
|
void 0 === e && (e = 0),
|
|
this.x = t,
|
|
this.y = e
|
|
}
|
|
return t.prototype.set = function (t, e) {
|
|
return this.x = t,
|
|
this.y = e,
|
|
this
|
|
},
|
|
t.prototype.length = function () {
|
|
var t = this.x,
|
|
e = this.y;
|
|
return Math.sqrt(t * t + e * e)
|
|
},
|
|
t.prototype.normalize = function () {
|
|
var t = this.length();
|
|
return 0 != t && (this.x /= t, this.y /= t),
|
|
this
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.Vector2 = c;
|
|
var p = function () {
|
|
function t() {
|
|
this.maxDelta = .064,
|
|
this.framesPerSecond = 0,
|
|
this.delta = 0,
|
|
this.totalTime = 0,
|
|
this.lastTime = Date.now() / 1e3,
|
|
this.frameCount = 0,
|
|
this.frameTime = 0
|
|
}
|
|
return t.prototype.update = function () {
|
|
var t = Date.now() / 1e3;
|
|
this.delta = t - this.lastTime,
|
|
this.frameTime += this.delta,
|
|
this.totalTime += this.delta,
|
|
this.delta > this.maxDelta && (this.delta = this.maxDelta),
|
|
this.lastTime = t,
|
|
this.frameCount++,
|
|
this.frameTime > 1 && (this.framesPerSecond = this.frameCount / this.frameTime, this.frameTime = 0, this.frameCount = 0)
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.TimeKeeper = p;
|
|
var d = function () {
|
|
function t(t) {
|
|
void 0 === t && (t = 32),
|
|
this.addedValues = 0,
|
|
this.lastValue = 0,
|
|
this.mean = 0,
|
|
this.dirty = !0,
|
|
this.values = new Array(t)
|
|
}
|
|
return t.prototype.hasEnoughData = function () {
|
|
return this.addedValues >= this.values.length
|
|
},
|
|
t.prototype.addValue = function (t) {
|
|
this.addedValues < this.values.length && this.addedValues++,
|
|
this.values[this.lastValue++] = t,
|
|
this.lastValue > this.values.length - 1 && (this.lastValue = 0),
|
|
this.dirty = !0
|
|
},
|
|
t.prototype.getMean = function () {
|
|
if (this.hasEnoughData()) {
|
|
if (this.dirty) {
|
|
for (var t = 0, e = 0; e < this.values.length; e++)
|
|
t += this.values[e];
|
|
this.mean = t / this.values.length,
|
|
this.dirty = !1
|
|
}
|
|
return this.mean
|
|
}
|
|
return 0
|
|
},
|
|
t
|
|
}
|
|
();
|
|
t.WindowedMean = d
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (t) {
|
|
if (null == t)
|
|
throw new Error("name cannot be null.");
|
|
this.name = t
|
|
};
|
|
t.Attachment = e;
|
|
var i = function (e) {
|
|
function i(t) {
|
|
var n = e.call(this, t) || this;
|
|
return n.id = (65535 & i.nextID++) << 11,
|
|
n.worldVerticesLength = 0,
|
|
n.deformAttachment = n,
|
|
n
|
|
}
|
|
return s(i, e),
|
|
i.prototype.computeWorldVerticesOld = function (t, e) {
|
|
this.computeWorldVertices(t, 0, this.worldVerticesLength, e, 0, 2)
|
|
},
|
|
i.prototype.computeWorldVertices = function (t, e, i, n, r, o) {
|
|
i = r + (i >> 1) * o;
|
|
var s = t.bone.skeleton,
|
|
a = t.deform,
|
|
h = this.vertices,
|
|
l = this.bones;
|
|
if (null != l) {
|
|
for (var u = 0, c = 0, p = 0; p < e; p += 2) {
|
|
u += (m = l[u]) + 1,
|
|
c += m
|
|
}
|
|
var d = s.bones;
|
|
if (0 == a.length)
|
|
for (C = r, $ = 3 * c; C < i; C += o) {
|
|
var f = 0,
|
|
_ = 0,
|
|
m = l[u++];
|
|
for (m += u; u < m; u++, $ += 3) {
|
|
w = d[l[u]].matrix,
|
|
M = h[$],
|
|
I = h[$ + 1];
|
|
var y = h[$ + 2];
|
|
f += (M * w.a + I * w.c + w.tx) * y,
|
|
_ += (M * w.b + I * w.d + w.ty) * y
|
|
}
|
|
n[C] = f,
|
|
n[C + 1] = _
|
|
}
|
|
else
|
|
for (var g = a, v = (C = r, $ = 3 * c, c << 1); C < i; C += o) {
|
|
f = 0,
|
|
_ = 0,
|
|
m = l[u++];
|
|
for (m += u; u < m; u++, $ += 3, v += 2) {
|
|
w = d[l[u]].matrix,
|
|
M = h[$] + g[v],
|
|
I = h[$ + 1] + g[v + 1],
|
|
y = h[$ + 2];
|
|
f += (M * w.a + I * w.c + w.tx) * y,
|
|
_ += (M * w.b + I * w.d + w.ty) * y
|
|
}
|
|
n[C] = f,
|
|
n[C + 1] = _
|
|
}
|
|
} else {
|
|
a.length > 0 && (h = a);
|
|
for (var w, x = (w = t.bone.matrix).tx, b = w.ty, E = w.a, $ = w.c, A = w.b, S = w.d, T = e, C = r; C < i; T += 2, C += o) {
|
|
var M = h[T],
|
|
I = h[T + 1];
|
|
n[C] = M * E + I * $ + x,
|
|
n[C + 1] = M * A + I * S + b
|
|
}
|
|
}
|
|
},
|
|
i.prototype.copyTo = function (e) {
|
|
null != this.bones ? (e.bones = new Array(this.bones.length), t.Utils.arrayCopy(this.bones, 0, e.bones, 0, this.bones.length)) : e.bones = null,
|
|
null != this.vertices ? (e.vertices = t.Utils.newFloatArray(this.vertices.length), t.Utils.arrayCopy(this.vertices, 0, e.vertices, 0, this.vertices.length)) : e.vertices = null,
|
|
e.worldVerticesLength = this.worldVerticesLength,
|
|
e.deformAttachment = this.deformAttachment
|
|
},
|
|
i.nextID = 0,
|
|
i
|
|
}
|
|
(e);
|
|
t.VertexAttachment = i
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
!function (t) {
|
|
t[t.Region = 0] = "Region",
|
|
t[t.BoundingBox = 1] = "BoundingBox",
|
|
t[t.Mesh = 2] = "Mesh",
|
|
t[t.LinkedMesh = 3] = "LinkedMesh",
|
|
t[t.Path = 4] = "Path",
|
|
t[t.Point = 5] = "Point",
|
|
t[t.Clipping = 6] = "Clipping"
|
|
}
|
|
(t.AttachmentType || (t.AttachmentType = {}))
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (e) {
|
|
function i(i) {
|
|
var n = e.call(this, i) || this;
|
|
return n.color = new t.Color(1, 1, 1, 1),
|
|
n
|
|
}
|
|
return s(i, e),
|
|
i.prototype.copy = function () {
|
|
var t = new i(name);
|
|
return this.copyTo(t),
|
|
t.color.setFromColor(this.color),
|
|
t
|
|
},
|
|
i
|
|
}
|
|
(t.VertexAttachment);
|
|
t.BoundingBoxAttachment = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (e) {
|
|
function i(i) {
|
|
var n = e.call(this, i) || this;
|
|
return n.color = new t.Color(.2275, .2275, .8078, 1),
|
|
n
|
|
}
|
|
return s(i, e),
|
|
i.prototype.copy = function () {
|
|
var t = new i(name);
|
|
return this.copyTo(t),
|
|
t.endSlot = this.endSlot,
|
|
t.color.setFromColor(this.color),
|
|
t
|
|
},
|
|
i
|
|
}
|
|
(t.VertexAttachment);
|
|
t.ClippingAttachment = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (e) {
|
|
function i(i) {
|
|
var n = e.call(this, i) || this;
|
|
return n.color = new t.Color(1, 1, 1, 1),
|
|
n.tempColor = new t.Color(0, 0, 0, 0),
|
|
n
|
|
}
|
|
return s(i, e),
|
|
i.prototype.getParentMesh = function () {
|
|
return this.parentMesh
|
|
},
|
|
i.prototype.setParentMesh = function (t) {
|
|
this.parentMesh = t,
|
|
null != t && (this.bones = t.bones, this.vertices = t.vertices, this.worldVerticesLength = t.worldVerticesLength, this.regionUVs = t.regionUVs, this.triangles = t.triangles, this.hullLength = t.hullLength, this.worldVerticesLength = t.worldVerticesLength)
|
|
},
|
|
i.prototype.copy = function () {
|
|
if (null != this.parentMesh)
|
|
return this.newLinkedMesh();
|
|
var e = new i(this.name);
|
|
return e.region = this.region,
|
|
e.path = this.path,
|
|
e.color.setFromColor(this.color),
|
|
this.copyTo(e),
|
|
e.regionUVs = new Float32Array(this.regionUVs.length),
|
|
t.Utils.arrayCopy(this.regionUVs, 0, e.regionUVs, 0, this.regionUVs.length),
|
|
e.uvs = new Array(this.uvs.length),
|
|
t.Utils.arrayCopy(this.uvs, 0, e.uvs, 0, this.uvs.length),
|
|
e.triangles = new Array(this.triangles.length),
|
|
t.Utils.arrayCopy(this.triangles, 0, e.triangles, 0, this.triangles.length),
|
|
e.hullLength = this.hullLength,
|
|
null != this.edges && (e.edges = new Array(this.edges.length), t.Utils.arrayCopy(this.edges, 0, e.edges, 0, this.edges.length)),
|
|
e.width = this.width,
|
|
e.height = this.height,
|
|
e
|
|
},
|
|
i.prototype.newLinkedMesh = function () {
|
|
var t = new i(this.name);
|
|
return t.region = this.region,
|
|
t.path = this.path,
|
|
t.color.setFromColor(this.color),
|
|
t.deformAttachment = this.deformAttachment,
|
|
t.setParentMesh(null != this.parentMesh ? this.parentMesh : this),
|
|
t
|
|
},
|
|
i
|
|
}
|
|
(t.VertexAttachment);
|
|
t.MeshAttachment = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (e) {
|
|
function i(i) {
|
|
var n = e.call(this, i) || this;
|
|
return n.closed = !1,
|
|
n.constantSpeed = !1,
|
|
n.color = new t.Color(1, 1, 1, 1),
|
|
n
|
|
}
|
|
return s(i, e),
|
|
i.prototype.copy = function () {
|
|
var e = new i(name);
|
|
return this.copyTo(e),
|
|
e.lengths = new Array(this.lengths.length),
|
|
t.Utils.arrayCopy(this.lengths, 0, e.lengths, 0, this.lengths.length),
|
|
e.closed = closed,
|
|
e.constantSpeed = this.constantSpeed,
|
|
e.color.setFromColor(this.color),
|
|
e
|
|
},
|
|
i
|
|
}
|
|
(t.VertexAttachment);
|
|
t.PathAttachment = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (e) {
|
|
function i(i) {
|
|
var n = e.call(this, i) || this;
|
|
return n.color = new t.Color(.38, .94, 0, 1),
|
|
n
|
|
}
|
|
return s(i, e),
|
|
i.prototype.computeWorldPosition = function (t, e) {
|
|
var i = t.matrix;
|
|
return e.x = this.x * i.a + this.y * i.c + t.worldX,
|
|
e.y = this.x * i.b + this.y * i.d + t.worldY,
|
|
e
|
|
},
|
|
i.prototype.computeWorldRotation = function (e) {
|
|
var i = e.matrix,
|
|
n = t.MathUtils.cosDeg(this.rotation),
|
|
r = t.MathUtils.sinDeg(this.rotation),
|
|
o = n * i.a + r * i.c,
|
|
s = n * i.b + r * i.d;
|
|
return Math.atan2(s, o) * t.MathUtils.radDeg
|
|
},
|
|
i.prototype.copy = function () {
|
|
var t = new i(name);
|
|
return t.x = this.x,
|
|
t.y = this.y,
|
|
t.rotation = this.rotation,
|
|
t.color.setFromColor(this.color),
|
|
t
|
|
},
|
|
i
|
|
}
|
|
(t.VertexAttachment);
|
|
t.PointAttachment = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function (e) {
|
|
function i(i) {
|
|
var n = e.call(this, i) || this;
|
|
return n.x = 0,
|
|
n.y = 0,
|
|
n.scaleX = 1,
|
|
n.scaleY = 1,
|
|
n.rotation = 0,
|
|
n.width = 0,
|
|
n.height = 0,
|
|
n.color = new t.Color(1, 1, 1, 1),
|
|
n.offset = t.Utils.newFloatArray(8),
|
|
n.uvs = t.Utils.newFloatArray(8),
|
|
n.tempColor = new t.Color(1, 1, 1, 1),
|
|
n
|
|
}
|
|
return s(i, e),
|
|
i.prototype.updateOffset = function () {
|
|
var t = this.width / this.region.originalWidth * this.scaleX,
|
|
e = this.height / this.region.originalHeight * this.scaleY,
|
|
n = -this.width / 2 * this.scaleX + this.region.offsetX * t,
|
|
r = -this.height / 2 * this.scaleY + this.region.offsetY * e,
|
|
o = n + this.region.width * t,
|
|
s = r + this.region.height * e,
|
|
a = this.rotation * Math.PI / 180,
|
|
h = Math.cos(a),
|
|
l = Math.sin(a),
|
|
u = n * h + this.x,
|
|
c = n * l,
|
|
p = r * h + this.y,
|
|
d = r * l,
|
|
f = o * h + this.x,
|
|
_ = o * l,
|
|
m = s * h + this.y,
|
|
y = s * l,
|
|
g = this.offset;
|
|
g[i.OX1] = u - d,
|
|
g[i.OY1] = p + c,
|
|
g[i.OX2] = u - y,
|
|
g[i.OY2] = m + c,
|
|
g[i.OX3] = f - y,
|
|
g[i.OY3] = m + _,
|
|
g[i.OX4] = f - d,
|
|
g[i.OY4] = p + _
|
|
},
|
|
i.prototype.setRegion = function (t) {
|
|
this.region = t;
|
|
var e = this.uvs;
|
|
t.rotate ? (e[2] = t.u, e[3] = t.v2, e[4] = t.u, e[5] = t.v, e[6] = t.u2, e[7] = t.v, e[0] = t.u2, e[1] = t.v2) : (e[0] = t.u, e[1] = t.v2, e[2] = t.u, e[3] = t.v, e[4] = t.u2, e[5] = t.v, e[6] = t.u2, e[7] = t.v2)
|
|
},
|
|
i.prototype.computeWorldVertices = function (t, e, n, r) {
|
|
var o = this.offset,
|
|
s = t.matrix,
|
|
a = s.tx,
|
|
h = s.ty,
|
|
l = s.a,
|
|
u = s.c,
|
|
c = s.b,
|
|
p = s.d,
|
|
d = 0,
|
|
f = 0;
|
|
d = o[i.OX1],
|
|
f = o[i.OY1],
|
|
e[n] = d * l + f * u + a,
|
|
e[n + 1] = d * c + f * p + h,
|
|
n += r,
|
|
d = o[i.OX2],
|
|
f = o[i.OY2],
|
|
e[n] = d * l + f * u + a,
|
|
e[n + 1] = d * c + f * p + h,
|
|
n += r,
|
|
d = o[i.OX3],
|
|
f = o[i.OY3],
|
|
e[n] = d * l + f * u + a,
|
|
e[n + 1] = d * c + f * p + h,
|
|
n += r,
|
|
d = o[i.OX4],
|
|
f = o[i.OY4],
|
|
e[n] = d * l + f * u + a,
|
|
e[n + 1] = d * c + f * p + h
|
|
},
|
|
i.prototype.copy = function () {
|
|
var e = new i(name);
|
|
return e.region = this.region,
|
|
e.rendererObject = this.rendererObject,
|
|
e.path = this.path,
|
|
e.x = this.x,
|
|
e.y = this.y,
|
|
e.scaleX = this.scaleX,
|
|
e.scaleY = this.scaleY,
|
|
e.rotation = this.rotation,
|
|
e.width = this.width,
|
|
e.height = this.height,
|
|
t.Utils.arrayCopy(this.uvs, 0, e.uvs, 0, 8),
|
|
t.Utils.arrayCopy(this.offset, 0, e.offset, 0, 8),
|
|
e.color.setFromColor(this.color),
|
|
e
|
|
},
|
|
i.OX1 = 0,
|
|
i.OY1 = 1,
|
|
i.OX2 = 2,
|
|
i.OY2 = 3,
|
|
i.OX3 = 4,
|
|
i.OY3 = 5,
|
|
i.OX4 = 6,
|
|
i.OY4 = 7,
|
|
i.X1 = 0,
|
|
i.Y1 = 1,
|
|
i.C1R = 2,
|
|
i.C1G = 3,
|
|
i.C1B = 4,
|
|
i.C1A = 5,
|
|
i.U1 = 6,
|
|
i.V1 = 7,
|
|
i.X2 = 8,
|
|
i.Y2 = 9,
|
|
i.C2R = 10,
|
|
i.C2G = 11,
|
|
i.C2B = 12,
|
|
i.C2A = 13,
|
|
i.U2 = 14,
|
|
i.V2 = 15,
|
|
i.X3 = 16,
|
|
i.Y3 = 17,
|
|
i.C3R = 18,
|
|
i.C3G = 19,
|
|
i.C3B = 20,
|
|
i.C3A = 21,
|
|
i.U3 = 22,
|
|
i.V3 = 23,
|
|
i.X4 = 24,
|
|
i.Y4 = 25,
|
|
i.C4R = 26,
|
|
i.C4G = 27,
|
|
i.C4B = 28,
|
|
i.C4A = 29,
|
|
i.U4 = 30,
|
|
i.V4 = 31,
|
|
i
|
|
}
|
|
(t.Attachment);
|
|
t.RegionAttachment = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t, e) {
|
|
this.jitterX = 0,
|
|
this.jitterY = 0,
|
|
this.jitterX = t,
|
|
this.jitterY = e
|
|
}
|
|
return e.prototype.begin = function (t) {},
|
|
e.prototype.transform = function (e, i, n, r) {
|
|
e.x += t.MathUtils.randomTriangular(-this.jitterX, this.jitterY),
|
|
e.y += t.MathUtils.randomTriangular(-this.jitterX, this.jitterY)
|
|
},
|
|
e.prototype.end = function () {},
|
|
e
|
|
}
|
|
();
|
|
t.JitterEffect = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
!function (t) {
|
|
var e = function () {
|
|
function e(t) {
|
|
this.centerX = 0,
|
|
this.centerY = 0,
|
|
this.radius = 0,
|
|
this.angle = 0,
|
|
this.worldX = 0,
|
|
this.worldY = 0,
|
|
this.radius = t
|
|
}
|
|
return e.prototype.begin = function (t) {
|
|
this.worldX = t.x + this.centerX,
|
|
this.worldY = t.y + this.centerY
|
|
},
|
|
e.prototype.transform = function (i, n, r, o) {
|
|
var s = this.angle * t.MathUtils.degreesToRadians,
|
|
a = i.x - this.worldX,
|
|
h = i.y - this.worldY,
|
|
l = Math.sqrt(a * a + h * h);
|
|
if (l < this.radius) {
|
|
var u = e.interpolation.apply(0, s, (this.radius - l) / this.radius),
|
|
c = Math.cos(u),
|
|
p = Math.sin(u);
|
|
i.x = c * a - p * h + this.worldX,
|
|
i.y = p * a + c * h + this.worldY
|
|
}
|
|
},
|
|
e.prototype.end = function () {},
|
|
e.interpolation = new t.PowOut(2),
|
|
e
|
|
}
|
|
();
|
|
t.SwirlEffect = e
|
|
}
|
|
(t.core || (t.core = {}))
|
|
}
|
|
(o || (o = {})),
|
|
Math.fround || (Math.fround = Math.fround = (r = new Float32Array(1), function (t) {
|
|
return r[0] = t,
|
|
r[0]
|
|
})),
|
|
function (t) {
|
|
t.core.Bone.yDown = !0;
|
|
var e = [0, 0, 0],
|
|
i = function (t) {
|
|
function e() {
|
|
var e = null !== t && t.apply(this, arguments) || this;
|
|
return e.region = null,
|
|
e.attachment = null,
|
|
e
|
|
}
|
|
return s(e, t),
|
|
e
|
|
}
|
|
(PIXI.Sprite);
|
|
t.SpineSprite = i;
|
|
var n = PIXI.GraphicsGeometry.prototype;
|
|
if (!n.invalidate) {
|
|
var r = [];
|
|
n.invalidate = function () {
|
|
var t = this.graphicsData;
|
|
r.push(0),
|
|
this.graphicsData = r,
|
|
this.clear(),
|
|
this.graphicsData = t
|
|
}
|
|
}
|
|
var o = function (t) {
|
|
function e(e, i, n, r, o) {
|
|
var s = t.call(this, e, i, n, r, o) || this;
|
|
return s.region = null,
|
|
s.attachment = null,
|
|
s
|
|
}
|
|
return s(e, t),
|
|
e
|
|
}
|
|
(PIXI.SimpleMesh);
|
|
t.SpineMesh = o;
|
|
var a = function (n) {
|
|
function r(e) {
|
|
var i = n.call(this) || this;
|
|
if (!e)
|
|
throw new Error("The spineData param is required.");
|
|
if ("string" == typeof e)
|
|
throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');
|
|
i.spineData = e,
|
|
i.skeleton = new t.core.Skeleton(e),
|
|
i.skeleton.updateWorldTransform(),
|
|
i.stateData = new t.core.AnimationStateData(e),
|
|
i.state = new t.core.AnimationState(i.stateData),
|
|
i.slotContainers = [],
|
|
i.tempClipContainers = [];
|
|
for (var r = 0, o = i.skeleton.slots.length; r < o; r++) {
|
|
var s = i.skeleton.slots[r],
|
|
a = s.getAttachment(),
|
|
h = i.newContainer();
|
|
if (i.slotContainers.push(h), i.addChild(h), i.tempClipContainers.push(null), a instanceof t.core.RegionAttachment) {
|
|
var l = a.region.name,
|
|
u = i.createSprite(s, a, l);
|
|
s.currentSprite = u,
|
|
s.currentSpriteName = l,
|
|
h.addChild(u)
|
|
} else if (a instanceof t.core.MeshAttachment) {
|
|
var c = i.createMesh(s, a);
|
|
s.currentMesh = c,
|
|
s.currentMeshName = a.name,
|
|
h.addChild(c)
|
|
} else {
|
|
if (!(a instanceof t.core.ClippingAttachment))
|
|
continue;
|
|
i.createGraphics(s, a),
|
|
h.addChild(s.clippingContainer),
|
|
h.addChild(s.currentGraphics)
|
|
}
|
|
}
|
|
return i.tintRgb = new Float32Array([1, 1, 1]),
|
|
i.autoUpdate = !0,
|
|
i.visible = !0,
|
|
i
|
|
}
|
|
return s(r, n),
|
|
Object.defineProperty(r.prototype, "autoUpdate", {
|
|
get: function () {
|
|
return this._autoUpdate
|
|
},
|
|
set: function (t) {
|
|
t !== this._autoUpdate && (this._autoUpdate = t, this.updateTransform = t ? r.prototype.autoUpdateTransform : PIXI.Container.prototype.updateTransform)
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(r.prototype, "visible", {
|
|
get: function () {
|
|
return this._visible
|
|
},
|
|
set: function (t) {
|
|
t !== this._visible && (this._visible = t, t && (this.lastTime = 0))
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(r.prototype, "tint", {
|
|
get: function () {
|
|
return PIXI.utils.rgb2hex(this.tintRgb)
|
|
},
|
|
set: function (t) {
|
|
this.tintRgb = PIXI.utils.hex2rgb(t, this.tintRgb)
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
Object.defineProperty(r.prototype, "delayLimit", {
|
|
get: function () {
|
|
return (void 0 !== this.localDelayLimit ? this.localDelayLimit : r.globalDelayLimit) || Number.MAX_VALUE
|
|
},
|
|
enumerable: !0,
|
|
configurable: !0
|
|
}),
|
|
r.prototype.update = function (i) {
|
|
var n = this.delayLimit;
|
|
if (i > n && (i = n), this.state.update(i), this.state.apply(this.skeleton), this.skeleton) {
|
|
this.skeleton.updateWorldTransform();
|
|
var r = this.skeleton.slots,
|
|
o = this.color,
|
|
s = null,
|
|
a = null;
|
|
o ? (s = o.light, a = o.dark) : s = this.tintRgb;
|
|
for (var h = 0, l = r.length; h < l; h++) {
|
|
var u = (T = r[h]).getAttachment(),
|
|
c = this.slotContainers[h];
|
|
if (u) {
|
|
var p = null,
|
|
d = u.color;
|
|
if (u instanceof t.core.RegionAttachment) {
|
|
var f = u.region;
|
|
if (f) {
|
|
T.currentMesh && (T.currentMesh.visible = !1, T.currentMesh = null, T.currentMeshName = void 0);
|
|
var _ = f;
|
|
if (T.currentSpriteName && T.currentSpriteName === _.name)
|
|
T.currentSpriteName !== _.name || T.hackRegion || this.setSpriteRegion(u, T.currentSprite, f);
|
|
else {
|
|
var m = _.name;
|
|
if (T.currentSprite && (T.currentSprite.visible = !1), T.sprites = T.sprites || {}, void 0 !== T.sprites[m])
|
|
T.sprites[m].visible = !0;
|
|
else {
|
|
var y = this.createSprite(T, u, m);
|
|
c.addChild(y)
|
|
}
|
|
T.currentSprite = T.sprites[m],
|
|
T.currentSpriteName = m
|
|
}
|
|
}
|
|
(g = c.transform).setFromMatrix(T.bone.matrix),
|
|
T.currentSprite.color ? p = T.currentSprite.color : (e[0] = s[0] * T.color.r * d.r, e[1] = s[1] * T.color.g * d.g, e[2] = s[2] * T.color.b * d.b, T.currentSprite.tint = PIXI.utils.rgb2hex(e)),
|
|
T.currentSprite.blendMode = T.blendMode
|
|
} else if (u instanceof t.core.MeshAttachment) {
|
|
var g;
|
|
if (T.currentSprite)
|
|
T.currentSprite.visible = !1, T.currentSprite = null, T.currentSpriteName = void 0, (g = new PIXI.Transform)._parentID = -1, g._worldID = c.transform._worldID, c.transform = g;
|
|
if (!T.currentMeshName || T.currentMeshName !== u.name) {
|
|
var v = u.name;
|
|
if (T.currentMesh && (T.currentMesh.visible = !1), T.meshes = T.meshes || {}, void 0 !== T.meshes[v])
|
|
T.meshes[v].visible = !0;
|
|
else {
|
|
var w = this.createMesh(T, u);
|
|
c.addChild(w)
|
|
}
|
|
T.currentMesh = T.meshes[v],
|
|
T.currentMeshName = v
|
|
}
|
|
u.computeWorldVerticesOld(T, T.currentMesh.vertices),
|
|
T.currentMesh.color ? p = T.currentMesh.color : (e[0] = s[0] * T.color.r * d.r, e[1] = s[1] * T.color.g * d.g, e[2] = s[2] * T.color.b * d.b, T.currentMesh.tint = PIXI.utils.rgb2hex(e)),
|
|
T.currentMesh.blendMode = T.blendMode
|
|
} else {
|
|
if (!(u instanceof t.core.ClippingAttachment)) {
|
|
c.visible = !1;
|
|
continue
|
|
}
|
|
T.currentGraphics || (this.createGraphics(T, u), c.addChild(T.clippingContainer), c.addChild(T.currentGraphics)),
|
|
this.updateGraphics(T, u)
|
|
}
|
|
if (c.visible = !0, p) {
|
|
var x = T.color.r * d.r,
|
|
b = T.color.g * d.g,
|
|
E = T.color.b * d.b;
|
|
p.setLight(s[0] * x + a[0] * (1 - x), s[1] * b + a[1] * (1 - b), s[2] * E + a[2] * (1 - E)),
|
|
T.darkColor ? (x = T.darkColor.r, b = T.darkColor.g, E = T.darkColor.b) : (x = 0, b = 0, E = 0),
|
|
p.setDark(s[0] * x + a[0] * (1 - x), s[1] * b + a[1] * (1 - b), s[2] * E + a[2] * (1 - E))
|
|
}
|
|
c.alpha = T.color.a
|
|
} else
|
|
c.visible = !1
|
|
}
|
|
var $ = this.skeleton.drawOrder,
|
|
A = null,
|
|
S = null;
|
|
for (h = 0, l = $.length; h < l; h++) {
|
|
var T = r[$[h].data.index];
|
|
c = this.slotContainers[$[h].data.index];
|
|
if (S || null !== c.parent && c.parent !== this && (c.parent.removeChild(c), c.parent = this), T.currentGraphics && T.getAttachment())
|
|
S = T.clippingContainer, A = T.getAttachment(), S.children.length = 0, this.children[h] = c, A.endSlot == T.data && (A.endSlot = null);
|
|
else if (S) {
|
|
var C = this.tempClipContainers[h];
|
|
C || ((C = this.tempClipContainers[h] = this.newContainer()).visible = !1),
|
|
this.children[h] = C,
|
|
c.parent = null,
|
|
S.addChild(c),
|
|
A.endSlot == T.data && (S.renderable = !0, S = null, A = null)
|
|
} else
|
|
this.children[h] = c
|
|
}
|
|
}
|
|
},
|
|
r.prototype.setSpriteRegion = function (e, i, n) {
|
|
i.attachment === e && i.region === n || (i.region = n, i.attachment = e, i.texture = n.texture, i.rotation = e.rotation * t.core.MathUtils.degRad, i.position.x = e.x, i.position.y = e.y, i.alpha = e.color.a, n.size ? (i.scale.x = n.size.width / n.originalWidth, i.scale.y = -n.size.height / n.originalHeight) : (i.scale.x = e.scaleX * e.width / n.originalWidth, i.scale.y = -e.scaleY * e.height / n.originalHeight))
|
|
},
|
|
r.prototype.setMeshRegion = function (t, e, i) {
|
|
e.attachment === t && e.region === i || (e.region = i, e.attachment = t, e.texture = i.texture, i.texture.updateUvs(), e.uvBuffer.update(t.regionUVs))
|
|
},
|
|
r.prototype.autoUpdateTransform = function () {
|
|
if (r.globalAutoUpdate) {
|
|
this.lastTime = this.lastTime || Date.now();
|
|
var t = .001 * (Date.now() - this.lastTime);
|
|
this.lastTime = Date.now(),
|
|
this.update(t)
|
|
} else
|
|
this.lastTime = 0;
|
|
PIXI.Container.prototype.updateTransform.call(this)
|
|
},
|
|
r.prototype.createSprite = function (t, e, i) {
|
|
var n = e.region;
|
|
t.hackAttachment === e && (n = t.hackRegion);
|
|
var r = n.texture,
|
|
o = this.newSprite(r);
|
|
return o.anchor.set(.5),
|
|
this.setSpriteRegion(e, o, e.region),
|
|
t.sprites = t.sprites || {},
|
|
t.sprites[i] = o,
|
|
o
|
|
},
|
|
r.prototype.createMesh = function (t, e) {
|
|
var i = e.region;
|
|
t.hackAttachment === e && (i = t.hackRegion, t.hackAttachment = null, t.hackRegion = null);
|
|
var n = this.newMesh(i.texture, new Float32Array(e.regionUVs.length), e.regionUVs, new Uint16Array(e.triangles), PIXI.DRAW_MODES.TRIANGLES);
|
|
return n.canvasPadding && (n.canvasPadding = 1.5),
|
|
n.alpha = e.color.a,
|
|
n.region = e.region,
|
|
this.setMeshRegion(e, n, i),
|
|
t.meshes = t.meshes || {},
|
|
t.meshes[e.name] = n,
|
|
n
|
|
},
|
|
r.prototype.createGraphics = function (t, e) {
|
|
var i = this.newGraphics(),
|
|
n = new PIXI.Polygon([]);
|
|
return i.clear(),
|
|
i.beginFill(16777215, 1),
|
|
i.drawPolygon(n),
|
|
i.renderable = !1,
|
|
t.currentGraphics = i,
|
|
t.clippingContainer = this.newContainer(),
|
|
t.clippingContainer.mask = t.currentGraphics,
|
|
i
|
|
},
|
|
r.prototype.updateGraphics = function (t, e) {
|
|
var i = t.currentGraphics.geometry,
|
|
n = i.graphicsData[0].shape.points,
|
|
r = e.worldVerticesLength;
|
|
n.length = r,
|
|
e.computeWorldVertices(t, 0, r, n, 0, 2),
|
|
i.invalidate()
|
|
},
|
|
r.prototype.hackTextureBySlotIndex = function (e, i, n) {
|
|
void 0 === i && (i = null),
|
|
void 0 === n && (n = null);
|
|
var r = this.skeleton.slots[e];
|
|
if (!r)
|
|
return !1;
|
|
var o = r.getAttachment(),
|
|
s = o.region;
|
|
return i ? ((s = new t.core.TextureRegion).texture = i, s.size = n, r.hackRegion = s, r.hackAttachment = o) : (r.hackRegion = null, r.hackAttachment = null),
|
|
r.currentSprite && r.currentSprite.region != s ? (this.setSpriteRegion(o, r.currentSprite, s), r.currentSprite.region = s) : r.currentMesh && r.currentMesh.region != s && this.setMeshRegion(o, r.currentMesh, s),
|
|
!0
|
|
},
|
|
r.prototype.hackTextureBySlotName = function (t, e, i) {
|
|
void 0 === e && (e = null),
|
|
void 0 === i && (i = null);
|
|
var n = this.skeleton.findSlotIndex(t);
|
|
return -1 != n && this.hackTextureBySlotIndex(n, e, i)
|
|
},
|
|
r.prototype.newContainer = function () {
|
|
return new PIXI.Container
|
|
},
|
|
r.prototype.newSprite = function (t) {
|
|
return new i(t)
|
|
},
|
|
r.prototype.newGraphics = function () {
|
|
return new PIXI.Graphics
|
|
},
|
|
r.prototype.newMesh = function (t, e, i, n, r) {
|
|
return new o(t, e, i, n, r)
|
|
},
|
|
r.prototype.transformHack = function () {
|
|
return 1
|
|
},
|
|
r.prototype.hackAttachmentGroups = function (t, e, i) {
|
|
if (t) {
|
|
for (var n = [], r = [], o = 0, s = this.skeleton.slots.length; o < s; o++) {
|
|
var a = this.skeleton.slots[o],
|
|
h = a.currentSpriteName || a.currentMeshName || "",
|
|
l = a.currentSprite || a.currentMesh;
|
|
h.endsWith(t) ? (l.parentGroup = e, r.push(l)) : i && l && (l.parentGroup = i, n.push(l))
|
|
}
|
|
return [n, r]
|
|
}
|
|
},
|
|
r.prototype.destroy = function (t) {
|
|
for (var e = 0, i = this.skeleton.slots.length; e < i; e++) {
|
|
var r = this.skeleton.slots[e];
|
|
for (var o in r.meshes)
|
|
r.meshes[o].destroy(t);
|
|
for (var s in r.meshes = null, r.sprites)
|
|
r.sprites[s].destroy(t);
|
|
r.sprites = null
|
|
}
|
|
for (e = 0, i = this.slotContainers.length; e < i; e++)
|
|
this.slotContainers[e].destroy(t);
|
|
this.spineData = null,
|
|
this.skeleton = null,
|
|
this.slotContainers = null,
|
|
this.stateData = null,
|
|
this.state = null,
|
|
this.tempClipContainers = null,
|
|
n.prototype.destroy.call(this, t)
|
|
},
|
|
r.globalAutoUpdate = !0,
|
|
r.globalDelayLimit = 0,
|
|
r.clippingPolygon = [],
|
|
r
|
|
}
|
|
(PIXI.Container);
|
|
t.Spine = a
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
PIXI.spine = t;
|
|
var e = PIXI.Texture.prototype;
|
|
e._updateUvs || (e._updateUvs = e.updateUvs)
|
|
}
|
|
(o || (o = {})),
|
|
function (t) {
|
|
PIXI.LoaderResource.setExtensionXhrType("skel", PIXI.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);
|
|
var e = function () {
|
|
function e() {}
|
|
return e.use = function (e, r) {
|
|
if (!e.data)
|
|
return r();
|
|
var o = function (t) {
|
|
return t.type === PIXI.LoaderResource.TYPE.JSON
|
|
}
|
|
(e) && e.data.bones,
|
|
s = function (t) {
|
|
return t.xhrType === PIXI.LoaderResource.XHR_RESPONSE_TYPE.BUFFER
|
|
}
|
|
(e) && ("skel" === e.extension || e.metadata.spineMetadata);
|
|
if (!o && !s)
|
|
return r();
|
|
var a = null,
|
|
h = e.data;
|
|
o ? a = new t.core.SkeletonJson(null) : (a = new t.core.SkeletonBinary(null), e.data instanceof ArrayBuffer && (h = new Uint8Array(e.data)));
|
|
var l = e.metadata || {},
|
|
u = l ? e.metadata.spineSkeletonScale : null;
|
|
u && (a.scale = u);
|
|
var c = l ? e.metadata.spineAtlas : null;
|
|
if (!1 === c)
|
|
return r();
|
|
if (c && c.pages)
|
|
return a.attachmentLoader = new t.core.AtlasAttachmentLoader(c), e.spineData = a.readSkeletonData(h), e.spineAtlas = c, r();
|
|
var p = l.spineAtlasSuffix || ".atlas",
|
|
d = e.url,
|
|
f = d.indexOf("?");
|
|
f > 0 && (d = d.substr(0, f)),
|
|
d = d.substr(0, d.lastIndexOf(".")) + p,
|
|
e.metadata && e.metadata.spineAtlasFile && (d = e.metadata.spineAtlasFile),
|
|
d = d.replace(this.baseUrl, "");
|
|
var _ = {
|
|
crossOrigin: e.crossOrigin,
|
|
xhrType: PIXI.LoaderResource.XHR_RESPONSE_TYPE.TEXT,
|
|
metadata: l.spineMetadata || null,
|
|
parentResource: e
|
|
},
|
|
m = {
|
|
crossOrigin: e.crossOrigin,
|
|
metadata: l.imageMetadata || null,
|
|
parentResource: e
|
|
},
|
|
y = e.url.substr(0, e.url.lastIndexOf("/") + 1);
|
|
y = y.replace(this.baseUrl, "");
|
|
var g = l.imageNamePrefix || e.name + "_atlas_page_",
|
|
v = l.images ? n(l.images) : l.image ? n({
|
|
default:
|
|
l.image
|
|
}) : l.imageLoader ? l.imageLoader(this, g, y, m) : i(this, g, y, m),
|
|
w = function (i) {
|
|
new t.core.TextureAtlas(i, v, (function (i) {
|
|
i && (a.attachmentLoader = new t.core.AtlasAttachmentLoader(i), e.spineData = a.readSkeletonData(h), e.spineAtlas = i),
|
|
r()
|
|
}))
|
|
};
|
|
e.metadata && e.metadata.atlasRawData ? w(e.metadata.atlasRawData) : this.add(e.name + "_atlas", d, _, (function (t) {
|
|
t.error ? r() : w(t.data)
|
|
}))
|
|
},
|
|
e
|
|
}
|
|
();
|
|
function i(t, e, i, n) {
|
|
return i && i.lastIndexOf("/") !== i.length - 1 && (i += "/"),
|
|
function (r, o) {
|
|
var s = e + r,
|
|
a = i + r,
|
|
h = t.resources[s];
|
|
if (h) {
|
|
function l() {
|
|
o(h.texture.baseTexture)
|
|
}
|
|
h.texture ? l() : h.onAfterMiddleware.add(l)
|
|
} else
|
|
t.add(s, a, n, (function (t) {
|
|
t.error ? o(null) : o(t.texture.baseTexture)
|
|
}))
|
|
}
|
|
}
|
|
function n(t) {
|
|
return function (e, i) {
|
|
var n = t[e] || t.default;
|
|
n && n.baseTexture ? i(n.baseTexture) : i(n)
|
|
}
|
|
}
|
|
t.AtlasParser = e,
|
|
t.imageLoaderAdapter = i,
|
|
t.syncImageLoaderAdapter = function (t, e) {
|
|
return t && t.lastIndexOf("/") !== t.length - 1 && (t += "/"),
|
|
function (t, i) {
|
|
i(PIXI.BaseTexture.from(t, e))
|
|
}
|
|
},
|
|
t.staticImageLoader = n,
|
|
PIXI.Loader && PIXI.Loader.registerPlugin(e)
|
|
}
|
|
(o || (o = {}))
|
|
}, {}
|
|
],
|
|
PXMd: [function (t, e, i) {
|
|
"use strict";
|
|
t("pixi-spine")
|
|
}, {
|
|
"pixi-spine": "d92s"
|
|
}
|
|
],
|
|
vDHW: [function (t, e, i) {
|
|
var n,
|
|
r = arguments[3];
|
|
/*!
|
|
* howler.js v2.1.3
|
|
* howlerjs.com
|
|
*
|
|
* (c) 2013-2019, James Simpson of GoldFire Studios
|
|
* goldfirestudios.com
|
|
*
|
|
* MIT License
|
|
*/
|
|
!function () {
|
|
"use strict";
|
|
var t = function () {
|
|
this.init()
|
|
};
|
|
t.prototype = {
|
|
init: function () {
|
|
var t = this || e;
|
|
return t._counter = 1e3,
|
|
t._html5AudioPool = [],
|
|
t.html5PoolSize = 10,
|
|
t._codecs = {},
|
|
t._howls = [],
|
|
t._muted = !1,
|
|
t._volume = 1,
|
|
t._canPlayEvent = "canplaythrough",
|
|
t._navigator = "undefined" != typeof window && window.navigator ? window.navigator : null,
|
|
t.masterGain = null,
|
|
t.noAudio = !1,
|
|
t.usingWebAudio = !0,
|
|
t.autoSuspend = !0,
|
|
t.ctx = null,
|
|
t.autoUnlock = !0,
|
|
t._setup(),
|
|
t
|
|
},
|
|
volume: function (t) {
|
|
var i = this || e;
|
|
if (t = parseFloat(t), i.ctx || p(), void 0 !== t && t >= 0 && t <= 1) {
|
|
if (i._volume = t, i._muted)
|
|
return i;
|
|
i.usingWebAudio && i.masterGain.gain.setValueAtTime(t, e.ctx.currentTime);
|
|
for (var n = 0; n < i._howls.length; n++)
|
|
if (!i._howls[n]._webAudio)
|
|
for (var r = i._howls[n]._getSoundIds(), o = 0; o < r.length; o++) {
|
|
var s = i._howls[n]._soundById(r[o]);
|
|
s && s._node && (s._node.volume = s._volume * t)
|
|
}
|
|
return i
|
|
}
|
|
return i._volume
|
|
},
|
|
mute: function (t) {
|
|
var i = this || e;
|
|
i.ctx || p(),
|
|
i._muted = t,
|
|
i.usingWebAudio && i.masterGain.gain.setValueAtTime(t ? 0 : i._volume, e.ctx.currentTime);
|
|
for (var n = 0; n < i._howls.length; n++)
|
|
if (!i._howls[n]._webAudio)
|
|
for (var r = i._howls[n]._getSoundIds(), o = 0; o < r.length; o++) {
|
|
var s = i._howls[n]._soundById(r[o]);
|
|
s && s._node && (s._node.muted = !!t || s._muted)
|
|
}
|
|
return i
|
|
},
|
|
unload: function () {
|
|
for (var t = this || e, i = t._howls.length - 1; i >= 0; i--)
|
|
t._howls[i].unload();
|
|
return t.usingWebAudio && t.ctx && void 0 !== t.ctx.close && (t.ctx.close(), t.ctx = null, p()),
|
|
t
|
|
},
|
|
codecs: function (t) {
|
|
return (this || e)._codecs[t.replace(/^x-/, "")]
|
|
},
|
|
_setup: function () {
|
|
var t = this || e;
|
|
if (t.state = t.ctx && t.ctx.state || "suspended", t._autoSuspend(), !t.usingWebAudio)
|
|
if ("undefined" != typeof Audio)
|
|
try {
|
|
void 0 === (new Audio).oncanplaythrough && (t._canPlayEvent = "canplay")
|
|
} catch (e) {
|
|
t.noAudio = !0
|
|
}
|
|
else
|
|
t.noAudio = !0;
|
|
try {
|
|
(new Audio).muted && (t.noAudio = !0)
|
|
} catch (t) {}
|
|
return t.noAudio || t._setupCodecs(),
|
|
t
|
|
},
|
|
_setupCodecs: function () {
|
|
var t = this || e,
|
|
i = null;
|
|
try {
|
|
i = "undefined" != typeof Audio ? new Audio : null
|
|
} catch (e) {
|
|
return t
|
|
}
|
|
if (!i || "function" != typeof i.canPlayType)
|
|
return t;
|
|
var n = i.canPlayType("audio/mpeg;").replace(/^no$/, ""),
|
|
r = t._navigator && t._navigator.userAgent.match(/OPR\/([0-6].)/g),
|
|
o = r && parseInt(r[0].split("/")[1], 10) < 33;
|
|
return t._codecs = {
|
|
mp3: !(o || !n && !i.canPlayType("audio/mp3;").replace(/^no$/, "")),
|
|
mpeg: !!n,
|
|
opus: !!i.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""),
|
|
ogg: !!i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
|
|
oga: !!i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
|
|
wav: !!i.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
|
|
aac: !!i.canPlayType("audio/aac;").replace(/^no$/, ""),
|
|
caf: !!i.canPlayType("audio/x-caf;").replace(/^no$/, ""),
|
|
m4a: !!(i.canPlayType("audio/x-m4a;") || i.canPlayType("audio/m4a;") || i.canPlayType("audio/aac;")).replace(/^no$/, ""),
|
|
mp4: !!(i.canPlayType("audio/x-mp4;") || i.canPlayType("audio/mp4;") || i.canPlayType("audio/aac;")).replace(/^no$/, ""),
|
|
weba: !!i.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""),
|
|
webm: !!i.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ""),
|
|
dolby: !!i.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/, ""),
|
|
flac: !!(i.canPlayType("audio/x-flac;") || i.canPlayType("audio/flac;")).replace(/^no$/, "")
|
|
},
|
|
t
|
|
},
|
|
_unlockAudio: function () {
|
|
var t = this || e;
|
|
if (!t._audioUnlocked && t.ctx) {
|
|
t._audioUnlocked = !1,
|
|
t.autoUnlock = !1,
|
|
t._mobileUnloaded || 44100 === t.ctx.sampleRate || (t._mobileUnloaded = !0, t.unload()),
|
|
t._scratchBuffer = t.ctx.createBuffer(1, 1, 22050);
|
|
var i = function (e) {
|
|
for (var n = 0; n < t.html5PoolSize; n++)
|
|
try {
|
|
var r = new Audio;
|
|
r._unlocked = !0,
|
|
t._releaseHtml5Audio(r)
|
|
} catch (e) {
|
|
t.noAudio = !0
|
|
}
|
|
for (n = 0; n < t._howls.length; n++)
|
|
if (!t._howls[n]._webAudio)
|
|
for (var o = t._howls[n]._getSoundIds(), s = 0; s < o.length; s++) {
|
|
var a = t._howls[n]._soundById(o[s]);
|
|
a && a._node && !a._node._unlocked && (a._node._unlocked = !0, a._node.load())
|
|
}
|
|
t._autoResume();
|
|
var h = t.ctx.createBufferSource();
|
|
h.buffer = t._scratchBuffer,
|
|
h.connect(t.ctx.destination),
|
|
void 0 === h.start ? h.noteOn(0) : h.start(0),
|
|
"function" == typeof t.ctx.resume && t.ctx.resume(),
|
|
h.onended = function () {
|
|
h.disconnect(0),
|
|
t._audioUnlocked = !0,
|
|
document.removeEventListener("touchstart", i, !0),
|
|
document.removeEventListener("touchend", i, !0),
|
|
document.removeEventListener("click", i, !0);
|
|
for (var e = 0; e < t._howls.length; e++)
|
|
t._howls[e]._emit("unlock")
|
|
}
|
|
};
|
|
return document.addEventListener("touchstart", i, !0),
|
|
document.addEventListener("touchend", i, !0),
|
|
document.addEventListener("click", i, !0),
|
|
t
|
|
}
|
|
},
|
|
_obtainHtml5Audio: function () {
|
|
var t = this || e;
|
|
if (t._html5AudioPool.length)
|
|
return t._html5AudioPool.pop();
|
|
var i = (new Audio).play();
|
|
return i && "undefined" != typeof Promise && (i instanceof Promise || "function" == typeof i.then) && i.catch((function () {
|
|
console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")
|
|
})),
|
|
new Audio
|
|
},
|
|
_releaseHtml5Audio: function (t) {
|
|
var i = this || e;
|
|
return t._unlocked && i._html5AudioPool.push(t),
|
|
i
|
|
},
|
|
_autoSuspend: function () {
|
|
var t = this;
|
|
if (t.autoSuspend && t.ctx && void 0 !== t.ctx.suspend && e.usingWebAudio) {
|
|
for (var i = 0; i < t._howls.length; i++)
|
|
if (t._howls[i]._webAudio)
|
|
for (var n = 0; n < t._howls[i]._sounds.length; n++)
|
|
if (!t._howls[i]._sounds[n]._paused)
|
|
return t;
|
|
return t._suspendTimer && clearTimeout(t._suspendTimer),
|
|
t._suspendTimer = setTimeout((function () {
|
|
t.autoSuspend && (t._suspendTimer = null, t.state = "suspending", t.ctx.suspend().then((function () {
|
|
t.state = "suspended",
|
|
t._resumeAfterSuspend && (delete t._resumeAfterSuspend, t._autoResume())
|
|
})))
|
|
}), 3e4),
|
|
t
|
|
}
|
|
},
|
|
_autoResume: function () {
|
|
var t = this;
|
|
if (t.ctx && void 0 !== t.ctx.resume && e.usingWebAudio)
|
|
return "running" === t.state && t._suspendTimer ? (clearTimeout(t._suspendTimer), t._suspendTimer = null) : "suspended" === t.state ? (t.ctx.resume().then((function () {
|
|
t.state = "running";
|
|
for (var e = 0; e < t._howls.length; e++)
|
|
t._howls[e]._emit("resume")
|
|
})), t._suspendTimer && (clearTimeout(t._suspendTimer), t._suspendTimer = null)) : "suspending" === t.state && (t._resumeAfterSuspend = !0), t
|
|
}
|
|
};
|
|
var e = new t,
|
|
o = function (t) {
|
|
t.src && 0 !== t.src.length ? this.init(t) : console.error("An array of source files must be passed with any new Howl.")
|
|
};
|
|
o.prototype = {
|
|
init: function (t) {
|
|
var i = this;
|
|
return e.ctx || p(),
|
|
i._autoplay = t.autoplay || !1,
|
|
i._format = "string" != typeof t.format ? t.format : [t.format],
|
|
i._html5 = t.html5 || !1,
|
|
i._muted = t.mute || !1,
|
|
i._loop = t.loop || !1,
|
|
i._pool = t.pool || 5,
|
|
i._preload = "boolean" != typeof t.preload || t.preload,
|
|
i._rate = t.rate || 1,
|
|
i._sprite = t.sprite || {},
|
|
i._src = "string" != typeof t.src ? t.src : [t.src],
|
|
i._volume = void 0 !== t.volume ? t.volume : 1,
|
|
i._xhrWithCredentials = t.xhrWithCredentials || !1,
|
|
i._duration = 0,
|
|
i._state = "unloaded",
|
|
i._sounds = [],
|
|
i._endTimers = {},
|
|
i._queue = [],
|
|
i._playLock = !1,
|
|
i._onend = t.onend ? [{
|
|
fn: t.onend
|
|
}
|
|
] : [],
|
|
i._onfade = t.onfade ? [{
|
|
fn: t.onfade
|
|
}
|
|
] : [],
|
|
i._onload = t.onload ? [{
|
|
fn: t.onload
|
|
}
|
|
] : [],
|
|
i._onloaderror = t.onloaderror ? [{
|
|
fn: t.onloaderror
|
|
}
|
|
] : [],
|
|
i._onplayerror = t.onplayerror ? [{
|
|
fn: t.onplayerror
|
|
}
|
|
] : [],
|
|
i._onpause = t.onpause ? [{
|
|
fn: t.onpause
|
|
}
|
|
] : [],
|
|
i._onplay = t.onplay ? [{
|
|
fn: t.onplay
|
|
}
|
|
] : [],
|
|
i._onstop = t.onstop ? [{
|
|
fn: t.onstop
|
|
}
|
|
] : [],
|
|
i._onmute = t.onmute ? [{
|
|
fn: t.onmute
|
|
}
|
|
] : [],
|
|
i._onvolume = t.onvolume ? [{
|
|
fn: t.onvolume
|
|
}
|
|
] : [],
|
|
i._onrate = t.onrate ? [{
|
|
fn: t.onrate
|
|
}
|
|
] : [],
|
|
i._onseek = t.onseek ? [{
|
|
fn: t.onseek
|
|
}
|
|
] : [],
|
|
i._onunlock = t.onunlock ? [{
|
|
fn: t.onunlock
|
|
}
|
|
] : [],
|
|
i._onresume = [],
|
|
i._webAudio = e.usingWebAudio && !i._html5,
|
|
void 0 !== e.ctx && e.ctx && e.autoUnlock && e._unlockAudio(),
|
|
e._howls.push(i),
|
|
i._autoplay && i._queue.push({
|
|
event: "play",
|
|
action: function () {
|
|
i.play()
|
|
}
|
|
}),
|
|
i._preload && i.load(),
|
|
i
|
|
},
|
|
load: function () {
|
|
var t = null;
|
|
if (e.noAudio)
|
|
this._emit("loaderror", null, "No audio support.");
|
|
else {
|
|
"string" == typeof this._src && (this._src = [this._src]);
|
|
for (var i = 0; i < this._src.length; i++) {
|
|
var n,
|
|
r;
|
|
if (this._format && this._format[i])
|
|
n = this._format[i];
|
|
else {
|
|
if ("string" != typeof(r = this._src[i])) {
|
|
this._emit("loaderror", null, "Non-string found in selected audio sources - ignoring.");
|
|
continue
|
|
}
|
|
(n = /^data:audio\/([^;,]+);/i.exec(r)) || (n = /\.([^.]+)$/.exec(r.split("?", 1)[0])),
|
|
n && (n = n[1].toLowerCase())
|
|
}
|
|
if (n || console.warn('No file extension was found. Consider using the "format" property or specify an extension.'), n && e.codecs(n)) {
|
|
t = this._src[i];
|
|
break
|
|
}
|
|
}
|
|
if (t)
|
|
return this._src = t, this._state = "loading", "https:" === window.location.protocol && "http:" === t.slice(0, 5) && (this._html5 = !0, this._webAudio = !1), new s(this), this._webAudio && h(this), this;
|
|
this._emit("loaderror", null, "No codec support for selected audio sources.")
|
|
}
|
|
},
|
|
play: function (t, i) {
|
|
var n = this,
|
|
r = null;
|
|
if ("number" == typeof t)
|
|
r = t, t = null;
|
|
else {
|
|
if ("string" == typeof t && "loaded" === n._state && !n._sprite[t])
|
|
return null;
|
|
if (void 0 === t && (t = "__default", !n._playLock)) {
|
|
for (var o = 0, s = 0; s < n._sounds.length; s++)
|
|
n._sounds[s]._paused && !n._sounds[s]._ended && (o++, r = n._sounds[s]._id);
|
|
1 === o ? t = null : r = null
|
|
}
|
|
}
|
|
var a = r ? n._soundById(r) : n._inactiveSound();
|
|
if (!a)
|
|
return null;
|
|
if (r && !t && (t = a._sprite || "__default"), "loaded" !== n._state) {
|
|
a._sprite = t,
|
|
a._ended = !1;
|
|
var h = a._id;
|
|
return n._queue.push({
|
|
event: "play",
|
|
action: function () {
|
|
n.play(h)
|
|
}
|
|
}),
|
|
h
|
|
}
|
|
if (r && !a._paused)
|
|
return i || n._loadQueue("play"), a._id;
|
|
n._webAudio && e._autoResume();
|
|
var l = Math.max(0, a._seek > 0 ? a._seek : n._sprite[t][0] / 1e3),
|
|
u = Math.max(0, (n._sprite[t][0] + n._sprite[t][1]) / 1e3 - l),
|
|
c = 1e3 * u / Math.abs(a._rate),
|
|
p = n._sprite[t][0] / 1e3,
|
|
d = (n._sprite[t][0] + n._sprite[t][1]) / 1e3;
|
|
a._sprite = t,
|
|
a._ended = !1;
|
|
var f = function () {
|
|
a._paused = !1,
|
|
a._seek = l,
|
|
a._start = p,
|
|
a._stop = d,
|
|
a._loop = !(!a._loop && !n._sprite[t][2])
|
|
};
|
|
if (!(l >= d)) {
|
|
var _ = a._node;
|
|
if (n._webAudio) {
|
|
var m = function () {
|
|
n._playLock = !1,
|
|
f(),
|
|
n._refreshBuffer(a);
|
|
var t = a._muted || n._muted ? 0 : a._volume;
|
|
_.gain.setValueAtTime(t, e.ctx.currentTime),
|
|
a._playStart = e.ctx.currentTime,
|
|
void 0 === _.bufferSource.start ? a._loop ? _.bufferSource.noteGrainOn(0, l, 86400) : _.bufferSource.noteGrainOn(0, l, u) : a._loop ? _.bufferSource.start(0, l, 86400) : _.bufferSource.start(0, l, u),
|
|
c !== 1 / 0 && (n._endTimers[a._id] = setTimeout(n._ended.bind(n, a), c)),
|
|
i || setTimeout((function () {
|
|
n._emit("play", a._id),
|
|
n._loadQueue()
|
|
}), 0)
|
|
};
|
|
"running" === e.state ? m() : (n._playLock = !0, n.once("resume", m), n._clearTimer(a._id))
|
|
} else {
|
|
var y = function () {
|
|
_.currentTime = l,
|
|
_.muted = a._muted || n._muted || e._muted || _.muted,
|
|
_.volume = a._volume * e.volume(),
|
|
_.playbackRate = a._rate;
|
|
try {
|
|
var r = _.play();
|
|
if (r && "undefined" != typeof Promise && (r instanceof Promise || "function" == typeof r.then) ? (n._playLock = !0, f(), r.then((function () {
|
|
n._playLock = !1,
|
|
_._unlocked = !0,
|
|
i || (n._emit("play", a._id), n._loadQueue())
|
|
})).catch((function () {
|
|
n._playLock = !1,
|
|
n._emit("playerror", a._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),
|
|
a._ended = !0,
|
|
a._paused = !0
|
|
}))) : i || (n._playLock = !1, f(), n._emit("play", a._id), n._loadQueue()), _.playbackRate = a._rate, _.paused)
|
|
return void n._emit("playerror", a._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");
|
|
"__default" !== t || a._loop ? n._endTimers[a._id] = setTimeout(n._ended.bind(n, a), c) : (n._endTimers[a._id] = function () {
|
|
n._ended(a),
|
|
_.removeEventListener("ended", n._endTimers[a._id], !1)
|
|
}, _.addEventListener("ended", n._endTimers[a._id], !1))
|
|
} catch (t) {
|
|
n._emit("playerror", a._id, t)
|
|
}
|
|
};
|
|
"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" === _.src && (_.src = n._src, _.load());
|
|
var g = window && window.ejecta || !_.readyState && e._navigator.isCocoonJS;
|
|
if (_.readyState >= 3 || g)
|
|
y();
|
|
else {
|
|
n._playLock = !0;
|
|
var v = function () {
|
|
y(),
|
|
_.removeEventListener(e._canPlayEvent, v, !1)
|
|
};
|
|
_.addEventListener(e._canPlayEvent, v, !1),
|
|
n._clearTimer(a._id)
|
|
}
|
|
}
|
|
return a._id
|
|
}
|
|
n._ended(a)
|
|
},
|
|
pause: function (t) {
|
|
var e = this;
|
|
if ("loaded" !== e._state || e._playLock)
|
|
return e._queue.push({
|
|
event: "pause",
|
|
action: function () {
|
|
e.pause(t)
|
|
}
|
|
}), e;
|
|
for (var i = e._getSoundIds(t), n = 0; n < i.length; n++) {
|
|
e._clearTimer(i[n]);
|
|
var r = e._soundById(i[n]);
|
|
if (r && !r._paused && (r._seek = e.seek(i[n]), r._rateSeek = 0, r._paused = !0, e._stopFade(i[n]), r._node))
|
|
if (e._webAudio) {
|
|
if (!r._node.bufferSource)
|
|
continue;
|
|
void 0 === r._node.bufferSource.stop ? r._node.bufferSource.noteOff(0) : r._node.bufferSource.stop(0),
|
|
e._cleanBuffer(r._node)
|
|
} else
|
|
isNaN(r._node.duration) && r._node.duration !== 1 / 0 || r._node.pause();
|
|
arguments[1] || e._emit("pause", r ? r._id : null)
|
|
}
|
|
return e
|
|
},
|
|
stop: function (t, e) {
|
|
var i = this;
|
|
if ("loaded" !== i._state || i._playLock)
|
|
return i._queue.push({
|
|
event: "stop",
|
|
action: function () {
|
|
i.stop(t)
|
|
}
|
|
}), i;
|
|
for (var n = i._getSoundIds(t), r = 0; r < n.length; r++) {
|
|
i._clearTimer(n[r]);
|
|
var o = i._soundById(n[r]);
|
|
o && (o._seek = o._start || 0, o._rateSeek = 0, o._paused = !0, o._ended = !0, i._stopFade(n[r]), o._node && (i._webAudio ? o._node.bufferSource && (void 0 === o._node.bufferSource.stop ? o._node.bufferSource.noteOff(0) : o._node.bufferSource.stop(0), i._cleanBuffer(o._node)) : isNaN(o._node.duration) && o._node.duration !== 1 / 0 || (o._node.currentTime = o._start || 0, o._node.pause(), o._node.duration === 1 / 0 && i._clearSound(o._node))), e || i._emit("stop", o._id))
|
|
}
|
|
return i
|
|
},
|
|
mute: function (t, i) {
|
|
var n = this;
|
|
if ("loaded" !== n._state || n._playLock)
|
|
return n._queue.push({
|
|
event: "mute",
|
|
action: function () {
|
|
n.mute(t, i)
|
|
}
|
|
}), n;
|
|
if (void 0 === i) {
|
|
if ("boolean" != typeof t)
|
|
return n._muted;
|
|
n._muted = t
|
|
}
|
|
for (var r = n._getSoundIds(i), o = 0; o < r.length; o++) {
|
|
var s = n._soundById(r[o]);
|
|
s && (s._muted = t, s._interval && n._stopFade(s._id), n._webAudio && s._node ? s._node.gain.setValueAtTime(t ? 0 : s._volume, e.ctx.currentTime) : s._node && (s._node.muted = !!e._muted || t), n._emit("mute", s._id))
|
|
}
|
|
return n
|
|
},
|
|
volume: function () {
|
|
var t,
|
|
i,
|
|
n,
|
|
r = this,
|
|
o = arguments;
|
|
if (0 === o.length)
|
|
return r._volume;
|
|
if (1 === o.length || 2 === o.length && void 0 === o[1]) {
|
|
var s = r._getSoundIds(),
|
|
a = s.indexOf(o[0]);
|
|
a >= 0 ? i = parseInt(o[0], 10) : t = parseFloat(o[0])
|
|
} else
|
|
o.length >= 2 && (t = parseFloat(o[0]), i = parseInt(o[1], 10));
|
|
if (!(void 0 !== t && t >= 0 && t <= 1))
|
|
return (n = i ? r._soundById(i) : r._sounds[0]) ? n._volume : 0;
|
|
if ("loaded" !== r._state || r._playLock)
|
|
return r._queue.push({
|
|
event: "volume",
|
|
action: function () {
|
|
r.volume.apply(r, o)
|
|
}
|
|
}), r;
|
|
void 0 === i && (r._volume = t),
|
|
i = r._getSoundIds(i);
|
|
for (var h = 0; h < i.length; h++)
|
|
(n = r._soundById(i[h])) && (n._volume = t, o[2] || r._stopFade(i[h]), r._webAudio && n._node && !n._muted ? n._node.gain.setValueAtTime(t, e.ctx.currentTime) : n._node && !n._muted && (n._node.volume = t * e.volume()), r._emit("volume", n._id));
|
|
return r
|
|
},
|
|
fade: function (t, i, n, r) {
|
|
var o = this;
|
|
if ("loaded" !== o._state || o._playLock)
|
|
return o._queue.push({
|
|
event: "fade",
|
|
action: function () {
|
|
o.fade(t, i, n, r)
|
|
}
|
|
}), o;
|
|
t = parseFloat(t),
|
|
i = parseFloat(i),
|
|
n = parseFloat(n),
|
|
o.volume(t, r);
|
|
for (var s = o._getSoundIds(r), a = 0; a < s.length; a++) {
|
|
var h = o._soundById(s[a]);
|
|
if (h) {
|
|
if (r || o._stopFade(s[a]), o._webAudio && !h._muted) {
|
|
var l = e.ctx.currentTime,
|
|
u = l + n / 1e3;
|
|
h._volume = t,
|
|
h._node.gain.setValueAtTime(t, l),
|
|
h._node.gain.linearRampToValueAtTime(i, u)
|
|
}
|
|
o._startFadeInterval(h, t, i, n, s[a], void 0 === r)
|
|
}
|
|
}
|
|
return o
|
|
},
|
|
_startFadeInterval: function (t, e, i, n, r, o) {
|
|
var s = this,
|
|
a = e,
|
|
h = i - e,
|
|
l = Math.abs(h / .01),
|
|
u = Math.max(4, l > 0 ? n / l : n),
|
|
c = Date.now();
|
|
t._fadeTo = i,
|
|
t._interval = setInterval((function () {
|
|
var r = (Date.now() - c) / n;
|
|
c = Date.now(),
|
|
a += h * r,
|
|
a = Math.max(0, a),
|
|
a = Math.min(1, a),
|
|
a = Math.round(100 * a) / 100,
|
|
s._webAudio ? t._volume = a : s.volume(a, t._id, !0),
|
|
o && (s._volume = a),
|
|
(i < e && a <= i || i > e && a >= i) && (clearInterval(t._interval), t._interval = null, t._fadeTo = null, s.volume(i, t._id), s._emit("fade", t._id))
|
|
}), u)
|
|
},
|
|
_stopFade: function (t) {
|
|
var i = this._soundById(t);
|
|
return i && i._interval && (this._webAudio && i._node.gain.cancelScheduledValues(e.ctx.currentTime), clearInterval(i._interval), i._interval = null, this.volume(i._fadeTo, t), i._fadeTo = null, this._emit("fade", t)),
|
|
this
|
|
},
|
|
loop: function () {
|
|
var t,
|
|
e,
|
|
i,
|
|
n = this,
|
|
r = arguments;
|
|
if (0 === r.length)
|
|
return n._loop;
|
|
if (1 === r.length) {
|
|
if ("boolean" != typeof r[0])
|
|
return !!(i = n._soundById(parseInt(r[0], 10))) && i._loop;
|
|
t = r[0],
|
|
n._loop = t
|
|
} else
|
|
2 === r.length && (t = r[0], e = parseInt(r[1], 10));
|
|
for (var o = n._getSoundIds(e), s = 0; s < o.length; s++)
|
|
(i = n._soundById(o[s])) && (i._loop = t, n._webAudio && i._node && i._node.bufferSource && (i._node.bufferSource.loop = t, t && (i._node.bufferSource.loopStart = i._start || 0, i._node.bufferSource.loopEnd = i._stop)));
|
|
return n
|
|
},
|
|
rate: function () {
|
|
var t,
|
|
i,
|
|
n,
|
|
r = this,
|
|
o = arguments;
|
|
if (0 === o.length)
|
|
i = r._sounds[0]._id;
|
|
else if (1 === o.length) {
|
|
var s = r._getSoundIds(),
|
|
a = s.indexOf(o[0]);
|
|
a >= 0 ? i = parseInt(o[0], 10) : t = parseFloat(o[0])
|
|
} else
|
|
2 === o.length && (t = parseFloat(o[0]), i = parseInt(o[1], 10));
|
|
if ("number" != typeof t)
|
|
return (n = r._soundById(i)) ? n._rate : r._rate;
|
|
if ("loaded" !== r._state || r._playLock)
|
|
return r._queue.push({
|
|
event: "rate",
|
|
action: function () {
|
|
r.rate.apply(r, o)
|
|
}
|
|
}), r;
|
|
void 0 === i && (r._rate = t),
|
|
i = r._getSoundIds(i);
|
|
for (var h = 0; h < i.length; h++)
|
|
if (n = r._soundById(i[h])) {
|
|
r.playing(i[h]) && (n._rateSeek = r.seek(i[h]), n._playStart = r._webAudio ? e.ctx.currentTime : n._playStart),
|
|
n._rate = t,
|
|
r._webAudio && n._node && n._node.bufferSource ? n._node.bufferSource.playbackRate.setValueAtTime(t, e.ctx.currentTime) : n._node && (n._node.playbackRate = t);
|
|
var l = r.seek(i[h]),
|
|
u = (r._sprite[n._sprite][0] + r._sprite[n._sprite][1]) / 1e3 - l,
|
|
c = 1e3 * u / Math.abs(n._rate);
|
|
!r._endTimers[i[h]] && n._paused || (r._clearTimer(i[h]), r._endTimers[i[h]] = setTimeout(r._ended.bind(r, n), c)),
|
|
r._emit("rate", n._id)
|
|
}
|
|
return r
|
|
},
|
|
seek: function () {
|
|
var t,
|
|
i,
|
|
n = this,
|
|
r = arguments;
|
|
if (0 === r.length)
|
|
i = n._sounds[0]._id;
|
|
else if (1 === r.length) {
|
|
var o = n._getSoundIds(),
|
|
s = o.indexOf(r[0]);
|
|
s >= 0 ? i = parseInt(r[0], 10) : n._sounds.length && (i = n._sounds[0]._id, t = parseFloat(r[0]))
|
|
} else
|
|
2 === r.length && (t = parseFloat(r[0]), i = parseInt(r[1], 10));
|
|
if (void 0 === i)
|
|
return n;
|
|
if ("loaded" !== n._state || n._playLock)
|
|
return n._queue.push({
|
|
event: "seek",
|
|
action: function () {
|
|
n.seek.apply(n, r)
|
|
}
|
|
}), n;
|
|
var a = n._soundById(i);
|
|
if (a) {
|
|
if (!("number" == typeof t && t >= 0)) {
|
|
if (n._webAudio) {
|
|
var h = n.playing(i) ? e.ctx.currentTime - a._playStart : 0,
|
|
l = a._rateSeek ? a._rateSeek - a._seek : 0;
|
|
return a._seek + (l + h * Math.abs(a._rate))
|
|
}
|
|
return a._node.currentTime
|
|
}
|
|
var u = n.playing(i);
|
|
u && n.pause(i, !0),
|
|
a._seek = t,
|
|
a._ended = !1,
|
|
n._clearTimer(i),
|
|
n._webAudio || !a._node || isNaN(a._node.duration) || (a._node.currentTime = t);
|
|
var c = function () {
|
|
n._emit("seek", i),
|
|
u && n.play(i, !0)
|
|
};
|
|
if (u && !n._webAudio) {
|
|
var p = function () {
|
|
n._playLock ? setTimeout(p, 0) : c()
|
|
};
|
|
setTimeout(p, 0)
|
|
} else
|
|
c()
|
|
}
|
|
return n
|
|
},
|
|
playing: function (t) {
|
|
if ("number" == typeof t) {
|
|
var e = this._soundById(t);
|
|
return !!e && !e._paused
|
|
}
|
|
for (var i = 0; i < this._sounds.length; i++)
|
|
if (!this._sounds[i]._paused)
|
|
return !0;
|
|
return !1
|
|
},
|
|
duration: function (t) {
|
|
var e = this._duration,
|
|
i = this._soundById(t);
|
|
return i && (e = this._sprite[i._sprite][1] / 1e3),
|
|
e
|
|
},
|
|
state: function () {
|
|
return this._state
|
|
},
|
|
unload: function () {
|
|
for (var t = this, i = t._sounds, n = 0; n < i.length; n++)
|
|
i[n]._paused || t.stop(i[n]._id), t._webAudio || (t._clearSound(i[n]._node), i[n]._node.removeEventListener("error", i[n]._errorFn, !1), i[n]._node.removeEventListener(e._canPlayEvent, i[n]._loadFn, !1), e._releaseHtml5Audio(i[n]._node)), delete i[n]._node, t._clearTimer(i[n]._id);
|
|
var r = e._howls.indexOf(t);
|
|
r >= 0 && e._howls.splice(r, 1);
|
|
var o = !0;
|
|
for (n = 0; n < e._howls.length; n++)
|
|
if (e._howls[n]._src === t._src || t._src.indexOf(e._howls[n]._src) >= 0) {
|
|
o = !1;
|
|
break
|
|
}
|
|
return a && o && delete a[t._src],
|
|
e.noAudio = !1,
|
|
t._state = "unloaded",
|
|
t._sounds = [],
|
|
t = null,
|
|
null
|
|
},
|
|
on: function (t, e, i, n) {
|
|
var r = this["_on" + t];
|
|
return "function" == typeof e && r.push(n ? {
|
|
id: i,
|
|
fn: e,
|
|
once: n
|
|
}
|
|
: {
|
|
id: i,
|
|
fn: e
|
|
}),
|
|
this
|
|
},
|
|
off: function (t, e, i) {
|
|
var n = this["_on" + t],
|
|
r = 0;
|
|
if ("number" == typeof e && (i = e, e = null), e || i)
|
|
for (r = 0; r < n.length; r++) {
|
|
var o = i === n[r].id;
|
|
if (e === n[r].fn && o || !e && o) {
|
|
n.splice(r, 1);
|
|
break
|
|
}
|
|
}
|
|
else if (t)
|
|
this["_on" + t] = [];
|
|
else {
|
|
var s = Object.keys(this);
|
|
for (r = 0; r < s.length; r++)
|
|
0 === s[r].indexOf("_on") && Array.isArray(this[s[r]]) && (this[s[r]] = [])
|
|
}
|
|
return this
|
|
},
|
|
once: function (t, e, i) {
|
|
return this.on(t, e, i, 1),
|
|
this
|
|
},
|
|
_emit: function (t, e, i) {
|
|
for (var n = this["_on" + t], r = n.length - 1; r >= 0; r--)
|
|
n[r].id && n[r].id !== e && "load" !== t || (setTimeout(function (t) {
|
|
t.call(this, e, i)
|
|
}
|
|
.bind(this, n[r].fn), 0), n[r].once && this.off(t, n[r].fn, n[r].id));
|
|
return this._loadQueue(t),
|
|
this
|
|
},
|
|
_loadQueue: function (t) {
|
|
if (this._queue.length > 0) {
|
|
var e = this._queue[0];
|
|
e.event === t && (this._queue.shift(), this._loadQueue()),
|
|
t || e.action()
|
|
}
|
|
return this
|
|
},
|
|
_ended: function (t) {
|
|
var i = t._sprite;
|
|
if (!this._webAudio && t._node && !t._node.paused && !t._node.ended && t._node.currentTime < t._stop)
|
|
return setTimeout(this._ended.bind(this, t), 100), this;
|
|
var n = !(!t._loop && !this._sprite[i][2]);
|
|
if (this._emit("end", t._id), !this._webAudio && n && this.stop(t._id, !0).play(t._id), this._webAudio && n) {
|
|
this._emit("play", t._id),
|
|
t._seek = t._start || 0,
|
|
t._rateSeek = 0,
|
|
t._playStart = e.ctx.currentTime;
|
|
var r = 1e3 * (t._stop - t._start) / Math.abs(t._rate);
|
|
this._endTimers[t._id] = setTimeout(this._ended.bind(this, t), r)
|
|
}
|
|
return this._webAudio && !n && (t._paused = !0, t._ended = !0, t._seek = t._start || 0, t._rateSeek = 0, this._clearTimer(t._id), this._cleanBuffer(t._node), e._autoSuspend()),
|
|
this._webAudio || n || this.stop(t._id, !0),
|
|
this
|
|
},
|
|
_clearTimer: function (t) {
|
|
if (this._endTimers[t]) {
|
|
if ("function" != typeof this._endTimers[t])
|
|
clearTimeout(this._endTimers[t]);
|
|
else {
|
|
var e = this._soundById(t);
|
|
e && e._node && e._node.removeEventListener("ended", this._endTimers[t], !1)
|
|
}
|
|
delete this._endTimers[t]
|
|
}
|
|
return this
|
|
},
|
|
_soundById: function (t) {
|
|
for (var e = 0; e < this._sounds.length; e++)
|
|
if (t === this._sounds[e]._id)
|
|
return this._sounds[e];
|
|
return null
|
|
},
|
|
_inactiveSound: function () {
|
|
this._drain();
|
|
for (var t = 0; t < this._sounds.length; t++)
|
|
if (this._sounds[t]._ended)
|
|
return this._sounds[t].reset();
|
|
return new s(this)
|
|
},
|
|
_drain: function () {
|
|
var t = this._pool,
|
|
e = 0,
|
|
i = 0;
|
|
if (!(this._sounds.length < t)) {
|
|
for (i = 0; i < this._sounds.length; i++)
|
|
this._sounds[i]._ended && e++;
|
|
for (i = this._sounds.length - 1; i >= 0; i--) {
|
|
if (e <= t)
|
|
return;
|
|
this._sounds[i]._ended && (this._webAudio && this._sounds[i]._node && this._sounds[i]._node.disconnect(0), this._sounds.splice(i, 1), e--)
|
|
}
|
|
}
|
|
},
|
|
_getSoundIds: function (t) {
|
|
if (void 0 === t) {
|
|
for (var e = [], i = 0; i < this._sounds.length; i++)
|
|
e.push(this._sounds[i]._id);
|
|
return e
|
|
}
|
|
return [t]
|
|
},
|
|
_refreshBuffer: function (t) {
|
|
return t._node.bufferSource = e.ctx.createBufferSource(),
|
|
t._node.bufferSource.buffer = a[this._src],
|
|
t._panner ? t._node.bufferSource.connect(t._panner) : t._node.bufferSource.connect(t._node),
|
|
t._node.bufferSource.loop = t._loop,
|
|
t._loop && (t._node.bufferSource.loopStart = t._start || 0, t._node.bufferSource.loopEnd = t._stop || 0),
|
|
t._node.bufferSource.playbackRate.setValueAtTime(t._rate, e.ctx.currentTime),
|
|
this
|
|
},
|
|
_cleanBuffer: function (t) {
|
|
var i = e._navigator && e._navigator.vendor.indexOf("Apple") >= 0;
|
|
if (e._scratchBuffer && t.bufferSource && (t.bufferSource.onended = null, t.bufferSource.disconnect(0), i))
|
|
try {
|
|
t.bufferSource.buffer = e._scratchBuffer
|
|
} catch (t) {}
|
|
return t.bufferSource = null,
|
|
this
|
|
},
|
|
_clearSound: function (t) {
|
|
/MSIE |Trident\//.test(e._navigator && e._navigator.userAgent) || (t.src = "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")
|
|
}
|
|
};
|
|
var s = function (t) {
|
|
this._parent = t,
|
|
this.init()
|
|
};
|
|
s.prototype = {
|
|
init: function () {
|
|
var t = this._parent;
|
|
return this._muted = t._muted,
|
|
this._loop = t._loop,
|
|
this._volume = t._volume,
|
|
this._rate = t._rate,
|
|
this._seek = 0,
|
|
this._paused = !0,
|
|
this._ended = !0,
|
|
this._sprite = "__default",
|
|
this._id = ++e._counter,
|
|
t._sounds.push(this),
|
|
this.create(),
|
|
this
|
|
},
|
|
create: function () {
|
|
var t = this._parent,
|
|
i = e._muted || this._muted || this._parent._muted ? 0 : this._volume;
|
|
return t._webAudio ? (this._node = void 0 === e.ctx.createGain ? e.ctx.createGainNode() : e.ctx.createGain(), this._node.gain.setValueAtTime(i, e.ctx.currentTime), this._node.paused = !0, this._node.connect(e.masterGain)) : e.noAudio || (this._node = e._obtainHtml5Audio(), this._errorFn = this._errorListener.bind(this), this._node.addEventListener("error", this._errorFn, !1), this._loadFn = this._loadListener.bind(this), this._node.addEventListener(e._canPlayEvent, this._loadFn, !1), this._node.src = t._src, this._node.preload = "auto", this._node.volume = i * e.volume(), this._node.load()),
|
|
this
|
|
},
|
|
reset: function () {
|
|
var t = this._parent;
|
|
return this._muted = t._muted,
|
|
this._loop = t._loop,
|
|
this._volume = t._volume,
|
|
this._rate = t._rate,
|
|
this._seek = 0,
|
|
this._rateSeek = 0,
|
|
this._paused = !0,
|
|
this._ended = !0,
|
|
this._sprite = "__default",
|
|
this._id = ++e._counter,
|
|
this
|
|
},
|
|
_errorListener: function () {
|
|
this._parent._emit("loaderror", this._id, this._node.error ? this._node.error.code : 0),
|
|
this._node.removeEventListener("error", this._errorFn, !1)
|
|
},
|
|
_loadListener: function () {
|
|
var t = this._parent;
|
|
t._duration = Math.ceil(10 * this._node.duration) / 10,
|
|
0 === Object.keys(t._sprite).length && (t._sprite = {
|
|
__default: [0, 1e3 * t._duration]
|
|
}),
|
|
"loaded" !== t._state && (t._state = "loaded", t._emit("load"), t._loadQueue()),
|
|
this._node.removeEventListener(e._canPlayEvent, this._loadFn, !1)
|
|
}
|
|
};
|
|
var a = {},
|
|
h = function (t) {
|
|
var e = t._src;
|
|
if (a[e])
|
|
return t._duration = a[e].duration, void c(t);
|
|
if (/^data:[^;]+;base64,/.test(e)) {
|
|
for (var i = atob(e.split(",")[1]), n = new Uint8Array(i.length), r = 0; r < i.length; ++r)
|
|
n[r] = i.charCodeAt(r);
|
|
u(n.buffer, t)
|
|
} else {
|
|
var o = new XMLHttpRequest;
|
|
o.open("GET", e, !0),
|
|
o.withCredentials = t._xhrWithCredentials,
|
|
o.responseType = "arraybuffer",
|
|
o.onload = function () {
|
|
var e = (o.status + "")[0];
|
|
"0" === e || "2" === e || "3" === e ? u(o.response, t) : t._emit("loaderror", null, "Failed loading audio file with status: " + o.status + ".")
|
|
},
|
|
o.onerror = function () {
|
|
t._webAudio && (t._html5 = !0, t._webAudio = !1, t._sounds = [], delete a[e], t.load())
|
|
},
|
|
l(o)
|
|
}
|
|
},
|
|
l = function (t) {
|
|
try {
|
|
t.send()
|
|
} catch (e) {
|
|
t.onerror()
|
|
}
|
|
},
|
|
u = function (t, i) {
|
|
var n = function () {
|
|
i._emit("loaderror", null, "Decoding audio data failed.")
|
|
},
|
|
r = function (t) {
|
|
t && i._sounds.length > 0 ? (a[i._src] = t, c(i, t)) : n()
|
|
};
|
|
"undefined" != typeof Promise && 1 === e.ctx.decodeAudioData.length ? e.ctx.decodeAudioData(t).then(r).catch(n) : e.ctx.decodeAudioData(t, r, n)
|
|
},
|
|
c = function (t, e) {
|
|
e && !t._duration && (t._duration = e.duration),
|
|
0 === Object.keys(t._sprite).length && (t._sprite = {
|
|
__default: [0, 1e3 * t._duration]
|
|
}),
|
|
"loaded" !== t._state && (t._state = "loaded", t._emit("load"), t._loadQueue())
|
|
},
|
|
p = function () {
|
|
if (e.usingWebAudio) {
|
|
try {
|
|
"undefined" != typeof AudioContext ? e.ctx = new AudioContext : "undefined" != typeof webkitAudioContext ? e.ctx = new webkitAudioContext : e.usingWebAudio = !1
|
|
} catch (t) {
|
|
e.usingWebAudio = !1
|
|
}
|
|
e.ctx || (e.usingWebAudio = !1);
|
|
var t = /iP(hone|od|ad)/.test(e._navigator && e._navigator.platform),
|
|
i = e._navigator && e._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),
|
|
n = i ? parseInt(i[1], 10) : null;
|
|
if (t && n && n < 9) {
|
|
var r = /safari/.test(e._navigator && e._navigator.userAgent.toLowerCase());
|
|
(e._navigator && e._navigator.standalone && !r || e._navigator && !e._navigator.standalone && !r) && (e.usingWebAudio = !1)
|
|
}
|
|
e.usingWebAudio && (e.masterGain = void 0 === e.ctx.createGain ? e.ctx.createGainNode() : e.ctx.createGain(), e.masterGain.gain.setValueAtTime(e._muted ? 0 : e._volume, e.ctx.currentTime), e.masterGain.connect(e.ctx.destination)),
|
|
e._setup()
|
|
}
|
|
};
|
|
"function" == typeof n && n.amd && n([], (function () {
|
|
return {
|
|
Howler: e,
|
|
Howl: o
|
|
}
|
|
})),
|
|
void 0 !== i && (i.Howler = e, i.Howl = o),
|
|
"undefined" != typeof window ? (window.HowlerGlobal = t, window.Howler = e, window.Howl = o, window.Sound = s) : void 0 !== r && (r.HowlerGlobal = t, r.Howler = e, r.Howl = o, r.Sound = s)
|
|
}
|
|
(),
|
|
/*!
|
|
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
|
|
*
|
|
* howler.js v2.1.3
|
|
* howlerjs.com
|
|
*
|
|
* (c) 2013-2019, James Simpson of GoldFire Studios
|
|
* goldfirestudios.com
|
|
*
|
|
* MIT License
|
|
*/
|
|
function () {
|
|
"use strict";
|
|
var t;
|
|
HowlerGlobal.prototype._pos = [0, 0, 0],
|
|
HowlerGlobal.prototype._orientation = [0, 0, -1, 0, 1, 0],
|
|
HowlerGlobal.prototype.stereo = function (t) {
|
|
if (!this.ctx || !this.ctx.listener)
|
|
return this;
|
|
for (var e = this._howls.length - 1; e >= 0; e--)
|
|
this._howls[e].stereo(t);
|
|
return this
|
|
},
|
|
HowlerGlobal.prototype.pos = function (t, e, i) {
|
|
return this.ctx && this.ctx.listener ? (e = "number" != typeof e ? this._pos[1] : e, i = "number" != typeof i ? this._pos[2] : i, "number" != typeof t ? this._pos : (this._pos = [t, e, i], void 0 !== this.ctx.listener.positionX ? (this.ctx.listener.positionX.setTargetAtTime(this._pos[0], Howler.ctx.currentTime, .1), this.ctx.listener.positionY.setTargetAtTime(this._pos[1], Howler.ctx.currentTime, .1), this.ctx.listener.positionZ.setTargetAtTime(this._pos[2], Howler.ctx.currentTime, .1)) : this.ctx.listener.setPosition(this._pos[0], this._pos[1], this._pos[2]), this)) : this
|
|
},
|
|
HowlerGlobal.prototype.orientation = function (t, e, i, n, r, o) {
|
|
if (!this.ctx || !this.ctx.listener)
|
|
return this;
|
|
var s = this._orientation;
|
|
return e = "number" != typeof e ? s[1] : e,
|
|
i = "number" != typeof i ? s[2] : i,
|
|
n = "number" != typeof n ? s[3] : n,
|
|
r = "number" != typeof r ? s[4] : r,
|
|
o = "number" != typeof o ? s[5] : o,
|
|
"number" != typeof t ? s : (this._orientation = [t, e, i, n, r, o], void 0 !== this.ctx.listener.forwardX ? (this.ctx.listener.forwardX.setTargetAtTime(t, Howler.ctx.currentTime, .1), this.ctx.listener.forwardY.setTargetAtTime(e, Howler.ctx.currentTime, .1), this.ctx.listener.forwardZ.setTargetAtTime(i, Howler.ctx.currentTime, .1), this.ctx.listener.upX.setTargetAtTime(n, Howler.ctx.currentTime, .1), this.ctx.listener.upY.setTargetAtTime(r, Howler.ctx.currentTime, .1), this.ctx.listener.upZ.setTargetAtTime(o, Howler.ctx.currentTime, .1)) : this.ctx.listener.setOrientation(t, e, i, n, r, o), this)
|
|
},
|
|
Howl.prototype.init = (t = Howl.prototype.init, function (e) {
|
|
return this._orientation = e.orientation || [1, 0, 0],
|
|
this._stereo = e.stereo || null,
|
|
this._pos = e.pos || null,
|
|
this._pannerAttr = {
|
|
coneInnerAngle: void 0 !== e.coneInnerAngle ? e.coneInnerAngle : 360,
|
|
coneOuterAngle: void 0 !== e.coneOuterAngle ? e.coneOuterAngle : 360,
|
|
coneOuterGain: void 0 !== e.coneOuterGain ? e.coneOuterGain : 0,
|
|
distanceModel: void 0 !== e.distanceModel ? e.distanceModel : "inverse",
|
|
maxDistance: void 0 !== e.maxDistance ? e.maxDistance : 1e4,
|
|
panningModel: void 0 !== e.panningModel ? e.panningModel : "HRTF",
|
|
refDistance: void 0 !== e.refDistance ? e.refDistance : 1,
|
|
rolloffFactor: void 0 !== e.rolloffFactor ? e.rolloffFactor : 1
|
|
},
|
|
this._onstereo = e.onstereo ? [{
|
|
fn: e.onstereo
|
|
}
|
|
] : [],
|
|
this._onpos = e.onpos ? [{
|
|
fn: e.onpos
|
|
}
|
|
] : [],
|
|
this._onorientation = e.onorientation ? [{
|
|
fn: e.onorientation
|
|
}
|
|
] : [],
|
|
t.call(this, e)
|
|
}),
|
|
Howl.prototype.stereo = function (t, i) {
|
|
var n = this;
|
|
if (!n._webAudio)
|
|
return n;
|
|
if ("loaded" !== n._state)
|
|
return n._queue.push({
|
|
event: "stereo",
|
|
action: function () {
|
|
n.stereo(t, i)
|
|
}
|
|
}), n;
|
|
var r = void 0 === Howler.ctx.createStereoPanner ? "spatial" : "stereo";
|
|
if (void 0 === i) {
|
|
if ("number" != typeof t)
|
|
return n._stereo;
|
|
n._stereo = t,
|
|
n._pos = [t, 0, 0]
|
|
}
|
|
for (var o = n._getSoundIds(i), s = 0; s < o.length; s++) {
|
|
var a = n._soundById(o[s]);
|
|
if (a) {
|
|
if ("number" != typeof t)
|
|
return a._stereo;
|
|
a._stereo = t,
|
|
a._pos = [t, 0, 0],
|
|
a._node && (a._pannerAttr.panningModel = "equalpower", a._panner && a._panner.pan || e(a, r), "spatial" === r ? void 0 !== a._panner.positionX ? (a._panner.positionX.setValueAtTime(t, Howler.ctx.currentTime), a._panner.positionY.setValueAtTime(0, Howler.ctx.currentTime), a._panner.positionZ.setValueAtTime(0, Howler.ctx.currentTime)) : a._panner.setPosition(t, 0, 0) : a._panner.pan.setValueAtTime(t, Howler.ctx.currentTime)),
|
|
n._emit("stereo", a._id)
|
|
}
|
|
}
|
|
return n
|
|
},
|
|
Howl.prototype.pos = function (t, i, n, r) {
|
|
var o = this;
|
|
if (!o._webAudio)
|
|
return o;
|
|
if ("loaded" !== o._state)
|
|
return o._queue.push({
|
|
event: "pos",
|
|
action: function () {
|
|
o.pos(t, i, n, r)
|
|
}
|
|
}), o;
|
|
if (i = "number" != typeof i ? 0 : i, n = "number" != typeof n ? - .5 : n, void 0 === r) {
|
|
if ("number" != typeof t)
|
|
return o._pos;
|
|
o._pos = [t, i, n]
|
|
}
|
|
for (var s = o._getSoundIds(r), a = 0; a < s.length; a++) {
|
|
var h = o._soundById(s[a]);
|
|
if (h) {
|
|
if ("number" != typeof t)
|
|
return h._pos;
|
|
h._pos = [t, i, n],
|
|
h._node && (h._panner && !h._panner.pan || e(h, "spatial"), void 0 !== h._panner.positionX ? (h._panner.positionX.setValueAtTime(t, Howler.ctx.currentTime), h._panner.positionY.setValueAtTime(i, Howler.ctx.currentTime), h._panner.positionZ.setValueAtTime(n, Howler.ctx.currentTime)) : h._panner.setPosition(t, i, n)),
|
|
o._emit("pos", h._id)
|
|
}
|
|
}
|
|
return o
|
|
},
|
|
Howl.prototype.orientation = function (t, i, n, r) {
|
|
var o = this;
|
|
if (!o._webAudio)
|
|
return o;
|
|
if ("loaded" !== o._state)
|
|
return o._queue.push({
|
|
event: "orientation",
|
|
action: function () {
|
|
o.orientation(t, i, n, r)
|
|
}
|
|
}), o;
|
|
if (i = "number" != typeof i ? o._orientation[1] : i, n = "number" != typeof n ? o._orientation[2] : n, void 0 === r) {
|
|
if ("number" != typeof t)
|
|
return o._orientation;
|
|
o._orientation = [t, i, n]
|
|
}
|
|
for (var s = o._getSoundIds(r), a = 0; a < s.length; a++) {
|
|
var h = o._soundById(s[a]);
|
|
if (h) {
|
|
if ("number" != typeof t)
|
|
return h._orientation;
|
|
h._orientation = [t, i, n],
|
|
h._node && (h._panner || (h._pos || (h._pos = o._pos || [0, 0, - .5]), e(h, "spatial")), void 0 !== h._panner.orientationX ? (h._panner.orientationX.setValueAtTime(t, Howler.ctx.currentTime), h._panner.orientationY.setValueAtTime(i, Howler.ctx.currentTime), h._panner.orientationZ.setValueAtTime(n, Howler.ctx.currentTime)) : h._panner.setOrientation(t, i, n)),
|
|
o._emit("orientation", h._id)
|
|
}
|
|
}
|
|
return o
|
|
},
|
|
Howl.prototype.pannerAttr = function () {
|
|
var t,
|
|
i,
|
|
n,
|
|
r = this,
|
|
o = arguments;
|
|
if (!r._webAudio)
|
|
return r;
|
|
if (0 === o.length)
|
|
return r._pannerAttr;
|
|
if (1 === o.length) {
|
|
if ("object" != typeof o[0])
|
|
return (n = r._soundById(parseInt(o[0], 10))) ? n._pannerAttr : r._pannerAttr;
|
|
t = o[0],
|
|
void 0 === i && (t.pannerAttr || (t.pannerAttr = {
|
|
coneInnerAngle: t.coneInnerAngle,
|
|
coneOuterAngle: t.coneOuterAngle,
|
|
coneOuterGain: t.coneOuterGain,
|
|
distanceModel: t.distanceModel,
|
|
maxDistance: t.maxDistance,
|
|
refDistance: t.refDistance,
|
|
rolloffFactor: t.rolloffFactor,
|
|
panningModel: t.panningModel
|
|
}), r._pannerAttr = {
|
|
coneInnerAngle: void 0 !== t.pannerAttr.coneInnerAngle ? t.pannerAttr.coneInnerAngle : r._coneInnerAngle,
|
|
coneOuterAngle: void 0 !== t.pannerAttr.coneOuterAngle ? t.pannerAttr.coneOuterAngle : r._coneOuterAngle,
|
|
coneOuterGain: void 0 !== t.pannerAttr.coneOuterGain ? t.pannerAttr.coneOuterGain : r._coneOuterGain,
|
|
distanceModel: void 0 !== t.pannerAttr.distanceModel ? t.pannerAttr.distanceModel : r._distanceModel,
|
|
maxDistance: void 0 !== t.pannerAttr.maxDistance ? t.pannerAttr.maxDistance : r._maxDistance,
|
|
refDistance: void 0 !== t.pannerAttr.refDistance ? t.pannerAttr.refDistance : r._refDistance,
|
|
rolloffFactor: void 0 !== t.pannerAttr.rolloffFactor ? t.pannerAttr.rolloffFactor : r._rolloffFactor,
|
|
panningModel: void 0 !== t.pannerAttr.panningModel ? t.pannerAttr.panningModel : r._panningModel
|
|
})
|
|
} else
|
|
2 === o.length && (t = o[0], i = parseInt(o[1], 10));
|
|
for (var s = r._getSoundIds(i), a = 0; a < s.length; a++)
|
|
if (n = r._soundById(s[a])) {
|
|
var h = n._pannerAttr;
|
|
h = {
|
|
coneInnerAngle: void 0 !== t.coneInnerAngle ? t.coneInnerAngle : h.coneInnerAngle,
|
|
coneOuterAngle: void 0 !== t.coneOuterAngle ? t.coneOuterAngle : h.coneOuterAngle,
|
|
coneOuterGain: void 0 !== t.coneOuterGain ? t.coneOuterGain : h.coneOuterGain,
|
|
distanceModel: void 0 !== t.distanceModel ? t.distanceModel : h.distanceModel,
|
|
maxDistance: void 0 !== t.maxDistance ? t.maxDistance : h.maxDistance,
|
|
refDistance: void 0 !== t.refDistance ? t.refDistance : h.refDistance,
|
|
rolloffFactor: void 0 !== t.rolloffFactor ? t.rolloffFactor : h.rolloffFactor,
|
|
panningModel: void 0 !== t.panningModel ? t.panningModel : h.panningModel
|
|
};
|
|
var l = n._panner;
|
|
l ? (l.coneInnerAngle = h.coneInnerAngle, l.coneOuterAngle = h.coneOuterAngle, l.coneOuterGain = h.coneOuterGain, l.distanceModel = h.distanceModel, l.maxDistance = h.maxDistance, l.refDistance = h.refDistance, l.rolloffFactor = h.rolloffFactor, l.panningModel = h.panningModel) : (n._pos || (n._pos = r._pos || [0, 0, - .5]), e(n, "spatial"))
|
|
}
|
|
return r
|
|
},
|
|
Sound.prototype.init = function (t) {
|
|
return function () {
|
|
var e = this._parent;
|
|
this._orientation = e._orientation,
|
|
this._stereo = e._stereo,
|
|
this._pos = e._pos,
|
|
this._pannerAttr = e._pannerAttr,
|
|
t.call(this),
|
|
this._stereo ? e.stereo(this._stereo) : this._pos && e.pos(this._pos[0], this._pos[1], this._pos[2], this._id)
|
|
}
|
|
}
|
|
(Sound.prototype.init),
|
|
Sound.prototype.reset = function (t) {
|
|
return function () {
|
|
var e = this._parent;
|
|
return this._orientation = e._orientation,
|
|
this._stereo = e._stereo,
|
|
this._pos = e._pos,
|
|
this._pannerAttr = e._pannerAttr,
|
|
this._stereo ? e.stereo(this._stereo) : this._pos ? e.pos(this._pos[0], this._pos[1], this._pos[2], this._id) : this._panner && (this._panner.disconnect(0), this._panner = void 0, e._refreshBuffer(this)),
|
|
t.call(this)
|
|
}
|
|
}
|
|
(Sound.prototype.reset);
|
|
var e = function (t, e) {
|
|
"spatial" === (e = e || "spatial") ? (t._panner = Howler.ctx.createPanner(), t._panner.coneInnerAngle = t._pannerAttr.coneInnerAngle, t._panner.coneOuterAngle = t._pannerAttr.coneOuterAngle, t._panner.coneOuterGain = t._pannerAttr.coneOuterGain, t._panner.distanceModel = t._pannerAttr.distanceModel, t._panner.maxDistance = t._pannerAttr.maxDistance, t._panner.refDistance = t._pannerAttr.refDistance, t._panner.rolloffFactor = t._pannerAttr.rolloffFactor, t._panner.panningModel = t._pannerAttr.panningModel, void 0 !== t._panner.positionX ? (t._panner.positionX.setValueAtTime(t._pos[0], Howler.ctx.currentTime), t._panner.positionY.setValueAtTime(t._pos[1], Howler.ctx.currentTime), t._panner.positionZ.setValueAtTime(t._pos[2], Howler.ctx.currentTime)) : t._panner.setPosition(t._pos[0], t._pos[1], t._pos[2]), void 0 !== t._panner.orientationX ? (t._panner.orientationX.setValueAtTime(t._orientation[0], Howler.ctx.currentTime), t._panner.orientationY.setValueAtTime(t._orientation[1], Howler.ctx.currentTime), t._panner.orientationZ.setValueAtTime(t._orientation[2], Howler.ctx.currentTime)) : t._panner.setOrientation(t._orientation[0], t._orientation[1], t._orientation[2])) : (t._panner = Howler.ctx.createStereoPanner(), t._panner.pan.setValueAtTime(t._stereo, Howler.ctx.currentTime)),
|
|
t._panner.connect(t._node),
|
|
t._paused || t._parent.pause(t._id, !0).play(t._id, !0)
|
|
}
|
|
}
|
|
()
|
|
}, {}
|
|
],
|
|
TrJf: [function (t, e, i) {
|
|
"use strict";
|
|
var n = t("howler");
|
|
window.Howler = n.Howler,
|
|
n.Howl.prototype.unpause = function () {
|
|
for (var t, e = 0; e < this._sounds.length; e++)
|
|
this._sounds[e]._paused && !this._sounds[e]._ended && (t = this._sounds[e]._id, this.play(t));
|
|
return this
|
|
}
|
|
}, {
|
|
howler: "vDHW"
|
|
}
|
|
],
|
|
tFGK: [function (t, e, i) {
|
|
!function () {
|
|
function t(t, e) {
|
|
document.addEventListener ? t.addEventListener("scroll", e, !1) : t.attachEvent("scroll", e)
|
|
}
|
|
function i(t) {
|
|
this.a = document.createElement("div"),
|
|
this.a.setAttribute("aria-hidden", "true"),
|
|
this.a.appendChild(document.createTextNode(t)),
|
|
this.b = document.createElement("span"),
|
|
this.c = document.createElement("span"),
|
|
this.h = document.createElement("span"),
|
|
this.f = document.createElement("span"),
|
|
this.g = -1,
|
|
this.b.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",
|
|
this.c.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",
|
|
this.f.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",
|
|
this.h.style.cssText = "display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",
|
|
this.b.appendChild(this.h),
|
|
this.c.appendChild(this.f),
|
|
this.a.appendChild(this.b),
|
|
this.a.appendChild(this.c)
|
|
}
|
|
function n(t, e) {
|
|
t.a.style.cssText = "max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:" + e + ";"
|
|
}
|
|
function r(t) {
|
|
var e = t.a.offsetWidth,
|
|
i = e + 100;
|
|
return t.f.style.width = i + "px",
|
|
t.c.scrollLeft = i,
|
|
t.b.scrollLeft = t.b.scrollWidth + 100,
|
|
t.g !== e && (t.g = e, !0)
|
|
}
|
|
function o(e, i) {
|
|
function n() {
|
|
var t = o;
|
|
r(t) && t.a.parentNode && i(t.g)
|
|
}
|
|
var o = e;
|
|
t(e.b, n),
|
|
t(e.c, n),
|
|
r(e)
|
|
}
|
|
function s(t, e) {
|
|
var i = e || {};
|
|
this.family = t,
|
|
this.style = i.style || "normal",
|
|
this.weight = i.weight || "normal",
|
|
this.stretch = i.stretch || "normal"
|
|
}
|
|
var a = null,
|
|
h = null,
|
|
l = null,
|
|
u = null;
|
|
function c() {
|
|
return null === u && (u = !!document.fonts),
|
|
u
|
|
}
|
|
function p() {
|
|
if (null === l) {
|
|
var t = document.createElement("div");
|
|
try {
|
|
t.style.font = "condensed 100px sans-serif"
|
|
} catch (t) {}
|
|
l = "" !== t.style.font
|
|
}
|
|
return l
|
|
}
|
|
function d(t, e) {
|
|
return [t.style, t.weight, p() ? t.stretch : "", "100px", e].join(" ")
|
|
}
|
|
s.prototype.load = function (t, e) {
|
|
var r = this,
|
|
s = t || "BESbswy",
|
|
l = 0,
|
|
u = e || 3e3,
|
|
p = (new Date).getTime();
|
|
return new Promise((function (t, e) {
|
|
if (c() && !function () {
|
|
if (null === h)
|
|
if (c() && /Apple/.test(window.navigator.vendor)) {
|
|
var t = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent);
|
|
h = !!t && 603 > parseInt(t[1], 10)
|
|
} else
|
|
h = !1;
|
|
return h
|
|
}
|
|
()) {
|
|
var f = new Promise((function (t, e) {
|
|
!function i() {
|
|
(new Date).getTime() - p >= u ? e(Error(u + "ms timeout exceeded")) : document.fonts.load(d(r, '"' + r.family + '"'), s).then((function (e) {
|
|
1 <= e.length ? t() : setTimeout(i, 25)
|
|
}), e)
|
|
}
|
|
()
|
|
})),
|
|
_ = new Promise((function (t, e) {
|
|
l = setTimeout((function () {
|
|
e(Error(u + "ms timeout exceeded"))
|
|
}), u)
|
|
}));
|
|
Promise.race([_, f]).then((function () {
|
|
clearTimeout(l),
|
|
t(r)
|
|
}), e)
|
|
} else !function (t) {
|
|
document.body ? t() : document.addEventListener ? document.addEventListener("DOMContentLoaded", (function e() {
|
|
document.removeEventListener("DOMContentLoaded", e),
|
|
t()
|
|
})) : document.attachEvent("onreadystatechange", (function e() {
|
|
"interactive" != document.readyState && "complete" != document.readyState || (document.detachEvent("onreadystatechange", e), t())
|
|
}))
|
|
}
|
|
((function () {
|
|
function h() {
|
|
var e;
|
|
(e = -1 != m && -1 != y || -1 != m && -1 != g || -1 != y && -1 != g) && ((e = m != y && m != g && y != g) || (null === a && (e = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent), a = !!e && (536 > parseInt(e[1], 10) || 536 === parseInt(e[1], 10) && 11 >= parseInt(e[2], 10))), e = a && (m == v && y == v && g == v || m == w && y == w && g == w || m == x && y == x && g == x)), e = !e),
|
|
e && (b.parentNode && b.parentNode.removeChild(b), clearTimeout(l), t(r))
|
|
}
|
|
var c = new i(s),
|
|
f = new i(s),
|
|
_ = new i(s),
|
|
m = -1,
|
|
y = -1,
|
|
g = -1,
|
|
v = -1,
|
|
w = -1,
|
|
x = -1,
|
|
b = document.createElement("div");
|
|
b.dir = "ltr",
|
|
n(c, d(r, "sans-serif")),
|
|
n(f, d(r, "serif")),
|
|
n(_, d(r, "monospace")),
|
|
b.appendChild(c.a),
|
|
b.appendChild(f.a),
|
|
b.appendChild(_.a),
|
|
document.body.appendChild(b),
|
|
v = c.a.offsetWidth,
|
|
w = f.a.offsetWidth,
|
|
x = _.a.offsetWidth,
|
|
function t() {
|
|
if ((new Date).getTime() - p >= u)
|
|
b.parentNode && b.parentNode.removeChild(b), e(Error(u + "ms timeout exceeded"));
|
|
else {
|
|
var i = document.hidden;
|
|
!0 !== i && void 0 !== i || (m = c.a.offsetWidth, y = f.a.offsetWidth, g = _.a.offsetWidth, h()),
|
|
l = setTimeout(t, 50)
|
|
}
|
|
}
|
|
(),
|
|
o(c, (function (t) {
|
|
m = t,
|
|
h()
|
|
})),
|
|
n(c, d(r, '"' + r.family + '",sans-serif')),
|
|
o(f, (function (t) {
|
|
y = t,
|
|
h()
|
|
})),
|
|
n(f, d(r, '"' + r.family + '",serif')),
|
|
o(_, (function (t) {
|
|
g = t,
|
|
h()
|
|
})),
|
|
n(_, d(r, '"' + r.family + '",monospace'))
|
|
}))
|
|
}))
|
|
},
|
|
"object" == typeof e ? e.exports = s : (window.FontFaceObserver = s, window.FontFaceObserver.prototype.load = s.prototype.load)
|
|
}
|
|
()
|
|
}, {}
|
|
],
|
|
Focm: [function (t, e, i) {
|
|
"use strict";
|
|
var n,
|
|
r = (n = t("ismobilejs")) && n.__esModule ? n : {
|
|
default:
|
|
n
|
|
};
|
|
t("./pixi.js"),
|
|
t("./pixi-spine.js"),
|
|
t("./howler.js"),
|
|
window.isMobile = r.default,
|
|
window.FontFaceObserver = t("fontfaceobserver")
|
|
}, {
|
|
"./pixi.js": "AIIz",
|
|
"./pixi-spine.js": "PXMd",
|
|
"./howler.js": "TrJf",
|
|
ismobilejs: "S82H",
|
|
fontfaceobserver: "tFGK"
|
|
}
|
|
]
|
|
}, {}, ["Focm"]), function (t, e) {
|
|
"use strict";
|
|
t.temple = t.temple || {},
|
|
t.temple.sound = t.temple.sound || {};
|
|
var i,
|
|
n = function () {
|
|
return Vr.__string_rec(this, "")
|
|
},
|
|
r = r || {};
|
|
function o(t, e) {
|
|
var i = Object.create(t);
|
|
for (var n in e)
|
|
i[n] = e[n];
|
|
return e.toString !== Object.prototype.toString && (i.toString = e.toString),
|
|
i
|
|
}
|
|
var s = function (t, e) {
|
|
this.r = new RegExp(t, e.split("u").join(""))
|
|
};
|
|
s.__name__ = !0,
|
|
s.prototype = {
|
|
match: function (t) {
|
|
return this.r.global && (this.r.lastIndex = 0),
|
|
this.r.m = this.r.exec(t),
|
|
this.r.s = t,
|
|
null != this.r.m
|
|
},
|
|
matched: function (t) {
|
|
if (null != this.r.m && t >= 0 && t < this.r.m.length)
|
|
return this.r.m[t];
|
|
throw Dr.thrown("EReg::matched")
|
|
},
|
|
__class__: s
|
|
};
|
|
var a = function () {};
|
|
a.__name__ = !0,
|
|
a.substr = function (t, e, i) {
|
|
if (null == i)
|
|
i = t.length;
|
|
else if (i < 0) {
|
|
if (0 != e)
|
|
return "";
|
|
i = t.length + i
|
|
}
|
|
return t.substr(e, i)
|
|
},
|
|
a.remove = function (t, e) {
|
|
var i = t.indexOf(e);
|
|
return -1 != i && (t.splice(i, 1), !0)
|
|
},
|
|
a.now = function () {
|
|
return Date.now()
|
|
};
|
|
var h = function () {};
|
|
h.__name__ = !0,
|
|
h.iter = function (t, e) {
|
|
for (var i, n = (i = t)instanceof Array ? new jr(i) : i.iterator(); n.hasNext(); )
|
|
e(n.next())
|
|
},
|
|
Math.__name__ = !0;
|
|
var l = function () {};
|
|
l.__name__ = !0,
|
|
l.field = function (t, e) {
|
|
try {
|
|
return t[e]
|
|
} catch (t) {
|
|
return null
|
|
}
|
|
},
|
|
l.fields = function (t) {
|
|
var e = [];
|
|
if (null != t) {
|
|
var i = Object.prototype.hasOwnProperty;
|
|
for (var n in t)
|
|
"__id__" != n && "hx__closures__" != n && i.call(t, n) && e.push(n)
|
|
}
|
|
return e
|
|
},
|
|
l.deleteField = function (t, e) {
|
|
return !!Object.prototype.hasOwnProperty.call(t, e) && (delete t[e], !0)
|
|
};
|
|
var u = function () {};
|
|
u.__name__ = !0,
|
|
u.string = function (t) {
|
|
return Vr.__string_rec(t, "")
|
|
},
|
|
u.parseInt = function (t) {
|
|
if (null != t)
|
|
for (var e = 0, i = t.length; e < i; ) {
|
|
var n = e++,
|
|
r = t.charCodeAt(n);
|
|
if (r <= 8 || r >= 14 && 32 != r && 45 != r) {
|
|
var o = t.charCodeAt(n + 1),
|
|
s = parseInt(t, 120 == o || 88 == o ? 16 : 10);
|
|
return isNaN(s) ? null : s
|
|
}
|
|
}
|
|
return null
|
|
},
|
|
u.random = function (t) {
|
|
return t <= 0 ? 0 : Math.floor(Math.random() * t)
|
|
};
|
|
var c = function () {};
|
|
c.__name__ = !0,
|
|
c.startsWith = function (t, e) {
|
|
return t.length >= e.length && 0 == t.lastIndexOf(e, 0)
|
|
},
|
|
c.replace = function (t, e, i) {
|
|
return t.split(e).join(i)
|
|
};
|
|
var p = {
|
|
toFloat: function (t) {
|
|
return t < 0 ? 4294967296 + t : t + 0
|
|
}
|
|
},
|
|
d = function () {};
|
|
d.__name__ = !0,
|
|
d.__isInterface__ = !0,
|
|
d.prototype = {
|
|
__class__: d
|
|
};
|
|
var f = function () {
|
|
this.next = null,
|
|
this.owner = null,
|
|
this._flags = 0
|
|
};
|
|
f.__name__ = !0,
|
|
f.__interfaces__ = [d],
|
|
f.prototype = {
|
|
onAdded: function () {},
|
|
onRemoved: function () {},
|
|
onStart: function () {},
|
|
onStop: function () {},
|
|
onUpdate: function (t) {},
|
|
dispose: function () {
|
|
null != this.owner && this.owner.removeComponent(this)
|
|
},
|
|
get_name: function () {
|
|
return null
|
|
},
|
|
__class__: f
|
|
};
|
|
var _ = function () {
|
|
f.call(this)
|
|
};
|
|
_.__name__ = !0,
|
|
_.__super__ = f,
|
|
_.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
Un.stage.updateContainerSize()
|
|
},
|
|
get_name: function () {
|
|
return "$oF"
|
|
},
|
|
__class__: _
|
|
});
|
|
var m = function (t) {
|
|
PIXI.settings.RESOLUTION = 1,
|
|
PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST,
|
|
PIXI.settings.MIPMAP_TEXTURES = PIXI.MIPMAP_MODES.OFF,
|
|
Un.init(t, {
|
|
width: 850,
|
|
height: 480,
|
|
backgroundColor: 361193,
|
|
resolution: Un.getResolution(),
|
|
antialias: !0
|
|
}),
|
|
En.init(),
|
|
this.checkStartConditions() && (dn.defaultStyle = {
|
|
fontFamily: S.fonts.NORMAL,
|
|
fontSize: 12
|
|
}, Un.root.add(Rn.EArray([Rn.EComponent(new _)])), y.execute((function () {})))
|
|
};
|
|
m.__name__ = !0,
|
|
m.main = function () {
|
|
PIXI.utils.skipHello(),
|
|
window.document.addEventListener("DOMContentLoaded", (function () {
|
|
return new m(window.document.getElementById("container"))
|
|
}))
|
|
},
|
|
m.prototype = {
|
|
checkStartConditions: function () {
|
|
var t = !PIXI.utils.isMobile.any;
|
|
if (xn.isNativeChinese())
|
|
return !t || (window.document.documentElement.classList.add("is-not-supported"), !1);
|
|
var i = !1;
|
|
t && (i = !0);
|
|
for (var n = [157, 130, 132, 176, 155, 167, 144, 164, 158, 125, 107, 173, 147, 146, 136, 166, 157, 161], r = new Array(n.length), o = 0, s = n.length; o < s; ) {
|
|
var a = o++;
|
|
r[a] = String.fromCodePoint(n[a] - 58)
|
|
}
|
|
var h = r.join("");
|
|
//if (null != En.id2 && En.id2 == h || (i = !0), i)
|
|
// return bn.exit(), !1;
|
|
var l = c.replace(e.location.href, "/" + h, "");
|
|
return window.history.pushState({
|
|
url: l
|
|
}, null, l),
|
|
!0
|
|
},
|
|
__class__: m
|
|
};
|
|
var y = function () {};
|
|
y.__name__ = !0,
|
|
y.execute = function (t) {
|
|
var e = Un.get_sceneManager().goto(S.scenes.preloader).$_,
|
|
i = e instanceof rn ? e : null;
|
|
Un.root.add(Rn.EComponent(new ki));
|
|
for (var n = [new xo(S.files.webFonts.manifest), new go(gn.addSpeedAdjusterKeys), new go((function () {})), new go(cs(i, i.show)), new go(y.removeLoadIndicator), new _o(S.files.bitmapFonts.manifest, i), new _o(S.files.json.manifest, i), new _o(S.files.global.manifest, i), new wo(S.sounds.shared, Un.get_soundManager(), i)], r = 0, o = X.getGameAssetLoadTasks(1, i); r < o.length; )
|
|
n.push(o[r++]);
|
|
n.push(new vo(i.terminal.completedSignal)),
|
|
n.push(new go(y.startFirstScene)),
|
|
new co(n).execute(t)
|
|
},
|
|
y.startFirstScene = function () {
|
|
var t = S.scenes.title(1);
|
|
Un.root.addEntity((new On).addComponent(new Gr(1, (function () {
|
|
Un.get_sceneManager().goto(t)
|
|
}))), !0)
|
|
},
|
|
y.removeLoadIndicator = function () {
|
|
var t = window.document.querySelector(".load-indicator");
|
|
null != t && t.parentNode.removeChild(t)
|
|
};
|
|
var g = {
|
|
getNext: function (t) {
|
|
switch (t) {
|
|
case 1:
|
|
return 2;
|
|
case 2:
|
|
return 3;
|
|
case 3:
|
|
return xn.isNativeChinese() ? 1 : null
|
|
}
|
|
},
|
|
getPrevious: function (t) {
|
|
switch (t) {
|
|
case 1:
|
|
return xn.isNativeChinese() ? 3 : null;
|
|
case 2:
|
|
return 1;
|
|
case 3:
|
|
return 2
|
|
}
|
|
},
|
|
toString: function (t) {
|
|
return "game-" + t
|
|
},
|
|
fromString: function (t) {
|
|
switch (t) {
|
|
case "game-1":
|
|
return 1;
|
|
case "game-2":
|
|
return 2;
|
|
case "game-3":
|
|
return 3;
|
|
default:
|
|
return 1
|
|
}
|
|
}
|
|
},
|
|
v = function () {};
|
|
v.__name__ = !0,
|
|
v.prototype = {
|
|
__class__: v
|
|
};
|
|
var w = function () {
|
|
this.ui = "ui-animations",
|
|
this.cutscene3 = "game3_cutscenes",
|
|
this.cutscene2 = "game2_cutscenes",
|
|
this.cutscene1 = "game1_cutscenes",
|
|
this.game3 = "game-3-animations",
|
|
this.game2 = "game-2-animations",
|
|
this.game1 = "game-1-animations",
|
|
v.call(this)
|
|
};
|
|
w.__name__ = !0,
|
|
w.__super__ = v,
|
|
w.prototype = o(v.prototype, {
|
|
get_currentGame: function () {
|
|
return this.getFrom(g.current)
|
|
},
|
|
getFrom: function (t) {
|
|
switch (t) {
|
|
case 1:
|
|
return this.game1;
|
|
case 2:
|
|
return this.game2;
|
|
case 3:
|
|
return this.game3
|
|
}
|
|
},
|
|
get_currentCutscene: function () {
|
|
switch (g.current) {
|
|
case 1:
|
|
return this.cutscene1;
|
|
case 2:
|
|
return this.cutscene2;
|
|
case 3:
|
|
return this.cutscene3
|
|
}
|
|
},
|
|
__class__: w
|
|
});
|
|
var x = function () {};
|
|
x.__name__ = !0,
|
|
x.has = function (t, e) {
|
|
var i = e;
|
|
return null == e && (i = x.defaultLibaryName),
|
|
null != x._libraryByName.get(i)._symbols.h[t]
|
|
},
|
|
x.get = function (t, e, i, n) {
|
|
null == i && (i = !0);
|
|
var r = e;
|
|
null == e && (r = x.defaultLibaryName);
|
|
var o = x._libraryByName.get(r).createSprite(t, null, n);
|
|
if (i && x.scaleByLibraryName.exists(e)) {
|
|
var s = 1 / x.scaleByLibraryName.get(e);
|
|
o.container.scale.set(s)
|
|
}
|
|
return o
|
|
},
|
|
x.getSprite = function (t, e, i, n) {
|
|
return null == i && (i = !0),
|
|
x.get(t, e, i, n).container
|
|
},
|
|
x.getTexture = function (t, e, i) {
|
|
return null == i && (i = !0),
|
|
x.getSprite(t, e, i).texture
|
|
},
|
|
x.getMovieSprite = function (t, e, i) {
|
|
null == i && (i = !0);
|
|
var n = e;
|
|
null == e && (n = x.defaultLibaryName);
|
|
var r = x._libraryByName.get(n).createSprite(t, !0);
|
|
if (i && x.scaleByLibraryName.exists(e)) {
|
|
var o = 1 / x.scaleByLibraryName.get(e);
|
|
r.container.scale.set(o)
|
|
}
|
|
return r
|
|
},
|
|
x.getMovieSpritePlayer = function (t, e, i) {
|
|
null == i && (i = !0);
|
|
var n = e;
|
|
null == e && (n = x.defaultLibaryName);
|
|
var r = new eo(x._libraryByName.get(n), t);
|
|
if (i && x.scaleByLibraryName.exists(e)) {
|
|
var o = r.movieSprite,
|
|
s = 1 / x.scaleByLibraryName.get(e);
|
|
o.container.scale.set(s)
|
|
}
|
|
return r
|
|
},
|
|
x.dispose = function () {
|
|
x._libraryByName = null,
|
|
x.scaleByLibraryName = null
|
|
};
|
|
var b = function () {
|
|
this.json = new O,
|
|
this.webFonts = new R,
|
|
this.bitmapFonts = new T,
|
|
this.global = new P,
|
|
this.game3 = new I,
|
|
this.game2 = new M,
|
|
this.game1 = new C,
|
|
v.call(this)
|
|
};
|
|
b.__name__ = !0,
|
|
b.__super__ = v,
|
|
b.prototype = o(v.prototype, {
|
|
get_currentGame: function () {
|
|
return this.getFrom(g.current)
|
|
},
|
|
getFrom: function (t) {
|
|
switch (t) {
|
|
case 1:
|
|
return this.game1;
|
|
case 2:
|
|
return this.game2;
|
|
case 3:
|
|
return this.game3
|
|
}
|
|
},
|
|
__class__: b
|
|
});
|
|
var E = function () {
|
|
this.NORMAL = "Perfect_DOS_VGA_437_Win, monospace, Arial, sans-serif",
|
|
v.call(this)
|
|
};
|
|
E.__name__ = !0,
|
|
E.__super__ = v,
|
|
E.prototype = o(v.prototype, {
|
|
__class__: E
|
|
});
|
|
var $ = function () {
|
|
this.outro = _r.Page((function () {
|
|
return new tn
|
|
}), "game-3/outro"),
|
|
this.preloader = _r.Page((function () {
|
|
return new rn
|
|
}), "preloader"),
|
|
v.call(this)
|
|
};
|
|
$.__name__ = !0,
|
|
$.__super__ = v,
|
|
$.prototype = o(v.prototype, {
|
|
prologue: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new en(e)
|
|
}), (null == t ? "null" : g.toString(t)) + "/prologue")
|
|
},
|
|
title: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new ln(e)
|
|
}), (null == t ? "null" : g.toString(t)) + "/home")
|
|
},
|
|
intro: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new Qi(e)
|
|
}), (null == t ? "null" : g.toString(t)) + "/intro")
|
|
},
|
|
game: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new Ki(e)
|
|
}), (null == t.gameId ? "null" : g.toString(t.gameId)) + "/play")
|
|
},
|
|
win: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new hn(e)
|
|
}), (null == t.gameId ? "null" : g.toString(t.gameId)) + "/win")
|
|
},
|
|
lose: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new an(e)
|
|
}), (null == t.gameId ? "null" : g.toString(t.gameId)) + "/lose")
|
|
},
|
|
easterEgg: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new on(e)
|
|
}), (null == t.gameId ? "null" : g.toString(t.gameId)) + "/easteregg")
|
|
},
|
|
bossBattle: function (t) {
|
|
var e = t;
|
|
return _r.Page((function () {
|
|
return new Ki(e)
|
|
}), "game-3/bossbattle")
|
|
},
|
|
__class__: $
|
|
});
|
|
var A = function () {
|
|
this.shared = new F,
|
|
this.game3 = new k,
|
|
this.game2 = new L,
|
|
this.game1 = new D,
|
|
v.call(this)
|
|
};
|
|
A.__name__ = !0,
|
|
A.__super__ = v,
|
|
A.prototype = o(v.prototype, {
|
|
getFrom: function (t) {
|
|
switch (t) {
|
|
case 1:
|
|
return this.game1;
|
|
case 2:
|
|
return this.game2;
|
|
case 3:
|
|
return this.game3
|
|
}
|
|
},
|
|
__class__: A
|
|
});
|
|
var S = function () {};
|
|
S.__name__ = !0;
|
|
var T = function () {
|
|
this.manifest = {
|
|
path: "assets/fonts/bitmap/",
|
|
fileNames: ["perfectdos_0.png", "perfectdos.fnt"]
|
|
}
|
|
};
|
|
T.__name__ = !0,
|
|
T.prototype = {
|
|
__class__: T
|
|
};
|
|
var C = function () {
|
|
this.manifest = {
|
|
path: "assets/games/game-1/",
|
|
fileNames: ["game-1-animations/atlas0.png", "game-1-animations/library.json", "button_exit.png", "game1_cutscenes/atlas1.png", "game1_cutscenes/atlas0.png", "game1_cutscenes/library.json", "button_restart.png", "button_start.png"]
|
|
}
|
|
};
|
|
C.__name__ = !0,
|
|
C.prototype = {
|
|
__class__: C
|
|
};
|
|
var M = function () {
|
|
this.manifest = {
|
|
path: "assets/games/game-2/",
|
|
fileNames: ["game2_cutscenes/atlas1.png", "game2_cutscenes/atlas0.png", "game2_cutscenes/library.json", "button_exit.png", "game-2-animations/atlas0.png", "game-2-animations/library.json", "button_restart.png", "button_start.png"]
|
|
}
|
|
};
|
|
M.__name__ = !0,
|
|
M.prototype = {
|
|
__class__: M
|
|
};
|
|
var I = function () {
|
|
this.manifest = {
|
|
path: "assets/games/game-3/",
|
|
fileNames: ["button_exit.png", "game3_cutscenes/atlas0.png", "game3_cutscenes/library.json", "button_restart.png", "game-3-animations/atlas0.png", "game-3-animations/library.json", "button_playagain.png", "button_start.png"]
|
|
}
|
|
};
|
|
I.__name__ = !0,
|
|
I.prototype = {
|
|
__class__: I
|
|
};
|
|
var P = function () {
|
|
this.manifest = {
|
|
path: "assets/global/",
|
|
fileNames: ["ui-animations/atlas0.png", "ui-animations/library.json"]
|
|
}
|
|
};
|
|
P.__name__ = !0,
|
|
P.prototype = {
|
|
__class__: P
|
|
};
|
|
var O = function () {
|
|
this.manifest = {
|
|
path: "assets/json/",
|
|
fileNames: ["game-2.json", "game-1.json", "game-3.json"]
|
|
}
|
|
};
|
|
O.__name__ = !0,
|
|
O.prototype = {
|
|
__class__: O
|
|
};
|
|
var R = function () {
|
|
this.manifest = {
|
|
path: "assets/fonts/web/",
|
|
fileNames: ["Perfect_DOS_VGA_437_Win.ttf"]
|
|
}
|
|
};
|
|
R.__name__ = !0,
|
|
R.prototype = {
|
|
__class__: R
|
|
};
|
|
var D = function () {
|
|
var t,
|
|
e;
|
|
(e = []).push((t = "atk_a_var1") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ATK_A_VAR1 = e,
|
|
(e = []).push((t = "black_hole") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.BLACK_HOLE = e,
|
|
(e = []).push((t = "black_hole_loop_cinematic") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.BLACK_HOLE_LOOP_CINEMATIC = e,
|
|
(e = []).push((t = "enemy_bigship_shoot") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ENEMY_BIGSHIP_SHOOT = e,
|
|
(e = []).push((t = "enemy_shoot") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ENEMY_SHOOT = e,
|
|
(e = []).push((t = "explosion1_var1") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.EXPLOSION1_VAR1 = e,
|
|
(e = []).push((t = "explosion1_var2") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.EXPLOSION1_VAR2 = e,
|
|
(e = []).push((t = "hit_enemy") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.HIT_ENEMY = e,
|
|
(e = []).push((t = "hit_meteor") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.HIT_METEOR = e,
|
|
(e = []).push((t = "music_project_laser") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_PROJECT_LASER = e,
|
|
(e = []).push((t = "music_project_laser_cinematic") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_PROJECT_LASER_CINEMATIC = e,
|
|
(e = []).push((t = "music_project_laser_gameover") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_PROJECT_LASER_GAMEOVER = e,
|
|
(e = []).push((t = "music_project_laser_title_screen") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_PROJECT_LASER_TITLE_SCREEN = e,
|
|
(e = []).push((t = "music_project_laser_victory") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_PROJECT_LASER_VICTORY = e,
|
|
(e = []).push((t = "pickup_powerup") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PICKUP_POWERUP = e,
|
|
(e = []).push((t = "player_die") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_DIE = e,
|
|
(e = []).push((t = "shoot_rocket") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.SHOOT_ROCKET = e,
|
|
(e = []).push((t = "shoot_tripleshot") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.SHOOT_TRIPLESHOT = e,
|
|
this.path = "assets/sounds/game-1/",
|
|
this.fileNames = [this.SHOOT_TRIPLESHOT, this.SHOOT_ROCKET, this.PLAYER_DIE, this.PICKUP_POWERUP, this.MUSIC_PROJECT_LASER_VICTORY, this.MUSIC_PROJECT_LASER_TITLE_SCREEN, this.MUSIC_PROJECT_LASER_GAMEOVER, this.MUSIC_PROJECT_LASER_CINEMATIC, this.MUSIC_PROJECT_LASER, this.HIT_METEOR, this.HIT_ENEMY, this.EXPLOSION1_VAR2, this.EXPLOSION1_VAR1, this.ENEMY_SHOOT, this.ENEMY_BIGSHIP_SHOOT, this.BLACK_HOLE_LOOP_CINEMATIC, this.BLACK_HOLE, this.ATK_A_VAR1],
|
|
h.iter(this.fileNames, (function (t) {
|
|
for (var e = 0; e < t.length; ) {
|
|
var i = e++;
|
|
t[e - 1] = "assets/sounds/game-1/" + t[i]
|
|
}
|
|
}))
|
|
};
|
|
D.__name__ = !0,
|
|
D.prototype = {
|
|
find: function (t) {
|
|
for (var e = 0, i = this.fileNames; e < i.length; ) {
|
|
var n = i[e];
|
|
if (++e, this.path + t == Xr.withoutExtension(n[0]))
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
__class__: D
|
|
};
|
|
var L = function () {
|
|
var t,
|
|
e;
|
|
(e = []).push((t = "enemy_shoot") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ENEMY_SHOOT = e,
|
|
(e = []).push((t = "explosion") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.EXPLOSION = e,
|
|
(e = []).push((t = "explosion_acid") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.EXPLOSION_ACID = e,
|
|
(e = []).push((t = "falling_bomb_loop") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.FALLING_BOMB_LOOP = e,
|
|
(e = []).push((t = "music_slugfest") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_SLUGFEST = e,
|
|
(e = []).push((t = "music_slugfest_cinematic") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_SLUGFEST_CINEMATIC = e,
|
|
(e = []).push((t = "music_slugfest_cinematic_b") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_SLUGFEST_CINEMATIC_B = e,
|
|
(e = []).push((t = "music_slugfest_gameover") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_SLUGFEST_GAMEOVER = e,
|
|
(e = []).push((t = "music_slugfest_title_screen") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_SLUGFEST_TITLE_SCREEN = e,
|
|
(e = []).push((t = "music_slugfest_victory") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_SLUGFEST_VICTORY = e,
|
|
(e = []).push((t = "player_dies") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_DIES = e,
|
|
(e = []).push((t = "player_moves_down") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_MOVES_DOWN = e,
|
|
(e = []).push((t = "player_moves_up") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_MOVES_UP = e,
|
|
(e = []).push((t = "shoot_a_var1") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.SHOOT_A_VAR1 = e,
|
|
(e = []).push((t = "shoot_b_var1") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.SHOOT_B_VAR1 = e,
|
|
(e = []).push((t = "shoot_b_var2") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.SHOOT_B_VAR2 = e,
|
|
(e = []).push((t = "slug_pew_shoot") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.SLUG_PEW_SHOOT = e,
|
|
(e = []).push((t = "slug_punches_loop") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.SLUG_PUNCHES_LOOP = e,
|
|
this.path = "assets/sounds/game-2/",
|
|
this.fileNames = [this.SLUG_PUNCHES_LOOP, this.SLUG_PEW_SHOOT, this.SHOOT_B_VAR2, this.SHOOT_B_VAR1, this.SHOOT_A_VAR1, this.PLAYER_MOVES_UP, this.PLAYER_MOVES_DOWN, this.PLAYER_DIES, this.MUSIC_SLUGFEST_VICTORY, this.MUSIC_SLUGFEST_TITLE_SCREEN, this.MUSIC_SLUGFEST_GAMEOVER, this.MUSIC_SLUGFEST_CINEMATIC_B, this.MUSIC_SLUGFEST_CINEMATIC, this.MUSIC_SLUGFEST, this.FALLING_BOMB_LOOP, this.EXPLOSION_ACID, this.EXPLOSION, this.ENEMY_SHOOT],
|
|
h.iter(this.fileNames, (function (t) {
|
|
for (var e = 0; e < t.length; ) {
|
|
var i = e++;
|
|
t[e - 1] = "assets/sounds/game-2/" + t[i]
|
|
}
|
|
}))
|
|
};
|
|
L.__name__ = !0,
|
|
L.prototype = {
|
|
find: function (t) {
|
|
for (var e = 0, i = this.fileNames; e < i.length; ) {
|
|
var n = i[e];
|
|
if (++e, this.path + t == Xr.withoutExtension(n[0]))
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
__class__: L
|
|
};
|
|
var k = function () {
|
|
var t,
|
|
e;
|
|
(e = []).push((t = "arcade_explode") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ARCADE_EXPLODE = e,
|
|
(e = []).push((t = "arcade_hurt") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ARCADE_HURT = e,
|
|
(e = []).push((t = "boss_defeated") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.BOSS_DEFEATED = e,
|
|
(e = []).push((t = "enemy_defeated") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ENEMY_DEFEATED = e,
|
|
(e = []).push((t = "enemy_hurt") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ENEMY_HURT = e,
|
|
(e = []).push((t = "enemy_shoot") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.ENEMY_SHOOT = e,
|
|
(e = []).push((t = "music_bossfight_intro") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_BOSSFIGHT_INTRO = e,
|
|
(e = []).push((t = "music_bossfight_loop") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_BOSSFIGHT_LOOP = e,
|
|
(e = []).push((t = "music_starcadia") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_STARCADIA = e,
|
|
(e = []).push((t = "music_starcadia_cinematic_a") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_STARCADIA_CINEMATIC_A = e,
|
|
(e = []).push((t = "music_starcadia_gameover") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_STARCADIA_GAMEOVER = e,
|
|
(e = []).push((t = "music_starcadia_victory") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.MUSIC_STARCADIA_VICTORY = e,
|
|
(e = []).push((t = "pickup_coin") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PICKUP_COIN = e,
|
|
(e = []).push((t = "player_doublejump") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_DOUBLEJUMP = e,
|
|
(e = []).push((t = "player_hurt") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_HURT = e,
|
|
(e = []).push((t = "player_jump") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_JUMP = e,
|
|
(e = []).push((t = "player_land") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_LAND = e,
|
|
(e = []).push((t = "player_shoot") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PLAYER_SHOOT = e,
|
|
this.path = "assets/sounds/game-3/",
|
|
this.fileNames = [this.PLAYER_SHOOT, this.PLAYER_LAND, this.PLAYER_JUMP, this.PLAYER_HURT, this.PLAYER_DOUBLEJUMP, this.PICKUP_COIN, this.MUSIC_STARCADIA_VICTORY, this.MUSIC_STARCADIA_GAMEOVER, this.MUSIC_STARCADIA_CINEMATIC_A, this.MUSIC_STARCADIA, this.MUSIC_BOSSFIGHT_LOOP, this.MUSIC_BOSSFIGHT_INTRO, this.ENEMY_SHOOT, this.ENEMY_HURT, this.ENEMY_DEFEATED, this.BOSS_DEFEATED, this.ARCADE_HURT, this.ARCADE_EXPLODE],
|
|
h.iter(this.fileNames, (function (t) {
|
|
for (var e = 0; e < t.length; ) {
|
|
var i = e++;
|
|
t[e - 1] = "assets/sounds/game-3/" + t[i]
|
|
}
|
|
}))
|
|
};
|
|
k.__name__ = !0,
|
|
k.prototype = {
|
|
find: function (t) {
|
|
for (var e = 0, i = this.fileNames; e < i.length; ) {
|
|
var n = i[e];
|
|
if (++e, this.path + t == Xr.withoutExtension(n[0]))
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
__class__: k
|
|
};
|
|
var F = function () {
|
|
var t,
|
|
e;
|
|
(e = []).push((t = "preloader_click") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.PRELOADER_CLICK = e,
|
|
(e = []).push((t = "ui_click_1") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.UI_CLICK_1 = e,
|
|
(e = []).push((t = "ui_click_2") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.UI_CLICK_2 = e,
|
|
(e = []).push((t = "ui_start_game") + ".ogg"),
|
|
e.push(t + ".m4a"),
|
|
e.push(t + ".mp3"),
|
|
this.UI_START_GAME = e,
|
|
this.path = "assets/sounds/shared/",
|
|
this.fileNames = [this.UI_START_GAME, this.UI_CLICK_2, this.UI_CLICK_1, this.PRELOADER_CLICK],
|
|
h.iter(this.fileNames, (function (t) {
|
|
for (var e = 0; e < t.length; ) {
|
|
var i = e++;
|
|
t[e - 1] = "assets/sounds/shared/" + t[i]
|
|
}
|
|
}))
|
|
};
|
|
F.__name__ = !0,
|
|
F.prototype = {
|
|
find: function (t) {
|
|
for (var e = 0, i = this.fileNames; e < i.length; ) {
|
|
var n = i[e];
|
|
if (++e, this.path + t == Xr.withoutExtension(n[0]))
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
__class__: F
|
|
};
|
|
var N = function () {
|
|
this.stateChanged = new Nn,
|
|
f.call(this)
|
|
};
|
|
N.__name__ = !0,
|
|
N.__super__ = f,
|
|
N.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
if (null == this.currentState || !this.currentState.keepInState()) {
|
|
var e = null;
|
|
null != this.currentState && (e = this.currentState.getNextStateName()),
|
|
null == e && null == (e = this.$Ba()) && (e = this.$ba()),
|
|
null != e && this.changeStateTo(e)
|
|
}
|
|
null != this.currentState && this.currentState.onUpdateState(t)
|
|
},
|
|
$ba: function () {
|
|
return null
|
|
},
|
|
$Ba: function () {
|
|
return null
|
|
},
|
|
changeStateTo: function (t, e) {
|
|
var i = this.currentState,
|
|
n = this.owner[t];
|
|
(i != n || i.canReactivate) && (null != i && (i.onDeactivate(), Vr.__implements(i, kt) && (i.data = null)), this.currentState = n, this.previousState = i, null != this.currentState && (0 == (1 & this.currentState._flags) && (this.currentState._flags |= 1, this.currentState.onStart()), null != e && Vr.__implements(this.currentState, kt) && (this.currentState.data = e), this.currentState.onActivate()), this.stateChanged.emit(this.currentState, i))
|
|
},
|
|
dispose: function () {
|
|
this.previousState = null,
|
|
this.currentState = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$Aa"
|
|
},
|
|
__class__: N
|
|
});
|
|
var B = function (t, e, i) {
|
|
this.$a = new Pn,
|
|
this.chunkUnitSize = 50,
|
|
this.cullMargin = 4,
|
|
this.spawnMargin = 3,
|
|
this.cullBounds = new rt,
|
|
this.spawnBounds = new rt,
|
|
this.viewportBounds = new rt,
|
|
this.worldProjection = new zi,
|
|
N.call(this),
|
|
this.factory = t,
|
|
this.sceneWidth = e,
|
|
this.sceneHeight = i
|
|
};
|
|
B.__name__ = !0,
|
|
B.__super__ = N,
|
|
B.prototype = o(N.prototype, {
|
|
onAdded: function () {
|
|
null == this.containers && (this.containers = this.owner.$oe),
|
|
null == this.gameModel && (this.gameModel = this.owner.$Qf),
|
|
N.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EComponent(this.$ca = new Xn(null, this.containers.main))),
|
|
this.containers.screenShake.add(Rn.EComponent(this.screenShake = new qr)),
|
|
this.camera = new Wr(this.sceneWidth, this.sceneHeight, 1),
|
|
this.camera.isVirtual = !0,
|
|
this.owner.add(Rn.EArray([Rn.EComponent(this.camera), Rn.EComponent(Vr.__cast(this.factory, f)), Rn.EComponent(new Do), Rn.EComponent(this.worldProjection)]))
|
|
},
|
|
onStart: function () {
|
|
null == this.containers && (this.containers = this.owner.$oe),
|
|
null == this.gameModel && (this.gameModel = this.owner.$Qf),
|
|
N.prototype.onStart.call(this);
|
|
var t = this.owner._internal_getFromParents("$se").top,
|
|
e = new On,
|
|
i = Rn.EComponent(new zr(0, 100, 100)),
|
|
n = Rn.EComponent(new So(Oo.Relative(100), Oo.Relative(100)).setScaleMode(Po.Cover)),
|
|
r = new uo;
|
|
r.$A_().set__(0),
|
|
t.add(Rn.EEntity(e.add(Rn.EArray([i, n, Rn.EComponent(r), Rn.EComponent(this.fader = new De)])))),
|
|
this.$da()
|
|
},
|
|
addTouchUI: function (t) {
|
|
this.owner._internal_getFromParents("$se").top.addEntity((new On).addComponent(this.touchUI = t))
|
|
},
|
|
createVignette: function (t) {
|
|
var e = this.containers.vignette,
|
|
i = Rn.EEntity((new On).add(Rn.EComponent(new cn))),
|
|
n = Rn.EEntity((new On).add(Rn.EComponent(S.animations.get("vignette_" + this.sceneHeight, S.animationLibraries.ui).setXY(-t, 0)))),
|
|
r = new On,
|
|
o = S.animations.get("vignette_" + this.sceneHeight, S.animationLibraries.ui).setXY(this.sceneWidth + t, 0);
|
|
o.container.scale.set(-1, 1),
|
|
e.add(Rn.EArray([i, n, Rn.EEntity(r.add(Rn.EComponent(o)))]))
|
|
},
|
|
onUpdate: function (t) {
|
|
N.prototype.onUpdate.call(this, t),
|
|
null != this.worldElementLayer && (this.viewportBounds.set_from(this.worldElementLayer.viewportLeft._value), this.viewportBounds.set_to(this.worldElementLayer.viewportRight._value), this.spawnBounds.set_from(this.worldElementLayer.viewportLeft._value - this.spawnMargin * this.chunkUnitSize), this.spawnBounds.set_to(this.worldElementLayer.viewportRight._value + this.spawnMargin * this.chunkUnitSize), this.cullBounds.set_from(this.worldElementLayer.viewportLeft._value - this.cullMargin * this.chunkUnitSize), this.cullBounds.set_to(this.worldElementLayer.viewportRight._value + this.cullMargin * this.chunkUnitSize))
|
|
},
|
|
startGame: function () {
|
|
this.gameModel.isPlaying.set__(!0)
|
|
},
|
|
finishLevel: function (t) {
|
|
this.gameModel.outcome = t
|
|
},
|
|
endGame: function (t) {
|
|
null == t && (t = 0);
|
|
var e = this,
|
|
i = t;
|
|
null == t && (i = 0),
|
|
this.owner.addEntity((new On).addComponent(new Gr(i, (function () {
|
|
e.gameModel.isPlaying.set__(!1)
|
|
}))), !0)
|
|
},
|
|
$da: function () {},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
N.prototype.dispose.call(this)
|
|
},
|
|
__class__: B
|
|
});
|
|
var U = function () {
|
|
this.ui = (new On).addComponent(new Vt),
|
|
this.debug = (new On).addComponent(new Vt),
|
|
this.vignette = (new On).addComponent(new Vt),
|
|
this.top = (new On).addComponent(new Vt),
|
|
this.mid = (new On).addComponent(new Vt),
|
|
this.bottom = (new On).addComponent(new Vt),
|
|
this.screenShake = (new On).addComponent(new Vt),
|
|
this.main = (new On).addComponent(new Vt),
|
|
f.call(this)
|
|
};
|
|
U.__name__ = !0,
|
|
U.__super__ = f,
|
|
U.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
this.owner.addEntity(this.main.addEntity(this.screenShake.addEntity(this.bottom).addEntity(this.mid).addEntity(this.top).addEntity(this.vignette).addEntity(this.debug))).addEntity(this.ui)
|
|
},
|
|
get_name: function () {
|
|
return "$oe"
|
|
},
|
|
__class__: U
|
|
});
|
|
var X = function (t, e, i) {
|
|
null == i && (i = 0),
|
|
this.$r = 850,
|
|
this.$q = !1,
|
|
this.$P = !1,
|
|
f.call(this),
|
|
this.$S = e,
|
|
this.$s = t,
|
|
this.$t = i
|
|
};
|
|
X.__name__ = !0,
|
|
X.getGameAssetLoadTasks = function (t, e) {
|
|
var i = S.files.getFrom(t).manifest;
|
|
S.files.getFrom(t),
|
|
fo.NUM_PRELOADER_STEPS = 0;
|
|
var n = [];
|
|
n.push(new _o(i, e));
|
|
var r,
|
|
o = S.sounds.getFrom(t);
|
|
if (o.fileNames.length > 0) {
|
|
var s = Un.get_soundManager().sounds,
|
|
a = o.fileNames;
|
|
r = null == s.h.__keys__[a[a.length - 1].__id__]
|
|
} else
|
|
r = !1;
|
|
return r && n.push(new wo(o, Un.get_soundManager(), e)),
|
|
n
|
|
},
|
|
X.disposeAssets = function (t) {
|
|
if (null != t) {
|
|
var e = t,
|
|
i = S.files.getFrom(e).manifest;
|
|
if (Object.prototype.hasOwnProperty.call(Un.assets.assetPackByName.h, i.path)) {
|
|
var n = S.animationLibraries.getFrom(e);
|
|
x._libraryByName.remove(n),
|
|
Un.assets.disposePack(i.path)
|
|
}
|
|
}
|
|
},
|
|
X.__super__ = f,
|
|
X.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.containers && (this.containers = this.owner._internal_getFromParents("$se")),
|
|
f.prototype.onStart.call(this),
|
|
this.initLoaders()
|
|
},
|
|
initLoaders: function () {
|
|
this.containers.top.addEntity((new On).addComponent(this.$Q = new pn(this.$r, 1, 197217, 14090239, 0, bo.TOP_LEFT)).addComponent(new So(Oo.Relative(this.$r), Oo.Relative(1), Oo.Relative(0), To.fromString("100%"), Oo.Relative(0), To.fromString("100%")).setScaleMode(Po.FitToWidth))),
|
|
this.$Q.container.visible = !1,
|
|
new co(X.getGameAssetLoadTasks(this.$s, this.$Q)).execute(cs(this, this.$u));
|
|
var t = this.$t;
|
|
null == t && (t = 0),
|
|
this.owner.addEntity((new On).addComponent(new Gr(t, cs(this, this.$T))), !0)
|
|
},
|
|
$T: function () {
|
|
this.$q = !0,
|
|
this.$U()
|
|
},
|
|
$u: function () {
|
|
this.$P = !0,
|
|
this.$Q.container.visible = !1,
|
|
this.$U()
|
|
},
|
|
$U: function () {
|
|
this.$q && this.$P && this.$S()
|
|
},
|
|
get_name: function () {
|
|
return "$p"
|
|
},
|
|
__class__: X
|
|
});
|
|
var j = function (t) {
|
|
this._disposer = new Pn,
|
|
this.score = new Ln(0),
|
|
this.playTime = new Ln(0),
|
|
this.isPlaying = new Ln(!1),
|
|
f.call(this),
|
|
this.gameId = t
|
|
};
|
|
j.__name__ = !0,
|
|
j.__super__ = f,
|
|
j.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
f.prototype.onStart.call(this),
|
|
this._disposer.add(Un.get_keyboard().connect(189, (function () {
|
|
var e = t.score;
|
|
e.set__(e._value - 100)
|
|
}))),
|
|
this._disposer.add(Un.get_keyboard().connect(187, (function () {
|
|
var e = t.score;
|
|
e.set__(e._value + 100)
|
|
})))
|
|
},
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), this.isPlaying._value) {
|
|
var e = this.playTime;
|
|
e.set__(e._value + t)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$Qf"
|
|
},
|
|
dispose: function () {
|
|
null != this._disposer && (this._disposer.dispose(), this._disposer = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: j
|
|
});
|
|
var V = function (t, e) {
|
|
this.$ea = _i.Right,
|
|
B.call(this, new G, t, e),
|
|
this.spawnMargin = 8,
|
|
this.cullMargin = 9
|
|
};
|
|
V.__name__ = !0,
|
|
V.__super__ = B,
|
|
V.prototype = o(B.prototype, {
|
|
onAdded: function () {
|
|
B.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Ut), Rn.EComponent(new jt), Rn.EComponent(new Xt), Rn.EComponent(this.sounds = new W)]))
|
|
},
|
|
onStart: function () {
|
|
B.prototype.onStart.call(this),
|
|
this.camera.offset.x.set__(-50),
|
|
this.createVignette(380),
|
|
this.$Ga(),
|
|
this.$ha(),
|
|
this.$CB(),
|
|
this.$ga(),
|
|
PIXI.utils.isMobile.any && this.addTouchUI(new Yt(55)),
|
|
this.changeStateTo("$fB", null)
|
|
},
|
|
$ga: function () {
|
|
this.owner._internal_getFromParents("$se").top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite("healthbar", S.animationLibraries.get_currentGame())), Rn.EComponent(new Ni(this.playerEntity.$qD.value)), Rn.EComponent(new So(Oo.Relative(0), Oo.Relative(0), Oo.Relative(20), Oo.Relative(40)))]))))
|
|
},
|
|
$Ga: function () {
|
|
var t = new mi,
|
|
e = new J;
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(0, .2).setViewOffset(0, this.sceneHeight).setCameraOffset(1e3, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("back_a")), t))])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent((new Vt).setAlpha(.8)), Rn.EComponent(new li(.4, .5).setViewOffset(0, .5 * this.sceneHeight - 100).setCameraOffset(950, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("back_c")), t))])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent((new Vt).setAlpha(.8)), Rn.EComponent(new li(.5, .6).setViewOffset(0, .5 * this.sceneHeight + 100).setCameraOffset(1050, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("back_c")), t))])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(.6, .6).setViewOffset(0, .5 * this.sceneHeight).setCameraOffset(1e3, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("planets")), e))])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(.8, .8).setViewOffset(0, .5 * this.sceneHeight).setCameraOffset(1e3, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("planets")), e))])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent((new Vt).setAlpha(.5)), Rn.EComponent(new li(2.5, 1).setViewOffset(0, .5 * this.sceneHeight).setCameraOffset(1e3, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("back_d")), t))])))),
|
|
this.containers.top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent((new Vt).setAlpha(.9)), Rn.EComponent(new li(6, 1.35).setViewOffset(0, .5 * this.sceneHeight).setCameraOffset(1e3, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("back_e")), t))])))),
|
|
this.containers.mid.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(this.worldElementLayer = new li(1, 1, "worldElement").setViewOffset(0, .5 * this.sceneHeight)), Rn.EEntity(this.worldElementContainer = new On)])))),
|
|
this.containers.mid.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(1, 1, "playerElement").setViewOffset(0, .5 * this.sceneHeight)), Rn.EEntity(this.worldPlayerContainer = new On)]))))
|
|
},
|
|
createDialog: function (t, e) {
|
|
var i = (new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite("dialog_game", S.animationLibraries.get_currentCutscene()).setXY(.5 * this.sceneWidth, this.sceneHeight))]));
|
|
if (null != ((n = i.$w)instanceof br ? n : null)) {
|
|
var n,
|
|
r = (n = i.$w)instanceof br ? n : null;
|
|
r.$hF(t / r.symbol.frames * r.symbol.duration),
|
|
r.$iF(!0)
|
|
}
|
|
var o = new Pn;
|
|
if (e) {
|
|
i.add(Rn.EComponent(o));
|
|
var s = (new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite("dialog_button_up", S.animationLibraries.get_currentCutscene()).setXY(331, -70))])),
|
|
a = this.owner,
|
|
h = (new On).addComponent(new Gr(1, (function () {
|
|
i.add(Rn.EEntity(s))
|
|
})));
|
|
a.addEntity(h, !0),
|
|
o.add(h)
|
|
}
|
|
return this.containers.main.add(Rn.EEntity(i)),
|
|
i
|
|
},
|
|
$ha: function () {
|
|
var t,
|
|
e = this.factory.createPlayer();
|
|
if (null == ((i = e.$Aa)instanceof $t ? i : null))
|
|
t = e;
|
|
else {
|
|
var i = e.$Aa;
|
|
this.player = i instanceof $t ? i : null,
|
|
t = e
|
|
}
|
|
return this.playerEntity = t,
|
|
this.worldPlayerContainer.add(Rn.EEntity(this.playerEntity)),
|
|
this.playerEntity
|
|
},
|
|
$CB: function () {
|
|
this.worldElementContainer.parent.parent.add(Rn.EComponent(this.enemyList = new Q)),
|
|
this.spawner = new z(this.worldElementLayer.viewportRight, _i.Left),
|
|
this.spawner.isEnabled = !1,
|
|
this.spawner.offset.x = this.spawnMargin * this.chunkUnitSize,
|
|
this.worldElementContainer.addEntity((new On).add(Rn.EComponent(this.spawner)))
|
|
},
|
|
$ia: function (t) {
|
|
for (var e = Un.assets.getJson(S.files.json.manifest.fileNames[1]), i = 0; i < e.length; ) {
|
|
var n = e[i];
|
|
if (++i, n.id == t)
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
onUpdate: function (t) {
|
|
B.prototype.onUpdate.call(this, t),
|
|
this.$dB(t)
|
|
},
|
|
$dB: function (t) {
|
|
var e = this.playerEntity.$Aa,
|
|
i = e instanceof $t ? e : null;
|
|
if ("$Vd" != (null != i.currentState ? i.currentState.get_name() : null)) {
|
|
var n,
|
|
r,
|
|
o = this.camera.target,
|
|
s = i.levelAnchorPosition,
|
|
a = {
|
|
x: 0,
|
|
y: .15 * i.playerOffset.y
|
|
},
|
|
h = s.x,
|
|
l = s.y;
|
|
n = h + a.x,
|
|
r = l + a.y,
|
|
o.x = n,
|
|
o.y = r
|
|
} else
|
|
this.camera.target.x += 60 * t
|
|
},
|
|
__class__: V
|
|
});
|
|
var H = function () {};
|
|
H.__name__ = !0,
|
|
H.__isInterface__ = !0,
|
|
H.prototype = {
|
|
__class__: H
|
|
};
|
|
var G = function () {
|
|
f.call(this)
|
|
};
|
|
G.__name__ = !0,
|
|
G.__interfaces__ = [H],
|
|
G.__super__ = f,
|
|
G.prototype = o(f.prototype, {
|
|
create: function (t, e) {
|
|
return new On
|
|
},
|
|
createPlayer: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer("player_idle", S.animationLibraries.get_currentGame()))]))), Rn.EComponent(new $t), Rn.EComponent(new Ci), Rn.EComponent(new Ei), Rn.EComponent(new xi(100)), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new ji), Rn.EComponent(new It), Rn.EComponent(vi.fromMovieSprite("player_colliders", S.animationLibraries.get_currentGame(), null, 1, 0))]))
|
|
},
|
|
createProjectile: function (t, e) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame()))])).setTimeScale(rs.native.range(.9, 1.1))), Rn.EComponent(new Gi), Rn.EComponent(new Wi(!0)), Rn.EComponent(new Li(1, 1275)), Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), 1, 4, e).setFilterFlagsMethod(No.Inclusive))]))
|
|
},
|
|
createEnemy: function (t, e) {
|
|
var i = e;
|
|
return this.$mB((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer(null, S.animationLibraries.get_currentGame()))])).setTimeScale(rs.native.range(.9, 1.1))), Rn.EComponent(new Gi), Rn.EComponent(new Wi(!0)), Rn.EComponent(new Ii(t, i)), Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), null, 2, 0))])), t, i)
|
|
},
|
|
$mB: function (t, e, i) {
|
|
var n;
|
|
switch (i) {
|
|
case "enemy_biggy_ship_a":
|
|
n = Rn.EComponent(new ct);
|
|
break;
|
|
case "enemy_chicken_ship":
|
|
n = Rn.EComponent(new lt);
|
|
break;
|
|
case "enemy_meteor_1":
|
|
case "enemy_meteor_2":
|
|
case "enemy_meteor_3":
|
|
n = Rn.EComponent(new _t);
|
|
break;
|
|
case "enemy_portal":
|
|
n = Rn.EComponent(new tt);
|
|
break;
|
|
case "enemy_special_black_hole":
|
|
n = Rn.EComponent(new gt);
|
|
break;
|
|
case "enemy_suicide_bot":
|
|
n = Rn.EComponent(new vt);
|
|
break;
|
|
default:
|
|
n = null
|
|
}
|
|
return t.add(Rn.EArray([n])),
|
|
t
|
|
},
|
|
createPickup: function (t, e) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer(t, S.animationLibraries.get_currentGame()))])).setTimeScale(rs.native.range(.9, 1.1))), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new Et(e)), Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), null, 8, 0))]))
|
|
},
|
|
createExplosion: function (t) {
|
|
var e = new On,
|
|
i = S.animations.get(t, S.animationLibraries.get_currentGame()),
|
|
n = u.random(4) * Math.PI;
|
|
return i.container.rotation = n,
|
|
e.add(Rn.EArray([Rn.EComponent(i), Rn.EComponent(new Kr)])).setTimeScale(rs.native.range(.9, 1.2))
|
|
},
|
|
get_name: function () {
|
|
return "$LB"
|
|
},
|
|
__class__: G
|
|
});
|
|
var Y = function () {
|
|
f.call(this)
|
|
};
|
|
Y.__name__ = !0,
|
|
Y.__super__ = f,
|
|
Y.prototype = o(f.prototype, {
|
|
get_name: function () {
|
|
return "$V_"
|
|
},
|
|
__class__: Y
|
|
});
|
|
var W = function () {
|
|
Y.call(this)
|
|
};
|
|
W.__name__ = !0,
|
|
W.__super__ = Y,
|
|
W.prototype = o(Y.prototype, {
|
|
playProjectile: function (t) {
|
|
switch (t) {
|
|
case 0:
|
|
var e = S.sounds.game1.ENEMY_SHOOT;
|
|
Un.get_soundManager().play(e, .8);
|
|
break;
|
|
case 1:
|
|
e = S.sounds.game1.ENEMY_BIGSHIP_SHOOT;
|
|
Un.get_soundManager().play(e, .8);
|
|
break;
|
|
case 2:
|
|
e = S.sounds.game1.ATK_A_VAR1;
|
|
Un.get_soundManager().play(e, .6);
|
|
break;
|
|
case 3:
|
|
e = S.sounds.game1.SHOOT_ROCKET;
|
|
Un.get_soundManager().play(e, .7);
|
|
break;
|
|
case 4:
|
|
e = S.sounds.game1.SHOOT_TRIPLESHOT;
|
|
Un.get_soundManager().play(e, .4)
|
|
}
|
|
},
|
|
playExplosion: function () {
|
|
var t = W.explosions;
|
|
Un.get_soundManager().play(ls.randomElement(t, rs.native), 1)
|
|
},
|
|
playHitMeteor: function () {
|
|
var t = S.sounds.game1.HIT_METEOR;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playHitBlackHole: function () {
|
|
var t = S.sounds.game1.BLACK_HOLE;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playPickup: function () {
|
|
var t = S.sounds.game1.PICKUP_POWERUP;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playerDie: function () {
|
|
var t = S.sounds.game1.PLAYER_DIE;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
__class__: W
|
|
});
|
|
var z = function (t, e) {
|
|
this.$Ub = new as(1.1),
|
|
this.offset = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.isEnabled = !0,
|
|
f.call(this),
|
|
this.$tb = t,
|
|
this.$Tb = e;
|
|
for (var i = "-M----- -----M- ---M---- ----M--- -C---- ---C-- -B--- -p-B- -M- M-M-M -M--M--M- -M- --M--M--M-- M--M MM----MM MMMM--MMMM B-C-C-B --C- -B--- -C--- --B -C- Cp-C -CMC- M-M-M -M--M--M- M-B-M -CC- -D- MMrMM -M--MM--M- MM-B-MM M-C-M -MM--C--MM- p M-D-C -S--r- M--M-M --C-- -C--- -DB D-- M--B-M C-C-C-C -D--- --D-- ".split(" "), n = new Array(i.length), r = 0, o = i.length; r < o; ) {
|
|
var s = r++;
|
|
n[s] = i[s].split("")
|
|
}
|
|
this.$ub = n
|
|
};
|
|
z.__name__ = !0,
|
|
z.__super__ = f,
|
|
z.prototype = o(f.prototype, {
|
|
$wb: function () {
|
|
for (var t = this.$ub.shift(), e = t.length, i = 0; i < t.length; ) {
|
|
var n = t[i],
|
|
r = i++/(e-1);if("-"!=n)switch(n){case"B":this.$hB("enemy_portal",r);break;case"C":this.$hB("enemy_chicken_ship",r);break;case"D":this.$hB("enemy_biggy_ship_a",r);break;case"M":this.$hB(rs.native.fromArray(["enemy_meteor_1","enemy_meteor_2","enemy_meteor_3"]),r);break;case"S":this.$hB("enemy_special_black_hole",r);break;case"p":this.$HB("powerup",r);break;case"r":this.$HB("powerup_rocket",r)}}},$hB:function(t,e){var i=this.$tb._value+this.offset.x|0,n=-195+rs.native.to(30),r=n+(240+rs.native.to(-30)-n)*(e<0?0:e>1?1:e)|0,o=t;"enemy_special_black_hole"==t&&(o="enemy_portal");var s=this.$Ma.factory.createEnemy(o,t);if(null!=s.$rD){var a=s.$rD,h=a.position3d;h.x=i,h.y=null==r?i:r,a.heading.set__(this.$Tb)}var l=s.$Aa,u=l instanceof Ii?l:null;this.owner.parent.addEntity(s),this.$GB.add(u)},$HB:function(t,e){var i=this.$tb._value+this.offset.x|0,n=-195+rs.native.to(30),r=n+(240+rs.native.to(-30)-n)*(e<0?0:e>1?1:e)|0,o=this.$Ma.factory.createPickup("powerup",t);if(null!=o.$rD){var s=o.$rD,a=s.position3d;a.x=i,a.y=null==r?i:r,s.heading.set__(this.$Tb)}this.owner.parent.addEntity(o)},onUpdate:function(t){if(f.prototype.onUpdate.call(this,t),this.isEnabled){var e=this.$Ub;e.isEnabled&&e.time<=0||!this.$Ub.update(t)||(this.$wb(),this.$ub.length>0&&this.$Ub.reset())}},get_name:function(){return"$gB"},onStart:function(){null==this.$Ma&&(this.$Ma=this.owner._internal_getFromParents("$Aa",B)),null==this.$sb&&(this.$sb=this.owner._internal_getFromParents("$hE")),null==this.$GB&&(this.$GB=this.owner._internal_getFromParents("$FD")),f.prototype.onStart.call(this)},__class__:z});var q=function(){};q.__name__=!0,q.__isInterface__=!0,q.prototype={__class__:q};var J=function(){this.$lB=20,this.$KB=0,this.$jB=new Zo([0,1,2]),this.$IB=new Zo(["game_1_redplanet","game1_bigplanet","game1_doubleplanet","game1_earthplanet","game1_redplanetsingle","game1_ringplanet","game1_smallplanet"]),f.call(this);this.$JB=202.5,this.$kB=135};J.__name__=!0,J.__interfaces__=[q],J.__super__=f,J.prototype=o(f.prototype,{populate:function(t,e){var i,n,r,o=e.moveDirection,s=(n=o.x,r=o.y,n=n*(i=t.startIndex)),a=r=r*i;s=n*(i=e.chunkUnitSize),a=r*i;var h=u.parseInt(t.data.id.split("_x_")[1]),l=this.$KB%this.$lB==0?"game1_planet_smiley":this.$IB.next(),c=s+Math.random()*h,p=a-this.$JB+this.$jB.next()*this.$kB+Math.random()*this.$kB;return t.entities.push((new On).add(Rn.EComponent(S.animations.get(l,S.animationLibraries.get_currentGame()).setXY(c,p)))),this.$KB++,t.entities},depopulate:function(t,e){for(var i=t.entities.slice(),n=0,r=t.entities;n<r.length;)r[n++].dispose();return t.entities=[],i},get_name:function(){return"$iB"},__class__:J});var K=function(t){f.call(this),this.$vC=t};K.__name__=!0,K.__super__=f,K.prototype=o(f.prototype,{onStart:function(){null==this.$ya&&(this.$ya=this.owner.$w),null==this.$dA&&(this.$dA=this.owner.$rD),null==this.$Ma&&(this.$Ma=this.owner._internal_getFromParents("$Aa",V)),f.prototype.onStart.call(this),this.$uC=this.owner.parent},explode:function(t,e,i){null==i&&(i=0),null==e&&(e=0),null==t&&(t=0);var n=this,r=i;null==i&&(r=0),this.owner.addEntity((new On).addComponent(new Gr(r,(function(){var i;switch(n.$UC={x:n.$ya.container.x+t,y:n.$ya.container.y+e},n.$vC){case 0:i=n.$Ma.factory.createExplosion("explosion_big");break;case 1:i=n.$Ma.factory.createExplosion(ls.randomElement(K.SMALL_EXPLOSION_SYMBOLS,rs.native))}switch(null!=i.$w&&i.$w.container.position.copyFrom(n.$UC),n.$uC.addEntity(i),n.owner._internal_getFromParents("$pe").shakeItBaby(20,.3,1),n.$vC){case 0:n.$VC(50,rs.native.range(.1,.3)),n.$VC(50,rs.native.range(.1,.3)),n.$VC(50,rs.native.range(.1,.3));break;case 1:n.$VC(8,rs.native.range(0,.1)),n.$VC(8,rs.native.range(0,.1))}n.$Ma.sounds.playExplosion(),Gr.create(n.owner)}))),!0)},$VC:function(t,e){var i=this,n=e;null==e&&(n=0),this.$uC.addEntity((new On).addComponent(new Gr(n,(function(){var e={x:i.$UC.x+rs.native.range(-t,t),y:i.$UC.y+rs.native.range(-t,t)},n=i.$Ma.factory.createExplosion(ls.randomElement(K.SMALL_EXPLOSION_SYMBOLS,rs.native));null!=n.$w&&n.$w.container.position.copyFrom(e),i.$uC.addEntity(n)}))),!0)},get_name:function(){return"$TC"},onAdded:function(){null==this.$ya&&(this.$ya=this.owner.$w),null==this.$dA&&(this.$dA=this.owner.$rD),f.prototype.onAdded.call(this)},__class__:K});var Z=function(t){this.removedSignal=new sr,f.call(this),null!=t&&this.removedSignal.connect(t)};Z.__name__=!0,Z.__super__=f,Z.prototype=o(f.prototype,{onRemoved:function(){f.prototype.onRemoved.call(this),this.removedSignal.emit(this)},get_name:function(){return"$gD"},__class__:Z});var Q=function(){this.activeEnemies=[],f.call(this)};Q.__name__=!0,Q.__super__=f,Q.prototype=o(f.prototype,{add:function(t){var e=this;this.activeEnemies.push(t),t.owner.add(Rn.EComponent(new Z((function(i){a.remove(e.activeEnemies,t)}))))},get_name:function(){return"$FD"},__class__:Q});var tt=function(){f.call(this)};tt.__name__=!0,tt.__super__=f,tt.prototype=o(f.prototype,{onAdded:function(){var t=this;f.prototype.onAdded.call(this);var e=Rn.EComponent(new $i(vn.fromFlag(1),(function(e){var i=t.owner.$rD,n=e.other.owner.$Aa;(n instanceof $t?n:null).changeStateTo("$Xd",{worldElement:i,isSpecialBlackHole:!1})})));this.owner.add(Rn.EArray([e,Rn.EComponent(new ht),Rn.EComponent(new st),Rn.EComponent(new ot(new rt(0,700))),Rn.EComponent(new at)]));var i=this.owner.$Aa;(i instanceof Ii?i:null).fallbackStateName="$od"},get_name:function(){return"$rd"},__class__:tt});var et=function(){this.$La=new Pn,this.$la=!1,this.canReactivate=!1,f.call(this)};et.__name__=!0,et.__super__=f,et.prototype=o(f.prototype,{onActivate:function(){this.$la=!0},onDeactivate:function(){this.$La.dispose()},getNextStateName:function(){return null},onUpdateState:function(t){},keepInState:function(){return this.$la},deactivate:function(){this.$la=!1},get_name:function(){return"$Ka"},dispose:function(){null!=this.$La&&(this.$La.dispose(),this.$La=null),f.prototype.dispose.call(this)},__class__:et});var it=function(t,e,i){null==e&&(e=!1),et.call(this),this.$MA=t,this.$oA=e,null!=i&&(this.$OA=i),this.$NA=this.$OA};it.__name__=!0,it.__super__=et,it.prototype=o(et.prototype,{onStart:function(){et.prototype.onStart.call(this);var t=this.owner.$w;this.$nA=t instanceof eo?t:null,null==this.$nA&&(this.$nA=this.owner._internal_getFromChildren("$w",eo))},onActivate:function(){et.prototype.onActivate.call(this),this.$pA()},$pA:function(){this.$oA?this.$La.add(this.$nA.setMovie(this.$PA()).gotoAndPlay(0,!0)):this.$La.add(this.$nA.setMovie(this.$PA()).gotoAndPlay(0).completed(cs(this,this.$qA)))},$PA:function(){return this.$MA},$qA:function(){null==this.$OA&&(this.$la=!1)},onDeactivate:function(){et.prototype.onDeactivate.call(this),this.$la=!1,this.$NA=null},onUpdateState:function(t){if(et.prototype.onUpdateState.call(this,t),null!=this.$OA){var e;if(null!=this.$NA){e=(this.$NA-=t)<=0}else e=!1;e&&(this.$la=!1)}},dispose:function(){this.$nA=null,et.prototype.dispose.call(this)},get_name:function(){return"$mA"},__class__:it});var nt=function(t,e,i){null==e&&(e=!1),it.call(this,null,e,i),this.$Mb=t};nt.__name__=!0,nt.__super__=it,nt.prototype=o(it.prototype,{$PA:function(){return this.$jb.animationPrefix+this.$Mb},get_name:function(){return"$mb"},onStart:function(){null==this.$jb&&(this.$jb=this.owner.$Aa),it.prototype.onStart.call(this)},onAdded:function(){null==this.$jb&&(this.$jb=this.owner.$Aa),it.prototype.onAdded.call(this)},__class__:nt});var rt=function(t,e){null==e&&(e=1),null==t&&(t=0),this._from=t,this._to=e,this.updateSize(),this._direction=this._to>this._from?1:-1};rt.__name__=!0,rt.prototype={set:function(t,e){this._from=t,this._to=e,this.updateSize(),this._direction=this._to>this._from?1:-1},getFactorFromValue:function(t){return Math.abs((this.clamp(t)-this._from)/this._size)
|
|
},
|
|
getValueFromFactor: function (t) {
|
|
return this._from + this._direction * (t * this._size)
|
|
},
|
|
translate: function (t, e) {
|
|
return e.getValueFromFactor(this.getFactorFromValue(t))
|
|
},
|
|
clamp: function (t) {
|
|
return this._to > this._from ? this.clampTo(t, this._from, this._to) : this.clampTo(t, this._to, this._from)
|
|
},
|
|
clampTo: function (t, e, i) {
|
|
return t < e ? e : t > i ? i : t
|
|
},
|
|
updateSize: function () {
|
|
return this._size = Math.abs(this._from - this._to),
|
|
this._size
|
|
},
|
|
set_from: function (t) {
|
|
return this._from = t,
|
|
this.updateSize(),
|
|
this._direction = this._to > this._from ? 1 : -1,
|
|
t
|
|
},
|
|
set_to: function (t) {
|
|
return this._to = t,
|
|
this.updateSize(),
|
|
this._direction = this._to > this._from ? 1 : -1,
|
|
t
|
|
},
|
|
__class__: rt
|
|
};
|
|
var ot = function (t) {
|
|
this.$Ub = 0,
|
|
nt.call(this, "loop", !0),
|
|
this.$qd = t
|
|
};
|
|
ot.__name__ = !0,
|
|
ot.__super__ = nt,
|
|
ot.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
this.$dA.heading.set__(_i.Left),
|
|
this.$db = this.$Ma.playerEntity.$rD
|
|
},
|
|
onUpdateState: function (t) {
|
|
var e;
|
|
if (nt.prototype.onUpdateState.call(this, t), this.$jb.$KD())
|
|
if (null != this.$Ub) {
|
|
e = (this.$Ub -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
else
|
|
e = !1;
|
|
e && (this.$Qd() && this.$Id(), this.$Ub = ot._spawnIntervalRange.getValueFromFactor(Math.random()))
|
|
},
|
|
$Qd: function () {
|
|
var t = $o.distanceTo(this.$dA.position3d, this.$db.position3d),
|
|
e = this.$qd;
|
|
return e._from <= t && t <= e._to || e._to <= t && t <= e._from
|
|
},
|
|
$Id: function () {
|
|
var t = this.$Ma.factory.createEnemy("enemy_suicide_bot", "enemy_suicide_bot");
|
|
if (null != t.$rD) {
|
|
var e = t.$rD.position3d,
|
|
i = this.$dA.position3d;
|
|
e.x = i.x,
|
|
e.y = i.y,
|
|
e.z = i.z
|
|
}
|
|
this.owner.parent.add(Rn.EEntity(t))
|
|
},
|
|
keepInState: function () {
|
|
return !0
|
|
},
|
|
get_name: function () {
|
|
return "$Pd"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ot
|
|
});
|
|
var st = function () {
|
|
nt.call(this, "opens", !1)
|
|
};
|
|
st.__name__ = !0,
|
|
st.__super__ = nt,
|
|
st.prototype = o(nt.prototype, {
|
|
getNextStateName: function () {
|
|
return "$Pd"
|
|
},
|
|
get_name: function () {
|
|
return "$pd"
|
|
},
|
|
__class__: st
|
|
});
|
|
var at = function () {
|
|
nt.call(this, "closes", !1)
|
|
};
|
|
at.__name__ = !0,
|
|
at.__super__ = nt,
|
|
at.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
this._collidable.disableCollisions()
|
|
},
|
|
keepInState: function () {
|
|
return !0
|
|
},
|
|
get_name: function () {
|
|
return "$Od"
|
|
},
|
|
onStart: function () {
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: at
|
|
});
|
|
var ht = function () {
|
|
et.call(this)
|
|
};
|
|
ht.__name__ = !0,
|
|
ht.__super__ = et,
|
|
ht.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
et.prototype.onActivate.call(this),
|
|
this._display.container.visible = !1,
|
|
this._collidable.disableCollisions()
|
|
},
|
|
onDeactivate: function () {
|
|
et.prototype.onDeactivate.call(this),
|
|
this._display.container.visible = !0,
|
|
this._collidable.enableCollisions()
|
|
},
|
|
keepInState: function () {
|
|
return !this._enemy.$KD()
|
|
},
|
|
getNextStateName: function () {
|
|
return "$pd"
|
|
},
|
|
get_name: function () {
|
|
return "$od"
|
|
},
|
|
onStart: function () {
|
|
null == this._display && (this._display = this.owner.$w),
|
|
null == this._enemy && (this._enemy = this.owner.$Aa),
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this._display && (this._display = this.owner.$w),
|
|
null == this._enemy && (this._enemy = this.owner.$Aa),
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
et.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ht
|
|
});
|
|
var lt = function () {
|
|
f.call(this)
|
|
};
|
|
lt.__name__ = !0,
|
|
lt.__super__ = f,
|
|
lt.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
var t = this;
|
|
f.prototype.onAdded.call(this);
|
|
var e = Rn.EComponent(new $i(vn.fromFlag(1), (function (e) {
|
|
e.current.disableCollisions(),
|
|
e.other.owner.$JD.hit(20),
|
|
t.owner.$qD.setHealth(0)
|
|
})));
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Ei), Rn.EComponent(new K(0)), e, Rn.EComponent(new xi(3)), Rn.EComponent(new bi(S.sounds.game1.HIT_ENEMY)), Rn.EComponent(new ut), Rn.EComponent(new It(0, -20))]));
|
|
var i = this.owner.$Aa;
|
|
(i instanceof Ii ? i : null).fallbackStateName = "$kd"
|
|
},
|
|
get_name: function () {
|
|
return "$ld"
|
|
},
|
|
__class__: lt
|
|
});
|
|
var ut = function () {
|
|
this.$dd = {
|
|
x: 200,
|
|
y: 50
|
|
},
|
|
this.$Cd = {
|
|
x: 80,
|
|
y: 30
|
|
},
|
|
this.$DA = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$Lb = 1,
|
|
this.$rC = 0,
|
|
nt.call(this, "idle", !0)
|
|
};
|
|
ut.__name__ = !0,
|
|
ut.__super__ = nt,
|
|
ut.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
this.$Kd = ls.randomElement(ut.shootPatterns, rs.native),
|
|
this.$rC = 0,
|
|
this.$dA.heading.set__(_i.Left);
|
|
var t = this.$DA,
|
|
e = this.$dA.position3d;
|
|
t.x = e.x,
|
|
t.y = e.y,
|
|
this.$DA = t;
|
|
var i = 80,
|
|
n = rs.native._random.next() > .5 ? -1 : 1;
|
|
this.$dA.velocity3d.x = i * n;
|
|
i = 30,
|
|
n = rs.native._random.next() > .5 ? -1 : 1;
|
|
this.$dA.velocity3d.y = i * n
|
|
},
|
|
onUpdateState: function (t) {
|
|
var e;
|
|
if (nt.prototype.onUpdateState.call(this, t), this.$jb.$KD())
|
|
if (null != this.$Lb) {
|
|
e = (this.$Lb -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
else
|
|
e = !1;
|
|
e && (this.fireProjectile(), this.$Lb = this.$Kd[this.$rC++ % this.$Kd.length]),
|
|
this.$dA.position3d.y - this.$DA.y > this.$dd.y / 2 ? this.$dA.velocity3d.y = -1 * this.$Cd.y : this.$dA.position3d.y - this.$DA.y < -this.$dd.y / 2 && (this.$dA.velocity3d.y = this.$Cd.y),
|
|
this.$dA.position3d.x - this.$DA.x > this.$dd.x / 2 ? this.$dA.velocity3d.x = -1 * this.$Cd.x : this.$dA.position3d.x - this.$DA.x < -this.$dd.x / 2 && (this.$dA.velocity3d.x = this.$Cd.x)
|
|
},
|
|
fireProjectile: function () {
|
|
var t = this,
|
|
e = Rn.EComponent(new St(1)),
|
|
i = this.$Ma.factory.createProjectile("projectile_chicken_ship", 1).add(e);
|
|
!function (e) {
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$iD)
|
|
return e;
|
|
var i = e.$rD;
|
|
e.$iD;
|
|
var n = i.position3d,
|
|
r = t.$dA.position3d;
|
|
n.x = r.x,
|
|
n.y = r.y,
|
|
n.z = r.z;
|
|
n = i.velocity3d;
|
|
var o,
|
|
s,
|
|
a = t.$dA.heading._value,
|
|
h = a.x,
|
|
l = a.y;
|
|
o = 300 * h,
|
|
s = 300 * l,
|
|
n.x = o,
|
|
n.y = s
|
|
}
|
|
(i),
|
|
this.$Ma.sounds.playProjectile(0),
|
|
this.owner.parent.add(Rn.EEntity(i))
|
|
},
|
|
get_name: function () {
|
|
return "$kd"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ut
|
|
});
|
|
var ct = function () {
|
|
f.call(this)
|
|
};
|
|
ct.__name__ = !0,
|
|
ct.__super__ = f,
|
|
ct.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
var t = this;
|
|
f.prototype.onAdded.call(this);
|
|
var e = Rn.EComponent(new $i(vn.fromFlag(1), (function (e) {
|
|
e.current.disableCollisions(),
|
|
e.other.owner.$JD.hit(20),
|
|
t.owner.$qD.setHealth(0)
|
|
})));
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Ei), Rn.EComponent(new K(0)), e, Rn.EComponent(new ft), Rn.EComponent(new xi(10)), Rn.EComponent(new bi(S.sounds.game1.HIT_ENEMY)), Rn.EComponent(new pt), Rn.EComponent(new It(0, -20))]));
|
|
var i = this.owner.$Aa;
|
|
(i instanceof Ii ? i : null).fallbackStateName = "$xC"
|
|
},
|
|
get_name: function () {
|
|
return "$Jd"
|
|
},
|
|
__class__: ct
|
|
});
|
|
var pt = function () {
|
|
this.$dd = {
|
|
x: 100,
|
|
y: 150
|
|
},
|
|
this.$Cd = {
|
|
x: 60,
|
|
y: 60
|
|
},
|
|
this.$DA = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$cd = !0,
|
|
this.$Bd = {
|
|
x: -50,
|
|
y: -40,
|
|
z: 0
|
|
},
|
|
this.$bd = {
|
|
x: -10,
|
|
y: -40,
|
|
z: 0
|
|
},
|
|
this.$ZC = 0,
|
|
this.$zC = 0,
|
|
this.$YC = 0,
|
|
this.$yC = 0,
|
|
nt.call(this, "idle", !0)
|
|
};
|
|
pt.__name__ = !0,
|
|
pt.__super__ = nt,
|
|
pt.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
var t = this;
|
|
nt.prototype.onActivate.call(this),
|
|
this.owner._internal_getFromChildren("$w", eo).owner.timeScale = 1,
|
|
this.$_d = ls.randomElement(pt.gunPatterns, rs.native),
|
|
this.$ad = ls.randomElement(pt.rocketLauncherPatterns, rs.native),
|
|
this.$zC = 0,
|
|
this.$ZC = 0,
|
|
this.$dA.heading.set__(_i.Left),
|
|
this.$La.add(this.$HA.value.watch((function (e, i) {
|
|
t.$jb.animationPrefix = "enemy_biggy_ship_b_",
|
|
t.$pA()
|
|
}), !1).once());
|
|
var e = this.$DA,
|
|
i = this.$dA.position3d;
|
|
e.x = i.x,
|
|
e.y = i.y,
|
|
this.$DA = e;
|
|
var n = 60,
|
|
r = rs.native.range(-1, 1);
|
|
this.$dA.velocity3d.x = n * r;
|
|
n = 60,
|
|
r = rs.native.range(-1, 1);
|
|
this.$dA.velocity3d.y = n * r
|
|
},
|
|
onUpdateState: function (t) {
|
|
if (nt.prototype.onUpdateState.call(this, t), this.$jb.$KD()) {
|
|
var e;
|
|
if (null != this.$yC)
|
|
e = (this.$yC -= t) <= 0;
|
|
else
|
|
e = !1;
|
|
if (e) {
|
|
var i = this.$cd ? this.$Bd : this.$bd;
|
|
this.$cd = !this.$cd;
|
|
var n = this.$dA.position3d,
|
|
r = {
|
|
x: n.x,
|
|
y: n.y,
|
|
z: n.z
|
|
};
|
|
r.x += i.x,
|
|
r.y += i.y,
|
|
r.z += i.z,
|
|
this.fireRocketLauncher(r),
|
|
this.$yC = this.$ad[this.$ZC++ % this.$ad.length]
|
|
}
|
|
if (null != this.$YC)
|
|
e = (this.$YC -= t) <= 0;
|
|
else
|
|
e = !1;
|
|
e && (this.$XC.fire(), this.$YC = this.$_d[this.$zC++ % this.$_d.length])
|
|
}
|
|
this.$dA.position3d.y - this.$DA.y > this.$dd.y / 2 ? this.$dA.velocity3d.y = -1 * this.$Cd.y : this.$dA.position3d.y - this.$DA.y < -this.$dd.y / 2 && (this.$dA.velocity3d.y = this.$Cd.y),
|
|
this.$dA.position3d.x - this.$DA.x > this.$dd.x / 2 ? this.$dA.velocity3d.x = -1 * this.$Cd.x : this.$dA.position3d.x - this.$DA.x < -this.$dd.x / 2 && (this.$dA.velocity3d.x = this.$Cd.x)
|
|
},
|
|
fireRocketLauncher: function (t) {
|
|
var e = this,
|
|
i = function (i) {
|
|
if (null == i.$rD)
|
|
return i;
|
|
if (null == i.$iD)
|
|
return i;
|
|
var n = i.$rD;
|
|
i.$iD.hitPoints = 20,
|
|
n.heading.set__(_i.Left),
|
|
(s = n.position3d).x = t.x,
|
|
s.y = t.y,
|
|
s.z = t.z;
|
|
var r,
|
|
o,
|
|
s = n.velocity3d,
|
|
a = e.$dA.heading._value,
|
|
h = a.x,
|
|
l = a.y;
|
|
return r = 300 * h,
|
|
o = 300 * l,
|
|
s.x = r,
|
|
s.y = o,
|
|
n.position3d.x += 20,
|
|
e.$Ma.sounds.playProjectile(1),
|
|
i
|
|
}
|
|
(this.$Ma.factory.createProjectile("missile", 1).add(Rn.EComponent(new Ct(this.$Ma.player.owner.$Md))));
|
|
this.owner.parent.add(Rn.EEntity(i))
|
|
},
|
|
get_name: function () {
|
|
return "$xC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$XC && (this.$XC = this.owner.$jd),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$XC && (this.$XC = this.owner.$jd),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: pt
|
|
});
|
|
var dt = function (t, e, i) {
|
|
this.$Fd = "",
|
|
this.isEnabled = !1,
|
|
this.$fd = 0,
|
|
this._disposer = new Pn,
|
|
f.call(this),
|
|
this.$gd = e,
|
|
this.$Gd = t,
|
|
this.$Ed = i
|
|
};
|
|
dt.__name__ = !0,
|
|
dt.__super__ = f,
|
|
dt.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
null == this._worldElement && (this._worldElement = this.owner.$rD),
|
|
f.prototype.onAdded.call(this),
|
|
this.gunEntity = (new On).add(Rn.EArray([Rn.EComponent(this.$ed = S.animations.getMovieSpritePlayer(null, S.animationLibraries.get_currentGame()).setXY(this.$gd.x, this.$gd.y))])),
|
|
this._disposer.add(this.gunEntity),
|
|
this.owner.add(Rn.EEntity(this.gunEntity))
|
|
},
|
|
onStart: function () {
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
null == this._worldElement && (this._worldElement = this.owner.$rD),
|
|
null == this._game && (this._game = this.owner._internal_getFromParents("$Aa", V)),
|
|
f.prototype.onStart.call(this),
|
|
this.isEnabled = !0
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
if (f.prototype.onUpdate.call(this, t), null != this.$fd) {
|
|
e = (this.$fd -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
e && (this.$fd = null),
|
|
this.$ed.movieSprite.$jc + .01 >= this.$ed.movieSprite.symbol.duration && this.$ed.gotoAndPause(0)
|
|
},
|
|
fire: function () {
|
|
this.$ed.gotoAndPlay(0, !1),
|
|
this.$fd = this.$Ed
|
|
},
|
|
disable: function () {
|
|
this.isEnabled = !1
|
|
},
|
|
release: function () {},
|
|
setHeading: function (t) {
|
|
this.$Fd = t.vertical._value < 0 ? "_up" : t.vertical._value > 0 ? "_down" : "_normal",
|
|
this.$hd()
|
|
},
|
|
$hd: function () {
|
|
if (null != this.$ed.playback) {
|
|
var t = this.$ed.isPaused,
|
|
e = this.$ed.playback.get_time();
|
|
this.$ed.setMovie("" + this.$Gd + this.$Fd),
|
|
t ? this.$ed.gotoAndPause(e) : this.$ed.gotoAndPlay(e)
|
|
} else
|
|
this.$ed.setMovie("" + this.$Gd + this.$Fd)
|
|
},
|
|
$Hd: function () {
|
|
if (this.isEnabled) {
|
|
if (null != this.$fd) {
|
|
var t = this.$fd;
|
|
return null != t && t <= 0
|
|
}
|
|
return !0
|
|
}
|
|
return !1
|
|
},
|
|
$id: function () {
|
|
if (null != this.$fd) {
|
|
var t = this.$fd;
|
|
return !(null != t && t <= 0)
|
|
}
|
|
return !1
|
|
},
|
|
get_name: function () {
|
|
return "$Dd"
|
|
},
|
|
dispose: function () {
|
|
null != this._disposer && (this._disposer.dispose(), this._disposer = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: dt
|
|
});
|
|
var ft = function () {
|
|
dt.call(this, "enemy_biggy_gun_1", {
|
|
x: 0,
|
|
y: 0
|
|
}, .01)
|
|
};
|
|
ft.__name__ = !0,
|
|
ft.__super__ = dt,
|
|
ft.prototype = o(dt.prototype, {
|
|
onStart: function () {
|
|
dt.prototype.onStart.call(this),
|
|
this.$Fd = "_normal",
|
|
this.$hd()
|
|
},
|
|
fire: function () {
|
|
dt.prototype.fire.call(this);
|
|
var t,
|
|
e = Rn.EComponent(new St(1)),
|
|
i = this._game.factory.createProjectile("projectile_chicken_ship", 1).add(e);
|
|
if (null == i.$rD)
|
|
t = i;
|
|
else {
|
|
var n = i.$rD,
|
|
r = n.position3d,
|
|
o = this._worldElement.position3d;
|
|
r.x = o.x,
|
|
r.y = o.y,
|
|
r.z = o.z;
|
|
r = n.position3d;
|
|
var s = this.$ed.container.position;
|
|
r.x += s.x,
|
|
r.y += s.y,
|
|
n.position3d.y += 11;
|
|
r = n.velocity3d;
|
|
var a,
|
|
h,
|
|
l = this._worldElement.heading._value,
|
|
u = l.x,
|
|
c = l.y;
|
|
a = 550 * u,
|
|
h = 550 * c,
|
|
r.x = a,
|
|
r.y = h,
|
|
this._game.sounds.playProjectile(0),
|
|
t = i
|
|
}
|
|
this._game.worldPlayerContainer.addEntity(t)
|
|
},
|
|
get_name: function () {
|
|
return "$jd"
|
|
},
|
|
__class__: ft
|
|
});
|
|
var _t = function () {
|
|
f.call(this)
|
|
};
|
|
_t.__name__ = !0,
|
|
_t.__super__ = f,
|
|
_t.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
var t = this;
|
|
f.prototype.onAdded.call(this);
|
|
var e = this.owner,
|
|
i = Rn.EComponent(new xi(10)),
|
|
n = Rn.EComponent((new Ei).setFilter(Ei.INVINCIBILITY_FILTER)),
|
|
r = Rn.EComponent(new $i([1, 32], (function (e) {
|
|
if (e.current.owner.$rD.velocity3d.x = 0, e.current.disableCollisions(), 0 != (32 & e.other.flags))
|
|
e.other.disableCollisions(), ((i = t.owner.$TC)instanceof yt ? i : null).reason = 0;
|
|
else if (0 != (1 & e.other.flags)) {
|
|
var i;
|
|
e.other.owner.$JD.hit(20),
|
|
e.other.owner.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get("meteor_debris", S.animationLibraries.get_currentGame()).setXY(20, 5)), Rn.EComponent(new Kr)])))),
|
|
((i = t.owner.$TC)instanceof yt ? i : null).reason = 1
|
|
}
|
|
t.owner.$qD.setHealth(0)
|
|
})));
|
|
e.add(Rn.EArray([i, n, Rn.EComponent(new yt(1)), r, Rn.EComponent(new mt), Rn.EComponent(new It)]));
|
|
var o = this.owner.$Aa;
|
|
(o instanceof Ii ? o : null).fallbackStateName = "$wC"
|
|
},
|
|
get_name: function () {
|
|
return "$WC"
|
|
},
|
|
__class__: _t
|
|
});
|
|
var mt = function () {
|
|
nt.call(this, "idle", !0)
|
|
};
|
|
mt.__name__ = !0,
|
|
mt.__super__ = nt,
|
|
mt.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
this.$dA.heading.set__(_i.Left);
|
|
var t = this.$dA.heading._value.x,
|
|
e = new rt(150, 300).getValueFromFactor(Math.random());
|
|
this.$dA.velocity3d.x = t * e,
|
|
this.owner.$w.container.scale.y = rs.native._random.next() > .5 ? -1 : 1
|
|
},
|
|
onUpdateState: function (t) {
|
|
var e;
|
|
if (nt.prototype.onUpdateState.call(this, t), this.$jb.$KD()) {
|
|
var i = this.$HA;
|
|
e = i.value._value > i.valueBounds._from
|
|
} else
|
|
e = !1;
|
|
e ? this.$_b.enableCollisions() : this.$_b.disableCollisions()
|
|
},
|
|
get_name: function () {
|
|
return "$wC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: mt
|
|
});
|
|
var yt = function (t) {
|
|
this.reason = 0,
|
|
K.call(this, t)
|
|
};
|
|
yt.__name__ = !0,
|
|
yt.__super__ = K,
|
|
yt.prototype = o(K.prototype, {
|
|
explode: function (t, e, i) {
|
|
switch (null == i && (i = 0), null == e && (e = 0), null == t && (t = 0), this.owner._internal_getFromParents("$pe").shakeItBaby(20, .3, 1), this.reason) {
|
|
case 0:
|
|
this.$Ma.sounds.playExplosion();
|
|
break;
|
|
case 1:
|
|
this.$Ma.sounds.playHitMeteor()
|
|
}
|
|
var n = this.owner._internal_getFromChildren("$w", eo),
|
|
r = this.owner;
|
|
n.setMovie("meteor_impact").play(!1).completed((function () {
|
|
return Gr.create(r)
|
|
}))
|
|
},
|
|
__class__: yt
|
|
});
|
|
var gt = function () {
|
|
f.call(this)
|
|
};
|
|
gt.__name__ = !0,
|
|
gt.__super__ = f,
|
|
gt.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
var t = this;
|
|
f.prototype.onAdded.call(this);
|
|
var e = !1,
|
|
i = null,
|
|
n = Rn.EComponent(new $i([1, 4], (function (n) {
|
|
var r = n.other.flags;
|
|
if (0 != (4 & r)) {
|
|
e = !0;
|
|
var o = t.owner;
|
|
i = (new On).add(Rn.EArray([Rn.EComponent(S.animations.get("special_portal_open", S.animationLibraries.get_currentGame())), Rn.EComponent(new uo)])),
|
|
o.addEntity(i)
|
|
} else if (0 != (1 & r)) {
|
|
var s = t.owner.$rD,
|
|
a = n.other.owner.$Aa;
|
|
(a instanceof $t ? a : null).changeStateTo("$Xd", {
|
|
worldElement: s,
|
|
isSpecialBlackHole: e
|
|
}),
|
|
null != i && i.$Hf.$A_().animate(1, 0, .2, null, null, 0)
|
|
}
|
|
})));
|
|
this.owner.add(Rn.EArray([n, Rn.EComponent(new ht), Rn.EComponent(new st), Rn.EComponent(new ot(new rt(9999999, 999999))), Rn.EComponent(new at)]));
|
|
var r = this.owner.$Aa;
|
|
(r instanceof Ii ? r : null).fallbackStateName = "$od"
|
|
},
|
|
get_name: function () {
|
|
return "$tC"
|
|
},
|
|
__class__: gt
|
|
});
|
|
var vt = function () {
|
|
f.call(this)
|
|
};
|
|
vt.__name__ = !0,
|
|
vt.__super__ = f,
|
|
vt.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
var t = this;
|
|
f.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Ei), Rn.EComponent(new K(1)), Rn.EComponent(new xi(1)), Rn.EComponent(new $i(vn.fromFlag(1), (function (e) {
|
|
e.current.disableCollisions(),
|
|
e.other.owner.$JD.hit(10),
|
|
t.owner.$qD.setHealth(0)
|
|
}))), Rn.EComponent(new xt), Rn.EComponent(new It)]));
|
|
var e = this.owner.$Aa;
|
|
(e instanceof Ii ? e : null).fallbackStateName = "$qC"
|
|
},
|
|
get_name: function () {
|
|
return "$SC"
|
|
},
|
|
__class__: vt
|
|
});
|
|
var wt = function () {
|
|
nt.call(this, "idle", !0)
|
|
};
|
|
wt.__name__ = !0,
|
|
wt.__super__ = nt,
|
|
wt.prototype = o(nt.prototype, {
|
|
get_name: function () {
|
|
return "$qC"
|
|
},
|
|
__class__: wt
|
|
});
|
|
var xt = function () {
|
|
this.$RC = 30,
|
|
this.$rC = 0,
|
|
this.$QC = 0,
|
|
wt.call(this)
|
|
};
|
|
xt.__name__ = !0,
|
|
xt.__super__ = wt,
|
|
xt.prototype = o(wt.prototype, {
|
|
onActivate: function () {
|
|
wt.prototype.onActivate.call(this),
|
|
this.$dA.heading.set__(_i.Left),
|
|
this.$db = this.$Ma.playerEntity.$rD;
|
|
var t,
|
|
e,
|
|
i,
|
|
n,
|
|
r = 1.5 * Math.PI,
|
|
o = Math.random(),
|
|
s = r + (.8 * (o < 0 ? 0 : o > 1 ? 1 : o) - .4),
|
|
a = Math.sin(s),
|
|
h = Math.cos(s),
|
|
l = this.$dA.velocity3d,
|
|
u = this.$RC;
|
|
t = a * u,
|
|
e = h * u;
|
|
i = 4 * t,
|
|
n = 4 * e,
|
|
l.x = i,
|
|
l.y = n
|
|
},
|
|
onUpdateState: function (t) {
|
|
var e;
|
|
if (wt.prototype.onUpdateState.call(this, t), null != this.$QC) {
|
|
e = (this.$QC -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
e && this.$dA.position3d.x > this.$db.position3d.x && (this.$RC += 30, this.$sC(), this.$QC = xt._spawnIntervalRange.getValueFromFactor(Math.random()))
|
|
},
|
|
$sC: function () {
|
|
if (this.$rC % 4 < 2) {
|
|
var t = this.$dA.velocity3d,
|
|
e = this.$db.position3d,
|
|
i = this.$dA.position3d,
|
|
n = {
|
|
x: e.x,
|
|
y: e.y
|
|
};
|
|
n.x -= i.x,
|
|
n.y -= i.y;
|
|
e = $o.normalize(n);
|
|
var r = this.$RC,
|
|
o = a = e.x,
|
|
s = h = e.y;
|
|
o = a * r,
|
|
s = h * r,
|
|
t.x = o,
|
|
t.y = s
|
|
} else {
|
|
var a,
|
|
h;
|
|
t = this.$dA.velocity3d,
|
|
o = a = rs.native.range(-1, 1),
|
|
s = h = rs.native.range(-1, 1);
|
|
o = a * (r = this.$RC),
|
|
s = h * r,
|
|
t.x = o,
|
|
t.y = s
|
|
}
|
|
this.$rC++
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
wt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
wt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: xt
|
|
});
|
|
var bt = function () {
|
|
f.call(this)
|
|
};
|
|
bt.__name__ = !0,
|
|
bt.__super__ = f,
|
|
bt.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
f.prototype.onStart.call(this);
|
|
var t = this.owner._internal_getFromChildren("$w", eo);
|
|
null != t && t.play(!0)
|
|
},
|
|
get_name: function () {
|
|
return "$nB"
|
|
},
|
|
__class__: bt
|
|
});
|
|
var Et = function (t) {
|
|
bt.call(this),
|
|
this.$PC = t
|
|
};
|
|
Et.__name__ = !0,
|
|
Et.__super__ = bt,
|
|
Et.prototype = o(bt.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
bt.prototype.onStart.call(this);
|
|
var e = Rn.EComponent(new $i(vn.fromFlag(1), (function (e) {
|
|
var i = e.other.owner.$qD;
|
|
if (i.value._value > i.valueBounds._from) {
|
|
e.current.disableCollisions(),
|
|
e.current.owner.add(Rn.EComponent(new Gr));
|
|
var n = e.other.owner.$Aa;
|
|
(n instanceof $t ? n : null).randomizeGun("powerup_rocket" == t.$PC),
|
|
t.owner._internal_getFromParents("$V_", W).playPickup()
|
|
}
|
|
})));
|
|
this.owner.add(e)
|
|
},
|
|
__class__: Et
|
|
});
|
|
var $t = function () {
|
|
this.playerOffset = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$td = 1,
|
|
this.baseSpeedModifier = 1,
|
|
this.levelAnchorPosition = {
|
|
x: 1e3,
|
|
y: 0
|
|
},
|
|
this.playerDied = new Mr,
|
|
this.$a = new Pn,
|
|
N.call(this)
|
|
};
|
|
$t.__name__ = !0,
|
|
$t.__super__ = N,
|
|
$t.prototype = o(N.prototype, {
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
N.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Nt), Rn.EComponent(new Bt), Rn.EComponent(new Dt), Rn.EComponent(new Lt), Rn.EComponent(new Ft)]))
|
|
},
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
N.prototype.onStart.call(this),
|
|
this.$a.add(this.owner.$qD.value.watch((function (e, i) {
|
|
if (0 == e)
|
|
t.$_b.disableCollisions(), t.changeStateTo("$_D", null);
|
|
else if (e < i) {
|
|
var n = t.owner,
|
|
r = [16057380],
|
|
o = new Pn;
|
|
if (null != n.$w) {
|
|
var s = n.$w,
|
|
a = new yr(r[0], 1);
|
|
s.container.filters = [a];
|
|
var h = 0;
|
|
o.add(hs.create(n.parent, .05, 1, (function () {
|
|
var t = h += .5;
|
|
a.update(r[(0 | t) % r.length], 1 == a.multiplier ? 0 : 1)
|
|
})));
|
|
var l = n.parent;
|
|
n = (new On).addComponent(new Gr(.1, (function () {
|
|
s.container.filters = null
|
|
})));
|
|
l.addEntity(n, !0),
|
|
o.add(n)
|
|
}
|
|
} else {
|
|
n = t.owner;
|
|
var u = [16441449];
|
|
o = new Pn;
|
|
if (null != n.$w) {
|
|
var c = n.$w,
|
|
p = new yr(u[0], 1);
|
|
c.container.filters = [p];
|
|
var d = 0;
|
|
o.add(hs.create(n.parent, .05, 3, (function () {
|
|
var t = d += .5;
|
|
p.update(u[(0 | t) % u.length], 1 == p.multiplier ? 0 : 1)
|
|
})));
|
|
l = n.parent,
|
|
n = (new On).addComponent(new Gr(.2, (function () {
|
|
c.container.filters = null
|
|
})));
|
|
l.addEntity(n, !0),
|
|
o.add(n)
|
|
}
|
|
}
|
|
}), !1)),
|
|
this.setGun(new At)
|
|
},
|
|
onUpdate: function (t) {
|
|
N.prototype.onUpdate.call(this, t),
|
|
this.$ud(t),
|
|
this.$Ud()
|
|
},
|
|
$ud: function (t) {
|
|
var e = this.$td,
|
|
i = 2 * t;
|
|
this.$td = e + (this.baseSpeedModifier - e) * (i < 0 ? 0 : i > 1 ? 1 : i),
|
|
this.levelAnchorPosition.x += 100 * t * this.$td;
|
|
var n = this.$dA.position3d,
|
|
r = this.levelAnchorPosition;
|
|
n.x = r.x,
|
|
n.y = r.y;
|
|
n = this.$dA.position3d;
|
|
var o = this.playerOffset;
|
|
n.x += o.x,
|
|
n.y += o.y
|
|
},
|
|
$Ud: function () {
|
|
null != this.$Td && (this.$Td.setHeading(this.$hA.axis1), this.$hA.buttonAction1.wasPressed._value ? this.$Td.$Hd() && this.$Td.fire() : this.$hA.buttonAction1.wasReleased._value && this.$Td.$id() && this.$Td.release())
|
|
},
|
|
disableGun: function () {
|
|
null != this.$Td && this.$Td.disable()
|
|
},
|
|
randomizeGun: function (t) {
|
|
var e;
|
|
if (t && null != this.$Td && "$ED" != this.$Td.get_name())
|
|
e = "$ED";
|
|
else if (null != this.$Td) {
|
|
var i = ["$GD", "$dD"];
|
|
a.remove(i, this.$Td.get_name()),
|
|
e = ls.randomElement(i, rs.native)
|
|
} else
|
|
e = "$GD";
|
|
this.setGun("$ED" == e ? new Pt : "$GD" == e ? new At : "$dD" == e ? new Ot : null)
|
|
},
|
|
disposeGun: function () {
|
|
var t = this.$Td;
|
|
null != t && t.dispose(),
|
|
this.$Td = null
|
|
},
|
|
setGun: function (t) {
|
|
this.disposeGun(),
|
|
null != t && (this.owner.add(Rn.EComponent(t)), this.$Td = t, ss.create(this.owner, 1, (function () {
|
|
var e = t.gunEntity,
|
|
i = [14417919],
|
|
n = new Pn;
|
|
if (null != e.$w) {
|
|
var r = e.$w,
|
|
o = new yr(i[0], 1);
|
|
r.container.filters = [o];
|
|
var s = 0;
|
|
n.add(hs.create(e.parent, .1, 3, (function () {
|
|
var t = s += .5;
|
|
o.update(i[(0 | t) % i.length], 1 == o.multiplier ? 0 : 1)
|
|
})));
|
|
var a = e.parent;
|
|
e = (new On).addComponent(new Gr(.4, (function () {
|
|
r.container.filters = null
|
|
})));
|
|
a.addEntity(e, !0),
|
|
n.add(e)
|
|
}
|
|
})))
|
|
},
|
|
$ba: function () {
|
|
return "$wd"
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
N.prototype.dispose.call(this)
|
|
},
|
|
__class__: $t
|
|
});
|
|
var At = function () {
|
|
dt.call(this, "player_gun_1", {
|
|
x: 0,
|
|
y: -20
|
|
}, .01)
|
|
};
|
|
At.__name__ = !0,
|
|
At.__super__ = dt,
|
|
At.prototype = o(dt.prototype, {
|
|
fire: function () {
|
|
var t = this;
|
|
dt.prototype.fire.call(this);
|
|
var e = Rn.EComponent(new St(1)),
|
|
i = function (e) {
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$w)
|
|
return e;
|
|
var i = e.$rD,
|
|
n = e.$w,
|
|
r = i.position3d,
|
|
o = t._worldElement.position3d;
|
|
r.x = o.x,
|
|
r.y = o.y,
|
|
r.z = o.z;
|
|
r = i.position3d;
|
|
var s = t.$ed.container.position;
|
|
r.x += s.x,
|
|
r.y += s.y,
|
|
i.position3d.y -= 11;
|
|
r = i.velocity3d;
|
|
var a,
|
|
h,
|
|
l = t._worldElement.heading._value,
|
|
c = l.x,
|
|
p = l.y;
|
|
a = 550 * c,
|
|
h = 550 * p,
|
|
r.x = a,
|
|
r.y = h;
|
|
var d = u.random(4) * Math.PI / 2;
|
|
return n.container.rotation = d,
|
|
t._game.sounds.playProjectile(2),
|
|
e
|
|
}
|
|
(this._game.factory.createProjectile("projectile_blaster", 2).add(e));
|
|
this._game.worldPlayerContainer.addEntity(i)
|
|
},
|
|
get_name: function () {
|
|
return "$GD"
|
|
},
|
|
__class__: At
|
|
});
|
|
var St = function (t) {
|
|
f.call(this),
|
|
this.$HD = t
|
|
};
|
|
St.__name__ = !0,
|
|
St.__super__ = f,
|
|
St.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this._projectile && (this._projectile = this.owner.$iD),
|
|
f.prototype.onStart.call(this),
|
|
this.$h = this._projectile.impactSignal.connect((function () {
|
|
var e,
|
|
i = t.owner.$rD.position3d,
|
|
n = t.owner._internal_getFromParents("$LB").createExplosion("bullet_damage");
|
|
if (null == n.$w)
|
|
e = n;
|
|
else {
|
|
var r = n.$w.container.position;
|
|
r.x = i.x,
|
|
r.y = i.y,
|
|
e = n
|
|
}
|
|
t.owner.parent.addEntity(e)
|
|
})),
|
|
this._projectile.hitPoints = this.$HD
|
|
},
|
|
get_name: function () {
|
|
return "$hD"
|
|
},
|
|
onAdded: function () {
|
|
null == this._projectile && (this._projectile = this.owner.$iD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: St
|
|
});
|
|
var Tt = function () {
|
|
this._targetSpeedChange = 2,
|
|
this._targetSpeed = 150,
|
|
this._retargetInterval = 1,
|
|
this._verticalTargetRange = 100,
|
|
this._hitPoints = 1,
|
|
this._yTargetVelocity = 0,
|
|
this._retargetCooldown = 0,
|
|
f.call(this)
|
|
};
|
|
Tt.__name__ = !0,
|
|
Tt.__super__ = f,
|
|
Tt.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this._projectile && (this._projectile = this.owner.$iD),
|
|
null == this._worldElement && (this._worldElement = this.owner.$rD),
|
|
f.prototype.onStart.call(this),
|
|
this._projectile.hitPoints = this._hitPoints,
|
|
this.$h = this._projectile.impactSignal.connect((function () {
|
|
var e,
|
|
i = t.owner.$rD.position3d,
|
|
n = t.owner._internal_getFromParents("$LB").createExplosion("bullet_damage");
|
|
if (null == n.$w)
|
|
e = n;
|
|
else {
|
|
var r = n.$w.container.position;
|
|
r.x = i.x,
|
|
r.y = i.y,
|
|
e = n
|
|
}
|
|
t.owner.parent.addEntity(e)
|
|
}))
|
|
},
|
|
isInRange: function (t) {
|
|
if (Math.abs(this._worldElement.position3d.y - (t._worldElement.position3d.y + t.$Nd)) > this._verticalTargetRange)
|
|
return !1;
|
|
var e = t._worldElement.position3d.x + t.$nd - this._worldElement.position3d.x;
|
|
return this._worldElement.velocity3d.x < 0 && (e *= -1),
|
|
e > 0
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
if (f.prototype.onUpdate.call(this, t), null != this._retargetCooldown) {
|
|
e = (this._retargetCooldown -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
if (e && (this._retargetCooldown = this._retargetInterval, this._homingLock = this.getHomingLock()), this._yTargetVelocity = 0, null != this._homingLock) {
|
|
var i = this._homingLock;
|
|
this._yTargetVelocity = this._worldElement.position3d.y > i._worldElement.position3d.y + i.$Nd ? -this._targetSpeed : this._targetSpeed
|
|
}
|
|
var n = this._worldElement.velocity3d.y,
|
|
r = t * this._targetSpeedChange;
|
|
this._worldElement.velocity3d.y = n + (this._yTargetVelocity - n) * (r < 0 ? 0 : r > 1 ? 1 : r)
|
|
},
|
|
getHomingLock: function () {
|
|
return null
|
|
},
|
|
get_name: function () {
|
|
return "$fD"
|
|
},
|
|
onAdded: function () {
|
|
null == this._projectile && (this._projectile = this.owner.$iD),
|
|
null == this._worldElement && (this._worldElement = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Tt
|
|
});
|
|
var Ct = function (t) {
|
|
Tt.call(this),
|
|
this._target = t
|
|
};
|
|
Ct.__name__ = !0,
|
|
Ct.__super__ = Tt,
|
|
Ct.prototype = o(Tt.prototype, {
|
|
getHomingLock: function () {
|
|
return this.isInRange(this._target) ? this._target : null
|
|
},
|
|
__class__: Ct
|
|
});
|
|
var Mt = function (t) {
|
|
Tt.call(this),
|
|
this._enemies = t
|
|
};
|
|
Mt.__name__ = !0,
|
|
Mt.__super__ = Tt,
|
|
Mt.prototype = o(Tt.prototype, {
|
|
getHomingLock: function () {
|
|
for (var t = null, e = 179769313486231e294, i = 0, n = this._enemies.activeEnemies; i < n.length; ) {
|
|
var r = n[i];
|
|
++i;
|
|
var o = r.owner.$Md;
|
|
if (null != o && (r.owner.$RE.collisionsEnabled && null == r.owner.$re && this.isInRange(o))) {
|
|
var s = Math.abs(o._worldElement.position3d.x + o.$nd - this._worldElement.position3d.x) + rs.native.to(50);
|
|
s < e && (e = s, t = o)
|
|
}
|
|
}
|
|
return t
|
|
},
|
|
__class__: Mt
|
|
});
|
|
var It = function (t, e) {
|
|
null == e && (e = 0),
|
|
null == t && (t = 0),
|
|
f.call(this),
|
|
this.$nd = t,
|
|
this.$Nd = e
|
|
};
|
|
It.__name__ = !0,
|
|
It.__super__ = f,
|
|
It.prototype = o(f.prototype, {
|
|
get_name: function () {
|
|
return "$Md"
|
|
},
|
|
onStart: function () {
|
|
null == this._worldElement && (this._worldElement = this.owner.$rD),
|
|
f.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this._worldElement && (this._worldElement = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: It
|
|
});
|
|
var Pt = function () {
|
|
dt.call(this, "player_gun_3", {
|
|
x: 0,
|
|
y: -20
|
|
}, .55)
|
|
};
|
|
Pt.__name__ = !0,
|
|
Pt.__super__ = dt,
|
|
Pt.prototype = o(dt.prototype, {
|
|
fire: function () {
|
|
var t = this;
|
|
dt.prototype.fire.call(this);
|
|
for (var e = 0; e < 4; ) {
|
|
var i = function (e) {
|
|
return function (i) {
|
|
if (null == i.$rD)
|
|
return i;
|
|
if (null == i.$RE)
|
|
return i;
|
|
var n = i.$rD;
|
|
i.$RE.flags |= 32,
|
|
n.heading.set__(_i.Right);
|
|
var r = n.position3d,
|
|
o = t._worldElement.position3d;
|
|
r.x = o.x,
|
|
r.y = o.y,
|
|
r.z = o.z;
|
|
r = n.position3d;
|
|
var s = t.$ed.container.position;
|
|
r.x += s.x,
|
|
r.y += s.y,
|
|
n.position3d.x += 15 + e[0] % 2 * 8,
|
|
n.position3d.y -= 12 + 8 * (e[0] / 2 | 0);
|
|
r = n.velocity3d;
|
|
var a,
|
|
h,
|
|
l = t._worldElement.heading._value,
|
|
u = l.x,
|
|
c = l.y,
|
|
p = Pt.bulletSpeed.getValueFromFactor(Math.random());
|
|
return a = u * p,
|
|
h = c * p,
|
|
r.x = a,
|
|
r.y = h,
|
|
n.velocity3d.y += rs.native.range(-60, 60),
|
|
t._game.sounds.playProjectile(3),
|
|
i
|
|
}
|
|
}
|
|
([e++]),
|
|
n = Rn.EComponent(new Mt(this._enemies)),
|
|
r = i(this._game.factory.createProjectile("player_projectile_rocket", 2).add(n));
|
|
this._game.worldPlayerContainer.addEntity(r)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$ED"
|
|
},
|
|
onStart: function () {
|
|
null == this._enemies && (this._enemies = this.owner._internal_getFromParents("$FD")),
|
|
dt.prototype.onStart.call(this)
|
|
},
|
|
__class__: Pt
|
|
});
|
|
var Ot = function () {
|
|
dt.call(this, "player_gun_2", {
|
|
x: 0,
|
|
y: -20
|
|
}, 1)
|
|
};
|
|
Ot.__name__ = !0,
|
|
Ot.__super__ = dt,
|
|
Ot.prototype = o(dt.prototype, {
|
|
fire: function () {
|
|
var t = this;
|
|
dt.prototype.fire.call(this);
|
|
for (var e = 0; e < 5; ) {
|
|
var i,
|
|
n = e++,
|
|
r = [null],
|
|
o = Rn.EComponent(new St(1)),
|
|
s = this._game.factory.createProjectile("projectile_blaster", 2).add(o).add(Rn.EComponent(new Gr(1.5, function (e) {
|
|
return function () {
|
|
var i = e[0].$rD.position3d,
|
|
n = (new On).setTimeScale(rs.native.range(.8, 1.2)),
|
|
r = S.animations.get("bullet_dissolves", S.animationLibraries.get_currentGame()).setXY(i.x, i.y),
|
|
o = u.random(4) * Math.PI / 2;
|
|
r.container.rotation = o;
|
|
var s = n.add(Rn.EArray([Rn.EComponent(r), Rn.EComponent(new Kr)]));
|
|
t._game.worldPlayerContainer.addEntity(s)
|
|
}
|
|
}
|
|
(r))));
|
|
if (null == s.$rD)
|
|
i = s;
|
|
else {
|
|
var a = s.$rD,
|
|
h = a.position3d,
|
|
l = t._worldElement.position3d;
|
|
h.x = l.x,
|
|
h.y = l.y,
|
|
h.z = l.z;
|
|
var c = a.position3d,
|
|
p = t.$ed.container.position;
|
|
c.x += p.x,
|
|
c.y += p.y,
|
|
a.position3d.x += 15,
|
|
a.position3d.y -= 11;
|
|
var d,
|
|
f,
|
|
_ = a.velocity3d,
|
|
m = t._worldElement.heading._value,
|
|
y = m.x,
|
|
g = m.y;
|
|
d = 400 * y,
|
|
f = 400 * g,
|
|
_.x = d,
|
|
_.y = f;
|
|
var v,
|
|
w,
|
|
x = n / 5,
|
|
b = Math.PI / 2 - .3,
|
|
E = b + (.3 + Math.PI / 2 - b) * (x < 0 ? 0 : x > 1 ? 1 : x),
|
|
$ = Math.sin(E),
|
|
A = Math.cos(E),
|
|
T = a.velocity3d;
|
|
v = 400 * $,
|
|
w = 400 * A,
|
|
T.x = v,
|
|
T.y = w,
|
|
t._game.sounds.playProjectile(4),
|
|
i = s
|
|
}
|
|
var C = r[0] = i;
|
|
this._game.worldPlayerContainer.addEntity(C)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$dD"
|
|
},
|
|
__class__: Ot
|
|
});
|
|
var Rt = function (t, e, i) {
|
|
it.call(this, t, e, i)
|
|
};
|
|
Rt.__name__ = !0,
|
|
Rt.__super__ = it,
|
|
Rt.prototype = o(it.prototype, {
|
|
get_name: function () {
|
|
return "$vd"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Rt
|
|
});
|
|
var Dt = function () {
|
|
this.$BD = 0,
|
|
this.$AD = 0,
|
|
this.$aD = 200,
|
|
Rt.call(this, null, !0)
|
|
};
|
|
Dt.__name__ = !0,
|
|
Dt.__super__ = Rt,
|
|
Dt.prototype = o(Rt.prototype, {
|
|
onActivate: function () {
|
|
Rt.prototype.onActivate.call(this);
|
|
var t = this.owner,
|
|
e = [16057380, 16777215],
|
|
i = new Pn;
|
|
if (null != t.$w) {
|
|
var n = t.$w,
|
|
r = new yr(e[0], 1);
|
|
n.container.filters = [r];
|
|
var o = 0;
|
|
i.add(hs.create(t.parent, .1, 100, (function () {
|
|
var t = o += .5;
|
|
r.update(e[(0 | t) % e.length], 1 == r.multiplier ? 0 : 1)
|
|
})));
|
|
var s = t.parent;
|
|
t = (new On).addComponent(new Gr(10.1, (function () {
|
|
n.container.filters = null
|
|
})));
|
|
s.addEntity(t, !0),
|
|
i.add(t)
|
|
}
|
|
this.$Ma.sounds.playerDie(),
|
|
this.$Ma.player.disableGun(),
|
|
this.owner.$JD.filter = Ei.INVINCIBILITY_FILTER,
|
|
this.$uC = this.owner.parent
|
|
},
|
|
onUpdateState: function (t) {
|
|
Rt.prototype.onUpdateState.call(this, t),
|
|
this.$pA(),
|
|
this.$cD(t),
|
|
this.$CD(t)
|
|
},
|
|
$cD: function (t) {
|
|
this.$AD += this.$aD * t,
|
|
this.$rA.playerOffset.y += t * this.$AD
|
|
},
|
|
$PA: function () {
|
|
return "player_move_down"
|
|
},
|
|
$CD: function (t) {
|
|
this.$BD += t,
|
|
this.$BD > .05 && (this.$BD = 0, this.$UC = {
|
|
x: this.$ya.container.x,
|
|
y: this.$ya.container.y
|
|
}, this.$VC(), this.$VC(), this.$VC())
|
|
},
|
|
$VC: function () {
|
|
var t = {
|
|
x: this.$UC.x,
|
|
y: this.$UC.y
|
|
};
|
|
t.x += rs.native.range(-50, 50),
|
|
t.y += rs.native.range(0, 50);
|
|
var e = this.$Ma.factory.createExplosion(ls.randomElement(["explosion_medium", "explosion_medium_02"], rs.native));
|
|
null != e.$w && e.$w.container.position.copyFrom(t),
|
|
this.$uC.addEntity(e)
|
|
},
|
|
keepInState: function () {
|
|
return this.$rA.playerOffset.y < 600
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Zd"
|
|
},
|
|
get_name: function () {
|
|
return "$_D"
|
|
},
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
Rt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
Rt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Dt
|
|
});
|
|
var Lt = function () {
|
|
Rt.call(this, null, !0)
|
|
};
|
|
Lt.__name__ = !0,
|
|
Lt.__super__ = Rt,
|
|
Lt.prototype = o(Rt.prototype, {
|
|
onActivate: function () {
|
|
Rt.prototype.onActivate.call(this),
|
|
this.$rA.playerDied.emit()
|
|
},
|
|
$PA: function () {
|
|
return "player_move_down"
|
|
},
|
|
get_name: function () {
|
|
return "$Zd"
|
|
},
|
|
__class__: Lt
|
|
});
|
|
var kt = function () {};
|
|
kt.__name__ = !0,
|
|
kt.__isInterface__ = !0,
|
|
kt.prototype = {
|
|
__class__: kt
|
|
};
|
|
var Ft = function () {
|
|
this.$yd = {
|
|
x: -54,
|
|
y: 0
|
|
},
|
|
Rt.call(this, "player_blackhole_death", !1)
|
|
};
|
|
Ft.__name__ = !0,
|
|
Ft.__interfaces__ = [kt],
|
|
Ft.__super__ = Rt,
|
|
Ft.prototype = o(Rt.prototype, {
|
|
onActivate: function () {
|
|
Rt.prototype.onActivate.call(this),
|
|
this.$rA.disposeGun(),
|
|
this.owner.$RE.disableCollisions(),
|
|
this.$Ma.sounds.playHitBlackHole(),
|
|
this.owner.$JD.filter = Ei.INVINCIBILITY_FILTER
|
|
},
|
|
onUpdateState: function (t) {
|
|
Rt.prototype.onUpdateState.call(this, t),
|
|
this.$rA.baseSpeedModifier = .2;
|
|
var e = this.data.worldElement.position3d,
|
|
i = this.$rA.levelAnchorPosition,
|
|
n = (u = e.x, c = e.y, u = u - i.x),
|
|
r = c = c - i.y;
|
|
n = u + (i = this.$yd).x,
|
|
r = c + i.y;
|
|
e = this.$rA.playerOffset;
|
|
var o = this.$rA.playerOffset,
|
|
s = 10 * t,
|
|
a = (u = n, c = r, s < 0 ? 0 : s > 1 ? 1 : s),
|
|
h = u = u - o.x,
|
|
l = c = c - o.y;
|
|
h = u * a,
|
|
l = c * a;
|
|
var u,
|
|
c,
|
|
p = u = o.x,
|
|
d = c = o.y;
|
|
p = u + h,
|
|
d = c + l,
|
|
e.x = p,
|
|
e.y = d
|
|
},
|
|
onDeactivate: function () {
|
|
Rt.prototype.onDeactivate.call(this),
|
|
this.data.isSpecialBlackHole ? this.$Ma.owner.$Yd.finish(2) : this.$Ma.owner.$Yd.finish(1),
|
|
this.$ya.container.visible = !1
|
|
},
|
|
get_name: function () {
|
|
return "$Xd"
|
|
},
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
Rt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
Rt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Ft
|
|
});
|
|
var Nt = function () {
|
|
this._smoothMovementSpeed = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
Rt.call(this, null, !0)
|
|
};
|
|
Nt.__name__ = !0,
|
|
Nt.__super__ = Rt,
|
|
Nt.prototype = o(Rt.prototype, {
|
|
onUpdateState: function (t) {
|
|
Rt.prototype.onUpdateState.call(this, t),
|
|
this.$pA(),
|
|
this.$hA.axis1.horizontal._value < 0 ? this.$rA.baseSpeedModifier = 1 : this.$hA.axis1.horizontal._value > 0 ? this.$rA.baseSpeedModifier = 2 : this.$rA.baseSpeedModifier = 1;
|
|
var e,
|
|
i,
|
|
n = this._smoothMovementSpeed,
|
|
r = {
|
|
x: 250,
|
|
y: 350
|
|
},
|
|
o = (e = (l = this.$hA.axis1.value).x, i = l.y, e = e * r.x, i = i * r.y, 15 * t),
|
|
s = (e = e * t, i = i * t, o < 0 ? 0 : o > 1 ? 1 : o),
|
|
a = e = e - n.x,
|
|
h = i = i - n.y;
|
|
a = e * s,
|
|
h = i * s,
|
|
(l = {
|
|
x: n.x,
|
|
y: n.y
|
|
}).x += a,
|
|
l.y += h,
|
|
this._smoothMovementSpeed = l;
|
|
var l = this.$rA.playerOffset,
|
|
u = (r = this._smoothMovementSpeed, {
|
|
x: l.x,
|
|
y: l.y
|
|
});
|
|
u.x += r.x,
|
|
u.y += r.y,
|
|
this.$rA.playerOffset = this.$Wd(u, t)
|
|
},
|
|
$Wd: function (t, e) {
|
|
var i = {
|
|
x: t.x,
|
|
y: t.y
|
|
},
|
|
n = 8 * e;
|
|
if (i.x <= 80) {
|
|
var r = i.x;
|
|
i.x = r + (80 - r) * (n < 0 ? 0 : n > 1 ? 1 : n)
|
|
} else if (i.x >= 500) {
|
|
r = i.x;
|
|
i.x = r + (500 - r) * (n < 0 ? 0 : n > 1 ? 1 : n)
|
|
}
|
|
if (i.y <= -200) {
|
|
r = i.y;
|
|
i.y = r + (-200 - r) * (n < 0 ? 0 : n > 1 ? 1 : n)
|
|
} else if (i.y >= 200) {
|
|
r = i.y;
|
|
i.y = r + (200 - r) * (n < 0 ? 0 : n > 1 ? 1 : n)
|
|
}
|
|
return i
|
|
},
|
|
$PA: function () {
|
|
return this.$hA.axis1.vertical._value < 0 ? "player_move_up" : this.$hA.axis1.vertical._value > 0 ? "player_move_down" : this.$hA.axis1.horizontal._value < 0 ? "player_idle" : this.$hA.axis1.horizontal._value > 0 ? "player_move_left_right" : "player_idle"
|
|
},
|
|
get_name: function () {
|
|
return "$wd"
|
|
},
|
|
onStart: function () {
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
Rt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
Rt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Nt
|
|
});
|
|
var Bt = function () {
|
|
Rt.call(this, "player_move_left_right", !0, 3)
|
|
};
|
|
Bt.__name__ = !0,
|
|
Bt.__super__ = Rt,
|
|
Bt.prototype = o(Rt.prototype, {
|
|
onActivate: function () {
|
|
Rt.prototype.onActivate.call(this),
|
|
this.$Ma.player.disableGun(),
|
|
this.owner.$RE.disableCollisions()
|
|
},
|
|
onUpdateState: function (t) {
|
|
Rt.prototype.onUpdateState.call(this, t),
|
|
this.$rA.baseSpeedModifier += 15 * t
|
|
},
|
|
onDeactivate: function () {
|
|
Rt.prototype.onDeactivate.call(this),
|
|
this.$Ma.endGame()
|
|
},
|
|
get_name: function () {
|
|
return "$Vd"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
Rt.prototype.onStart.call(this)
|
|
},
|
|
__class__: Bt
|
|
});
|
|
var Ut = function () {
|
|
et.call(this)
|
|
};
|
|
Ut.__name__ = !0,
|
|
Ut.__super__ = et,
|
|
Ut.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
var t = this;
|
|
et.prototype.onActivate.call(this);
|
|
var e = this.$Ma.touchUI;
|
|
null != e && e.disable(),
|
|
this.$g_(1.5, (function () {
|
|
var e = t.$Ma.createDialog(0, !0),
|
|
i = Rn.EComponent(new no((function (i) {
|
|
e.$Hf.$A_().animate(1, 0, .1, null, null, 0),
|
|
t.$g_(.1, cs(t, t.deactivate))
|
|
})));
|
|
e.add(Rn.EArray([Rn.EComponent(new uo), i])),
|
|
t.$La.add(e)
|
|
}))
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Yd"
|
|
},
|
|
$g_: function (t, e) {
|
|
var i = this.$La,
|
|
n = this.owner,
|
|
r = t;
|
|
null == t && (r = 0);
|
|
var o = (new On).addComponent(new Gr(r, e));
|
|
return n.addEntity(o, !0),
|
|
i.add(o)
|
|
},
|
|
get_name: function () {
|
|
return "$fB"
|
|
},
|
|
onStart: function () {
|
|
null == this.$FB && (this.$FB = this.owner._internal_getFromParents("$se")),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
__class__: Ut
|
|
});
|
|
var Xt = function () {
|
|
et.call(this)
|
|
};
|
|
Xt.__name__ = !0,
|
|
Xt.__super__ = et,
|
|
Xt.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
et.prototype.onActivate.call(this);
|
|
var t = this.$Ma.touchUI;
|
|
switch (null != t && t.disable(), this.$Ma.gameModel.outcome) {
|
|
case 0:
|
|
this.$Ma.createDialog(1, !1),
|
|
this.$Ma.player.changeStateTo("$Vd", null);
|
|
break;
|
|
case 1:
|
|
this.$Ma.createDialog(2, !1),
|
|
this.$Ma.endGame(2);
|
|
break;
|
|
case 2:
|
|
this.$Ma.endGame()
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$EB"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", V)),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
__class__: Xt
|
|
});
|
|
var jt = function () {
|
|
this.$zd = !1,
|
|
et.call(this)
|
|
};
|
|
jt.__name__ = !0,
|
|
jt.__super__ = et,
|
|
jt.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
et.prototype.onActivate.call(this);
|
|
var t = this.$Ma.touchUI;
|
|
null != t && t.enable(),
|
|
this.$Ma.spawner.isEnabled = !0,
|
|
this.$zd = !1;
|
|
var e = cs(this, this.finish);
|
|
this.$La.add(this.$Ma.player.playerDied.connect((function () {
|
|
e(1)
|
|
})))
|
|
},
|
|
onDeactivate: function () {
|
|
this.$Ma.spawner.isEnabled = !1,
|
|
et.prototype.onDeactivate.call(this)
|
|
},
|
|
onUpdateState: function (t) {
|
|
if (3 == this.$Ma.spawner.$ub.length && !this.$zd) {
|
|
var e = this.$Ma.spawnMargin * this.$Ma.chunkUnitSize;
|
|
this.$Ma.worldElementContainer.parent.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get("game1_big_planet", S.animationLibraries.get_currentGame()).setXY(this.$Ma.worldElementLayer.viewportRight._value + e, 290))])))),
|
|
this.$zd = !0
|
|
}
|
|
0 == this.$Ma.spawner.$ub.length && 0 == this.$Ma.enemyList.activeEnemies.length && this.finish(0)
|
|
},
|
|
finish: function (t) {
|
|
this.$Ma.finishLevel(t),
|
|
this.$la = !1
|
|
},
|
|
getNextStateName: function () {
|
|
return "$EB"
|
|
},
|
|
get_name: function () {
|
|
return "$Yd"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onAdded.call(this)
|
|
},
|
|
__class__: jt
|
|
});
|
|
var Vt = function (t) {
|
|
this.useLayerIndex = !1,
|
|
f.call(this),
|
|
this.container = null != t ? t : new PIXI.Container
|
|
};
|
|
Vt.__name__ = !0,
|
|
Vt.render = function (t, e) {
|
|
var i = t.$w;
|
|
null != i && e.render(i.container)
|
|
},
|
|
Vt.__super__ = f,
|
|
Vt.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
f.prototype.onStart.call(this),
|
|
this.reparentContainer()
|
|
},
|
|
onStop: function () {
|
|
null != this.container.parent && this.container.parent.removeChild(this.container),
|
|
f.prototype.onStop.call(this)
|
|
},
|
|
reparentContainer: function () {
|
|
if (null != this.owner.parent) {
|
|
var t = this.owner.parent._internal_getFromParents("$w");
|
|
if (null != t) {
|
|
var e = this.owner.layerIndex;
|
|
this.useLayerIndex && e <= t.container.children.length ? t.container.addChildAt(this.container, e) : t.container.addChild(this.container)
|
|
}
|
|
}
|
|
},
|
|
setXY: function (t, e) {
|
|
return this.container.position.set(t, e),
|
|
this
|
|
},
|
|
setAlpha: function (t) {
|
|
return this.container.alpha = t,
|
|
this
|
|
},
|
|
dispose: function () {
|
|
this.container.destroy(),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$w"
|
|
},
|
|
__class__: Vt
|
|
});
|
|
var Ht = function () {};
|
|
Ht.__name__ = !0,
|
|
Ht.__isInterface__ = !0,
|
|
Ht.prototype = {
|
|
__class__: Ht
|
|
};
|
|
var Gt = function () {
|
|
this.button4Down = new Ln(!1),
|
|
this.button3Down = new Ln(!1),
|
|
this.button2Down = new Ln(!1),
|
|
this.button1Down = new Ln(!1),
|
|
this.axisDirection = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
Vt.call(this)
|
|
};
|
|
Gt.__name__ = !0,
|
|
Gt.__interfaces__ = [Ht],
|
|
Gt.__super__ = Vt,
|
|
Gt.prototype = o(Vt.prototype, {
|
|
enable: function () {
|
|
this.container.visible = !0
|
|
},
|
|
disable: function () {
|
|
this.container.visible = !1
|
|
},
|
|
__class__: Gt
|
|
});
|
|
var Yt = function (t, e, i) {
|
|
null == i && (i = 120),
|
|
null == e && (e = 55),
|
|
null == t && (t = 30),
|
|
this.$ie = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$Ge = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$a = new Pn,
|
|
Gt.call(this),
|
|
this.$fe = t,
|
|
this.$Fe = e,
|
|
this.$ge = i
|
|
};
|
|
Yt.__name__ = !0,
|
|
Yt.__super__ = Gt,
|
|
Yt.prototype = o(Gt.prototype, {
|
|
onAdded: function () {
|
|
Gt.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$ya = new Vt), Rn.EComponent(new So(To.fromString("100%"), To.fromString("100%"))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$he = (new yn).setHitArea(0, 0, 2e3, 2e3)), Rn.EComponent(new ro(cs(this, this.$Ie), !1)), Rn.EComponent(new oo(cs(this, this.$je), !1)), Rn.EComponent(new So(Oo.Relative(2e3), Oo.Relative(2e3), To.fromString("40%"), To.fromString("50%"), To.fromString("100%"), To.fromString("50%")))]))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$He = new Xi(Math.round(this.$Fe))), Rn.EComponent(new So(Oo.Relative(120), Oo.Relative(120), To.fromString("100"), To.fromString("100% - 100")))]))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$Ya = new Ui(this.$ge).setHitArea(-150, -150, 300, 300)), Rn.EEntity((new On).add(Rn.EComponent(S.animations.get("button_shoot", S.animationLibraries.get_currentGame())))), Rn.EComponent(new So(Oo.Relative(this.$ge), Oo.Relative(this.$ge), To.fromString("100% - 100"), To.fromString("100% - 100")))])))])))),
|
|
this.$a.add(this.$he.isDown.watch(cs(this, this.$Je)));
|
|
var t = this.$Ya.isDown,
|
|
e = function (t, e) {
|
|
return t
|
|
},
|
|
i = new Ln(e(t._value, t._value));
|
|
t.get_changed().connect((function (t, n) {
|
|
i.set__(e(t))
|
|
})),
|
|
this.button1Down = i
|
|
},
|
|
$Ie: function (t) {
|
|
this.$Ge = t.data.getLocalPosition(this.$ya.container),
|
|
this.$Ge.x = Math.max(2 * this.$fe, this.$Ge.x),
|
|
this.$He.setXY(this.$Ge.x, this.$Ge.y),
|
|
this.$je(t)
|
|
},
|
|
$je: function (t) {
|
|
if (this.$he.isDown._value && (t.data.getLocalPosition(this.$he.container, this.$ie), this.$ie.x < 2e3)) {
|
|
var e = t.data.getLocalPosition(this.$ya.container),
|
|
i = this.$Ge,
|
|
n = {
|
|
x: e.x,
|
|
y: e.y
|
|
};
|
|
n.x -= i.x,
|
|
n.y -= i.y;
|
|
var r = n,
|
|
o = Math.min(1, Math.sqrt(r.x * r.x + r.y * r.y) / this.$fe),
|
|
s = $o.angle(r);
|
|
r.x = o * Math.cos(s),
|
|
r.y = o * Math.sin(s),
|
|
(e = this.$He.direction).x = r.x,
|
|
e.y = r.y
|
|
}
|
|
},
|
|
$Je: function (t, e) {
|
|
if (!t) {
|
|
var i = this.$He.direction;
|
|
i.x = 0,
|
|
i.y = 0
|
|
}
|
|
},
|
|
onUpdate: function (t) {
|
|
Gt.prototype.onUpdate.call(this, t);
|
|
var e = this.axisDirection,
|
|
i = this.$He.direction;
|
|
e.x = i.x,
|
|
e.y = i.y
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
Gt.prototype.dispose.call(this)
|
|
},
|
|
__class__: Yt
|
|
});
|
|
var Wt = function (t, e) {
|
|
this.$Ea = [],
|
|
this.$ea = _i.Right,
|
|
this.pewSlugs = [],
|
|
this.boxingSlugs = [],
|
|
this.cyclopsSlugs = [],
|
|
this.slugs = [],
|
|
B.call(this, new zt, t, e);
|
|
var i = 50,
|
|
n = i - 950;
|
|
this.$Ea.push(new rt(n, i)),
|
|
n += 1300,
|
|
i += 1300,
|
|
this.$Ea.push(new rt(n, i)),
|
|
n += 1300,
|
|
i += 1300,
|
|
this.$Ea.push(new rt(n, i)),
|
|
n += 1300,
|
|
i += 1300,
|
|
this.$Ea.push(new rt(n, i)),
|
|
n += 1300,
|
|
i += 1300
|
|
};
|
|
Wt.__name__ = !0,
|
|
Wt.__super__ = B,
|
|
Wt.prototype = o(B.prototype, {
|
|
onAdded: function () {
|
|
B.prototype.onAdded.call(this),
|
|
this.worldProjection.matrix.scale(1, -1),
|
|
this.worldProjection.zToXYProjection.x = -30,
|
|
this.worldProjection.zToXYProjection.y = 25,
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new ge), Rn.EComponent(new we), Rn.EComponent(new ve), Rn.EComponent(this.sounds = new qt)]))
|
|
},
|
|
onStart: function () {
|
|
B.prototype.onStart.call(this),
|
|
PIXI.utils.isMobile.any && this.addTouchUI(new xe),
|
|
this.camera.lockY = !0,
|
|
this.camera.offset.x.set__(-75),
|
|
this.camera.setBounds(0, 0, 179769313486231e294, 179769313486231e294),
|
|
this.camera.smoothTimeX = .4,
|
|
this.createVignette(190),
|
|
this.$Ga(),
|
|
this.$ha(),
|
|
this.$Ha(),
|
|
this.$ga(),
|
|
this.$fa(),
|
|
this.changeStateTo("$Oa", null)
|
|
},
|
|
$fa: function () {
|
|
for (var t = 0, e = this.$Ea; t < e.length; ) {
|
|
var i = [e[t]];
|
|
++t;
|
|
var n = function (t, e) {
|
|
return function (i) {
|
|
if (null == i.$rD)
|
|
return i;
|
|
if (null == i.$Wc)
|
|
return i;
|
|
var n = i.$rD;
|
|
return i.$Wc.autoUpdate = !1,
|
|
n.position3d.x = e[0]._from,
|
|
n.position3d.z = t[0],
|
|
i
|
|
}
|
|
}
|
|
([1.4], i)(this.factory.createGrass("grass_lane1", i[0]._size));
|
|
this.worldElementContainer.add(Rn.EEntity(n));
|
|
var r = function (t, e) {
|
|
return function (i) {
|
|
if (null == i.$rD)
|
|
return i;
|
|
if (null == i.$Wc)
|
|
return i;
|
|
var n = i.$rD;
|
|
return i.$Wc.autoUpdate = !1,
|
|
n.position3d.x = e[0]._from,
|
|
n.position3d.z = t[0],
|
|
i
|
|
}
|
|
}
|
|
([.4], i)(this.factory.createGrass("grass_lane2", i[0]._size));
|
|
this.worldElementContainer.add(Rn.EEntity(r));
|
|
var o = function (t, e) {
|
|
return function (i) {
|
|
if (null == i.$rD)
|
|
return i;
|
|
if (null == i.$Wc)
|
|
return i;
|
|
var n = i.$rD;
|
|
return i.$Wc.autoUpdate = !1,
|
|
n.position3d.x = e[0]._from,
|
|
n.position3d.z = t[0],
|
|
i
|
|
}
|
|
}
|
|
([ - .6], i)(this.factory.createGrass("grass_lane3", i[0]._size));
|
|
this.worldElementContainer.add(Rn.EEntity(o))
|
|
}
|
|
},
|
|
addSlug: function (t) {
|
|
this.slugs.push(t);
|
|
var e = t.$Aa;
|
|
switch ((e instanceof Ii ? e : null).type) {
|
|
case "slug_boxing":
|
|
this.boxingSlugs.push(t);
|
|
break;
|
|
case "slug_cyclops":
|
|
this.cyclopsSlugs.push(t);
|
|
break;
|
|
case "slug_pew":
|
|
this.pewSlugs.push(t)
|
|
}
|
|
},
|
|
removeSlug: function (t) {
|
|
a.remove(this.slugs, t),
|
|
a.remove(this.boxingSlugs, t),
|
|
a.remove(this.cyclopsSlugs, t),
|
|
a.remove(this.pewSlugs, t)
|
|
},
|
|
$ga: function () {
|
|
this.owner._internal_getFromParents("$se").top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite("healthbar", S.animationLibraries.get_currentGame())), Rn.EComponent(new Ni(this.playerEntity.$qD.value)), Rn.EComponent(new So(Oo.Relative(0), Oo.Relative(0), Oo.Relative(20), Oo.Relative(10)))]))))
|
|
},
|
|
$Ga: function () {
|
|
var t = new mi,
|
|
e = .5 * (650 - this.sceneWidth);
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(this.sky = new ye)])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(.88, 1).setCameraOffset(e, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("back_far")), t))])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(1, 1).setViewOffset(0, this.sceneHeight - 57)), Rn.EEntity(this.tripGasContainer = (new On).add(Rn.EArray([Rn.EComponent(new Yi)])))])))),
|
|
this.containers.bottom.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(1, 1).setCameraOffset(e + 350, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("rocks")), t))])))),
|
|
this.containers.mid.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(1, 1).setCameraOffset(e + 650, 0)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("lanes")), t))])))),
|
|
this.containers.mid.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(1, 1, "shadow_puddle").setViewOffset(0, this.sceneHeight - 57)), Rn.EEntity(this.puddleContainer = (new On).add(Rn.EComponent(new Vt))), Rn.EEntity(this.bombTargetContainer = (new On).add(Rn.EComponent(new Vt))), Rn.EEntity(this.shadowContainer = (new On).add(Rn.EComponent(new Vt)))])))),
|
|
this.containers.top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(this.worldElementLayer = new li(1, 1, "worldElement").setViewOffset(0, this.sceneHeight - 57)), Rn.EEntity(this.worldElementContainer = (new On).add(Rn.EArray([Rn.EComponent(new Yi)])))]))))
|
|
},
|
|
$ha: function () {
|
|
var t = this;
|
|
return this.playerEntity = function (e) {
|
|
if (null == ((i = e.$Aa)instanceof le ? i : null))
|
|
return e;
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$w)
|
|
return e;
|
|
var i,
|
|
n = (i = e.$Aa)instanceof le ? i : null,
|
|
r = e.$rD,
|
|
o = e.$w;
|
|
return t.player = n,
|
|
t.playerWorldElement = r,
|
|
t.playerDisplay = o,
|
|
r.position3d.x = -75,
|
|
e
|
|
}
|
|
(this.factory.createPlayer()),
|
|
this.worldElementContainer.add(Rn.EEntity(this.playerEntity)),
|
|
this.playerEntity
|
|
},
|
|
$Ha: function () {
|
|
this.spawner = new Jt(this.worldElementLayer.viewportRight, _i.Left),
|
|
this.spawner.offset.x = this.spawnMargin * this.chunkUnitSize * .25,
|
|
this.worldElementContainer.addEntity((new On).add(Rn.EComponent(this.spawner)))
|
|
},
|
|
$ia: function (t) {
|
|
for (var e = Un.assets.getJson(S.files.json.manifest.fileNames[0]), i = 0; i < e.length; ) {
|
|
var n = e[i];
|
|
if (++i, n.id == t)
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
onUpdate: function (t) {
|
|
B.prototype.onUpdate.call(this, t),
|
|
this.camera.target.x = this.playerWorldElement.position3d.x
|
|
},
|
|
$da: function () {
|
|
B.prototype.$da.call(this)
|
|
},
|
|
__class__: Wt
|
|
});
|
|
var zt = function () {
|
|
f.call(this)
|
|
};
|
|
zt.__name__ = !0,
|
|
zt.__interfaces__ = [H],
|
|
zt.__super__ = f,
|
|
zt.prototype = o(f.prototype, {
|
|
create: function (t, e) {
|
|
return new On
|
|
},
|
|
createPlayer: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer("player_idle", S.animationLibraries.get_currentGame()))]))), Rn.EComponent(new le), Rn.EComponent(new Ci), Rn.EComponent(new Ei), Rn.EComponent(new xi(100).setMaxHealth(100)), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new Ee("shadow_large")), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite("player_colliders", S.animationLibraries.get_currentGame(), null, 1, 0))]))
|
|
},
|
|
createProjectile: function (t, e) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame()))]))), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new Ee("shadow_medium")), Rn.EComponent(new Li(1, 250)), Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), 1, 4, e).setFilterFlagsMethod(No.Inclusive))]))
|
|
},
|
|
createEnemy: function (t, e) {
|
|
var i,
|
|
n = new On,
|
|
r = Rn.EComponent(new Vt),
|
|
o = Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer(null, S.animationLibraries.get_currentGame()))]))),
|
|
s = Rn.EComponent(new Gi),
|
|
a = Rn.EComponent(new Wi(!0)),
|
|
h = Rn.EComponent(new Ee("shadow_large")),
|
|
l = Rn.EComponent(new xi(100)),
|
|
u = Rn.EComponent(new Ii(t, e));
|
|
switch (e) {
|
|
case "slug_boxing":
|
|
i = Rn.EComponent(new ie);
|
|
break;
|
|
case "slug_cyclops":
|
|
i = Rn.EComponent(new ne);
|
|
break;
|
|
case "slug_pew":
|
|
i = Rn.EComponent(new re);
|
|
break;
|
|
default:
|
|
i = null
|
|
}
|
|
return n.add(Rn.EArray([r, o, s, a, h, l, u, i, Rn.EComponent(new Ei), Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), null, 2, 0))]))
|
|
},
|
|
createPickup: function (t, e) {
|
|
return null
|
|
},
|
|
createExplosion: function (t) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame())), Rn.EComponent(new Kr), Rn.EComponent(new Gi), Rn.EComponent(new Wi(rs.native._random.next() <= .5))]))
|
|
},
|
|
createPuddle: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer(null, S.animationLibraries.get_currentGame())), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new he)]))
|
|
},
|
|
createPuddleParticle: function () {
|
|
var t = new On,
|
|
e = Rn.EComponent(new Vt),
|
|
i = Rn.EEntity((new On).add(Rn.EComponent(S.animations.getMovieSpritePlayer(null, S.animationLibraries.get_currentGame()))).setTimeScale(rs.native.range(.7, 1.5))),
|
|
n = new Gi,
|
|
r = rs.native._random.next() > .5 ? _i.Left : _i.Right;
|
|
return n.heading.set__(r),
|
|
t.add(Rn.EArray([e, i, Rn.EComponent(n), Rn.EComponent(new Wi)]))
|
|
},
|
|
createGasCloud: function (t) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new ae(t))]))
|
|
},
|
|
createGasCloudParticle: function () {
|
|
var t = new On,
|
|
e = Rn.EComponent(new Vt),
|
|
i = Rn.EEntity((new On).add(Rn.EComponent(S.animations.getMovieSpritePlayer(null, S.animationLibraries.get_currentGame()).setAlpha(.75))).setTimeScale(rs.native.range(.7, 1.5))),
|
|
n = new Gi,
|
|
r = rs.native._random.next() > .5 ? _i.Left : _i.Right;
|
|
return n.heading.set__(r),
|
|
t.add(Rn.EArray([e, i, Rn.EComponent(n), Rn.EComponent(new Wi)]))
|
|
},
|
|
createBottle: function (t) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(S.animations.get("bottle", S.animationLibraries.get_currentGame())), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new Ee("shadow_medium")), Rn.EComponent(new se(t))]))
|
|
},
|
|
createBomb: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(S.animations.get("nuke", S.animationLibraries.get_currentGame())), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new Ee("shadow_medium")), Rn.EComponent(new oe)]))
|
|
},
|
|
createBombTarget: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(S.animations.get("target", S.animationLibraries.get_currentGame())), Rn.EComponent(new Gi), Rn.EComponent(new Wi(!1, !1))]))
|
|
},
|
|
createGrass: function (t, e) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new be(t, e))]))
|
|
},
|
|
get_name: function () {
|
|
return "$AA"
|
|
},
|
|
__class__: zt
|
|
});
|
|
var qt = function () {
|
|
Y.call(this)
|
|
};
|
|
qt.__name__ = !0,
|
|
qt.__super__ = Y,
|
|
qt.prototype = o(Y.prototype, {
|
|
playProjectile: function () {
|
|
Un.get_soundManager().play(ls.randomElement(qt.projectileSounds, rs.native), 1)
|
|
},
|
|
playExplosion: function (t) {
|
|
switch (t) {
|
|
case 0:
|
|
var e = S.sounds.game2.EXPLOSION;
|
|
Un.get_soundManager().play(e, 1);
|
|
break;
|
|
case 1:
|
|
e = S.sounds.game2.EXPLOSION_ACID;
|
|
Un.get_soundManager().play(e, 1)
|
|
}
|
|
},
|
|
playerMove: function (t) {
|
|
if (t) {
|
|
var e = S.sounds.game2.PLAYER_MOVES_UP;
|
|
Un.get_soundManager().play(e, 1)
|
|
} else {
|
|
e = S.sounds.game2.PLAYER_MOVES_DOWN;
|
|
Un.get_soundManager().play(e, 1)
|
|
}
|
|
},
|
|
playerDie: function () {
|
|
var t = S.sounds.game2.PLAYER_DIES;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
slugShoot: function () {
|
|
var t = S.sounds.game2.SLUG_PEW_SHOOT;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
slugPunchLoop: function () {
|
|
var t = S.sounds.game2.SLUG_PUNCHES_LOOP;
|
|
return null != Un.get_soundManager().sounds.h.__keys__[t.__id__] ? Un.get_soundManager().loop(t, 1) : null
|
|
},
|
|
slugThrow: function () {
|
|
var t = S.sounds.game2.FALLING_BOMB_LOOP;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
bombFall: function () {
|
|
var t = S.sounds.game2.FALLING_BOMB_LOOP;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
__class__: qt
|
|
});
|
|
var Jt = function (t, e) {
|
|
this.$Vb = 0,
|
|
this.$vb = [-1, 0, 1],
|
|
this.$Ub = new as(1),
|
|
this.offset = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.hasStarted = !1,
|
|
f.call(this),
|
|
this.$tb = t,
|
|
this.$Tb = e
|
|
};
|
|
Jt.__name__ = !0,
|
|
Jt.__super__ = f,
|
|
Jt.prototype = o(f.prototype, {
|
|
setWave: function (t) {
|
|
this.$ub = t
|
|
},
|
|
setSpawnInterval: function (t) {
|
|
this.$Ub.reset(t)
|
|
},
|
|
start: function () {
|
|
this.hasStarted = !0
|
|
},
|
|
stop: function () {
|
|
this.hasStarted = !1
|
|
},
|
|
insertInWave: function (t, e) {
|
|
this.$ub.length <= e ? this.$ub.push([t]) : this.$ub.splice(e, 0, [t])
|
|
},
|
|
$wb: function () {
|
|
for (var t = this.$ub.shift(), e = 0; e < t.length; ) {
|
|
var i = t[e],
|
|
n = e++,
|
|
r = t.length > 1 ? n - 1 : null;
|
|
"-" != i && ("R" == i ? this.$Xb(r) : this.$xb(this.$Wb(i), r))
|
|
}
|
|
},
|
|
$Wb: function (t) {
|
|
switch (t) {
|
|
case "B":
|
|
return "slug_boxing";
|
|
case "C":
|
|
return 0 == this.$Ma.cyclopsSlugs.length ? "slug_cyclops" : 0 == this.$Ma.pewSlugs.length ? "slug_pew" : "slug_boxing";
|
|
case "P":
|
|
return this.$Ma.pewSlugs.length < 2 ? "slug_pew" : 0 == this.$Ma.cyclopsSlugs.length ? "slug_cyclops" : "slug_boxing";
|
|
default:
|
|
throw Dr.thrown("Wave item with identifier " + t + " is not a slug")
|
|
}
|
|
},
|
|
$xb: function (t, e) {
|
|
var i = this.$vb.slice();
|
|
if ("slug_boxing" == t)
|
|
null == e && a.remove(i, this.$Vb);
|
|
else {
|
|
for (var n = 0, r = this.$Ma.cyclopsSlugs; n < r.length; )
|
|
a.remove(i, Math.round(r[n++].$rD.position3d.z));
|
|
for (n = 0, r = this.$Ma.pewSlugs; n < r.length; )
|
|
a.remove(i, Math.round(r[n++].$rD.position3d.z))
|
|
}
|
|
var o = i.length > 0;
|
|
null != e ? o && -1 == i.indexOf(e) && (e = rs.native.fromArray(i)) : e = o ? rs.native.fromArray(i) : rs.native.fromArray(this.$vb),
|
|
this.$Vb = e;
|
|
var s,
|
|
h = this.$tb._value + this.offset.x,
|
|
l = e + .01;
|
|
if (null != (s = this.$Ma.factory.createEnemy(t, t)).$rD) {
|
|
var u = s.$rD,
|
|
c = u.position3d;
|
|
c.x = h,
|
|
c.y = 0,
|
|
c.z = null == l ? 0 : l,
|
|
u.heading.set__(this.$Tb)
|
|
}
|
|
this.$Ma.addSlug(s),
|
|
this.$Ma.worldElementContainer.addEntity(s, !1)
|
|
},
|
|
$Xb: function (t) {
|
|
null == t && (t = rs.native.fromArray([-1, 0, 1]));
|
|
var e,
|
|
i = this.$Ma.factory.createBomb();
|
|
if (null == i.$rD)
|
|
e = i;
|
|
else {
|
|
var n = i.$rD;
|
|
n.position3d.x = this.$Ma.player.$dA.position3d.x,
|
|
n.position3d.y = 500,
|
|
n.position3d.z = t,
|
|
e = i
|
|
}
|
|
this.$Ma.worldElementContainer.addEntity(e)
|
|
},
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), this.hasStarted) {
|
|
var e = this.$Ub;
|
|
e.isEnabled && e.time <= 0 || !this.$Ub.update(t) || (this.$ub.length > 0 && this.$wb(), this.$Ub.reset())
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$Rb"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
null == this.$sb && (this.$sb = this.owner._internal_getFromParents("$hE")),
|
|
f.prototype.onStart.call(this)
|
|
},
|
|
__class__: Jt
|
|
});
|
|
var Kt = function () {
|
|
nt.call(this, "punch", !0)
|
|
};
|
|
Kt.__name__ = !0,
|
|
Kt.__super__ = nt,
|
|
Kt.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this);
|
|
var t = this.$Ma.sounds.slugPunchLoop();
|
|
null != t && this.$La.add(t),
|
|
this.$La.add(this.$qb.currentLabel.watch(cs(this, this.$Qb)))
|
|
},
|
|
$Qb: function (t, e) {
|
|
this.$zb(),
|
|
this.$Yb.shakeItBaby(5, .05, 0, !1)
|
|
},
|
|
$zb: function () {
|
|
this.$Ma.playerEntity.$JD.hit(5)
|
|
},
|
|
get_name: function () {
|
|
return "$yb"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$qb && (this.$qb = this.owner.$Zb),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
null == this.$Yb && (this.$Yb = this.owner._internal_getFromParents("$pe")),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$qb && (this.$qb = this.owner.$Zb),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Kt
|
|
});
|
|
var Zt = function () {
|
|
this.$DA = Ao.empty(),
|
|
this.$ob = !1,
|
|
this.$Nb = 0,
|
|
nt.call(this, "shoot")
|
|
};
|
|
Zt.__name__ = !0,
|
|
Zt.__super__ = nt,
|
|
Zt.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this);
|
|
var t = this.$dA.position3d;
|
|
this.$DA = {
|
|
x: t.x,
|
|
y: t.y,
|
|
z: t.z
|
|
},
|
|
this.$DA.x -= 30,
|
|
this.$DA.y = 30,
|
|
this.$ob = !0,
|
|
this.$Nb = 3,
|
|
this.$Ob()
|
|
},
|
|
$Ob: function () {
|
|
var t = this;
|
|
this.$Nb--;
|
|
var e = function (e) {
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$iD)
|
|
return e;
|
|
var i = e.$rD,
|
|
n = e.$iD,
|
|
r = i.position3d,
|
|
o = t.$DA;
|
|
return r.x = o.x,
|
|
r.y = o.y,
|
|
r.z = o.z,
|
|
i.position3d.z += .01,
|
|
i.velocity3d.x = -150,
|
|
n.hitPoints = 5,
|
|
n.maxRange = 500,
|
|
e
|
|
}
|
|
(this.$Ma.factory.createProjectile("projectile_pew", 1));
|
|
e._internal_getFromChildren("$w", br).owner.add(Rn.EComponent(new Zr)),
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(e)),
|
|
this.$Ma.sounds.slugShoot()
|
|
},
|
|
$qA: function () {
|
|
this.$Nb > 0 ? (this.$pA(), this.$Ob()) : this.$ob = !1
|
|
},
|
|
keepInState: function () {
|
|
return this.$ob
|
|
},
|
|
getNextStateName: function () {
|
|
return "$qC"
|
|
},
|
|
get_name: function () {
|
|
return "$nb"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Zt
|
|
});
|
|
var Qt = function () {
|
|
nt.call(this, "throw")
|
|
};
|
|
Qt.__name__ = !0,
|
|
Qt.__super__ = nt,
|
|
Qt.prototype = o(nt.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$qb && (this.$qb = this.owner.$Zb),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
this.$La.add(this.$qb.currentLabel.watch(cs(this, this.$Qb)))
|
|
},
|
|
$Qb: function (t, e) {
|
|
"throw" == t && this.$rb()
|
|
},
|
|
$rb: function () {
|
|
var t,
|
|
e = (r = this.$dA.position3d).x,
|
|
i = r.z;
|
|
r.y;
|
|
t = e - 20;
|
|
var n = {
|
|
x: (r = this.$Ma.playerWorldElement.position3d).x,
|
|
y: r.y,
|
|
z: r.z
|
|
};
|
|
n.y = 0,
|
|
n.z = Math.round(n.z);
|
|
var r,
|
|
o = this.$Ma.factory.createBottle(n);
|
|
(r = o.$rD.position3d).x = t,
|
|
r.y = 90,
|
|
r.z = i,
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(o)),
|
|
this.$Ma.sounds.slugThrow()
|
|
},
|
|
getNextStateName: function () {
|
|
return "$qC"
|
|
},
|
|
get_name: function () {
|
|
return "$Pb"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$qb && (this.$qb = this.owner.$Zb),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Qt
|
|
});
|
|
var te = {
|
|
toWaveItem: function (t) {
|
|
switch (t) {
|
|
case "slug_boxing":
|
|
return "B";
|
|
case "slug_cyclops":
|
|
return "C";
|
|
case "slug_pew":
|
|
return "P"
|
|
}
|
|
}
|
|
},
|
|
ee = function (t) {
|
|
this.$a = new Pn,
|
|
f.call(this),
|
|
this.$kb = t
|
|
};
|
|
ee.__name__ = !0,
|
|
ee.__super__ = f,
|
|
ee.prototype = o(f.prototype, {
|
|
$Jb: function () {
|
|
return this.$Ma.player.isAlive._value
|
|
},
|
|
onAdded: function () {
|
|
null == this.$jb && (this.$jb = this.owner.$Aa),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Ri), Rn.EComponent(new wt)])),
|
|
this.$dA.heading.set__(_i.Left),
|
|
this.$HA.value.set__(this.$kb.health),
|
|
this.$jb.fallbackStateName = "$Zc"
|
|
},
|
|
onStart: function () {
|
|
null == this.$jb && (this.$jb = this.owner.$Aa),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
f.prototype.onStart.call(this),
|
|
this.$db = this.$Ma.playerEntity.$rD,
|
|
this.$a.add(this.owner.$qD.value.watch(cs(this, this.$lb)))
|
|
},
|
|
$lb: function (t, e) {
|
|
if (0 == t) {
|
|
var i,
|
|
n = this.$Ma.factory.createExplosion("big_explosion");
|
|
if (null == n.$rD)
|
|
i = n;
|
|
else {
|
|
var r = n.$rD.position3d,
|
|
o = this.$dA.position3d;
|
|
r.x = o.x,
|
|
r.y = o.y,
|
|
r.z = o.z,
|
|
i = n
|
|
}
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(i)),
|
|
this.owner._internal_getFromParents("$pe").shakeItBaby(20, .3, 1),
|
|
this.$Ma.sounds.playExplosion(0),
|
|
this.$Ma.removeSlug(this.owner)
|
|
}
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
(f.prototype.onUpdate.call(this, t), this.$Jb()) ? ("$Zc" == (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) && (this.$dA.position3d.x -= this.$kb.speed * t), this.$Kb = this.$dA.position3d.x - this.$Ma.playerWorldElement.position3d.x, this.$Kb < -120 && (this.owner.add(Rn.EComponent(new Gr)), this.$Ma.spawner.insertInWave(te.toWaveItem(Vr.__cast(this.$jb.type, String)), 3), this.$Ma.removeSlug(this.owner))) : "$qC" != (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) && this.$jb.changeStateTo("$qC", null)
|
|
},
|
|
get_name: function () {
|
|
return "$Ib"
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: ee
|
|
});
|
|
var ie = function () {
|
|
ee.call(this, {
|
|
health: 4,
|
|
speed: 125
|
|
})
|
|
};
|
|
ie.__name__ = !0,
|
|
ie.__super__ = ee,
|
|
ie.prototype = o(ee.prototype, {
|
|
onAdded: function () {
|
|
ee.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Kt), Rn.EComponent(new Qr)]))
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
(ee.prototype.onUpdate.call(this, t), this.$Jb()) && (this.$Kb < 50 && this.$Kb > 20 && Math.abs(this.$dA.position3d.z - this.$Ma.playerWorldElement.position3d.z) < .1 ? "$Zc" == (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) && this.$jb.changeStateTo("$yb", null) : "$Zc" != (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) && this.$jb.changeStateTo("$Zc", null))
|
|
},
|
|
__class__: ie
|
|
});
|
|
var ne = function () {
|
|
this.$pb = new as(5),
|
|
ee.call(this, {
|
|
health: 3,
|
|
speed: 100
|
|
})
|
|
};
|
|
ne.__name__ = !0,
|
|
ne.__super__ = ee,
|
|
ne.prototype = o(ee.prototype, {
|
|
onAdded: function () {
|
|
ee.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Qt), Rn.EComponent(new Qr)]))
|
|
},
|
|
throwBottle: function () {
|
|
this.$jb.changeStateTo("$Pb", null)
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
(ee.prototype.onUpdate.call(this, t), this.$Jb()) && ("$Zc" == (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) ? this.$Kb < 290 && this.throwBottle() : "$qC" == (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) && this.$pb.update(t) && (this.throwBottle(), this.$pb.reset()))
|
|
},
|
|
__class__: ne
|
|
});
|
|
var re = function () {
|
|
this.$Lb = new as(2),
|
|
ee.call(this, {
|
|
health: 3,
|
|
speed: 100
|
|
})
|
|
};
|
|
re.__name__ = !0,
|
|
re.__super__ = ee,
|
|
re.prototype = o(ee.prototype, {
|
|
onAdded: function () {
|
|
ee.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Zt)]))
|
|
},
|
|
shoot: function () {
|
|
this.$jb.changeStateTo("$nb", null)
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
(ee.prototype.onUpdate.call(this, t), this.$Jb()) && ("$Zc" == (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) ? this.$Kb < 250 && this.shoot() : "$qC" == (null != (e = this.$jb).currentState ? e.currentState.get_name() : null) && this.$Lb.update(t) && (this.shoot(), this.$Lb.reset()))
|
|
},
|
|
__class__: re
|
|
});
|
|
var oe = function () {
|
|
this.$GA = !1,
|
|
f.call(this)
|
|
};
|
|
oe.__name__ = !0,
|
|
oe.__super__ = f,
|
|
oe.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
f.prototype.onStart.call(this);
|
|
var t,
|
|
e = this.$Ma.factory.createBombTarget();
|
|
if (null == e.$rD)
|
|
t = e;
|
|
else {
|
|
var i = e.$rD,
|
|
n = i.position3d,
|
|
r = this.$dA.position3d;
|
|
n.x = r.x,
|
|
n.y = r.y,
|
|
n.z = r.z,
|
|
i.position3d.y = 0,
|
|
t = e
|
|
}
|
|
this.$gA = t,
|
|
this.$Ma.bombTargetContainer.add(Rn.EEntity(this.$gA)),
|
|
this.$Ma.sounds.bombFall()
|
|
},
|
|
$fA: function () {
|
|
this.$gA.addComponent(new Gr),
|
|
this.owner.addComponent(new Gr);
|
|
var t,
|
|
e = this.$Ma.factory.createGasCloud();
|
|
if (null == e.$rD)
|
|
t = e;
|
|
else {
|
|
var i = e.$rD.position3d,
|
|
n = this.$dA.position3d;
|
|
i.x = n.x,
|
|
i.y = n.y,
|
|
i.z = n.z,
|
|
t = e
|
|
}
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(t)),
|
|
this.owner._internal_getFromParents("$pe").shakeItBaby(10, .1, 0, !1)
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
this.$GA || (this.$dA.position3d.y = Math.max(0, this.$dA.position3d.y - 125 * t), 0 == this.$dA.position3d.y && (this.$GA = !0, this.$fA()))
|
|
},
|
|
get_name: function () {
|
|
return "$FA"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: oe
|
|
});
|
|
var se = function (t) {
|
|
this.$EA = 0,
|
|
this._progress = 0,
|
|
f.call(this),
|
|
this.$eA = t
|
|
};
|
|
se.__name__ = !0,
|
|
se.__super__ = f,
|
|
se.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
f.prototype.onStart.call(this);
|
|
var t = this.$dA.position3d;
|
|
this.$DA = {
|
|
x: t.x,
|
|
y: t.y,
|
|
z: t.z
|
|
}
|
|
},
|
|
$fA: function () {
|
|
this.owner.addComponent(new Gr);
|
|
var t,
|
|
e = this.$Ma.factory.createPuddle();
|
|
if (null == e.$rD)
|
|
t = e;
|
|
else {
|
|
var i = e.$rD.position3d,
|
|
n = this.$dA.position3d;
|
|
i.x = n.x,
|
|
i.y = n.y,
|
|
i.z = n.z,
|
|
t = e
|
|
}
|
|
this.$Ma.puddleContainer.add(Rn.EEntity(t)),
|
|
this.owner._internal_getFromParents("$pe").shakeItBaby(10, .1, 0, !1)
|
|
},
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), 1 != this._progress) {
|
|
this.$EA += t;
|
|
var e = this.$EA / 1.75;
|
|
this._progress = e < 0 ? 0 : e > 1 ? 1 : e;
|
|
var i = this.$DA.x,
|
|
n = this._progress;
|
|
this.$dA.position3d.x = i + (this.$eA.x - i) * (n < 0 ? 0 : n > 1 ? 1 : n);
|
|
i = this.$DA.y,
|
|
n = this._progress;
|
|
this.$dA.position3d.y = i + (this.$eA.y - i) * (n < 0 ? 0 : n > 1 ? 1 : n);
|
|
i = this.$DA.z,
|
|
n = this._progress;
|
|
this.$dA.position3d.z = i + (this.$eA.z - i) * (n < 0 ? 0 : n > 1 ? 1 : n),
|
|
this._progress < .5 ? this.$dA.position3d.y += 175 * Gn.sineOut(2 * this._progress) : this.$dA.position3d.y += 175 * Gn.sineOut(1 - 2 * (this._progress - .5)),
|
|
1 == this._progress && this.$fA()
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$CA"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: se
|
|
});
|
|
var ae = function (t) {
|
|
this.$GA = !1,
|
|
this.$hb = [],
|
|
this.$Gb = 5,
|
|
this.$gb = null,
|
|
this.$Fb = new rt(.05, .1),
|
|
f.call(this),
|
|
this.$Eb = null != t ? t : 1
|
|
};
|
|
ae.__name__ = !0,
|
|
ae.__super__ = f,
|
|
ae.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$cb && (this.$cb = this.owner._internal_getFromParents("$gE")),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
f.prototype.onStart.call(this),
|
|
this.$Ma.sounds.playExplosion(1),
|
|
this.$db = this.$Ma.playerEntity.$rD,
|
|
this.$Db = new rt(this.$dA.position3d.x - 40, this.$dA.position3d.x + 40),
|
|
this.$eb = new rt(this.$dA.position3d.z - .5, this.$dA.position3d.z + .5),
|
|
this.$gb = 0,
|
|
this.$Hb(this.$dA.position3d.x, this.$eb._from),
|
|
this.$Hb(this.$dA.position3d.x, this.$eb._to)
|
|
},
|
|
$Hb: function (t, e) {
|
|
var i = Ao.empty();
|
|
i.x = null != t ? t : this.$Db.getValueFromFactor(Math.random()),
|
|
i.y = this.$dA.position3d.y,
|
|
i.z = null != e ? e : this.$eb.getValueFromFactor(Math.random());
|
|
var n,
|
|
r = this.$Ma.factory.createGasCloudParticle();
|
|
if (null == r.$rD)
|
|
n = r;
|
|
else {
|
|
var o = r.$rD.position3d;
|
|
o.x = i.x,
|
|
o.y = i.y,
|
|
o.z = i.z,
|
|
n = r
|
|
}
|
|
var s = n._internal_getFromChildren("$w", eo);
|
|
s.setMovie("gas_cloud_in").play().completed((function () {
|
|
s.setMovie("gas_cloud_loop").play(!0)
|
|
})),
|
|
this.owner.parent.add(Rn.EEntity(n)),
|
|
this.$hb.push(n)
|
|
},
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), !this.$GA)
|
|
if (this.$Eb <= 0) {
|
|
this.$GA = !0,
|
|
this.owner.add(Rn.EComponent(new Gr));
|
|
for (var e = 0, i = this.$hb; e < i.length; ) {
|
|
var n = [i[e++]],
|
|
r = this.owner.parent,
|
|
o = .5 * Math.random();
|
|
null == o && (o = 0),
|
|
r.addEntity((new On).addComponent(new Gr(o, function (t) {
|
|
return function () {
|
|
t[0]._internal_getFromChildren("$w", eo).setMovie("gas_cloud_out").play().completed(function (t) {
|
|
return function () {
|
|
t[0].add(Rn.EComponent(new Gr))
|
|
}
|
|
}
|
|
(t))
|
|
}
|
|
}
|
|
(n))), !0)
|
|
}
|
|
this.$hb = null
|
|
} else {
|
|
var s;
|
|
if (this.$Eb -= t, this.$hb.length < this.$Gb)
|
|
if (null != this.$gb) {
|
|
s = (this.$gb -= t) <= 0
|
|
} else
|
|
s = !1;
|
|
else
|
|
s = !1;
|
|
s && (this.$Hb(), this.$gb = this.$Fb.getValueFromFactor(Math.random())),
|
|
Math.abs(this.$db.position3d.z - this.$dA.position3d.z) < .5 && this.$Ma.playerEntity.$JD.hit(20 * t)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$ib"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ae
|
|
});
|
|
var he = function () {
|
|
this.$GA = !1,
|
|
this.$hb = [],
|
|
this.$Gb = 10,
|
|
this.$gb = null,
|
|
this.$Fb = new rt(.05, .1),
|
|
this.$Eb = 2,
|
|
f.call(this)
|
|
};
|
|
he.__name__ = !0,
|
|
he.__super__ = f,
|
|
he.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Cb && (this.$Cb = this.owner.$w),
|
|
null == this.$cb && (this.$cb = this.owner._internal_getFromParents("$gE")),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
f.prototype.onStart.call(this),
|
|
this.$Ma.sounds.playExplosion(1),
|
|
this.$db = this.$Ma.playerWorldElement,
|
|
this.owner.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite("puddle_splash", S.animationLibraries.get_currentGame())), Rn.EComponent(new Kr)])))),
|
|
this.$Cb.setMovie("puddle_in").play().completed((function () {
|
|
t.$Cb.setMovie("puddle_loop").play(!0)
|
|
})),
|
|
this.$Db = new rt(this.$dA.position3d.x - 30, this.$dA.position3d.x + 30),
|
|
this.$eb = new rt(this.$dA.position3d.z - .4, this.$dA.position3d.z + .4),
|
|
this.$gb = 0,
|
|
this.$Hb(this.$dA.position3d.x, this.$eb._from),
|
|
this.$Hb(this.$dA.position3d.x, this.$eb._to)
|
|
},
|
|
$Hb: function (t, e) {
|
|
var i = Ao.empty();
|
|
i.x = null != t ? t : this.$Db.getValueFromFactor(Math.random()),
|
|
i.y = 0,
|
|
i.z = null != e ? e : this.$eb.getValueFromFactor(Math.random());
|
|
var n,
|
|
r = this.$Ma.factory.createPuddleParticle();
|
|
if (null == r.$rD)
|
|
n = r;
|
|
else {
|
|
var o = r.$rD.position3d;
|
|
o.x = i.x,
|
|
o.y = i.y,
|
|
o.z = i.z,
|
|
n = r
|
|
}
|
|
n._internal_getFromChildren("$w", eo).setMovie(this.$hb.length % 2 == 0 ? "puddle_bubble" : "puddle_smoke").play(!0),
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(n)),
|
|
this.$hb.push(n)
|
|
},
|
|
onUpdate: function (t) {
|
|
var e = this;
|
|
if (f.prototype.onUpdate.call(this, t), !this.$GA)
|
|
if (this.$Eb <= 0) {
|
|
for (this.$GA = !0; this.$hb.length > 0; )
|
|
this.$hb.shift().add(Rn.EComponent(new Gr));
|
|
this.$Cb.setMovie("puddle_out").play().completed((function () {
|
|
e.owner.add(Rn.EComponent(new Gr))
|
|
}))
|
|
} else {
|
|
var i;
|
|
if (this.$Eb -= t, this.$hb.length < this.$Gb)
|
|
if (null != this.$gb) {
|
|
i = (this.$gb -= t) <= 0
|
|
} else
|
|
i = !1;
|
|
else
|
|
i = !1;
|
|
i && (this.$Hb(), this.$gb = this.$Fb.getValueFromFactor(Math.random())),
|
|
Math.abs(this.$db.position3d.z - this.$dA.position3d.z) < .5 && this.$Ma.playerEntity.$JD.hit(20 * t)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$Bb"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Cb && (this.$Cb = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: he
|
|
});
|
|
var le = function () {
|
|
this.$iA = [],
|
|
this.hasWon = new Ln(!1),
|
|
this.isInteractive = new Ln(!1),
|
|
this.isAlive = new Ln(!0),
|
|
this.isEnabled = new Ln(!0),
|
|
this.$a = new Pn,
|
|
N.call(this)
|
|
};
|
|
le.__name__ = !0,
|
|
le.__super__ = N,
|
|
le.prototype = o(N.prototype, {
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
N.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Di), Rn.EComponent(new fe), Rn.EComponent(new ue), Rn.EComponent(new de), Rn.EComponent(new pe), Rn.EComponent(new ce), Rn.EComponent(new me), Rn.EComponent(new _e)]))
|
|
},
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
N.prototype.onStart.call(this),
|
|
this.$a.add(this.$HA.value.watch((function (e, i) {
|
|
e > 0 && e < i && ("$Ab" != (null != t.currentState ? t.currentState.get_name() : null) && "$xA" != (null != t.currentState ? t.currentState.get_name() : null) || t.hurt())
|
|
}))),
|
|
this.changeStateTo("$Ab", null)
|
|
},
|
|
shoot: function () {
|
|
this.changeStateTo("$xA", null)
|
|
},
|
|
hurt: function () {
|
|
this.changeStateTo("$XA", null)
|
|
},
|
|
die: function () {
|
|
this.changeStateTo("$ZA", null)
|
|
},
|
|
walkToNextWavePosition: function () {
|
|
this.changeStateTo("$yA", null)
|
|
},
|
|
$jA: function (t) {
|
|
this.isEnabled._value && this.$iA.length < 2 && this.$iA.push(t)
|
|
},
|
|
sayQuote: function (t) {
|
|
var e = this.owner,
|
|
i = new On,
|
|
n = Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame())),
|
|
r = new uo;
|
|
r.$A_().animate(0, 1, .25, null, null, 0),
|
|
r.$Y().x.animate(10, 15, .25, Gn.quintOut, null, 0),
|
|
r.$Y().y.animate(-35, -40, .25, Gn.quintOut, null, 0),
|
|
r.$z().y.animate(0, 1, .25, Gn.backOut, null, 0),
|
|
e.add(Rn.EEntity(this.$IA = i.add(Rn.EArray([n, Rn.EComponent(r)]))))
|
|
},
|
|
clearQuote: function () {
|
|
null != this.$IA && null == this.$IA.$re && (this.$IA.add(Rn.EComponent(new Gr)), this.$IA = null)
|
|
},
|
|
$JA: function () {
|
|
this.isEnabled._value && this.$iA.length > 0 && this.$kA(this.$iA.shift())
|
|
},
|
|
$kA: function (t) {
|
|
if (!(t == _i.Up && this.$dA.position3d.z < - .9 || t == _i.Down && this.$dA.position3d.z > .9)) {
|
|
var e = this.$dA.position3d.z + t.axisDirection;
|
|
this.changeStateTo("$ab", Math.round(e < -1 ? -1 : e > 1 ? 1 : e))
|
|
}
|
|
},
|
|
onUpdate: function (t) {
|
|
N.prototype.onUpdate.call(this, t),
|
|
"$QA" != (null != this.currentState ? this.currentState.get_name() : null) && (this.isAlive.set__(this.$HA.value._value > 0), this.isAlive._value ? "$bb" == (null != this.currentState ? this.currentState.get_name() : null) ? (this.$hA.buttonUp.wasPressed._value && (this.$dA.position3d.z < - .5 ? this.changeStateTo("$QA", null) : (this.$jA(_i.Up), this.$JA())), this.$hA.buttonDown.wasPressed._value && (this.$jA(_i.Down), this.$JA())) : this.isInteractive._value && (this.$hA.buttonUp.wasPressed._value ? this.$jA(_i.Up) : this.$hA.buttonDown.wasPressed._value && this.$jA(_i.Down), "$Ab" != (null != this.currentState ? this.currentState.get_name() : null) && "$XA" != (null != this.currentState ? this.currentState.get_name() : null) && "$xA" != (null != this.currentState ? this.currentState.get_name() : null) || this.$hA.buttonAction1.wasPressed._value && (this.shoot(), this.$iA = []), "$Ab" != (null != this.currentState ? this.currentState.get_name() : null) && "$XA" != (null != this.currentState ? this.currentState.get_name() : null) && "$xA" != (null != this.currentState ? this.currentState.get_name() : null) || this.$JA()) : "$ZA" != (null != this.currentState ? this.currentState.get_name() : null) && this.die())
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
N.prototype.dispose.call(this)
|
|
},
|
|
__class__: le
|
|
});
|
|
var ue = function () {
|
|
this.$SA = !1,
|
|
this.$RA = new Vn(0),
|
|
it.call(this, "player_jump")
|
|
};
|
|
ue.__name__ = !0,
|
|
ue.__interfaces__ = [kt],
|
|
ue.__super__ = it,
|
|
ue.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.$SA = !0,
|
|
this.$Ma.sounds.playerMove(this.data < this.$dA.position3d.z),
|
|
this.$RA.animate(this.$dA.position3d.z, this.data, .05, Gn.linear, cs(this, this.$tA))
|
|
},
|
|
$tA: function () {
|
|
this.$dA.position3d.z = this.data,
|
|
this.$SA = !1
|
|
},
|
|
keepInState: function () {
|
|
return this.$SA
|
|
},
|
|
getNextStateName: function () {
|
|
return this.$rA.hasWon._value ? "$bb" : "$Ab"
|
|
},
|
|
onUpdateState: function (t) {
|
|
it.prototype.onUpdateState.call(this, t),
|
|
this.$RA.update(t),
|
|
this.$dA.position3d.z = this.$RA._value
|
|
},
|
|
get_name: function () {
|
|
return "$ab"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ue
|
|
});
|
|
var ce = function () {
|
|
it.call(this, "player_die")
|
|
};
|
|
ce.__name__ = !0,
|
|
ce.__super__ = it,
|
|
ce.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.$Ma.sounds.playerDie(),
|
|
this.$HA.value.set__(0),
|
|
this.$_b.collisionsEnabled = !1;
|
|
var t,
|
|
e = (new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite("player_die_explosion", S.animationLibraries.get_currentGame())), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new Kr)]));
|
|
if (null == e.$rD)
|
|
t = e;
|
|
else {
|
|
var i = e.$rD,
|
|
n = i.position3d,
|
|
r = this.$Ma.playerWorldElement.position3d;
|
|
n.x = r.x,
|
|
n.y = r.y,
|
|
n.z = r.z,
|
|
i.position3d.z += .01,
|
|
t = e
|
|
}
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(t))
|
|
},
|
|
get_name: function () {
|
|
return "$ZA"
|
|
},
|
|
onStart: function () {
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ce
|
|
});
|
|
var pe = function () {
|
|
it.call(this, "player_hurt")
|
|
};
|
|
pe.__name__ = !0,
|
|
pe.__super__ = it,
|
|
pe.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this);
|
|
var t = this.owner,
|
|
e = [16057380],
|
|
i = new Pn;
|
|
if (null != t.$w) {
|
|
var n = t.$w,
|
|
r = new yr(e[0], 1);
|
|
n.container.filters = [r];
|
|
var o = 0;
|
|
i.add(hs.create(t.parent, .05, 1, (function () {
|
|
var t = o += .5;
|
|
r.update(e[(0 | t) % e.length], 1 == r.multiplier ? 0 : 1)
|
|
})));
|
|
var s = t.parent;
|
|
t = (new On).addComponent(new Gr(.1, (function () {
|
|
n.container.filters = null
|
|
})));
|
|
s.addEntity(t, !0),
|
|
i.add(t)
|
|
}
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Ab"
|
|
},
|
|
get_name: function () {
|
|
return "$XA"
|
|
},
|
|
__class__: pe
|
|
});
|
|
var de = function () {
|
|
this.$zA = 0,
|
|
this.$YA = [75, 1375, 2675, 2805],
|
|
it.call(this, "player_move", !0)
|
|
};
|
|
de.__name__ = !0,
|
|
de.__super__ = it,
|
|
de.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.$zA = 37.5,
|
|
0 == this.$YA.length ? this.$la = !1 : this.$rA.isInteractive.set__(!1)
|
|
},
|
|
onDeactivate: function () {
|
|
this.$rA.isInteractive.set__(!0),
|
|
it.prototype.onDeactivate.call(this)
|
|
},
|
|
onUpdateState: function (t) {
|
|
if (it.prototype.onUpdateState.call(this, t), this.$zA = Math.min(this.$zA + 150 * t, 300), this.$dA.position3d.x += this.$zA * t, this.$YA.length > 1 && this.$HA.modifyHealth(5 * t), this.$dA.position3d.x >= this.$YA[0]) {
|
|
var e = this.$dA,
|
|
i = this.$YA.shift();
|
|
e.position3d.x = i,
|
|
this.$la = !1
|
|
}
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Ab"
|
|
},
|
|
get_name: function () {
|
|
return "$yA"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: de
|
|
});
|
|
var fe = function () {
|
|
it.call(this, "player_shoot"),
|
|
this.canReactivate = !0
|
|
};
|
|
fe.__name__ = !0,
|
|
fe.__super__ = it,
|
|
fe.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.fireProjectile()
|
|
},
|
|
fireProjectile: function () {
|
|
var t = this.$Ma.factory.createProjectile("player_projectile", 2);
|
|
if (null != t.$rD) {
|
|
var e = t.$rD,
|
|
i = e.position3d,
|
|
n = this.$dA.position3d;
|
|
i.x = n.x,
|
|
i.y = n.y,
|
|
i.z = n.z,
|
|
e.position3d.x += 50 * this.$dA.heading._value.axisDirection,
|
|
e.position3d.y += 27;
|
|
i = e.velocity3d;
|
|
var r,
|
|
o,
|
|
s = e.heading._value,
|
|
a = s.x,
|
|
h = s.y;
|
|
r = 400 * a,
|
|
o = 400 * h,
|
|
i.x = r,
|
|
i.y = o
|
|
}
|
|
this.owner.parent.add(Rn.EEntity(t)),
|
|
this.$Ma.sounds.playProjectile()
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Ab"
|
|
},
|
|
get_name: function () {
|
|
return "$xA"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: fe
|
|
});
|
|
var _e = function () {
|
|
this.$sA = new Vn(0),
|
|
this.$RA = new Vn(0),
|
|
it.call(this, "player_win")
|
|
};
|
|
_e.__name__ = !0,
|
|
_e.__super__ = it,
|
|
_e.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.$rA.clearQuote(),
|
|
this.$Ma.tripGasContainer.add(Rn.EEntity(this.owner));
|
|
var t = this.owner;
|
|
null != t.$TA && t.$TA.dispose(),
|
|
this.$RA.animate(this.$dA.position3d.z, -2, .05, Gn.linear, cs(this, this.$tA)),
|
|
this.$sA.animate(this.$dA.position3d.y, -150, .5, Gn.quadIn)
|
|
},
|
|
$tA: function () {},
|
|
onUpdateState: function (t) {
|
|
it.prototype.onUpdateState.call(this, t),
|
|
this.$sA.update(t),
|
|
this.$RA.update(t),
|
|
this.$dA.position3d.y = this.$sA._value,
|
|
this.$dA.position3d.z = this.$RA._value
|
|
},
|
|
get_name: function () {
|
|
return "$QA"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: _e
|
|
});
|
|
var me = function () {
|
|
it.call(this, "player_win", !0)
|
|
};
|
|
me.__name__ = !0,
|
|
me.__super__ = it,
|
|
me.prototype = o(it.prototype, {
|
|
get_name: function () {
|
|
return "$bb"
|
|
},
|
|
__class__: me
|
|
});
|
|
var ye = function () {
|
|
this.$xa = !1,
|
|
f.call(this);
|
|
this.$va = new rt(600, 1e3),
|
|
this.$Va = new rt(1900, 2300)
|
|
};
|
|
ye.__name__ = !0,
|
|
ye.__super__ = f,
|
|
ye.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
f.prototype.onStart.call(this),
|
|
this.$Wa = [new Vn(0), new Vn(0), new Vn(0)],
|
|
this.$wa = [this.$Xa("background_sky_blue"), this.$Xa("background_sky_pink"), this.$Xa("background_sky_yellow")];
|
|
for (var t = 0, e = this.$wa; t < e.length; ) {
|
|
var i = new Vt(e[t++]).setXY(.5 * (this.$Ma.sceneWidth - ye.$Ua), -25);
|
|
this.owner.add(Rn.EEntity((new On).add(Rn.EComponent(i))))
|
|
}
|
|
},
|
|
activateCrazyMode: function () {
|
|
this.$xa = !0,
|
|
this.$Wa[0].set_behavior(new Yn(1, 0, .2)),
|
|
this.$Wa[1].set_behavior(new Yn(.5, 0, .4)),
|
|
this.$Wa[2].set_behavior(new Yn(.5, 0, .3))
|
|
},
|
|
$Xa: function (t) {
|
|
var e = S.animations.getTexture(t, S.animationLibraries.get_currentGame());
|
|
return e.baseTexture.mipmap = PIXI.MIPMAP_MODES.OFF,
|
|
new PIXI.TilingSprite(e, ye.$Ua, 193)
|
|
},
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), !this.$xa) {
|
|
var e = this.$Ma.playerWorldElement.position3d.x;
|
|
this.$Wa[0].set__(e < this.$va._to ? 1 : 0),
|
|
this.$Wa[1].set__(this.$va.getFactorFromValue(e)),
|
|
this.$Wa[2].set__(this.$Va.getFactorFromValue(e))
|
|
}
|
|
for (var i = 0, n = this.$Wa; i < n.length; )
|
|
n[i++].update(t);
|
|
for (var r = this.$wa, o = 0; o < r.length; ) {
|
|
var s = r[o];
|
|
s.alpha = this.$Wa[o++]._value,
|
|
s.visible = 0 != s.alpha
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$ua"
|
|
},
|
|
__class__: ye
|
|
});
|
|
var ge = function () {
|
|
et.call(this)
|
|
};
|
|
ge.__name__ = !0,
|
|
ge.__super__ = et,
|
|
ge.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
et.prototype.onActivate.call(this);
|
|
var t = this.$Ma.touchUI;
|
|
null != t && t.disable(),
|
|
this.$Ma.fader.$nA.$A_().animate(1, 0, 1, null, cs(this, this.deactivate), 0)
|
|
},
|
|
getNextStateName: function () {
|
|
return "$pa"
|
|
},
|
|
get_name: function () {
|
|
return "$Oa"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
__class__: ge
|
|
});
|
|
var ve = function () {
|
|
this.$na = 0,
|
|
et.call(this)
|
|
};
|
|
ve.__name__ = !0,
|
|
ve.__super__ = et,
|
|
ve.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
et.prototype.onActivate.call(this);
|
|
var t = this.$Ma.touchUI;
|
|
switch (null != t && t.disable(), this.$Ma.gameModel.outcome) {
|
|
case 0:
|
|
this.$na = 4,
|
|
this.$oa();
|
|
break;
|
|
case 1:
|
|
this.$Ma.player.sayQuote("quote_lose"),
|
|
this.$na = 4
|
|
}
|
|
},
|
|
$Na: function (t, e) {
|
|
if (null != e) {
|
|
if ("$yA" == e.get_name() && "$Ab" == t.get_name()) {
|
|
this.$Ma.player.changeStateTo("$bb", null);
|
|
var i = this.$Ma.touchUI;
|
|
null != i && (i.enable(), Vr.__cast(i, f), Vr.__cast(i, f).owner.$w.container.alpha = 0)
|
|
}
|
|
"$QA" == t.get_name() && (this.$Ma.sky.activateCrazyMode(), this.$Ma.gameModel.outcome = 2, this.$na = 2)
|
|
}
|
|
},
|
|
$oa: function () {
|
|
var t = this;
|
|
this.$La.add(this.$Ma.player.stateChanged.connect(cs(this, this.$Na))),
|
|
this.$Ma.camera.lockX = !0,
|
|
this.$Ma.player.hasWon.set__(!0),
|
|
this.$Ma.player.walkToNextWavePosition();
|
|
for (var e = this.$Ma.playerWorldElement.position3d.x + 75 - 140, i = 0; i < 5; ) {
|
|
++i;
|
|
var n,
|
|
r = this.$Ma.factory.createGasCloud(179769313486231e294);
|
|
if (null == r.$rD)
|
|
n = r;
|
|
else {
|
|
var o = r.$rD;
|
|
o.position3d.x = e;
|
|
var s = rs.native.range(-30, -50);
|
|
o.position3d.y = s,
|
|
o.position3d.z = -2,
|
|
n = r
|
|
}
|
|
var a = [n];
|
|
a[0].timeScale = rs.native.range(.9, 1.1);
|
|
var h = this.owner,
|
|
l = rs.native.range(0, .5);
|
|
null == l && (l = 0),
|
|
h.addEntity((new On).addComponent(new Gr(l, function (e) {
|
|
return function () {
|
|
t.$Ma.tripGasContainer.add(Rn.EEntity(e[0]))
|
|
}
|
|
}
|
|
(a))), !0),
|
|
e += 70
|
|
}
|
|
},
|
|
onUpdateState: function (t) {
|
|
et.prototype.onUpdateState.call(this, t),
|
|
this.$na -= t,
|
|
this.$na < 0 && this.$Ma.endGame()
|
|
},
|
|
get_name: function () {
|
|
return "$ma"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
__class__: ve
|
|
});
|
|
var we = function () {
|
|
et.call(this)
|
|
};
|
|
we.__name__ = !0,
|
|
we.__super__ = et,
|
|
we.prototype = o(et.prototype, {
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onStart.call(this),
|
|
this.$Pa = this.$Ma.spawner
|
|
},
|
|
onActivate: function () {
|
|
var t = this;
|
|
et.prototype.onActivate.call(this),
|
|
this.$qa = [" -B- B-B B-- -B- --B B B-B B-B -C-", " -B- --R B-- -P- B-B -B- P R P B B -C- P-P R R", " B-B -C- B B R B B B R B B B R P P B B C R BBB P P C R"],
|
|
this.$Qa = [1, 1, 1],
|
|
this.$La.add(this.$Ma.playerEntity.$qD.value.watch((function (e, i) {
|
|
0 == e && t.$Ta(1)
|
|
}))),
|
|
this.$Ra()
|
|
},
|
|
$Na: function (t, e) {
|
|
null != e && ("$yA" == e.get_name() && "$Ab" == t.get_name() && this.$sa(), this.$Pa.hasStarted || "$ab" != e.get_name() || this.$Ra())
|
|
},
|
|
onDeactivate: function () {
|
|
this.$Pa.stop(),
|
|
this.$ta(),
|
|
et.prototype.onDeactivate.call(this)
|
|
},
|
|
onUpdateState: function (t) {
|
|
var e = this;
|
|
this.$Pa.hasStarted && 0 == this.$Pa.$ub.length && 0 == this.$Ma.slugs.length && (this.$Pa.stop(), this.owner.addEntity((new On).addComponent(new Gr(2, (function () {
|
|
e.$Ra()
|
|
}))), !0))
|
|
},
|
|
$Ra: function () {
|
|
var t = this.$Ma.touchUI;
|
|
null != t && t.disable(),
|
|
this.$Ma.player.isInteractive.set__(!1),
|
|
this.$Sa(),
|
|
Math.abs(this.$Ma.playerWorldElement.position3d.z) > .1 ? this.$Ma.player.changeStateTo("$ab", 0) : 0 == this.$qa.length ? (this.$Ma.playerEntity.$JD.filter = Ei.INVINCIBILITY_FILTER, this.$Ta(0)) : this.$Ma.player.walkToNextWavePosition()
|
|
},
|
|
$sa: function () {
|
|
this.$ta();
|
|
for (var t = this.$qa.shift().split(" "), e = new Array(t.length), i = 0, n = t.length; i < n; ) {
|
|
var r = i++;
|
|
e[r] = t[r].split("")
|
|
}
|
|
var o = this.$Qa.shift();
|
|
this.$Pa.setWave(e),
|
|
this.$Pa.setSpawnInterval(o),
|
|
this.$Pa.start();
|
|
var s = this.$Ma.touchUI;
|
|
null != s && s.enable()
|
|
},
|
|
$Sa: function () {
|
|
null == this.$ra && (this.$ra = this.$Ma.player.stateChanged.connect(cs(this, this.$Na)))
|
|
},
|
|
$ta: function () {
|
|
null != this.$ra && (this.$ra.dispose(), this.$ra = null)
|
|
},
|
|
$Ta: function (t) {
|
|
this.$Ma.finishLevel(t),
|
|
this.$la = !1
|
|
},
|
|
getNextStateName: function () {
|
|
return "$ma"
|
|
},
|
|
get_name: function () {
|
|
return "$pa"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onAdded.call(this)
|
|
},
|
|
__class__: we
|
|
});
|
|
var xe = function () {
|
|
this.$_A = .4,
|
|
this.$a = new Pn,
|
|
Gt.call(this)
|
|
};
|
|
xe.__name__ = !0,
|
|
xe.__super__ = Gt,
|
|
xe.prototype = o(Gt.prototype, {
|
|
onAdded: function () {
|
|
Gt.prototype.onAdded.call(this);
|
|
var t = 50 * this.$_A;
|
|
this.owner.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$ya = new Vt), Rn.EComponent(new So(To.fromString("100%"), To.fromString("100%"))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$Ya = new Ui(45).setHitArea(-150, -150, 300, 300)), Rn.EEntity((new On).add(Rn.EComponent(S.animations.get("button_shoot", S.animationLibraries.get_currentGame())))), Rn.EComponent(new So(Oo.Relative(t), Oo.Relative(t), To.fromString("100% - 30"), To.fromString("100% - 30"), Oo.Relative(.5 * t), Oo.Relative(.5 * t)))]))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$za = new Ui(35).setHitArea(-100, -150, 250, 170)), Rn.EEntity((new On).add(Rn.EComponent(S.animations.get("button_up", S.animationLibraries.get_currentGame())))), Rn.EComponent(new So(Oo.Relative(t), Oo.Relative(t), Oo.Relative(30), To.fromString("100% - 70"), Oo.Relative( - .5 * t), Oo.Relative(.5 * t)))]))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$Za = new Ui(35).setHitArea(-100, -15, 250, 100)), Rn.EEntity((new On).add(Rn.EComponent(S.animations.get("button_down", S.animationLibraries.get_currentGame())))), Rn.EComponent(new So(Oo.Relative(t), Oo.Relative(t), Oo.Relative(30), To.fromString("100% - 30"), Oo.Relative( - .5 * t), Oo.Relative(.5 * t)))])))]))))
|
|
},
|
|
onUpdate: function (t) {
|
|
if (Gt.prototype.onUpdate.call(this, t), this.button1Down.set__(this.$Ya.isDown._value), this.$za.isDown._value)
|
|
(e = this.axisDirection).x = 0, e.y = -1;
|
|
else if (this.$Za.isDown._value) {
|
|
(e = this.axisDirection).x = 0,
|
|
e.y = 1
|
|
} else {
|
|
var e;
|
|
(e = this.axisDirection).x = 0,
|
|
e.y = 0
|
|
}
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
Gt.prototype.dispose.call(this)
|
|
},
|
|
__class__: xe
|
|
});
|
|
var be = function (t, e) {
|
|
this.$cA = 0,
|
|
f.call(this),
|
|
this.$BA = t,
|
|
this.$i_ = e
|
|
};
|
|
be.__name__ = !0,
|
|
be.__super__ = f,
|
|
be.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onAdded.call(this),
|
|
this.$fa()
|
|
},
|
|
$fa: function () {
|
|
var t = this.$i_ - 150;
|
|
for (this.$Fa("small"), this.$Fa("tall"); this.$cA < t; )
|
|
this.$Fa(rs.native._random.next() <= .5 ? "small" : rs.native.fromArray(["medium", "tall"]));
|
|
this.$cA = t,
|
|
this.$Fa("tall"),
|
|
this.$Fa("small")
|
|
},
|
|
$Fa: function (t) {
|
|
var e = S.animations.getSprite(this.$BA + "_" + t, S.animationLibraries.get_currentGame());
|
|
e.x = this.$cA,
|
|
e.y = rs.native.range(-1, 1),
|
|
this.$ya.container.addChild(e);
|
|
var i,
|
|
n = this.$cA;
|
|
switch (t) {
|
|
case "medium":
|
|
i = 100;
|
|
break;
|
|
case "small":
|
|
i = 42;
|
|
break;
|
|
case "tall":
|
|
i = 100
|
|
}
|
|
return this.$cA = n + i,
|
|
e
|
|
},
|
|
get_name: function () {
|
|
return "$bA"
|
|
},
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onStart.call(this)
|
|
},
|
|
__class__: be
|
|
});
|
|
var Ee = function (t) {
|
|
null == t && (t = "generic_shadow"),
|
|
this.$WA = new Vn(1, 1, 0),
|
|
this.$wA = new Vn(0, 250, 500),
|
|
this.$VA = Ao.empty(),
|
|
this.$vA = Ao.empty(),
|
|
this.$k_ = {
|
|
x: 0,
|
|
y: 0,
|
|
z: 0
|
|
},
|
|
this.$a = new Pn,
|
|
f.call(this),
|
|
this.$uA = (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame()))])))])),
|
|
this.$UA = this.$uA.$w,
|
|
this.$WA.follow(this.$wA)
|
|
};
|
|
Ee.__name__ = !0,
|
|
Ee.__super__ = f,
|
|
Ee.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", Wt)),
|
|
f.prototype.onStart.call(this),
|
|
this.setTargetContainer(this.$Ma.shadowContainer)
|
|
},
|
|
setTargetContainer: function (t) {
|
|
t.addEntity(this.$uA),
|
|
this.$UA.reparentContainer()
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t);
|
|
var e = this.$vA,
|
|
i = this.$dA.position3d;
|
|
e.x = i.x,
|
|
e.y = i.y,
|
|
e.z = i.z,
|
|
this.$vA.y = 0;
|
|
e = this.$vA;
|
|
var n = this.$k_;
|
|
e.x += n.x,
|
|
e.y += n.y,
|
|
e.z += n.z,
|
|
this.$wA.set__(this.$dA.position3d.y),
|
|
this.$Ma.worldProjection.project(this.$vA, this.$VA),
|
|
this.$UA.setXY(this.$VA.x, this.$VA.y),
|
|
this.$UA.setAlpha(this.$WA._value)
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this),
|
|
this.$uA.add(Rn.EComponent(new Gr))
|
|
},
|
|
get_name: function () {
|
|
return "$TA"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Ee
|
|
});
|
|
var $e = function (t, e) {
|
|
this.$ea = _i.Right,
|
|
this.isBossBattle = !1,
|
|
B.call(this, new Ae, t, e)
|
|
};
|
|
$e.__name__ = !0,
|
|
$e.__super__ = B,
|
|
$e.prototype = o(B.prototype, {
|
|
onAdded: function () {
|
|
B.prototype.onAdded.call(this),
|
|
this.worldProjection.matrix.scale(1, -1),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new oi), Rn.EComponent(new ri), Rn.EComponent(new ei), Rn.EComponent(new ni), Rn.EComponent(new ii), Rn.EComponent(this.sounds = new Se)]))
|
|
},
|
|
onStart: function () {
|
|
B.prototype.onStart.call(this),
|
|
this.isBossBattle = Un.root._internal_getFromChildren("$_", Ki).$C().indexOf("bossbattle") >= 0,
|
|
PIXI.utils.isMobile.any && this.addTouchUI(new hi),
|
|
this.camera.lockY = !0,
|
|
this.owner.$lf.$df.set_fixedTimestep(.011111111111111112),
|
|
this.$WB(),
|
|
this.createVignette(190),
|
|
this.isBossBattle ? (this.$xB(), this.$ha(), this.$ga(), this.changeStateTo("$dc", null)) : (this.$Ga(), this.$ha(), this.$ga(), this.camera.offset.x.set__(.15 * -this.sceneWidth), this.changeStateTo("$Cc", null))
|
|
},
|
|
$WB: function () {
|
|
var t = this;
|
|
this.populator = new mi(this.worldProjection),
|
|
this.owner.add(Rn.EComponent(this.populator));
|
|
var e = new Zo(["enemy_leon", "enemy_max", "enemy_brock", "enemy_bea"]);
|
|
this.populator.unwrapper.registerTransformer(new Tn("enemy_", {
|
|
transformInfo: function (t) {
|
|
return t.willInstantiateSymbol = !1,
|
|
t
|
|
},
|
|
decorateEntity: function (i, n) {
|
|
var r = null,
|
|
o = null;
|
|
switch (n.symbolName) {
|
|
case "enemy_old_brawler":
|
|
r = "brawler_old",
|
|
o = "enemy_gale";
|
|
break;
|
|
case "enemy_surge":
|
|
r = "brawler_shooter",
|
|
o = "enemy_surge";
|
|
break;
|
|
case "enemy_young_brawler":
|
|
r = "brawler_young",
|
|
o = e.next()
|
|
}
|
|
var s = t.factory.createEnemy(o, r),
|
|
a = i.$w;
|
|
return function (e) {
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$w)
|
|
return e;
|
|
if (null == e.$kc)
|
|
return e;
|
|
var i = e.$rD,
|
|
r = e.$w,
|
|
o = e.$kc;
|
|
r.container.setTransform(a.container.position.x, a.container.position.y, n.keyframe.scaleX, n.keyframe.scaleY, null, -n.keyframe.skewX, n.keyframe.skewY, n.keyframe.pivotX, n.keyframe.pivotY),
|
|
t.worldProjection.unproject({
|
|
x: r.container.position.x,
|
|
y: r.container.position.y,
|
|
z: 0
|
|
}, i.position3d),
|
|
o.setMovementBounds(i.position3d.x, n.keyframe.scaleX <= 1.1 ? i.position3d.x : i.position3d.x + 20 * n.keyframe.scaleX)
|
|
}
|
|
(s),
|
|
s
|
|
}
|
|
}));
|
|
var i = new Zo(["obstacle_arcade_2", "obstacle_arcade_4", "obstacle_arcade_5", "obstacle_arcade_6", "obstacle_gumball"]);
|
|
this.populator.unwrapper.registerTransformer(new Tn("obstacle_random_arcade", {
|
|
transformInfo: function (t) {
|
|
return t.symbolName = i.next(),
|
|
t
|
|
}
|
|
})),
|
|
this.populator.unwrapper.registerTransformer(new Tn("obstacle_", {
|
|
transformInfo: function (t) {
|
|
return t.willInstantiateSymbol = !1,
|
|
t
|
|
},
|
|
decorateEntity: function (e, i) {
|
|
var n = t.factory.createObstacle(i.symbolName),
|
|
r = e.$w;
|
|
return null != n.$w && n.$w.container.setTransform(r.container.position.x, r.container.position.y, i.keyframe.scaleX, i.keyframe.scaleY, null, -i.keyframe.skewX, i.keyframe.skewY, i.keyframe.pivotX, i.keyframe.pivotY),
|
|
n
|
|
}
|
|
}));
|
|
var n = new Zo(["bg_neon_8bit", "bg_neon_lp", "bg_neon_plannet", "bg_neon_slugfest", "bg_neon_starrcade", "bg_poster"]);
|
|
this.populator.unwrapper.registerTransformer(new Tn("random_wall_decoration", {
|
|
transformInfo: function (t) {
|
|
return t.symbolName = n.next(),
|
|
t
|
|
},
|
|
decorateEntity: function (t, e) {
|
|
e.symbolName.indexOf("neon") >= 0 && t.add(Rn.EComponent(new ke));
|
|
var i = S.animationLibraries.get_currentGame();
|
|
null == i && (i = x.defaultLibaryName);
|
|
var n = x._libraryByName.get(i)._symbols.h[e.symbolName];
|
|
if (null != t.$w) {
|
|
var r = t.$w;
|
|
r.container.position.x -= n.anchorX,
|
|
r.container.position.y -= n.anchorY
|
|
}
|
|
return t
|
|
}
|
|
}));
|
|
var r = new Zo(["bg_tl_blue", "bg_tl_pink"]);
|
|
this.populator.unwrapper.registerTransformer(new Tn("bg_tl_", {
|
|
transformInfo: function (t) {
|
|
return t.symbolName = r.next(),
|
|
t
|
|
}
|
|
})),
|
|
this.populator.unwrapper.registerTransformer(new Tn("powerplug", {
|
|
transformInfo: function (t) {
|
|
return t.willInstantiateSymbol = !1,
|
|
t
|
|
},
|
|
decorateEntity: function (e, i) {
|
|
var n = t.factory.createBossPowerPlug(),
|
|
r = e.$w;
|
|
return function (e) {
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$w)
|
|
return e;
|
|
var n = e.$rD,
|
|
o = e.$w;
|
|
o.container.setTransform(r.container.position.x, r.container.position.y, i.keyframe.scaleX, i.keyframe.scaleY, null, -i.keyframe.skewX, i.keyframe.skewY, i.keyframe.pivotX, i.keyframe.pivotY),
|
|
t.worldProjection.unproject({
|
|
x: o.container.position.x,
|
|
y: o.container.position.y,
|
|
z: 0
|
|
}, n.position3d)
|
|
}
|
|
(n),
|
|
n
|
|
}
|
|
})),
|
|
this.populator.unwrapper.registerTransformer(new Tn("garage_door", {
|
|
decorateEntity: function (t, e) {
|
|
return t.add(Rn.EComponent(new Le)),
|
|
t
|
|
}
|
|
}))
|
|
},
|
|
triggerBossBattle: function () {
|
|
this.finishLevel(2)
|
|
},
|
|
showQuote: function (t) {
|
|
this.containers.top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame()).setXY(.5 * this.sceneWidth, .5 * this.sceneHeight))]))))
|
|
},
|
|
finishLevel: function (t) {
|
|
switch (B.prototype.finishLevel.call(this, t), t) {
|
|
case 0:
|
|
case 1:
|
|
this.changeStateTo("$HC", null);
|
|
break;
|
|
case 2:
|
|
this.changeStateTo("$IC", null);
|
|
break;
|
|
case 3:
|
|
this.changeStateTo("$iC", null)
|
|
}
|
|
},
|
|
$Ga: function () {
|
|
var t,
|
|
e = this.sceneHeight - 32;
|
|
(t = new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(.9, .9).setCameraOffset(0, 0).setViewOffset(0, e)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("background")), this.populator))])),
|
|
this.containers.bottom.add(Rn.EEntity(t)),
|
|
(t = new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new li(1, 1).setViewOffset(0, e)), Rn.EComponent(new di(this.$ea, new gi(this.$ia("platforms")), this.populator))])),
|
|
this.containers.bottom.add(Rn.EEntity(t)),
|
|
(t = new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(this.worldElementLayer = new li(1, 1, "worldElement").setCameraOffset(0, 0).setViewOffset(0, e)), Rn.EEntity(this.worldElementContainer = new On), Rn.EEntity(this.playerContainer = (new On).add(Rn.EComponent(new Vt))), Rn.EEntity(this.fxContainer = (new On).add(Rn.EComponent(new Vt)))])),
|
|
this.containers.mid.add(Rn.EEntity(t))
|
|
},
|
|
$ha: function () {
|
|
var t = this;
|
|
return this.playerEntity = this.factory.createPlayer(),
|
|
function (e) {
|
|
if (null == ((i = e.$Aa)instanceof ze ? i : null))
|
|
return e;
|
|
if (null == e.$w)
|
|
return e;
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$RE)
|
|
return e;
|
|
var i,
|
|
n = (i = e.$Aa)instanceof ze ? i : null,
|
|
r = e.$w,
|
|
o = e.$rD,
|
|
s = e.$RE;
|
|
t.player = n,
|
|
t.playerDisplay = r,
|
|
t.playerWorldElement = o,
|
|
t.playerCollidable = s
|
|
}
|
|
(this.playerEntity),
|
|
this.playerContainer.add(Rn.EEntity(this.playerEntity)),
|
|
this.$a.add(this.playerEntity.$qD.value.watch((function (e, i) {
|
|
0 == e && t.finishLevel(1)
|
|
}))),
|
|
this.playerEntity
|
|
},
|
|
$xB: function () {
|
|
var t = this.sceneHeight - 32,
|
|
e = new On;
|
|
e.add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(this.worldElementLayer = new li(1, 1, "worldElement").setCameraOffset(0, 0).setViewOffset(0, t)), Rn.EEntity(this.worldElementContainer = new On), Rn.EEntity(this.playerContainer = (new On).add(Rn.EComponent(new Vt))), Rn.EEntity(this.fxContainer = (new On).add(Rn.EComponent(new Vt)))])),
|
|
this.containers.mid.add(Rn.EEntity(e))
|
|
},
|
|
$ga: function () {
|
|
this.owner._internal_getFromParents("$se").top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite("healthbar", S.animationLibraries.get_currentGame())), Rn.EComponent(new ai(this.playerEntity.$qD.value)), Rn.EComponent(new So(Oo.Relative(0), Oo.Relative(0), Oo.Relative(10), Oo.Relative(10)))])))),
|
|
this.isBossBattle || this.owner._internal_getFromParents("$se").top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EComponent(new si(this.gameModel.score)), Rn.EComponent(new So(Oo.Relative(0), Oo.Relative(0), To.fromString("100% - 10"), Oo.Relative(10)))]))))
|
|
},
|
|
spawnCoin: function (t, e, i) {
|
|
var n = function (n) {
|
|
if (null == n.$rD)
|
|
return n;
|
|
if (null == ((r = n.$nB)instanceof We ? r : null))
|
|
return n;
|
|
var r,
|
|
o = n.$rD,
|
|
s = (r = n.$nB)instanceof We ? r : null,
|
|
a = o.position3d;
|
|
return a.x = t.x,
|
|
a.y = t.y,
|
|
s.bounce(e, i),
|
|
n
|
|
}
|
|
(this.factory.createPickup("pickup_coin", "coin"));
|
|
return this.worldElementContainer.add(Rn.EEntity(n)),
|
|
n
|
|
},
|
|
$ia: function (t) {
|
|
for (var e = Un.assets.getJson(S.files.json.manifest.fileNames[2]), i = 0; i < e.length; ) {
|
|
var n = e[i];
|
|
if (++i, n.id == t)
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
onUpdate: function (t) {
|
|
B.prototype.onUpdate.call(this, t),
|
|
"$Cc" == (null != this.currentState ? this.currentState.get_name() : null) && (this.camera.target.x = this.playerDisplay.container.x)
|
|
},
|
|
__class__: $e
|
|
});
|
|
var Ae = function () {
|
|
f.call(this)
|
|
};
|
|
Ae.__name__ = !0,
|
|
Ae.__interfaces__ = [H],
|
|
Ae.__super__ = f,
|
|
Ae.prototype = o(f.prototype, {
|
|
create: function (t, e) {
|
|
return "pickup_coin" == t ? this.createPickup(t, "coin") : t.indexOf("enemy") >= 0 ? this.createEnemy(t, "brawler_young") : new On
|
|
},
|
|
createPlayer: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer("player_idle", S.animationLibraries.get_currentGame()))]))), Rn.EComponent(new ze), Rn.EComponent(new Ci), Rn.EComponent(new Ei), Rn.EComponent(new xi(15)), Rn.EComponent(new Fe({
|
|
x: 16,
|
|
y: 10
|
|
}, "player", 500, 18)), Rn.EComponent(vi.fromMovieSprite("player_colliders", S.animationLibraries.get_currentGame(), null, 1, 0).setMass(2e3)), Rn.EComponent(new Vi), Rn.EComponent(new Gi), Rn.EComponent(new Wi)]))
|
|
},
|
|
createBoss: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer("boss_idle", S.animationLibraries.get_currentGame()))]))), Rn.EComponent(new Te), Rn.EComponent(new Ei), Rn.EComponent(new xi(1e4)), Rn.EComponent(new Fe({
|
|
x: 16,
|
|
y: 10
|
|
}, "boss", 500, 17)), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite("boss_colliders", S.animationLibraries.get_currentGame(), null, 2, 0).setMass(2e3))]))
|
|
},
|
|
createBossPowerPlug: function () {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(S.animations.get("powerplug", S.animationLibraries.get_currentGame())), Rn.EComponent(new Oe), Rn.EComponent(new Ei), Rn.EComponent(new xi(3)), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite("powerplug_colliders", S.animationLibraries.get_currentGame(), 2, 16, 0))]))
|
|
},
|
|
createProjectile: function (t, e) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame()))]))), Rn.EComponent(new Gi), Rn.EComponent(new Wi), Rn.EComponent(new Li(1, 300)), Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), 1, 4, e).setFilterFlagsMethod(No.Inclusive))]))
|
|
},
|
|
createEnemy: function (t, e) {
|
|
var i,
|
|
n = new On,
|
|
r = Rn.EComponent(new Vt),
|
|
o = Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer(null, S.animationLibraries.get_currentGame()))]))),
|
|
s = Rn.EComponent(new Gi),
|
|
a = Rn.EComponent(new Wi),
|
|
h = Rn.EComponent(new Ii(t, e));
|
|
switch (e) {
|
|
case "brawler_old":
|
|
i = Rn.EComponent(new Ve);
|
|
break;
|
|
case "brawler_shooter":
|
|
i = Rn.EComponent(new He);
|
|
break;
|
|
case "brawler_young":
|
|
i = Rn.EComponent(new Ge);
|
|
break;
|
|
default:
|
|
i = null
|
|
}
|
|
return n.add(Rn.EArray([r, o, s, a, h, i, Rn.EComponent(new Ri), Rn.EComponent(new wt), Rn.EComponent(new xi(1)), Rn.EComponent(new Re), Rn.EComponent(new Ei), Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), null, 2))]))
|
|
},
|
|
createPickup: function (t, e) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSprite(t, S.animationLibraries.get_currentGame()))])).setTimeScale(rs.native.range(.9, 1.1))), Rn.EComponent(new Gi), Rn.EComponent(new Wi), "coin" == e ? Rn.EComponent(new We) : null, Rn.EComponent(new wi), Rn.EComponent(new ji), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), null, 8, 0))]))
|
|
},
|
|
createObstacle: function (t) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(new Vt), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame()))])).setTimeScale(rs.native.range(.9, 1.1))), Rn.EComponent(new Gi), Rn.EComponent(new Ye), Rn.EComponent(new Re), Rn.EComponent(new Ei), Rn.EComponent(new xi(3)), Rn.EComponent(new Lo), Rn.EComponent(new Vi), Rn.EComponent(new ko), Rn.EComponent(vi.fromMovieSprite(t + "_colliders", S.animationLibraries.get_currentGame(), 2, 16, 0))]))
|
|
},
|
|
createExplosion: function (t) {
|
|
return (new On).add(Rn.EArray([Rn.EComponent(S.animations.get(t, S.animationLibraries.get_currentGame())), Rn.EComponent(new Kr)]))
|
|
},
|
|
get_name: function () {
|
|
return "$Qc"
|
|
},
|
|
__class__: Ae
|
|
});
|
|
var Se = function () {
|
|
Y.call(this)
|
|
};
|
|
Se.__name__ = !0,
|
|
Se.__super__ = Y,
|
|
Se.prototype = o(Y.prototype, {
|
|
playProjectile: function (t) {
|
|
if (t) {
|
|
var e = S.sounds.game3.PLAYER_SHOOT;
|
|
Un.get_soundManager().play(e, 1)
|
|
} else {
|
|
e = S.sounds.game3.ENEMY_SHOOT;
|
|
Un.get_soundManager().play(e, 1)
|
|
}
|
|
},
|
|
playBossDie: function () {
|
|
var t = S.sounds.game3.BOSS_DEFEATED;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playArcadeExplode: function () {
|
|
var t = S.sounds.game3.ARCADE_EXPLODE;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playArcadeHurt: function () {
|
|
var t = S.sounds.game3.ARCADE_HURT;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playEnemyHurt: function () {
|
|
var t = S.sounds.game3.ENEMY_HURT;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playEnemyDie: function () {
|
|
var t = S.sounds.game3.ENEMY_DEFEATED;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playerHurt: function () {
|
|
var t = S.sounds.game3.PLAYER_HURT;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playerJump: function () {
|
|
var t = S.sounds.game3.PLAYER_JUMP;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playerLand: function () {
|
|
var t = S.sounds.game3.PLAYER_LAND;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
playDoubleJump: function () {
|
|
var t = S.sounds.game3.PLAYER_DOUBLEJUMP;
|
|
Un.get_soundManager().play(t, 1)
|
|
},
|
|
__class__: Se
|
|
});
|
|
var Te = function () {
|
|
this.$DC = 3,
|
|
this.$BC = !0,
|
|
this.isAlive = new Ln(!0),
|
|
this.$a = new Pn,
|
|
N.call(this)
|
|
};
|
|
Te.__name__ = !0,
|
|
Te.__super__ = N,
|
|
Te.prototype = o(N.prototype, {
|
|
onAdded: function () {
|
|
null == this.$qB && (this.$qB = this.owner.$LC),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
N.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Ie), Rn.EComponent(new Pe), Rn.EComponent(new Me)]))
|
|
},
|
|
onStart: function () {
|
|
null == this.$qB && (this.$qB = this.owner.$LC),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Cb && (this.$Cb = this.owner._internal_getFromChildren("$w", eo)),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
N.prototype.onStart.call(this),
|
|
this.$cC = {
|
|
timeStamp: 0,
|
|
yPos: 0
|
|
},
|
|
this.$rA = this.$Ma.player,
|
|
this.$bC = this.$rA.owner.$JD,
|
|
this.$Ma.playerContainer.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$dC = S.animations.get("boss_wire_scale", S.animationLibraries.get_currentGame()).setXY(this.$dA.position3d.x + 12, this.$dA.position3d.y - 3))])))),
|
|
this.$a.add(this.$HA.value.watch(cs(this, this.$lb), !1)),
|
|
this.$a.add(this.$rA.owner.$qD.value.watch(cs(this, this.$eC), !1))
|
|
},
|
|
$lb: function (t, e) {
|
|
this.$bC.hit(Math.round(e - t))
|
|
},
|
|
$eC: function (t, e) {
|
|
if (t < e) {
|
|
var i = this.owner,
|
|
n = [16057380],
|
|
r = new Pn;
|
|
if (null != i.$w) {
|
|
var o = i.$w,
|
|
s = new yr(n[0], 1);
|
|
o.container.filters = [s];
|
|
var a = 0;
|
|
r.add(hs.create(i.parent, .05, 1, (function () {
|
|
var t = a += .5;
|
|
s.update(n[(0 | t) % n.length], 1 == s.multiplier ? 0 : 1)
|
|
})));
|
|
var h = i.parent;
|
|
i = (new On).addComponent(new Gr(.1, (function () {
|
|
o.container.filters = null
|
|
})));
|
|
h.addEntity(i, !0),
|
|
r.add(i)
|
|
}
|
|
}
|
|
},
|
|
idle: function () {
|
|
this.changeStateTo("$GC", null)
|
|
},
|
|
jump: function () {
|
|
this.changeStateTo("$gC", null)
|
|
},
|
|
shoot: function () {
|
|
this.$qB.fireProjectile(!1)
|
|
},
|
|
die: function () {
|
|
this.changeStateTo("$hC", null)
|
|
},
|
|
$EC: function (t) {
|
|
this.$dA.position3d.y = t.yPos,
|
|
this.isAlive._value && (t.didDie ? this.die() : (t.didJump && this.jump(), t.didShoot && this.shoot(), t.wasIdle && this.idle()))
|
|
},
|
|
onUpdate: function (t) {
|
|
if (N.prototype.onUpdate.call(this, t), this.$BC) {
|
|
var e = this.$rA.snapshots,
|
|
i = this.$rA.currentTime - .335;
|
|
if (!(i < 0)) {
|
|
for (var n = 0, r = e.length; n < r; ) {
|
|
var o = e[n++];
|
|
o.timeStamp > this.$cC.timeStamp && o.timeStamp < i && (this.$EC(o), this.$cC = o)
|
|
}
|
|
this.$dC.container.scale.y = this.$dA.position3d.y / this.$DC
|
|
}
|
|
}
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
N.prototype.dispose.call(this)
|
|
},
|
|
__class__: Te
|
|
});
|
|
var Ce = function () {
|
|
this.axis1 = new Ai,
|
|
this.buttonAction4 = new Si,
|
|
this.buttonAction3 = new Si,
|
|
this.buttonAction2 = new Si,
|
|
this.buttonAction1 = new Si,
|
|
this.buttonRight = new Si,
|
|
this.buttonLeft = new Si,
|
|
this.buttonDown = new Si,
|
|
this.buttonUp = new Si,
|
|
f.call(this)
|
|
};
|
|
Ce.__name__ = !0,
|
|
Ce.__super__ = f,
|
|
Ce.prototype = o(f.prototype, {
|
|
get_name: function () {
|
|
return "$Hc"
|
|
},
|
|
__class__: Ce
|
|
});
|
|
var Me = function () {
|
|
it.call(this, "boss_dazed", !0)
|
|
};
|
|
Me.__name__ = !0,
|
|
Me.__super__ = it,
|
|
Me.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.owner._internal_getFromParents("$V_", Se).playBossDie(),
|
|
this.$ec.isAlive.set__(!1)
|
|
},
|
|
get_name: function () {
|
|
return "$hC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$ec && (this.$ec = this.owner.$Aa),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ec && (this.$ec = this.owner.$Aa),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Me
|
|
});
|
|
var Ie = function () {
|
|
it.call(this, "boss_idle", !0)
|
|
};
|
|
Ie.__name__ = !0,
|
|
Ie.__super__ = it,
|
|
Ie.prototype = o(it.prototype, {
|
|
get_name: function () {
|
|
return "$GC"
|
|
},
|
|
__class__: Ie
|
|
});
|
|
var Pe = function () {
|
|
it.call(this, "boss_jump", !0)
|
|
};
|
|
Pe.__name__ = !0,
|
|
Pe.__super__ = it,
|
|
Pe.prototype = o(it.prototype, {
|
|
get_name: function () {
|
|
return "$gC"
|
|
},
|
|
__class__: Pe
|
|
});
|
|
var Oe = function () {
|
|
this.$FC = {
|
|
x: 23,
|
|
y: -47
|
|
},
|
|
this.health = new Ln(3),
|
|
this.$a = new Pn,
|
|
f.call(this)
|
|
};
|
|
Oe.__name__ = !0,
|
|
Oe.__super__ = f,
|
|
Oe.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$aB && (this.$aB = this.owner.$w),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
f.prototype.onStart.call(this),
|
|
this.$a.add(this.$HA.value.watch(cs(this, this.$lb), !1)),
|
|
this.$aB.$iF(!0)
|
|
},
|
|
$lb: function (t, e) {
|
|
var i = null;
|
|
if (0 == t) {
|
|
if (null == (s = this.$Ma.factory.createExplosion("medium_explosion")).$w)
|
|
i = s;
|
|
else {
|
|
var n = (a = s.$w).container.position,
|
|
r = this.owner.$w.container.position;
|
|
n.x = r.x,
|
|
n.y = r.y;
|
|
n = a.container.position;
|
|
var o = this.$FC;
|
|
n.x += o.x,
|
|
n.y += o.y,
|
|
i = s
|
|
}
|
|
this.$aB.$hF(this.$aB.symbol.duration)
|
|
} else if (t < e) {
|
|
var s;
|
|
if (null == (s = this.$Ma.factory.createExplosion("sparks_powerplug")).$w)
|
|
i = s;
|
|
else {
|
|
var a;
|
|
n = (a = s.$w).container.position,
|
|
r = this.owner.$w.container.position;
|
|
n.x = r.x,
|
|
n.y = r.y;
|
|
n = a.container.position,
|
|
o = this.$FC;
|
|
n.x += o.x,
|
|
n.y += o.y,
|
|
i = s
|
|
}
|
|
}
|
|
null != i && this.$Ma.fxContainer.add(Rn.EEntity(i))
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
this.health.set__(this.$HA.value._value)
|
|
},
|
|
get_name: function () {
|
|
return "$fC"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$aB && (this.$aB = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Oe
|
|
});
|
|
var Re = function (t) {
|
|
null == t && (t = 1),
|
|
this.$aC = new Zo([-31, -24, -17, -10, 10, 17, 24, 31]),
|
|
this.$a = new Pn,
|
|
f.call(this),
|
|
this.$AC = t
|
|
};
|
|
Re.__name__ = !0,
|
|
Re.__super__ = f,
|
|
Re.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
f.prototype.onStart.call(this),
|
|
this.$a.add(this.$HA.value.watch(cs(this, this.$lb), !1))
|
|
},
|
|
$lb: function (t, e) {
|
|
if (!(t > e))
|
|
for (var i = Math.round(e - t) * this.$AC, n = 0; n < i; ) {
|
|
++n;
|
|
var r = this.$dA.position3d,
|
|
o = {
|
|
x: 0,
|
|
y: 10
|
|
},
|
|
s = {
|
|
x: r.x,
|
|
y: r.y
|
|
};
|
|
s.x += o.x,
|
|
s.y += o.y,
|
|
this.$Ma.spawnCoin(s, this.$aC.next())
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$_C"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Re
|
|
});
|
|
var De = function () {
|
|
this.$a = new Pn,
|
|
f.call(this)
|
|
};
|
|
De.__name__ = !0,
|
|
De.__super__ = f,
|
|
De.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$nA && (this.$nA = this.owner.$Hf),
|
|
f.prototype.onStart.call(this),
|
|
this.$a.add(this.$nA.$A_().watch(cs(this, this.$hf)))
|
|
},
|
|
$hf: function (t, e) {
|
|
this.$ya.container.visible = t > 0
|
|
},
|
|
get_name: function () {
|
|
return "$Gf"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$nA && (this.$nA = this.owner.$Hf),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: De
|
|
});
|
|
var Le = function () {
|
|
f.call(this)
|
|
};
|
|
Le.__name__ = !0,
|
|
Le.__super__ = f,
|
|
Le.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
null == this.$aB && (this.$aB = this.owner.$w),
|
|
f.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EComponent(new Zr))
|
|
},
|
|
onStart: function () {
|
|
null == this.$aB && (this.$aB = this.owner.$w),
|
|
f.prototype.onStart.call(this),
|
|
this.$aB.$iF(!0)
|
|
},
|
|
open: function () {
|
|
this.$aB.$iF(!1)
|
|
},
|
|
get_name: function () {
|
|
return "$jC"
|
|
},
|
|
__class__: Le
|
|
});
|
|
var ke = function () {
|
|
this.$NA = null,
|
|
f.call(this)
|
|
};
|
|
ke.__name__ = !0,
|
|
ke.__super__ = f,
|
|
ke.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
f.prototype.onStart.call(this),
|
|
this.$qc()
|
|
},
|
|
$qc: function () {
|
|
this.$NA = rs.native.range(1, 4)
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
if (f.prototype.onUpdate.call(this, t), null != this.$NA) {
|
|
e = (this.$NA -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
if (e) {
|
|
var i = this.owner,
|
|
n = [0],
|
|
r = rs.native.intRange(1, 3);
|
|
null == r && (r = 1);
|
|
var o = new Pn;
|
|
if (null != i.$w) {
|
|
var s = i.$w,
|
|
a = new yr(n[0], 1);
|
|
s.container.filters = [a];
|
|
var h = 0;
|
|
o.add(hs.create(i.parent, .1, r, (function () {
|
|
var t = h += .5;
|
|
a.update(n[(0 | t) % n.length], 1 == a.multiplier ? 0 : 1)
|
|
})));
|
|
var l = i.parent,
|
|
u = .1 * r + .1;
|
|
null == u && (u = 0);
|
|
i = (new On).addComponent(new Gr(u, (function () {
|
|
s.container.filters = null
|
|
})));
|
|
l.addEntity(i, !0),
|
|
o.add(i)
|
|
}
|
|
this.$qc()
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$Pc"
|
|
},
|
|
__class__: ke
|
|
});
|
|
var Fe = function (t, e, i, n) {
|
|
f.call(this),
|
|
this.$k_ = t,
|
|
this.$mC = e,
|
|
this.$zA = i,
|
|
this.$MC = n
|
|
};
|
|
Fe.__name__ = !0,
|
|
Fe.__super__ = f,
|
|
Fe.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$nC = S.animations.getMovieSprite(this.$mC + "_muzzle_flash", S.animationLibraries.get_currentGame()).setXY(this.$k_.x, -this.$k_.y)), Rn.EComponent(new Zr)])))])),
|
|
this.$nC.$hF(this.$nC.symbol.duration),
|
|
this.$nC.$iF(!0)
|
|
},
|
|
fireProjectile: function (t) {
|
|
this.$nC.$hF(0),
|
|
this.$nC.$iF(!1),
|
|
this.$Ma.sounds.playProjectile(t);
|
|
var e = this.$Ma.factory.createProjectile(this.$mC + "_projectile", this.$MC);
|
|
if (null != e.$rD) {
|
|
var i = e.$rD,
|
|
n = i.position3d,
|
|
r = this.$dA.position3d;
|
|
n.x = r.x,
|
|
n.y = r.y,
|
|
n.z = r.z,
|
|
i.position3d.x += this.$k_.x * this.$dA.heading._value.axisDirection,
|
|
i.position3d.y += this.$k_.y,
|
|
i.heading.set__(this.$dA.heading._value.clone());
|
|
n = i.velocity3d;
|
|
var o,
|
|
s,
|
|
a = i.heading._value,
|
|
h = a.x,
|
|
l = a.y,
|
|
u = this.$zA;
|
|
o = h * u,
|
|
s = l * u,
|
|
n.x = o,
|
|
n.y = s
|
|
}
|
|
this.owner.parent.add(Rn.EEntity(e))
|
|
},
|
|
get_name: function () {
|
|
return "$LC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
f.prototype.onStart.call(this)
|
|
},
|
|
__class__: Fe
|
|
});
|
|
var Ne = function (t) {
|
|
this.$Kc = new rt,
|
|
this.$a = new Pn,
|
|
f.call(this),
|
|
this.settings = t
|
|
};
|
|
Ne.__name__ = !0,
|
|
Ne.__super__ = f,
|
|
Ne.prototype = o(f.prototype, {
|
|
setMovementBounds: function (t, e) {
|
|
this.$Kc.set(t, e)
|
|
},
|
|
facePlayer: function () {
|
|
this.settings.facePlayer && this.$dA.heading.set__(this.$Ma.playerWorldElement.position3d.x < this.$dA.position3d.x ? _i.Left : _i.Right)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$jb && (this.$jb = this.owner.$Aa),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Be), Rn.EComponent(new Xe), Rn.EComponent(new je), Rn.EComponent(new Ue)]))
|
|
},
|
|
onStart: function () {
|
|
null == this.$jb && (this.$jb = this.owner.$Aa),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
f.prototype.onStart.call(this),
|
|
this.$dA.heading.set__(rs.native._random.next() > .5 ? _i.Left : _i.Right);
|
|
var t = this.$Kc.getValueFromFactor(Math.random());
|
|
this.$dA.position3d.x = t,
|
|
this.$HA.value.set__(this.settings.health),
|
|
this.$a.add(this.$HA.value.watch(cs(this, this.$lb), !1)),
|
|
this.$jb.dieOnZeroHealth = !1,
|
|
this.$jb.fallbackStateName = "$Zc",
|
|
this.$_b.filterFlags = 1,
|
|
this.$_b.filterFlagsMethod = No.Inclusive,
|
|
this.$a.add(this.$_b.$ZE().connect(cs(this, this.$lc)))
|
|
},
|
|
$lc: function (t) {
|
|
var e;
|
|
if (this.$Ma.player.isAlive._value) {
|
|
var i = this.$jb;
|
|
e = "$Oc" != (null != i.currentState ? i.currentState.get_name() : null)
|
|
} else
|
|
e = !1;
|
|
e && this.$jb.changeStateTo("$Oc", null)
|
|
},
|
|
$lb: function (t, e) {
|
|
0 == t ? this.$jb.changeStateTo("$oc", null) : t < e && this.$jb.changeStateTo("$Nc", null)
|
|
},
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), "$oc" != (null != (i = this.$jb).currentState ? i.currentState.get_name() : null)) {
|
|
if (this.distanceToPlayer = $o.distanceTo(this.$dA.position3d, this.$Ma.playerWorldElement.position3d), "$Zc" != (null != (i = this.$jb).currentState ? i.currentState.get_name() : null))
|
|
e = "$qC" == (null != (i = this.$jb).currentState ? i.currentState.get_name() : null);
|
|
else
|
|
e = !0;
|
|
if (e && this.distanceToPlayer < 75)
|
|
this.$jb.changeStateTo("$Mc", null);
|
|
else {
|
|
var e;
|
|
if ("$Zc" != (null != (i = this.$jb).currentState ? i.currentState.get_name() : null))
|
|
e = "$qC" == (null != (i = this.$jb).currentState ? i.currentState.get_name() : null);
|
|
else
|
|
e = !0;
|
|
if (!e || this.$Kc._size < 1) {
|
|
"$Zc" == (null != (i = this.$jb).currentState ? i.currentState.get_name() : null) && this.$jb.changeStateTo("$qC", null)
|
|
} else {
|
|
"$qC" == (null != (i = this.$jb).currentState ? i.currentState.get_name() : null) && this.$jb.changeStateTo("$Zc", null),
|
|
this.$dA.position3d.x += this.settings.speed * t * this.$dA.heading._value.axisDirection;
|
|
var i = this.$Kc,
|
|
n = this.$dA.position3d.x;
|
|
i._from <= n && n <= i._to || i._to <= n && n <= i._from || (this.$dA.heading.set__(this.$dA.heading._value == _i.Left ? _i.Right : _i.Left), this.$dA.position3d.x = this.$Kc.clamp(this.$dA.position3d.x))
|
|
}
|
|
}
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$kc"
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Ne
|
|
});
|
|
var Be = function () {
|
|
nt.call(this, "attack")
|
|
};
|
|
Be.__name__ = !0,
|
|
Be.__super__ = nt,
|
|
Be.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this);
|
|
var t = this.$Ma.playerEntity;
|
|
null != t.$JD && t.$JD.hit(this.$nc.settings.attackHitPoints)
|
|
},
|
|
onUpdateState: function (t) {
|
|
nt.prototype.onUpdateState.call(this, t),
|
|
this.$nc.facePlayer()
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Zc"
|
|
},
|
|
get_name: function () {
|
|
return "$Oc"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$nc && (this.$nc = this.owner.$kc),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$nc && (this.$nc = this.owner.$kc),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Be
|
|
});
|
|
var Ue = function () {
|
|
nt.call(this, "dazed", !0)
|
|
};
|
|
Ue.__name__ = !0,
|
|
Ue.__super__ = nt,
|
|
Ue.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
this.owner._internal_getFromParents("$V_", Se).playEnemyDie(),
|
|
this.$_b.collisionsEnabled = !1
|
|
},
|
|
get_name: function () {
|
|
return "$oc"
|
|
},
|
|
onStart: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Ue
|
|
});
|
|
var Xe = function () {
|
|
nt.call(this, "hurt"),
|
|
this.canReactivate = !0
|
|
};
|
|
Xe.__name__ = !0,
|
|
Xe.__super__ = nt,
|
|
Xe.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
this.$Ma.sounds.playEnemyHurt()
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Zc"
|
|
},
|
|
get_name: function () {
|
|
return "$Nc"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
__class__: Xe
|
|
});
|
|
var je = function () {
|
|
nt.call(this, "windup", !0)
|
|
};
|
|
je.__name__ = !0,
|
|
je.__super__ = nt,
|
|
je.prototype = o(nt.prototype, {
|
|
onUpdateState: function (t) {
|
|
nt.prototype.onUpdateState.call(this, t),
|
|
this.$nc.facePlayer()
|
|
},
|
|
keepInState: function () {
|
|
return this.$nc.distanceToPlayer < 75
|
|
},
|
|
getNextStateName: function () {
|
|
return "$Zc"
|
|
},
|
|
get_name: function () {
|
|
return "$Mc"
|
|
},
|
|
onStart: function () {
|
|
null == this.$nc && (this.$nc = this.owner.$kc),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$nc && (this.$nc = this.owner.$kc),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: je
|
|
});
|
|
var Ve = function () {
|
|
Ne.call(this, {
|
|
health: 5,
|
|
speed: 25,
|
|
attackHitPoints: 3,
|
|
facePlayer: !0
|
|
})
|
|
};
|
|
Ve.__name__ = !0,
|
|
Ve.__super__ = Ne,
|
|
Ve.prototype = o(Ne.prototype, {
|
|
__class__: Ve
|
|
});
|
|
var He = function () {
|
|
this.$Lb = new as(1.5),
|
|
Ne.call(this, {
|
|
health: 5,
|
|
speed: 25,
|
|
attackHitPoints: 3,
|
|
facePlayer: !1
|
|
})
|
|
};
|
|
He.__name__ = !0,
|
|
He.__super__ = Ne,
|
|
He.prototype = o(Ne.prototype, {
|
|
onAdded: function () {
|
|
Ne.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(this.$qB = new Fe({
|
|
x: 19,
|
|
y: 13
|
|
}, "enemy_surge", 250, 17))]))
|
|
},
|
|
onStart: function () {
|
|
var t = this;
|
|
Ne.prototype.onStart.call(this),
|
|
this.$dA.heading.set__(_i.Left),
|
|
ss.create(this.owner, 1, (function () {
|
|
t.$qB.fireProjectile(!1)
|
|
}))
|
|
},
|
|
onUpdate: function (t) {
|
|
if (Ne.prototype.onUpdate.call(this, t), this.$Lb.update(t)) {
|
|
var e,
|
|
i;
|
|
if ("$Zc" != (null != (i = this.$jb).currentState ? i.currentState.get_name() : null))
|
|
e = "$qC" == (null != (i = this.$jb).currentState ? i.currentState.get_name() : null);
|
|
else
|
|
e = !0;
|
|
e && this.$qB.fireProjectile(!1),
|
|
this.$Lb.reset()
|
|
}
|
|
},
|
|
__class__: He
|
|
});
|
|
var Ge = function () {
|
|
Ne.call(this, {
|
|
health: 3,
|
|
speed: 75,
|
|
attackHitPoints: 3,
|
|
facePlayer: !0
|
|
})
|
|
};
|
|
Ge.__name__ = !0,
|
|
Ge.__super__ = Ne,
|
|
Ge.prototype = o(Ne.prototype, {
|
|
__class__: Ge
|
|
});
|
|
var Ye = function () {
|
|
this.$Yc = new as(.1),
|
|
this.$a = new Pn,
|
|
f.call(this)
|
|
};
|
|
Ye.__name__ = !0,
|
|
Ye.__super__ = f,
|
|
Ye.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
f.prototype.onStart.call(this),
|
|
this.$a.add(this.$HA.value.watch((function (e, i) {
|
|
e < i && t.$Ma.sounds.playArcadeHurt()
|
|
}), !1)),
|
|
this.$a.add(this.$Ma.player.stateChanged.connect(cs(this, this.$Na)))
|
|
},
|
|
$Na: function (t, e) {
|
|
"$JC" == t.get_name() && (this.$_b.collisionsEnabled = !1, this.$Yc.reset())
|
|
},
|
|
$zc: function () {
|
|
var t,
|
|
e = this,
|
|
i = this.$Ma.factory.createExplosion("big_explosion_02");
|
|
if (null == i.$w)
|
|
t = i;
|
|
else {
|
|
var n = i.$w,
|
|
r = n.container.position,
|
|
o = e.$dA.position3d.x,
|
|
s = -e.$dA.position3d.y;
|
|
r.x = o,
|
|
r.y = null == s ? o : s,
|
|
n.container.position.x += 3,
|
|
t = i
|
|
}
|
|
this.$Ma.fxContainer.add(Rn.EEntity(t)),
|
|
this.owner.parent.addEntity((new On).addComponent(new Gr(.1, (function () {
|
|
var t = {
|
|
x: e.$dA.position3d.x + rs.native.range(-10, 10),
|
|
y: -e.$dA.position3d.y - 20 + rs.native.range(-10, 10)
|
|
},
|
|
i = e.$Ma.factory.createExplosion("medium_explosion");
|
|
null != i.$w && i.$w.container.position.copyFrom(t),
|
|
e.$Ma.fxContainer.addEntity(i)
|
|
}))), !0),
|
|
this.owner.parent.addEntity((new On).addComponent(new Gr(.2, (function () {
|
|
var t = {
|
|
x: e.$dA.position3d.x + rs.native.range(-10, 10),
|
|
y: -e.$dA.position3d.y - 20 + rs.native.range(-10, 10)
|
|
},
|
|
i = e.$Ma.factory.createExplosion("medium_explosion");
|
|
null != i.$w && i.$w.container.position.copyFrom(t),
|
|
e.$Ma.fxContainer.addEntity(i)
|
|
}))), !0),
|
|
this.$Ma.sounds.playArcadeExplode()
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
if (f.prototype.onUpdate.call(this, t), this.$_b.collisionsEnabled)
|
|
e = !1;
|
|
else {
|
|
var i = this.$Yc;
|
|
e = !(i.isEnabled && i.time <= 0)
|
|
}
|
|
e && this.$Yc.update(t) && (this.$_b.collisionsEnabled = !0),
|
|
0 == this.$HA.value._value && null == this.owner.$re && (this.owner.add(Rn.EComponent(new Gr)), this.$zc())
|
|
},
|
|
get_name: function () {
|
|
return "$yc"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Ye
|
|
});
|
|
var We = function () {
|
|
this.$pB = !1,
|
|
this.$NB = new lo(0, 0),
|
|
bt.call(this)
|
|
};
|
|
We.__name__ = !0,
|
|
We.__super__ = bt,
|
|
We.prototype = o(bt.prototype, {
|
|
onAdded: function () {
|
|
var t = this;
|
|
null == this.$dA && (this.$dA = this.owner.$rD);
|
|
var e = Rn.EComponent(new $i(vn.fromFlag(1), (function (e) {
|
|
t.owner.$RE.disableCollisions();
|
|
var i = e.other.owner.$Aa;
|
|
(i instanceof ze ? i : null).collectCoin(),
|
|
t.owner.add(Rn.EComponent(new Gr)),
|
|
Un.get_soundManager().play(S.sounds.game3.PICKUP_COIN)
|
|
})));
|
|
this.owner.add(e)
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
bt.prototype.onStart.call(this);
|
|
var t = this.$dA.position3d;
|
|
this.$oB = {
|
|
x: t.x,
|
|
y: t.y
|
|
},
|
|
this.$NB.set(this.$dA.position3d.x, this.$dA.position3d.y),
|
|
null != this.$OB && (this.bounce(this.$OB.x, this.$OB.y), this.$OB = null);
|
|
var e = this.owner._internal_getFromChildren("$w", br);
|
|
e.$hF(rs.native._random.next() * e.symbol.duration)
|
|
},
|
|
bounce: function (t, e) {
|
|
var i = this;
|
|
null == t && (t = (rs.native._random.next() > .5 ? -1 : 1) * rs.native.range(15, 25)),
|
|
null == e && (e = 30),
|
|
null == this.$oB ? this.$OB = {
|
|
x: t,
|
|
y: e
|
|
}
|
|
: (this.$pB = !0, this.$NB.x.animateTo(this.$NB.x._value + t, .4), this.$NB.y.animateTo(this.$oB.y + e, .2, Gn.sineOut, (function () {
|
|
i.$NB.y.animateTo(i.$oB.y, .2, Gn.sineIn, (function () {
|
|
i.$PB(),
|
|
i.$pB = !1
|
|
}))
|
|
})))
|
|
},
|
|
$PB: function () {
|
|
var t = this.$dA.position3d,
|
|
e = this.$NB.x._value,
|
|
i = this.$NB.y._value;
|
|
t.x = e,
|
|
t.y = null == i ? e : i
|
|
},
|
|
onUpdate: function (t) {
|
|
if (bt.prototype.onUpdate.call(this, t), this.$pB) {
|
|
var e = this.$NB;
|
|
e.x.update(t),
|
|
e.y.update(t),
|
|
this.$PB()
|
|
}
|
|
},
|
|
__class__: We
|
|
});
|
|
var ze = function () {
|
|
this.$sB = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$RB = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$rB = 1,
|
|
this.snapshots = [],
|
|
this.currentTime = 0,
|
|
this.velocityDampening = {
|
|
x: 1,
|
|
y: 1
|
|
},
|
|
this.isInteractive = new Ln(!0),
|
|
this.isAlive = new Ln(!0),
|
|
this.isOnFloor = new Ln(!0),
|
|
this.canDoubleJump = !0,
|
|
this.$a = new Pn,
|
|
N.call(this)
|
|
};
|
|
ze.__name__ = !0,
|
|
ze.__super__ = N,
|
|
ze.prototype = o(N.prototype, {
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$qB && (this.$qB = this.owner.$LC),
|
|
N.prototype.onAdded.call(this),
|
|
this.owner.add(Rn.EArray([Rn.EComponent(new Ze), Rn.EComponent(new Qe), Rn.EComponent(new Je), Rn.EComponent(new ti), Rn.EComponent(new Ke), Rn.EComponent(new qe)]))
|
|
},
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$hA && (this.$hA = this.owner.$Hc),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$qB && (this.$qB = this.owner.$LC),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
N.prototype.onStart.call(this),
|
|
this.changeStateTo("$vB", null),
|
|
this.$a.add(this.$_b.$Tc().connect(cs(this, this.$SB))),
|
|
this.$a.add(this.isOnFloor.watch(cs(this, this.$tB))),
|
|
this.$a.add(this.owner.$qD.value.watch((function (e, i) {
|
|
e > 0 && e < i && t.hurt(Math.round(i - e))
|
|
}), !1))
|
|
},
|
|
collectCoin: function () {
|
|
var t = this.$Ma.gameModel.score;
|
|
t.set__(t._value + 1)
|
|
},
|
|
$SB: function (t) {
|
|
if (16 == t.other.flags) {
|
|
var e = t.type;
|
|
0 == e._hx_index && -1 != e.currentSides.indexOf(8) && this.isOnFloor.set__(!0)
|
|
}
|
|
3 == t.other.type && ("exit_trigger" == t.other.data ? this.$Ma.finishLevel(0) : "endboss_trigger" == t.other.data && this.$Ma.triggerBossBattle())
|
|
},
|
|
$tB: function (t, e) {
|
|
t ? this.changeStateTo("$VB", null) : "$vB" == (null != this.currentState ? this.currentState.get_name() : null) && this.changeStateTo("$KC", null)
|
|
},
|
|
hurt: function (t) {
|
|
"$kC" != (null != this.currentState ? this.currentState.get_name() : null) && this.changeStateTo("$kC", null);
|
|
var e = this.$Ma.gameModel.score._value,
|
|
i = e < t ? e : t;
|
|
if ((n = this.$Ma.gameModel.score).set__(n._value - i), !this.$Ma.isBossBattle)
|
|
for (var n = 0, r = i; n < r; ) {
|
|
++n;
|
|
var o = this.$dA.position3d,
|
|
s = o.x,
|
|
a = o.y,
|
|
h = {
|
|
x: 0,
|
|
y: rs.native.range(5, 15)
|
|
},
|
|
l = {
|
|
x: s,
|
|
y: a
|
|
};
|
|
l.x += h.x,
|
|
l.y += h.y;
|
|
var u = this.$Ma.spawnCoin(l, rs.native.range(-75, -125), rs.native.range(40, 60));
|
|
null != u.$RE && u.$RE.disableCollisions()
|
|
}
|
|
},
|
|
jump: function () {
|
|
this.isOnFloor._value ? this.$QB.didJump = !0 : this.$QB.didDoubleJump = !0,
|
|
this.changeStateTo("$JC", null)
|
|
},
|
|
shoot: function () {
|
|
this.$QB.didShoot = !0,
|
|
this.$qB.fireProjectile(!0)
|
|
},
|
|
die: function () {
|
|
this.$QB.didDie = !0,
|
|
this.changeStateTo("$lC", null)
|
|
},
|
|
drown: function () {
|
|
this.die(),
|
|
this.$ya.container.visible = !1;
|
|
var t,
|
|
e = (new On).add(Rn.EArray([Rn.EComponent(S.animations.get("lava_splash", S.animationLibraries.get_currentGame())), Rn.EComponent(new Kr)]));
|
|
if (null == e.$w)
|
|
t = e;
|
|
else {
|
|
var i = e.$w.container.position;
|
|
i.x = this.$ya.container.position.x,
|
|
i.y = 19,
|
|
t = e
|
|
}
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(t))
|
|
},
|
|
onUpdate: function (t) {
|
|
for (N.prototype.onUpdate.call(this, t), this.currentTime += t; this.snapshots.length > 0 && this.currentTime - this.snapshots[0].timeStamp > this.$rB; )
|
|
this.snapshots.shift();
|
|
if (this.$QB = {
|
|
timeStamp: this.currentTime,
|
|
yPos: this.$dA.position3d.y
|
|
}, this.snapshots.push(this.$QB), 0 == this.$HA.value._value)
|
|
"$lC" != (null != this.currentState ? this.currentState.get_name() : null) && this.die();
|
|
else if (this.$dA.position3d.y < -20)
|
|
this.drown();
|
|
else if (this.isAlive._value && this.isInteractive._value) {
|
|
var e = this.$dA.position3d,
|
|
i = this.$RB,
|
|
n = {
|
|
x: e.x,
|
|
y: e.y
|
|
};
|
|
n.x -= i.x,
|
|
n.y -= i.y,
|
|
this.$sB = n;
|
|
e = this.$RB;
|
|
var r = this.$dA.position3d;
|
|
e.x = r.x,
|
|
e.y = r.y,
|
|
this.isOnFloor._value && Math.abs(this.$sB.y) > 1 && this.changeStateTo("$KC", null),
|
|
"$kC" != (null != this.currentState ? this.currentState.get_name() : null) && (this.$_b.velocity.x = 115 * this.velocityDampening.x, this.$hA.buttonUp.wasPressed._value && (this.isOnFloor._value || this.canDoubleJump) && (this.isOnFloor._value || (this.canDoubleJump = !1), this.jump())),
|
|
this.$hA.buttonAction1.wasPressed._value && this.shoot()
|
|
}
|
|
var o = null != this.currentState ? this.currentState.get_name() : null;
|
|
this.$QB.wasIdle = "$vB" == o
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
N.prototype.dispose.call(this)
|
|
},
|
|
__class__: ze
|
|
});
|
|
var qe = function () {
|
|
it.call(this, "player_dazed", !0)
|
|
};
|
|
qe.__name__ = !0,
|
|
qe.__super__ = it,
|
|
qe.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.$HA.value.set__(0),
|
|
this.$rA.isAlive.set__(!1),
|
|
this.$_b.velocity.x = 0
|
|
},
|
|
get_name: function () {
|
|
return "$lC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: qe
|
|
});
|
|
var Je = function () {
|
|
it.call(this, "player_jump", !0)
|
|
};
|
|
Je.__name__ = !0,
|
|
Je.__super__ = it,
|
|
Je.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.$rA.isOnFloor.set__(!1)
|
|
},
|
|
get_name: function () {
|
|
return "$KC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Je
|
|
});
|
|
var Ke = function () {
|
|
it.call(this, "player_hurt", !0)
|
|
};
|
|
Ke.__name__ = !0,
|
|
Ke.__super__ = it,
|
|
Ke.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this);
|
|
var t = this.owner,
|
|
e = [16057380],
|
|
i = new Pn;
|
|
if (null != t.$w) {
|
|
var n = t.$w,
|
|
r = new yr(e[0], 1);
|
|
n.container.filters = [r];
|
|
var o = 0;
|
|
i.add(hs.create(t.parent, .05, 1, (function () {
|
|
var t = o += .5;
|
|
r.update(e[(0 | t) % e.length], 1 == r.multiplier ? 0 : 1)
|
|
})));
|
|
var s = t.parent;
|
|
t = (new On).addComponent(new Gr(.1, (function () {
|
|
n.container.filters = null
|
|
})));
|
|
s.addEntity(t, !0),
|
|
i.add(t)
|
|
}
|
|
this.$_b.velocity.x = -180 * this.$rA.velocityDampening.x,
|
|
this.$_b.velocity.y = -300 * this.$rA.velocityDampening.x;
|
|
var a = this.$_b;
|
|
a.position.y = a.step.y = a.$wE.y = a.position.y - 1,
|
|
this.$rA.isOnFloor.set__(!1),
|
|
this.$Ma.sounds.playerHurt()
|
|
},
|
|
get_name: function () {
|
|
return "$kC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Ke
|
|
});
|
|
var Ze = function () {
|
|
it.call(this, Ze._NAME_IDLE, !0)
|
|
};
|
|
Ze.__name__ = !0,
|
|
Ze.__super__ = it,
|
|
Ze.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this)
|
|
},
|
|
onUpdateState: function (t) {
|
|
it.prototype.onUpdateState.call(this, t),
|
|
this.$MA == Ze._NAME_MOVE && 0 == this.$_b.velocity.x && (this.$MA = Ze._NAME_IDLE, this.$pA()),
|
|
this.$MA == Ze._NAME_IDLE && this.$_b.velocity.x > 0 && (this.$MA = Ze._NAME_MOVE, this.$pA())
|
|
},
|
|
get_name: function () {
|
|
return "$vB"
|
|
},
|
|
onStart: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Ze
|
|
});
|
|
var Qe = function () {
|
|
it.call(this, "player_jump", !0),
|
|
this.canReactivate = !0
|
|
};
|
|
Qe.__name__ = !0,
|
|
Qe.__super__ = it,
|
|
Qe.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
if (it.prototype.onActivate.call(this), this.$rA.isOnFloor._value ? (this.$_b.velocity.y = -600, this.$Ma.sounds.playerJump()) : (this.$_b.velocity.y < 0 ? this.$_b.velocity.y += -390 : this.$_b.velocity.y = Math.min(-390, this.$_b.velocity.y), this.$Ma.sounds.playDoubleJump()), this.$_b.position.y > 1) {
|
|
var t = this.$_b;
|
|
t.position.y = t.step.y = t.$wE.y = -1
|
|
}
|
|
this.$rA.isOnFloor.set__(!1)
|
|
},
|
|
get_name: function () {
|
|
return "$JC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Qe
|
|
});
|
|
var ti = function () {
|
|
it.call(this, "player_idle", !0)
|
|
};
|
|
ti.__name__ = !0,
|
|
ti.__super__ = it,
|
|
ti.prototype = o(it.prototype, {
|
|
onActivate: function () {
|
|
it.prototype.onActivate.call(this),
|
|
this.$Ma.sounds.playerLand(),
|
|
this.$rA.isOnFloor.set__(!0),
|
|
this.$rA.canDoubleJump = !0
|
|
},
|
|
keepInState: function () {
|
|
return !1
|
|
},
|
|
getNextStateName: function () {
|
|
return "$vB"
|
|
},
|
|
get_name: function () {
|
|
return "$VB"
|
|
},
|
|
onStart: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
it.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$rA && (this.$rA = this.owner.$Aa),
|
|
it.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ti
|
|
});
|
|
var ei = function () {
|
|
et.call(this)
|
|
};
|
|
ei.__name__ = !0,
|
|
ei.__super__ = et,
|
|
ei.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
var t = this;
|
|
et.prototype.onActivate.call(this);
|
|
var e = this.$Ma.touchUI;
|
|
null != e && e.disable(),
|
|
this.$Ma.playerEntity.add(Rn.EComponent(new Gr)),
|
|
this.$Ma.fader.$nA.$A_().animate(0, 1, .2, null, (function () {
|
|
t.$Ma.containers.bottom.disposeChildren(),
|
|
t.$Ma.containers.mid.disposeChildren(),
|
|
t.$Ma.containers.top.disposeChildren(),
|
|
t.$Ma.containers.top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get("bossroom_intro", S.animationLibraries.get_currentGame())), Rn.EComponent(new Zr((function () {
|
|
t.$Ma.endGame()
|
|
})))])))),
|
|
t.$Ma.fader.$nA.$A_().animate(1, 0, .2, null, null, 0)
|
|
}), 0)
|
|
},
|
|
get_name: function () {
|
|
return "$IC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
__class__: ei
|
|
});
|
|
var ii = function () {
|
|
et.call(this)
|
|
};
|
|
ii.__name__ = !0,
|
|
ii.__super__ = et,
|
|
ii.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
var t = this;
|
|
et.prototype.onActivate.call(this);
|
|
var e = this.$Ma.touchUI;
|
|
null != e && e.disable(),
|
|
this.$Ma.worldElementContainer._internal_getFromChildren("$jC").open(),
|
|
this.owner.addEntity((new On).addComponent(new Gr(1, (function () {
|
|
t.$Ma.playerCollidable.velocity.x = 115
|
|
}))), !0)
|
|
},
|
|
onUpdateState: function (t) {
|
|
et.prototype.onUpdateState.call(this, t),
|
|
this.$Ma.playerCollidable.position.x > 355 && this.$Ma.endGame()
|
|
},
|
|
get_name: function () {
|
|
return "$iC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
__class__: ii
|
|
});
|
|
var ni = function () {
|
|
et.call(this)
|
|
};
|
|
ni.__name__ = !0,
|
|
ni.__super__ = et,
|
|
ni.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
et.prototype.onActivate.call(this);
|
|
for (var t = this.$Ma.populator.unwrapper.unwrap("chunk_bossbattle_x_500", S.animationLibraries.get_currentGame()), e = 0; e < t.length; ) {
|
|
var i = t[e];
|
|
++e,
|
|
this.$Ma.worldElementContainer.add(Rn.EEntity(i)),
|
|
null != i.$fC && (this.$Fc = i, this.$gc = i.$fC)
|
|
}
|
|
var n;
|
|
this.$hc(),
|
|
this.$Ma.playerCollidable.setXY(70, 0),
|
|
(n = this.$Ma.player.velocityDampening).x = 0,
|
|
n.y = 0,
|
|
(n = this.$Ec.position3d).x = 212,
|
|
n.y = 0,
|
|
this.$Ec.heading.set__(_i.Left),
|
|
this.$Ma.fxContainer.addEntity((new On).add(Rn.EComponent(S.animations.get("bossroom_lighttrail", S.animationLibraries.get_currentGame()).setXY(153, -167)))),
|
|
this.$La.add(this.$gc.health.watch(cs(this, this.$Gc)))
|
|
},
|
|
$Gc: function (t, e) {
|
|
0 == t && (this.$ec.die(), this.$Ma.player.isInteractive.set__(!1), this.$Ma.finishLevel(3))
|
|
},
|
|
$hc: function () {
|
|
var t = this;
|
|
return this.$Dc = this.$Ma.factory.createBoss(),
|
|
function (e) {
|
|
if (null == ((i = e.$Aa)instanceof Te ? i : null))
|
|
return e;
|
|
if (null == e.$rD)
|
|
return e;
|
|
if (null == e.$RE)
|
|
return e;
|
|
var i,
|
|
n = (i = e.$Aa)instanceof Te ? i : null,
|
|
r = e.$rD,
|
|
o = e.$RE;
|
|
t.$ec = n,
|
|
t.$fc = o,
|
|
t.$Ec = r
|
|
}
|
|
(this.$Dc),
|
|
this.$Ma.playerContainer.addEntity(this.$Dc, !1),
|
|
this.$Dc
|
|
},
|
|
onUpdateState: function (t) {
|
|
et.prototype.onUpdateState.call(this, t)
|
|
},
|
|
get_name: function () {
|
|
return "$dc"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", $e)),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
__class__: ni
|
|
});
|
|
var ri = function () {
|
|
et.call(this)
|
|
};
|
|
ri.__name__ = !0,
|
|
ri.__super__ = et,
|
|
ri.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
var t = this;
|
|
et.prototype.onActivate.call(this);
|
|
var e = this.$Ma.touchUI;
|
|
switch (null != e && e.disable(), this.$Ma.gameModel.outcome) {
|
|
case 0:
|
|
this.win();
|
|
break;
|
|
case 1:
|
|
this.lose()
|
|
}
|
|
this.owner.addEntity((new On).addComponent(new Gr(3, (function () {
|
|
t.$Ma.endGame()
|
|
}))), !0)
|
|
},
|
|
win: function () {
|
|
this.$Ma.showQuote("quote_win"),
|
|
this.$Ma.playerDisplay.container.visible = !1
|
|
},
|
|
lose: function () {
|
|
this.$Ma.showQuote("quote_lose")
|
|
},
|
|
get_name: function () {
|
|
return "$HC"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ri
|
|
});
|
|
var oi = function () {
|
|
et.call(this)
|
|
};
|
|
oi.__name__ = !0,
|
|
oi.__super__ = et,
|
|
oi.prototype = o(et.prototype, {
|
|
onActivate: function () {
|
|
var t;
|
|
et.prototype.onActivate.call(this),
|
|
(t = this.$Ma.playerCollidable).position.x = t.step.x = t.$wE.x = 1e3,
|
|
(t = this.$Ma.playerCollidable).position.y = t.step.y = t.$wE.y = -100
|
|
},
|
|
onDeactivate: function () {
|
|
et.prototype.onDeactivate.call(this)
|
|
},
|
|
onUpdateState: function (t) {},
|
|
get_name: function () {
|
|
return "$Cc"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner.$Aa),
|
|
et.prototype.onAdded.call(this)
|
|
},
|
|
__class__: oi
|
|
});
|
|
var si = function (t) {
|
|
this.$a = new Pn,
|
|
f.call(this),
|
|
this.$cc = t
|
|
};
|
|
si.__name__ = !0,
|
|
si.__super__ = f,
|
|
si.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
f.prototype.onAdded.call(this),
|
|
this.$Bc = new PIXI.BitmapText("0", {
|
|
font: "perfectdos",
|
|
align: "right"
|
|
}),
|
|
this.$Bc.anchor.set(1, 0),
|
|
this.owner.add(Rn.EArray([Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get("counter_coin", S.animationLibraries.get_currentGame()).setXY(-13, -2))]))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new Vt(this.$Bc).setXY(-13, 0))])))]))
|
|
},
|
|
onStart: function () {
|
|
var t = this;
|
|
f.prototype.onStart.call(this),
|
|
this.$a.add(this.$cc.watch((function (e, i) {
|
|
t.$Bc.text = null == e ? "null" : "" + e
|
|
})))
|
|
},
|
|
get_name: function () {
|
|
return "$bc"
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: si
|
|
});
|
|
var ai = function (t) {
|
|
f.call(this),
|
|
this.$HA = t,
|
|
this.$eB = this.$HA._value
|
|
};
|
|
ai.__name__ = !0,
|
|
ai.__super__ = f,
|
|
ai.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this._movieSprite && (this._movieSprite = this.owner.$w),
|
|
f.prototype.onStart.call(this);
|
|
var e = this.owner,
|
|
i = new On,
|
|
n = (new Vt).setXY(38, 0);
|
|
e.add(Rn.EArray([Rn.EEntity(i.add(Rn.EArray([Rn.EComponent(n)])))])),
|
|
this.$ac = S.animations.getSprite("healthbar_hearts_fill", S.animationLibraries.get_currentGame()),
|
|
this.$Ac = S.animations.getSprite("healthbar_hearts_mask", S.animationLibraries.get_currentGame()),
|
|
this.$ac.mask = this.$Ac,
|
|
n.container.addChild(this.$ac, this.$Ac),
|
|
this.$h = this.$HA.watch((function (e, i) {
|
|
t.$Ac.scale.x = e / t.$eB
|
|
}))
|
|
},
|
|
get_name: function () {
|
|
return "$_c"
|
|
},
|
|
onAdded: function () {
|
|
null == this._movieSprite && (this._movieSprite = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: ai
|
|
});
|
|
var hi = function () {
|
|
this.$a = new Pn,
|
|
Gt.call(this)
|
|
};
|
|
hi.__name__ = !0,
|
|
hi.__super__ = Gt,
|
|
hi.prototype = o(Gt.prototype, {
|
|
onAdded: function () {
|
|
Gt.prototype.onAdded.call(this);
|
|
this.owner.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$ya = new Vt), Rn.EComponent(new So(To.fromString("100%"), To.fromString("100%"))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$pc = new Ui(42).setHitArea(-100, -150, 300, 300)), Rn.EEntity((new On).add(Rn.EComponent(S.animations.get("button_jump", S.animationLibraries.get_currentGame())))), Rn.EComponent(new So(Oo.Relative(42), Oo.Relative(42), Oo.Relative(33), To.fromString("100% - 33")))]))), Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(this.$Ya = new Ui(42).setHitArea(-200, -150, 300, 300)), Rn.EEntity((new On).add(Rn.EComponent(S.animations.get("button_shoot", S.animationLibraries.get_currentGame())))), Rn.EComponent(new So(Oo.Relative(42), Oo.Relative(42), To.fromString("100% - 33"), To.fromString("100% - 33")))])))]))))
|
|
},
|
|
onUpdate: function (t) {
|
|
var e;
|
|
(Gt.prototype.onUpdate.call(this, t), this.button1Down.set__(this.$Ya.isDown._value), this.$pc.isDown._value) ? ((e = this.axisDirection).x = 0, e.y = -1) : ((e = this.axisDirection).x = 0, e.y = 0)
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
Gt.prototype.dispose.call(this)
|
|
},
|
|
__class__: hi
|
|
});
|
|
var li = function (t, e, i) {
|
|
null == i && (i = ""),
|
|
null == e && (e = 1),
|
|
null == t && (t = 1),
|
|
this.viewportBottom = new Ln(0),
|
|
this.viewportTop = new Ln(0),
|
|
this.viewportRight = new Ln(0),
|
|
this.viewportLeft = new Ln(0),
|
|
this.$IE = li.$Uc,
|
|
this.$vc = li.$Uc,
|
|
this.$iE = [],
|
|
f.call(this),
|
|
this.xMultiplier = t,
|
|
this.yMultiplier = e,
|
|
this.id = i
|
|
};
|
|
li.__name__ = !0,
|
|
li.__super__ = f,
|
|
li.prototype = o(f.prototype, {
|
|
setViewOffset: function (t, e) {
|
|
var i = this.$vc,
|
|
n = li.$Uc;
|
|
i.x == n.x && i.y == n.y ? this.$vc = {
|
|
x: t,
|
|
y: e
|
|
}
|
|
: ((i = this.$vc).x = t, i.y = null == e ? t : e);
|
|
return this
|
|
},
|
|
setCameraOffset: function (t, e) {
|
|
var i = this.$IE,
|
|
n = li.$Uc;
|
|
i.x == n.x && i.y == n.y ? this.$IE = {
|
|
x: t,
|
|
y: e
|
|
}
|
|
: ((i = this.$IE).x = t, i.y = null == e ? t : e);
|
|
return this
|
|
},
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", B)),
|
|
f.prototype.onStart.call(this),
|
|
this.$HE = this.$Ma.camera
|
|
},
|
|
addLayerEntity: function (t) {
|
|
this.$iE.push(t),
|
|
this.owner.addEntity(t)
|
|
},
|
|
removeLayerEntity: function (t) {
|
|
a.remove(this.$iE, t),
|
|
t.parent == this.owner && this.owner.removeEntity(t)
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
this.viewportLeft.set__(this.$HE.viewArea.x * this.xMultiplier + this.$IE.x),
|
|
this.viewportRight.set__(this.viewportLeft._value + this.$HE.viewArea.width),
|
|
this.viewportTop.set__(this.$HE.viewArea.y * this.yMultiplier + this.$IE.y),
|
|
this.viewportBottom.set__(this.viewportTop._value + this.$HE.viewArea.height),
|
|
this.$ya.setXY(-this.viewportLeft._value + this.$vc.x, -this.viewportTop._value + this.$vc.y)
|
|
},
|
|
get_name: function () {
|
|
return "$hE"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: li
|
|
});
|
|
var ui = function (t, e, i) {
|
|
null == i && (i = 1),
|
|
null == e && (e = 0),
|
|
this.entities = [],
|
|
this.data = t,
|
|
this.startIndex = e,
|
|
this.numCells = i
|
|
};
|
|
ui.__name__ = !0,
|
|
ui.prototype = {
|
|
__class__: ui
|
|
};
|
|
var ci = {
|
|
clone: function (t) {
|
|
return JSON.parse(JSON.stringify(t))
|
|
}
|
|
},
|
|
pi = {
|
|
clone: function (t) {
|
|
return JSON.parse(JSON.stringify(t))
|
|
}
|
|
},
|
|
di = function (t, e, i) {
|
|
this.$XD = [],
|
|
this.spawnEnabled = !0,
|
|
f.call(this),
|
|
this.moveDirection = t,
|
|
this.$yD = e,
|
|
this.$YD = i,
|
|
this.$xD = new ui({
|
|
id: "placeholder"
|
|
}),
|
|
this.$xD.startIndex = 1,
|
|
this.$xD.numCells = -1,
|
|
this.$wD = this.$xD,
|
|
this.$WD = this.$xD
|
|
};
|
|
di.__name__ = !0,
|
|
di.__super__ = f,
|
|
di.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
switch (null == this.layer && (this.layer = this.owner.$hE), null == this.game && (this.game = this.owner._internal_getFromParents("$Aa", B)), f.prototype.onStart.call(this), this.chunkUnitSize = this.game.chunkUnitSize, this.spawnMargin = this.game.spawnMargin, this.cullMargin = this.game.cullMargin, this.$vD = new fi(this.spawnMargin), this.$VD = new fi(this.cullMargin), this.$yD.chunkUnitSize = this.chunkUnitSize, this.moveDirection) {
|
|
case _i.Down:
|
|
this.$uD = this.layer.viewportTop,
|
|
this.$UD = this.layer.viewportBottom;
|
|
break;
|
|
case _i.Left:
|
|
this.$uD = this.layer.viewportRight,
|
|
this.$UD = this.layer.viewportLeft;
|
|
break;
|
|
case _i.Right:
|
|
this.$uD = this.layer.viewportLeft,
|
|
this.$UD = this.layer.viewportRight;
|
|
break;
|
|
case _i.Up:
|
|
this.$uD = this.layer.viewportBottom,
|
|
this.$UD = this.layer.viewportTop
|
|
}
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t);
|
|
var e = Math.floor(this.$uD._value * this.moveDirection.axisDirection / this.chunkUnitSize),
|
|
i = Math.floor(this.$UD._value * this.moveDirection.axisDirection / this.chunkUnitSize);
|
|
for (this.$vD.set(e, i), this.$VD.set(e, i), this.spawnEnabled && this.$zD(); ; ) {
|
|
var n;
|
|
if (0 != this.$XD.length) {
|
|
var r = this.$wD;
|
|
n = r.startIndex + r.numCells - 1 < this.$VD.lower
|
|
} else
|
|
n = !1;
|
|
if (!n)
|
|
break;
|
|
for (var o = this.$YD.depopulate(this.$XD.shift(), this), s = 0; s < o.length; )
|
|
this.layer.removeLayerEntity(o[s++]);
|
|
0 != this.$XD.length && (this.$wD = this.$XD[0])
|
|
}
|
|
for (; 0 != this.$XD.length && this.$WD.startIndex > this.$VD.upper; )
|
|
if (this.$YD.depopulate(this.$XD.pop(), this), 0 != this.$XD.length) {
|
|
var a = this.$XD;
|
|
this.$WD = a[a.length - 1]
|
|
}
|
|
0 == this.$XD.length && (this.$wD = this.$xD, this.$WD = this.$xD)
|
|
},
|
|
$zD: function () {
|
|
for (; this.$vD.lower < this.$wD.startIndex; ) {
|
|
var t = this.$wD.startIndex - 1;
|
|
if (null == (r = this.$yD.getChunkAtIndex(0 > t ? 0 : t, this)))
|
|
break;
|
|
for (var e = this.$YD.populate(r, this), i = 0; i < e.length; )
|
|
this.layer.addLayerEntity(e[i++]);
|
|
this.$XD.unshift(r),
|
|
this.$wD = r
|
|
}
|
|
for (; ; ) {
|
|
var n = this.$WD;
|
|
if (!(this.$vD.upper > n.startIndex + n.numCells - 1))
|
|
break;
|
|
var r,
|
|
o = this.$WD;
|
|
if (null == (r = this.$yD.getChunkAtIndex(o.startIndex + o.numCells - 1 + 1, this)))
|
|
break;
|
|
for (e = this.$YD.populate(r, this), i = 0; i < e.length; )
|
|
this.layer.addLayerEntity(e[i++]);
|
|
this.$XD.push(r),
|
|
this.$WD = r
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$TD"
|
|
},
|
|
onAdded: function () {
|
|
null == this.layer && (this.layer = this.owner.$hE),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: di
|
|
});
|
|
var fi = function (t) {
|
|
null == t && (t = 0),
|
|
this._offset = t
|
|
};
|
|
fi.__name__ = !0,
|
|
fi.prototype = {
|
|
set: function (t, e) {
|
|
var i = t - this._offset;
|
|
this.lower = 0 > i ? 0 : i;
|
|
i = e + this._offset;
|
|
this.upper = 0 > i ? 0 : i
|
|
},
|
|
__class__: fi
|
|
};
|
|
var _i = function (t, e) {
|
|
this.x = t,
|
|
this.y = e,
|
|
this.isHorizontal = 0 != t,
|
|
this.isVertical = 0 != e,
|
|
this.axisDirection = this.isHorizontal ? t : e
|
|
};
|
|
_i.__name__ = !0,
|
|
_i.prototype = {
|
|
clone: function () {
|
|
return new _i(this.x, this.y)
|
|
},
|
|
__class__: _i
|
|
};
|
|
var mi = function (t) {
|
|
this.unwrapper = new An,
|
|
f.call(this),
|
|
this.$YB = t,
|
|
this.init(null)
|
|
};
|
|
mi.__name__ = !0,
|
|
mi.__interfaces__ = [q],
|
|
mi.__super__ = f,
|
|
mi.prototype = o(f.prototype, {
|
|
init: function (t) {
|
|
var e = this;
|
|
this.unwrapper.registerTransformer(new Mn("_placeholder", "")),
|
|
this.unwrapper.registerTransformer(new Tn("spawner_", {
|
|
transformInfo: function (t) {
|
|
return t.willInstantiateSymbol = !1,
|
|
t
|
|
},
|
|
decorateEntity: function (t, i) {
|
|
var n = e.$Ma.factory.create(i.symbolName.split("spawner_")[1]),
|
|
r = t.$w;
|
|
if (null != n.$w && n.$w.container.setTransform(r.container.position.x, r.container.position.y, i.keyframe.scaleX, i.keyframe.scaleY, null, -i.keyframe.skewX, i.keyframe.skewY, i.keyframe.pivotX, i.keyframe.pivotY), null != n.$rD) {
|
|
var o = n.$rD;
|
|
e.$YB.unproject({
|
|
x: r.container.position.x,
|
|
y: r.container.y,
|
|
z: 0
|
|
}, o.position3d)
|
|
}
|
|
return n
|
|
}
|
|
})),
|
|
this.unwrapper.registerTransformer(new Cn(new s("_(collider)|(trigger)", "g"), {
|
|
transformInfo: function (t) {
|
|
return t.willInstantiateSymbol = !1,
|
|
t
|
|
},
|
|
decorateEntity: function (t, e) {
|
|
var i = e.keyframe,
|
|
n = e.symbolName.indexOf("_trigger") >= 0 ? 3 : 2;
|
|
return t.add(Rn.EComponent(new Fo(jo.BoxShape(new PIXI.Rectangle(0, 0, 10 * i.scaleX, 10 * i.scaleY)), n).setData(e.symbolName))),
|
|
t.add(Rn.EComponent(new Lo)),
|
|
t
|
|
}
|
|
})),
|
|
this.unwrapper.registerTransformer(new Tn("wall_collider", {
|
|
decorateEntity: function (t, e) {
|
|
return t.$RE.flags = 16,
|
|
t.add(Rn.EComponent(new ko)),
|
|
t
|
|
}
|
|
})),
|
|
this.unwrapper.registerTransformer(new Tn("tile_", {
|
|
decorateEntity: function (t, i) {
|
|
return e.$zB(i) && t.add(Rn.EArray([Rn.EComponent(vi.fromMovieSprite(i.symbolName + "_colliders", i.libraryName, 2, 16, 0, {
|
|
x: i.keyframe.scaleX,
|
|
y: i.keyframe.scaleY
|
|
})), Rn.EComponent(new Lo), Rn.EComponent(new ko)])),
|
|
t
|
|
}
|
|
}))
|
|
},
|
|
populate: function (t, e) {
|
|
var i,
|
|
n,
|
|
r = e.moveDirection,
|
|
o = r.x,
|
|
s = r.y;
|
|
i = o * (a = t.startIndex),
|
|
n = s * a;
|
|
var a = e.chunkUnitSize,
|
|
h = {
|
|
x: i,
|
|
y: n
|
|
};
|
|
return h.x *= a,
|
|
h.y *= a,
|
|
t.entities = this.unwrapper.unwrap(t.data.id, S.animationLibraries.get_currentGame(), h),
|
|
t.entities
|
|
},
|
|
depopulate: function (t, e) {
|
|
for (var i = t.entities.slice(), n = 0, r = t.entities; n < r.length; )
|
|
r[n++].dispose();
|
|
return t.entities = [],
|
|
i
|
|
},
|
|
$zB: function (t) {
|
|
return S.animations.has(t.symbolName + "_colliders", t.libraryName)
|
|
},
|
|
get_name: function () {
|
|
return "$yB"
|
|
},
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", B)),
|
|
f.prototype.onStart.call(this)
|
|
},
|
|
__class__: mi
|
|
});
|
|
var yi = function () {};
|
|
yi.__name__ = !0,
|
|
yi.__isInterface__ = !0,
|
|
yi.prototype = {
|
|
__class__: yi
|
|
};
|
|
var gi = function (t) {
|
|
this._random = rs.native,
|
|
this._sectionIndex = -1,
|
|
this._chunks = [],
|
|
this.chunkUnitSize = 100,
|
|
this.defaultNumCells = 4,
|
|
this.maxChunkHistory = 100,
|
|
this.setSection(t)
|
|
};
|
|
gi.__name__ = !0,
|
|
gi.__interfaces__ = [yi],
|
|
gi.prototype = {
|
|
setSection: function (t) {
|
|
this._rootSection = t,
|
|
this._sectionIndex = -1
|
|
},
|
|
unpackNextSection: function () {
|
|
var t;
|
|
null != this._activeSection ? t = 0 == (null != (e = this._activeSection).cycles ? e.cycles : 1) : t = !0;
|
|
if (t) {
|
|
if (this._sectionIndex++, !(this._sectionIndex < this._rootSection.sections.length))
|
|
return Dn.warn("No more sections to unpack"), !1;
|
|
this._activeSection = ci.clone(this._rootSection.sections[this._sectionIndex])
|
|
}
|
|
if (this.unpackSection(this._activeSection, this._chunks), -1 != (null != (e = this._activeSection).cycles ? e.cycles : 1)) {
|
|
var e = this._activeSection;
|
|
this._activeSection.cycles = (null != e.cycles ? e.cycles : 1) - 1
|
|
}
|
|
return this._chunks.length > this.maxChunkHistory && (this._chunks = this._chunks.slice(this._chunks.length - this.maxChunkHistory)),
|
|
!0
|
|
},
|
|
unpackSection: function (t, e) {
|
|
if (null == e && (e = []), null != t.chunks)
|
|
for (var i = 0, n = t.chunks; i < n.length; ) {
|
|
var r = n[i];
|
|
if (++i, -1 == (null != r.cycles ? r.cycles : 1))
|
|
Dn.warn("Chunk with id ${chunkData.id} is set to loop infinitely. This is not supported.");
|
|
else
|
|
for (var o = 0, s = null != r.cycles ? r.cycles : 1; o < s; )
|
|
++o, this.unpackChunk(r, e)
|
|
}
|
|
if (null != t.sections)
|
|
for (i = 0, n = t.sections; i < n.length; ) {
|
|
var a = n[i];
|
|
if (++i, -1 == (null != a.cycles ? a.cycles : 1))
|
|
Dn.warn("Section with id ${currSectionData.id} is set to loop infinitely. This is only supported for root sections.");
|
|
else
|
|
for (o = 0, s = null != a.cycles ? a.cycles : 1; o < s; )
|
|
++o, this.unpackSection(a, e)
|
|
}
|
|
return e
|
|
},
|
|
unpackChunk: function (t, e) {
|
|
if (t.id.indexOf("|") >= 0) {
|
|
var i = t.id.split("|");
|
|
(t = pi.clone(t)).id = ls.randomElement(i, this._random)
|
|
}
|
|
var n,
|
|
r = new ui(t);
|
|
if (0 != this._chunks.length) {
|
|
var o = this._chunks,
|
|
s = o[o.length - 1];
|
|
n = s.startIndex + s.numCells - 1
|
|
} else
|
|
n = -1;
|
|
if (r.startIndex = n + 1, r.data.id.indexOf("_x_") >= 0) {
|
|
var a = u.parseInt(r.data.id.split("_x_")[1]);
|
|
a % this.chunkUnitSize == 0 && (r.numCells = Math.round(a / this.chunkUnitSize))
|
|
} else
|
|
r.numCells = this.defaultNumCells;
|
|
return e.push(r),
|
|
e
|
|
},
|
|
getChunkAtIndex: function (t, e) {
|
|
for (; ; ) {
|
|
var i;
|
|
if (0 != this._chunks.length) {
|
|
var n = (r = this._chunks)[r.length - 1];
|
|
i = n.startIndex + n.numCells - 1
|
|
} else
|
|
i = -1;
|
|
if (!(t > i))
|
|
break;
|
|
if (!this.unpackNextSection())
|
|
return Dn.warn("A chunk at index " + t + " was requested, but none exists"), null
|
|
}
|
|
for (var r = this._chunks, o = new Jo(r, r.length - 1, 0, 1); o.hasNext(); ) {
|
|
var s = o.next();
|
|
if (this.isIndexWithinChunk(t, s.value))
|
|
return s.value
|
|
}
|
|
return null
|
|
},
|
|
isIndexWithinChunk: function (t, e) {
|
|
return t >= e.startIndex && t <= e.startIndex + e.numCells - 1
|
|
},
|
|
__class__: gi
|
|
};
|
|
var vi = function () {};
|
|
vi.__name__ = !0,
|
|
vi.fromMovieSprite = function (t, e, i, n, r, o) {
|
|
null == r && (r = 0),
|
|
null == n && (n = 0),
|
|
null == i && (i = 1),
|
|
null == o && (o = {
|
|
x: 1,
|
|
y: 1
|
|
});
|
|
var s = [];
|
|
return h.iter(S.animations.getMovieSprite(t, e).$fF, (function (t) {
|
|
var e,
|
|
i,
|
|
n = t.layer;
|
|
if (null != t.content.$w) {
|
|
var r = n.keyframes[0];
|
|
if (null == r.symbol)
|
|
return;
|
|
e = r,
|
|
i = jo.BoxShape(new PIXI.Rectangle(Math.round(e.x - e.pivotX * e.scaleX * o.x), Math.round(e.y - e.pivotY * e.scaleY * o.y), Math.round(10 * e.scaleX * o.x), Math.round(10 * e.scaleY * o.y))),
|
|
s.push(i)
|
|
}
|
|
})),
|
|
new Fo(jo.Group(s), i, n, r)
|
|
};
|
|
var wi = function () {
|
|
f.call(this)
|
|
};
|
|
wi.__name__ = !0,
|
|
wi.__super__ = f,
|
|
wi.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
this.$dA.position3d.x < this.$Ma.cullBounds._from && this.owner.add(Rn.EComponent(new Gr))
|
|
},
|
|
get_name: function () {
|
|
return "$MB"
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", B)),
|
|
f.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: wi
|
|
});
|
|
var xi = function (t) {
|
|
this.valueBounds = new rt(0, 179769313486231e294),
|
|
this.value = new Ln(0),
|
|
f.call(this),
|
|
this.value.set__(t)
|
|
};
|
|
xi.__name__ = !0,
|
|
xi.__super__ = f,
|
|
xi.prototype = o(f.prototype, {
|
|
setMaxHealth: function (t) {
|
|
return this.valueBounds.set_to(t),
|
|
this
|
|
},
|
|
setHealth: function (t) {
|
|
return this.value.set__(this.valueBounds.clamp(t)),
|
|
this
|
|
},
|
|
modifyHealth: function (t) {
|
|
return this.value.set__(this.valueBounds.clamp(this.value._value + t)),
|
|
this.value._value
|
|
},
|
|
get_name: function () {
|
|
return "$qD"
|
|
},
|
|
__class__: xi
|
|
});
|
|
var bi = function (t) {
|
|
f.call(this),
|
|
this.$md = t
|
|
};
|
|
bi.__name__ = !0,
|
|
bi.__super__ = f,
|
|
bi.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
f.prototype.onStart.call(this),
|
|
this.$h = this.$HA.value.watch((function (e, i) {
|
|
e < i && Un.get_soundManager().play(t.$md)
|
|
}))
|
|
},
|
|
get_name: function () {
|
|
return "$Ld"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: bi
|
|
});
|
|
var Ei = function () {
|
|
this.filter = Ei.NO_FILTER,
|
|
f.call(this)
|
|
};
|
|
Ei.__name__ = !0,
|
|
Ei.NO_FILTER = function (t) {
|
|
return t
|
|
},
|
|
Ei.INVINCIBILITY_FILTER = function (t) {
|
|
return 0
|
|
},
|
|
Ei.__super__ = f,
|
|
Ei.prototype = o(f.prototype, {
|
|
hit: function (t) {
|
|
var e = this.owner;
|
|
null != e.$qD && e.$qD.modifyHealth(this.filter(-t))
|
|
},
|
|
setFilter: function (t) {
|
|
return this.filter = t,
|
|
this
|
|
},
|
|
get_name: function () {
|
|
return "$JD"
|
|
},
|
|
__class__: Ei
|
|
});
|
|
var $i = function (t, e) {
|
|
f.call(this),
|
|
this.$Sd = t,
|
|
this.$sd = e
|
|
};
|
|
$i.__name__ = !0,
|
|
$i.__super__ = f,
|
|
$i.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
f.prototype.onStart.call(this),
|
|
this.$h = this._collidable.$ZE().connect((function (e) {
|
|
for (var i = 0, n = t.$Sd; i < n.length; )
|
|
0 != (e.other.flags & n[i++]) && t.$sd(e)
|
|
}))
|
|
},
|
|
get_name: function () {
|
|
return "$Rd"
|
|
},
|
|
onAdded: function () {
|
|
null == this._collidable && (this._collidable = this.owner.$RE),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: $i
|
|
});
|
|
var Ai = function (t) {
|
|
null == t && (t = ""),
|
|
this.vertical = new Ln(0),
|
|
this.horizontal = new Ln(0),
|
|
this.value = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.id = t
|
|
};
|
|
Ai.__name__ = !0,
|
|
Ai.prototype = {
|
|
__class__: Ai
|
|
};
|
|
var Si = function (t) {
|
|
null == t && (t = ""),
|
|
this.value = new Ln(0),
|
|
this.wasReleased = new Ln(!1),
|
|
this.wasPressed = new Ln(!1),
|
|
this.isPressed = new Ln(!1),
|
|
this.id = t
|
|
};
|
|
Si.__name__ = !0,
|
|
Si.prototype = {
|
|
__class__: Si
|
|
};
|
|
var Ti = function () {
|
|
this.$ce = [],
|
|
this.$Be = new Nr,
|
|
this.isActive = !0,
|
|
f.call(this)
|
|
};
|
|
Ti.__name__ = !0,
|
|
Ti.__super__ = f,
|
|
Ti.prototype = o(f.prototype, {
|
|
mapButton: function (t, e) {
|
|
this.$Be.h[t] = e
|
|
},
|
|
mapAxis: function (t, e, i, n, r) {
|
|
this.$ce.push({
|
|
left: t,
|
|
right: e,
|
|
up: i,
|
|
down: n,
|
|
axis: r
|
|
})
|
|
},
|
|
update: function () {
|
|
for (var t = this.$Be.keys(); t.hasNext(); ) {
|
|
var e = t.next(),
|
|
i = this.$Be.h[e];
|
|
i.wasPressed._value && i.wasPressed.set__(!1),
|
|
i.wasReleased._value && i.wasReleased.set__(!1);
|
|
var n = Un.get_keyboard().isDown(e);
|
|
n && !i.isPressed._value && i.wasPressed.set__(!0),
|
|
!n && i.isPressed._value && i.wasReleased.set__(!0),
|
|
i.isPressed.set__(n),
|
|
i.value.set__(n ? 1 : 0)
|
|
}
|
|
for (var r = 0, o = this.$ce; r < o.length; ) {
|
|
var s = o[r];
|
|
++r;
|
|
var a = Un.get_keyboard().isDown(s.left) ? -1 : 0,
|
|
h = Un.get_keyboard().isDown(s.right) ? 1 : 0;
|
|
s.axis.horizontal.set__(a + h);
|
|
var l = Un.get_keyboard().isDown(s.up) ? -1 : 0,
|
|
u = Un.get_keyboard().isDown(s.down) ? 1 : 0;
|
|
s.axis.vertical.set__(l + u);
|
|
var c = s.axis.value,
|
|
p = s.axis.horizontal._value,
|
|
d = s.axis.vertical._value;
|
|
c.x = p,
|
|
c.y = null == d ? p : d,
|
|
$o.normalize(c)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$be"
|
|
},
|
|
__class__: Ti
|
|
});
|
|
var Ci = function () {
|
|
Ce.call(this)
|
|
};
|
|
Ci.__name__ = !0,
|
|
Ci.__super__ = Ce,
|
|
Ci.prototype = o(Ce.prototype, {
|
|
onStart: function () {
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", B)),
|
|
Ce.prototype.onStart.call(this),
|
|
this.$ae = new Ti,
|
|
this.$ae.mapButton(38, this.buttonUp),
|
|
this.$ae.mapButton(40, this.buttonDown),
|
|
this.$ae.mapButton(37, this.buttonLeft),
|
|
this.$ae.mapButton(39, this.buttonRight),
|
|
this.$ae.mapButton(32, this.buttonAction1),
|
|
this.$ae.mapButton(49, this.buttonAction2),
|
|
this.$ae.mapButton(50, this.buttonAction3),
|
|
this.$ae.mapButton(51, this.buttonAction4),
|
|
this.$ae.mapAxis(37, 39, 38, 40, this.axis1),
|
|
null != this.$Ma.touchUI && (this.$Ae = new Mi(this.$Ma.touchUI), this.$Ae.mapButton(0, this.buttonUp), this.$Ae.mapButton(1, this.buttonDown), this.$Ae.mapButton(2, this.buttonLeft), this.$Ae.mapButton(3, this.buttonRight), this.$Ae.mapButton(4, this.buttonAction1), this.$Ae.mapButton(5, this.buttonAction2), this.$Ae.mapButton(6, this.buttonAction3), this.$Ae.mapButton(7, this.buttonAction4), this.$Ae.mapAxis(8, this.axis1), this.$ae.isActive = !1)
|
|
},
|
|
onUpdate: function (t) {
|
|
Ce.prototype.onUpdate.call(this, t),
|
|
null != this.$ae && this.$ae.isActive && this.$ae.update(),
|
|
null != this.$Ae && this.$Ae.isActive && this.$Ae.update()
|
|
},
|
|
__class__: Ci
|
|
});
|
|
var Mi = function (t) {
|
|
this.$ee = .6,
|
|
this.$de = new Nr,
|
|
this.$Be = new Nr,
|
|
this.isActive = !0,
|
|
f.call(this),
|
|
this.$De = t
|
|
};
|
|
Mi.__name__ = !0,
|
|
Mi.__super__ = f,
|
|
Mi.prototype = o(f.prototype, {
|
|
mapButton: function (t, e) {
|
|
this.$Be.set(t, e)
|
|
},
|
|
mapAxis: function (t, e) {
|
|
this.$de.set(t, e)
|
|
},
|
|
update: function () {
|
|
var t = this.$de.get(8),
|
|
e = t.value,
|
|
i = this.$De.axisDirection;
|
|
e.x = i.x,
|
|
e.y = i.y,
|
|
t.horizontal.set__(t.value.x),
|
|
t.vertical.set__(t.value.y);
|
|
var n = this.$Be.get(0),
|
|
r = -t.vertical._value;
|
|
this.$Ee(n, r < 0 ? 0 : r > 1 ? 1 : r);
|
|
n = this.$Be.get(1),
|
|
r = t.vertical._value;
|
|
this.$Ee(n, r < 0 ? 0 : r > 1 ? 1 : r);
|
|
n = this.$Be.get(2),
|
|
r = -t.horizontal._value;
|
|
this.$Ee(n, r < 0 ? 0 : r > 1 ? 1 : r);
|
|
n = this.$Be.get(3),
|
|
r = t.horizontal._value;
|
|
this.$Ee(n, r < 0 ? 0 : r > 1 ? 1 : r),
|
|
this.$Ee(this.$Be.get(4), this.$De.button1Down._value ? 1 : 0),
|
|
this.$Ee(this.$Be.get(5), this.$De.button2Down._value ? 1 : 0),
|
|
this.$Ee(this.$Be.get(6), this.$De.button3Down._value ? 1 : 0),
|
|
this.$Ee(this.$Be.get(7), this.$De.button4Down._value ? 1 : 0)
|
|
},
|
|
$Ee: function (t, e) {
|
|
t.value.set__(e),
|
|
t.wasPressed._value && t.wasPressed.set__(!1),
|
|
t.wasReleased._value && t.wasReleased.set__(!1);
|
|
var i = t.value._value > this.$ee;
|
|
i && !t.isPressed._value && t.wasPressed.set__(!0),
|
|
!i && t.isPressed._value && t.wasReleased.set__(!0),
|
|
t.isPressed.set__(i)
|
|
},
|
|
get_name: function () {
|
|
return "$Ce"
|
|
},
|
|
__class__: Mi
|
|
});
|
|
var Ii = function (t, e) {
|
|
this.dieOnZeroHealth = !0,
|
|
this.$a = new Pn,
|
|
N.call(this),
|
|
this.type = e,
|
|
this.animationPrefix = t + "_"
|
|
};
|
|
Ii.__name__ = !0,
|
|
Ii.__super__ = N,
|
|
Ii.prototype = o(N.prototype, {
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
N.prototype.onAdded.call(this)
|
|
},
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$HA && (this.$HA = this.owner.$qD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", B)),
|
|
N.prototype.onStart.call(this),
|
|
null != this.$HA && this.$a.add(this.$HA.value.watch(cs(this, this.$lb)))
|
|
},
|
|
$lb: function (t, e) {
|
|
0 == t ? this.dieOnZeroHealth && this.die() : t < e && this.$kD()
|
|
},
|
|
$kD: function () {
|
|
null != this.owner.$pD && this.changeStateTo("$pD", null);
|
|
var t = this.owner,
|
|
e = [16057380],
|
|
i = new Pn;
|
|
if (null != t.$w) {
|
|
var n = t.$w,
|
|
r = new yr(e[0], 1);
|
|
n.container.filters = [r];
|
|
var o = 0;
|
|
i.add(hs.create(t.parent, .05, 1, (function () {
|
|
var t = o += .5;
|
|
r.update(e[(0 | t) % e.length], 1 == r.multiplier ? 0 : 1)
|
|
})));
|
|
var s = t.parent;
|
|
t = (new On).addComponent(new Gr(.1, (function () {
|
|
n.container.filters = null
|
|
})));
|
|
s.addEntity(t, !0),
|
|
i.add(t)
|
|
}
|
|
},
|
|
die: function () {
|
|
null != this.owner.$PD && this.changeStateTo("$PD", null),
|
|
null != this.owner.$TC ? this.owner.$TC.explode(0, 0, .1) : Gr.create(this.owner, .1)
|
|
},
|
|
$KD: function () {
|
|
var t = this.$Ma.viewportBounds,
|
|
e = this.$dA.position3d.x;
|
|
return t._from <= e && e <= t._to || t._to <= e && e <= t._from
|
|
},
|
|
$ba: function () {
|
|
return this.fallbackStateName
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
N.prototype.dispose.call(this)
|
|
},
|
|
__class__: Ii
|
|
});
|
|
var Pi = function () {
|
|
nt.call(this, "die")
|
|
};
|
|
Pi.__name__ = !0,
|
|
Pi.__super__ = nt,
|
|
Pi.prototype = o(nt.prototype, {
|
|
onActivate: function () {
|
|
nt.prototype.onActivate.call(this),
|
|
null != this.$_b && (this.$_b.dispose(), this.$_b = null)
|
|
},
|
|
get_name: function () {
|
|
return "$PD"
|
|
},
|
|
onStart: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
nt.prototype.onStart.call(this)
|
|
},
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
nt.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Pi
|
|
});
|
|
var Oi = function () {
|
|
nt.call(this, "hurt")
|
|
};
|
|
Oi.__name__ = !0,
|
|
Oi.__super__ = nt,
|
|
Oi.prototype = o(nt.prototype, {
|
|
getNextStateName: function () {
|
|
return "$Zc"
|
|
},
|
|
get_name: function () {
|
|
return "$pD"
|
|
},
|
|
__class__: Oi
|
|
});
|
|
var Ri = function () {
|
|
nt.call(this, "move", !0)
|
|
};
|
|
Ri.__name__ = !0,
|
|
Ri.__super__ = nt,
|
|
Ri.prototype = o(nt.prototype, {
|
|
get_name: function () {
|
|
return "$Zc"
|
|
},
|
|
__class__: Ri
|
|
});
|
|
var Di = function () {
|
|
it.call(this, "player_idle", !0)
|
|
};
|
|
Di.__name__ = !0,
|
|
Di.__super__ = it,
|
|
Di.prototype = o(it.prototype, {
|
|
get_name: function () {
|
|
return "$Ab"
|
|
},
|
|
__class__: Di
|
|
});
|
|
var Li = function (t, e) {
|
|
null == t && (t = 1),
|
|
this.impactSignal = new Mr,
|
|
this.$a = new Pn,
|
|
f.call(this),
|
|
this.hitPoints = t,
|
|
this.maxRange = e
|
|
};
|
|
Li.__name__ = !0,
|
|
Li.__super__ = f,
|
|
Li.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onStart.call(this),
|
|
this.$ID = this.$dA.position3d.x,
|
|
this.$a.add(this.$_b.$Tc().connect(cs(this, this.$SB)))
|
|
},
|
|
$SB: function (t) {
|
|
var e = t.other.owner;
|
|
(null == e.$rD || Math.abs(e.$rD.position3d.z - this.$dA.position3d.z) < .5) && (this.onImpact(), null != e.$JD && e.$JD.hit(this.hitPoints))
|
|
},
|
|
onImpact: function () {
|
|
this.impactSignal.emit(),
|
|
this.$_b.disableCollisions(),
|
|
null != this.owner.$TC ? this.owner.$TC.explode(0, 0, 0) : this.$jD()
|
|
},
|
|
$jD: function () {
|
|
Gr.create(this.owner)
|
|
},
|
|
onUpdate: function (t) {
|
|
null != this.maxRange && Math.abs(this.$ID - this.$dA.position3d.x) > this.maxRange && this.$jD()
|
|
},
|
|
get_name: function () {
|
|
return "$iD"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Li
|
|
});
|
|
var ki = function () {
|
|
Y.call(this)
|
|
};
|
|
ki.__name__ = !0,
|
|
ki.__super__ = Y,
|
|
ki.prototype = o(Y.prototype, {
|
|
onStart: function () {},
|
|
start: function (t) {
|
|
var e = this;
|
|
null == this._connection && (this._connection = Un.get_sceneManager().currentSceneDefinition.watch((function (t, i) {
|
|
var n;
|
|
switch (t._hx_index) {
|
|
case 0:
|
|
n = {
|
|
getInstance: t.c,
|
|
name: t.name,
|
|
layer: 0
|
|
};
|
|
break;
|
|
case 1:
|
|
n = {
|
|
getInstance: t.c,
|
|
name: t.name,
|
|
layer: t.layer
|
|
}
|
|
}
|
|
var r,
|
|
o = g.fromString(n.name.split("/").shift()),
|
|
s = n.name.split("/").pop();
|
|
switch (o) {
|
|
case 1:
|
|
if (null == s)
|
|
r = null;
|
|
else
|
|
switch (s) {
|
|
case "easteregg":
|
|
r = S.sounds.game1.BLACK_HOLE_LOOP_CINEMATIC;
|
|
break;
|
|
case "":
|
|
case "home":
|
|
case "preloader":
|
|
r = S.sounds.game1.MUSIC_PROJECT_LASER_TITLE_SCREEN;
|
|
break;
|
|
case "intro":
|
|
r = S.sounds.game1.MUSIC_PROJECT_LASER_CINEMATIC;
|
|
break;
|
|
case "lose":
|
|
r = S.sounds.game1.MUSIC_PROJECT_LASER_GAMEOVER;
|
|
break;
|
|
case "play":
|
|
r = S.sounds.game1.MUSIC_PROJECT_LASER;
|
|
break;
|
|
case "win":
|
|
r = S.sounds.game1.MUSIC_PROJECT_LASER_VICTORY;
|
|
break;
|
|
default:
|
|
r = null
|
|
}
|
|
break;
|
|
case 2:
|
|
if (null == s)
|
|
r = null;
|
|
else
|
|
switch (s) {
|
|
case "":
|
|
case "prologue":
|
|
r = S.sounds.game2.MUSIC_SLUGFEST_CINEMATIC;
|
|
break;
|
|
case "easteregg":
|
|
r = S.sounds.game2.MUSIC_SLUGFEST_CINEMATIC_B;
|
|
break;
|
|
case "home":
|
|
case "intro":
|
|
r = S.sounds.game2.MUSIC_SLUGFEST_TITLE_SCREEN;
|
|
break;
|
|
case "lose":
|
|
r = S.sounds.game2.MUSIC_SLUGFEST_GAMEOVER;
|
|
break;
|
|
case "play":
|
|
r = S.sounds.game2.MUSIC_SLUGFEST;
|
|
break;
|
|
case "win":
|
|
r = S.sounds.game2.MUSIC_SLUGFEST_VICTORY;
|
|
break;
|
|
default:
|
|
r = null
|
|
}
|
|
break;
|
|
case 3:
|
|
if (null == s)
|
|
r = null;
|
|
else
|
|
switch (s) {
|
|
case "bossbattle":
|
|
r = S.sounds.game3.MUSIC_BOSSFIGHT_LOOP;
|
|
break;
|
|
case "easteregg":
|
|
r = S.sounds.game3.MUSIC_BOSSFIGHT_INTRO;
|
|
break;
|
|
case "":
|
|
case "home":
|
|
case "intro":
|
|
case "prologue":
|
|
r = S.sounds.game3.MUSIC_STARCADIA_CINEMATIC_A;
|
|
break;
|
|
case "lose":
|
|
r = S.sounds.game3.MUSIC_STARCADIA_GAMEOVER;
|
|
break;
|
|
case "play":
|
|
r = S.sounds.game3.MUSIC_STARCADIA;
|
|
break;
|
|
case "win":
|
|
r = S.sounds.game3.MUSIC_STARCADIA_VICTORY;
|
|
break;
|
|
default:
|
|
r = null
|
|
}
|
|
break;
|
|
default:
|
|
r = null
|
|
}
|
|
if (null != r)
|
|
if (r != []) {
|
|
var a = !0;
|
|
r == S.sounds.game3.MUSIC_BOSSFIGHT_INTRO && (a = !1),
|
|
e.playMusic(r, a)
|
|
} else
|
|
e.stopMusic()
|
|
})))
|
|
},
|
|
fade: function (t) {
|
|
if (null != this.$w_) {
|
|
var e = this.$w_.playback;
|
|
null != e && e.howl.fade(e.howl.volume(e.id), 0, Math.round(1e3 * t), e.id)
|
|
}
|
|
},
|
|
playMusic: function (t, e) {
|
|
null != this.$w_ && this.$w_.source == t || (this.stopMusic(), this.$w_ = {
|
|
playback: e ? null != Un.get_soundManager().sounds.h.__keys__[t.__id__] ? Un.get_soundManager().loop(t, 1) : null : Un.get_soundManager().play(t, 1),
|
|
source: t
|
|
})
|
|
},
|
|
stopMusic: function () {
|
|
if (null != this.$w_) {
|
|
var t = this.$w_.playback;
|
|
null != t && t.dispose(),
|
|
this.$w_ = null
|
|
}
|
|
},
|
|
dispose: function () {
|
|
null != this._connection && (this._connection.dispose(), this._connection = null),
|
|
Y.prototype.dispose.call(this)
|
|
},
|
|
__class__: ki
|
|
});
|
|
var Fi = function (t) {
|
|
Vt.call(this, new PIXI.Sprite(Un.assets.getTexture(t, S.files.get_currentGame().manifest.path)))
|
|
};
|
|
Fi.__name__ = !0,
|
|
Fi.__super__ = Vt,
|
|
Fi.prototype = o(Vt.prototype, {
|
|
__class__: Fi
|
|
});
|
|
var Ni = function (t) {
|
|
f.call(this),
|
|
this.$HA = t,
|
|
this.$eB = this.$HA._value
|
|
};
|
|
Ni.__name__ = !0,
|
|
Ni.__super__ = f,
|
|
Ni.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this._movieSprite && (this._movieSprite = this.owner.$w),
|
|
f.prototype.onStart.call(this),
|
|
this._movieSprite.$iF(!0),
|
|
this.$h = this.$HA.watch((function (e, i) {
|
|
t._movieSprite.$hF(e / t.$eB * t._movieSprite.symbol.duration)
|
|
}))
|
|
},
|
|
get_name: function () {
|
|
return "$DB"
|
|
},
|
|
onAdded: function () {
|
|
null == this._movieSprite && (this._movieSprite = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Ni
|
|
});
|
|
var Bi = function () {
|
|
this.$a = new Pn,
|
|
Vt.call(this)
|
|
};
|
|
Bi.__name__ = !0,
|
|
Bi.__super__ = Vt,
|
|
Bi.prototype = o(Vt.prototype, {
|
|
setHitArea: function (t, e, i, n) {
|
|
return this.container.hitArea = new PIXI.Rectangle(t, e, i, n),
|
|
this
|
|
},
|
|
enable: function () {
|
|
return this.container.interactive = !0,
|
|
this.container.buttonMode = !0,
|
|
this
|
|
},
|
|
onAdded: function () {
|
|
var t = this;
|
|
Vt.prototype.onAdded.call(this);
|
|
var e = new so;
|
|
this.$a.add(e.state.watch(cs(this, this.$M_))),
|
|
this.owner.addComponent(e),
|
|
null != this.$m_ && this.$a.add(Un.get_keyboard().down.connect((function (e) {
|
|
t.container.visible && -1 != t.$m_.indexOf(e.key) && t.owner.$aa.emit()
|
|
}))),
|
|
this.enable()
|
|
},
|
|
$M_: function (t, e) {
|
|
if (PIXI.utils.isMobile.any)
|
|
switch (t._hx_index) {
|
|
case 0:
|
|
case 1:
|
|
this.$n_();
|
|
break;
|
|
case 2:
|
|
case 3:
|
|
this.$N_()
|
|
}
|
|
else
|
|
switch (t._hx_index) {
|
|
case 0:
|
|
this.$n_(),
|
|
this.$o_();
|
|
break;
|
|
case 1:
|
|
this.$O_();
|
|
break;
|
|
case 2:
|
|
this.$N_(),
|
|
this.$p_();
|
|
break;
|
|
case 3:
|
|
this.$P_()
|
|
}
|
|
},
|
|
$n_: function () {},
|
|
$N_: function () {},
|
|
$o_: function () {},
|
|
$O_: function () {},
|
|
$p_: function () {},
|
|
$P_: function () {},
|
|
dispose: function () {
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
Vt.prototype.dispose.call(this)
|
|
},
|
|
__class__: Bi
|
|
});
|
|
var Ui = function (t) {
|
|
null == t && (t = 50),
|
|
this.isDown = new Ln(!1),
|
|
Bi.call(this),
|
|
this.$le = t
|
|
};
|
|
Ui.__name__ = !0,
|
|
Ui.__super__ = Bi,
|
|
Ui.prototype = o(Bi.prototype, {
|
|
onAdded: function () {
|
|
null == this.container.hitArea && this.setHitArea( - .5 * this.$le, - .5 * this.$le, this.$le, this.$le),
|
|
Bi.prototype.onAdded.call(this)
|
|
},
|
|
$N_: function () {
|
|
Bi.prototype.$N_.call(this),
|
|
this.isDown.set__(!0)
|
|
},
|
|
$n_: function () {
|
|
Bi.prototype.$n_.call(this),
|
|
this.isDown.set__(!1)
|
|
},
|
|
__class__: Ui
|
|
});
|
|
var Xi = function (t) {
|
|
this.direction = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
Vt.call(this),
|
|
this.size = t;
|
|
var e = S.animations.getSprite("touchpad_ring", S.animationLibraries.get_currentGame());
|
|
this.$Ne = S.animations.getSprite("touchpad_handle", S.animationLibraries.get_currentGame()),
|
|
this.container.addChild(e, this.$Ne)
|
|
};
|
|
Xi.__name__ = !0,
|
|
Xi.__super__ = Vt,
|
|
Xi.prototype = o(Vt.prototype, {
|
|
onUpdate: function (t) {
|
|
if (Vt.prototype.onUpdate.call(this, t), this.container.visible) {
|
|
var e = this.direction,
|
|
i = this.size,
|
|
n = {
|
|
x: e.x,
|
|
y: e.y
|
|
};
|
|
n.x *= i,
|
|
n.y *= i,
|
|
this.$Ne.position.copyFrom(n)
|
|
}
|
|
},
|
|
__class__: Xi
|
|
});
|
|
var ji = function (t) {
|
|
null == t && (t = !0),
|
|
this.$Vc = Ao.empty(),
|
|
this.$vc = ji.$Uc,
|
|
f.call(this),
|
|
this.updateEveryFrame = t
|
|
};
|
|
ji.__name__ = !0,
|
|
ji.__super__ = f,
|
|
ji.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$YB && (this.$YB = this.owner._internal_getFromParents("$gE")),
|
|
this.updatePosition()
|
|
},
|
|
onUpdate: function (t) {
|
|
this.updateEveryFrame && this.updatePosition()
|
|
},
|
|
updatePosition: function () {
|
|
var t = this.owner.$RE;
|
|
null != t && (this.$YB.project(this.$dA.position3d, this.$Vc), t.setXY(this.$Vc.x + this.$vc.x, this.$Vc.y + this.$vc.y))
|
|
},
|
|
get_name: function () {
|
|
return "$wc"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: ji
|
|
});
|
|
var Vi = function (t) {
|
|
null == t && (t = !0),
|
|
this.$Vc = Ao.empty(),
|
|
this.$vc = Vi.$Uc,
|
|
f.call(this),
|
|
this.updateEveryFrame = t
|
|
};
|
|
Vi.__name__ = !0,
|
|
Vi.__super__ = f,
|
|
Vi.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$YB && (this.$YB = this.owner._internal_getFromParents("$gE")),
|
|
this.updatePosition()
|
|
},
|
|
onUpdate: function (t) {
|
|
this.updateEveryFrame && this.updatePosition()
|
|
},
|
|
updatePosition: function () {
|
|
var t = this.owner.$RE;
|
|
if (null != t) {
|
|
var e = this.$Vc,
|
|
i = t.position.x + this.$vc.x,
|
|
n = t.position.y + this.$vc.y;
|
|
e.x = i,
|
|
e.y = null == n ? i : n,
|
|
e.z = 0,
|
|
this.$YB.unproject(this.$Vc, this.$dA.position3d)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$uc"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Vi
|
|
});
|
|
var Hi = function () {};
|
|
Hi.__name__ = !0,
|
|
Hi.__isInterface__ = !0;
|
|
var Gi = function () {
|
|
this.heading = new Ln(_i.Right),
|
|
this.velocity3d = Ao.empty(),
|
|
this.position3d = Ao.empty(),
|
|
f.call(this)
|
|
};
|
|
Gi.__name__ = !0,
|
|
Gi.__super__ = f,
|
|
Gi.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t);
|
|
var e,
|
|
i,
|
|
n,
|
|
r = this.position3d,
|
|
o = this.velocity3d,
|
|
s = o.x,
|
|
a = o.y,
|
|
h = o.z;
|
|
e = s * t,
|
|
i = a * t,
|
|
n = h * t,
|
|
r.x += e,
|
|
r.y += i,
|
|
r.z += n
|
|
},
|
|
get_name: function () {
|
|
return "$rD"
|
|
},
|
|
__class__: Gi
|
|
});
|
|
var Yi = function (t) {
|
|
null == t && (t = 0),
|
|
this.$ja = 0,
|
|
f.call(this),
|
|
this.$Ja = t,
|
|
this.$Ja++
|
|
};
|
|
Yi.__name__ = !0,
|
|
Yi.$ka = function (t, e) {
|
|
var i;
|
|
return t.position3d.z == e.position3d.z ? (i = t.position3d.y - e.position3d.y) < 0 ? -1 : i > 0 ? 1 : 0 : (i = t.position3d.z - e.position3d.z) < 0 ? -1 : i > 0 ? 1 : 0
|
|
},
|
|
Yi.__super__ = f,
|
|
Yi.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), this.$ja % this.$Ja == 0) {
|
|
us.depthSort(this.owner, "$rD", Yi.$ka);
|
|
for (var e = this.owner.firstChild; null != e; ) {
|
|
var i = e.next;
|
|
if (null != e.$w) {
|
|
var n = e.$w;
|
|
n.useLayerIndex = !0,
|
|
n.reparentContainer()
|
|
}
|
|
e = i
|
|
}
|
|
}
|
|
this.$ja++,
|
|
this.$ja %= this.$Ja
|
|
},
|
|
get_name: function () {
|
|
return "$Ia"
|
|
},
|
|
__class__: Yi
|
|
});
|
|
var Wi = function (t, e) {
|
|
null == e && (e = !0),
|
|
null == t && (t = !1),
|
|
this.$Xc = Ao.empty(),
|
|
this.$xc = 1,
|
|
f.call(this),
|
|
this.$xc = t ? -1 : 1,
|
|
this.autoUpdate = e
|
|
};
|
|
Wi.__name__ = !0,
|
|
Wi.__interfaces__ = [Hi],
|
|
Wi.__super__ = f,
|
|
Wi.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
null == this.$Ma && (this.$Ma = this.owner._internal_getFromParents("$Aa", B)),
|
|
f.prototype.onStart.call(this),
|
|
this.autoUpdate || this.updateProjection()
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
this.autoUpdate && this.updateProjection()
|
|
},
|
|
updateProjection: function () {
|
|
this.$Ma.worldProjection.project(this.$dA.position3d, this.$Xc),
|
|
this.$ya.container.position.set(this.$Xc.x, this.$Xc.y),
|
|
this.$ya.container.scale.x = this.$dA.heading._value.axisDirection * this.$xc
|
|
},
|
|
get_name: function () {
|
|
return "$Wc"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
null == this.$dA && (this.$dA = this.owner.$rD),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Wi
|
|
});
|
|
var zi = function () {
|
|
this.zToXYProjection = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.matrix = new PIXI.Matrix,
|
|
f.call(this)
|
|
};
|
|
zi.__name__ = !0,
|
|
zi.__interfaces__ = [Hi],
|
|
zi.__super__ = f,
|
|
zi.prototype = o(f.prototype, {
|
|
project: function (t, e) {
|
|
return null == e && (e = Ao.empty()),
|
|
this.matrix.apply(t, e),
|
|
e.x += t.z * this.zToXYProjection.x,
|
|
e.y += t.z * this.zToXYProjection.y,
|
|
e.z = t.z,
|
|
e
|
|
},
|
|
unproject: function (t, e) {
|
|
null == e && (e = Ao.empty());
|
|
var i = {
|
|
x: t.x,
|
|
y: t.y,
|
|
z: t.z
|
|
};
|
|
return i.x -= i.z * this.zToXYProjection.x,
|
|
i.y -= i.z * this.zToXYProjection.y,
|
|
this.matrix.applyInverse(i, e),
|
|
e
|
|
},
|
|
get_name: function () {
|
|
return "$gE"
|
|
},
|
|
__class__: zi
|
|
});
|
|
var qi = function () {
|
|
this.$a = new Pn,
|
|
this.containers = new cr,
|
|
f.call(this)
|
|
};
|
|
qi.__name__ = !0,
|
|
qi.__super__ = f,
|
|
qi.prototype = o(f.prototype, {
|
|
gotoScene: function (t, e) {
|
|
null != this.$A && this.$A.goto(t, e)
|
|
},
|
|
onAdded: function () {
|
|
f.prototype.onAdded.call(this),
|
|
this.owner.addComponent(this.containers)
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
null != this.$b && this.$b.update(t) && (this.$b.complete(), this.$b = null)
|
|
},
|
|
$B: function () {
|
|
this.isTransitioning = !1
|
|
},
|
|
$c: function () {
|
|
null != this.owner && this.owner.dispose(),
|
|
this.isTransitioning = !1
|
|
},
|
|
$C: function () {
|
|
var t,
|
|
e = this.id;
|
|
switch (e._hx_index) {
|
|
case 0:
|
|
t = {
|
|
getInstance: e.c,
|
|
name: e.name,
|
|
layer: 0
|
|
};
|
|
break;
|
|
case 1:
|
|
t = {
|
|
getInstance: e.c,
|
|
name: e.name,
|
|
layer: e.layer
|
|
}
|
|
}
|
|
return t.name
|
|
},
|
|
get_name: function () {
|
|
return "$_"
|
|
},
|
|
onStart: function () {
|
|
null == this.$A && (this.$A = this.owner._internal_getFromParents("$kF")),
|
|
f.prototype.onStart.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.containers && (this.containers.dispose(), this.containers = null),
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: qi
|
|
});
|
|
var Ji = function () {
|
|
this.$D = new So(To.fromString("100%"), To.fromString("100%")),
|
|
this.sceneHeight = 480,
|
|
this.sceneWidth = 850,
|
|
qi.call(this)
|
|
};
|
|
Ji.__name__ = !0,
|
|
Ji.__super__ = qi,
|
|
Ji.prototype = o(qi.prototype, {
|
|
onAdded: function () {
|
|
qi.prototype.onAdded.call(this),
|
|
this.owner.addComponent(this.$D),
|
|
this.containers.main.addComponent(new So(Oo.Relative(this.sceneWidth), Oo.Relative(this.sceneHeight), To.fromString("50%"), To.fromString("50%"), To.fromString("50%"), To.fromString("50%")).setScaleMode(Po.Contain)),
|
|
this.containers.top.addComponent(new So(To.fromString("100%"), To.fromString("100%"), To.fromString("50%"), To.fromString("50%"), To.fromString("50%"), To.fromString("50%")).setScaleMode(Po.Contained(this.sceneWidth, this.sceneHeight))),
|
|
this.containers.bottom.addComponent(new So(To.fromString("100%"), To.fromString("100%"), To.fromString("50%"), To.fromString("50%"), To.fromString("50%"), To.fromString("50%")).setScaleMode(Po.Contained(this.sceneWidth, this.sceneHeight)))
|
|
},
|
|
onStart: function () {
|
|
qi.prototype.onStart.call(this),
|
|
Ro.trackPageview(this.$C()),
|
|
this.$a.add(Un.stage.resizeSignal.connect(cs(this, this.$e))),
|
|
this.$e(Un.renderer.width / Un.renderer.resolution | 0, Un.renderer.height / Un.renderer.resolution | 0)
|
|
},
|
|
$e: function (t, e) {
|
|
this.$D.resize(t, e)
|
|
},
|
|
$E: function (t) {
|
|
var e;
|
|
switch (t) {
|
|
case 1:
|
|
e = 850;
|
|
break;
|
|
case 2:
|
|
case 3:
|
|
e = 425
|
|
}
|
|
switch (this.sceneWidth = e, t) {
|
|
case 1:
|
|
e = 480;
|
|
break;
|
|
case 2:
|
|
case 3:
|
|
e = 240
|
|
}
|
|
this.sceneHeight = e
|
|
},
|
|
__class__: Ji
|
|
});
|
|
var Ki = function (t) {
|
|
var e;
|
|
switch (Ji.call(this), this.$i = t, g.current = this.$i.gameId, this.$i.gameId) {
|
|
case 1:
|
|
e = 2296908;
|
|
break;
|
|
case 2:
|
|
case 3:
|
|
e = 0
|
|
}
|
|
Un.renderer.backgroundColor = e,
|
|
this.$E(this.$i.gameId)
|
|
};
|
|
Ki.__name__ = !0,
|
|
Ki.__super__ = Ji,
|
|
Ki.prototype = o(Ji.prototype, {
|
|
onAdded: function () {
|
|
var t,
|
|
e = this,
|
|
i = new U;
|
|
switch (this.$i.gameId) {
|
|
case 1:
|
|
t = new V(this.sceneWidth, this.sceneHeight);
|
|
break;
|
|
case 2:
|
|
t = new Wt(this.sceneWidth, this.sceneHeight);
|
|
break;
|
|
case 3:
|
|
t = new $e(this.sceneWidth, this.sceneHeight)
|
|
}
|
|
this.game = t,
|
|
this.containers.main.add(Rn.EArray([Rn.EComponent(new ho(.016666666666666666)), Rn.EComponent(i), Rn.EComponent(this.$i), Rn.EComponent(this.game)])),
|
|
this.$a.add(this.$i.isPlaying.get_changed().connect((function (t, i) {
|
|
t ? e.$x_() : e.$X_()
|
|
}))),
|
|
Ji.prototype.onAdded.call(this)
|
|
},
|
|
onStart: function () {
|
|
Ji.prototype.onStart.call(this),
|
|
this.game.startGame()
|
|
},
|
|
$x_: function () {},
|
|
$X_: function () {
|
|
switch (this.$i.outcome) {
|
|
case 0:
|
|
this.$A.goto(S.scenes.win(this.$i));
|
|
break;
|
|
case 1:
|
|
this.$A.goto(S.scenes.lose(this.$i));
|
|
break;
|
|
case 2:
|
|
this.$A.goto(S.scenes.easterEgg(this.$i));
|
|
break;
|
|
case 3:
|
|
this.$A.goto(S.scenes.outro)
|
|
}
|
|
},
|
|
__class__: Ki
|
|
});
|
|
var Zi = function (t) {
|
|
Ji.call(this),
|
|
this.$L = t
|
|
};
|
|
Zi.__name__ = !0,
|
|
Zi.__super__ = Ji,
|
|
Zi.prototype = o(Ji.prototype, {
|
|
onStart: function () {
|
|
Ji.prototype.onStart.call(this),
|
|
this.containers.main.add(Rn.EEntity((new On).add(Rn.EComponent(new zr(Un.renderer.backgroundColor, 1.5 * this.sceneWidth, this.sceneHeight, !0, 0, 1).setXY(.25 * -this.sceneWidth, 0))))),
|
|
this.containers.top.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(new cn), Rn.EComponent(new So(Oo.Relative(this.sceneWidth), Oo.Relative(this.sceneHeight), To.fromString("50%"), To.fromString("50%"), To.fromString("50%"), To.fromString("50%")))])))),
|
|
this.$M()
|
|
},
|
|
removeInteraction: function () {
|
|
var t = this.containers.main;
|
|
null != t.$aa && t.$aa.dispose()
|
|
},
|
|
enableInteraction: function (t) {
|
|
var e = Rn.EComponent(new no((function (e) {
|
|
t(e),
|
|
e.stopPropagation()
|
|
})));
|
|
this.containers.main.add(e)
|
|
},
|
|
$m: function (t) {
|
|
var e,
|
|
i,
|
|
n = this,
|
|
r = Zi.$l.slice(),
|
|
o = this.containers.main,
|
|
s = new On;
|
|
e = S.animations.getMovieSpritePlayer(t, S.animationLibraries.get_currentCutscene()).setXY(.5 * this.sceneWidth, 0),
|
|
i = s.add(Rn.EArray([Rn.EComponent(e)])),
|
|
o.add(Rn.EEntity(i));
|
|
var a = e.getLabels(),
|
|
h = new Pn;
|
|
i.add(Rn.EComponent(h));
|
|
var l = function () {
|
|
h.dispose(),
|
|
i.add(Rn.EComponent(new Gr(null, cs(n, n.$M))))
|
|
};
|
|
if (a.list.length > 0) {
|
|
var u = null;
|
|
(u = function () {
|
|
if (r.length > 0) {
|
|
var t = r.shift();
|
|
!function (t, i, r) {
|
|
if (n.removeInteraction(), e.getLabels().hasLabel(i)) {
|
|
var o = function () {
|
|
n.removeInteraction(),
|
|
h.dispose(),
|
|
r()
|
|
};
|
|
if (h.add(e.gotoLabelAndPlayRange(i, t, .025).completed((function () {
|
|
t || o()
|
|
}))), h.add(ss.create(n.owner, 2, (function () {
|
|
n.enableInteraction((function (t) {
|
|
o()
|
|
}))
|
|
}))), t) {
|
|
var s = h,
|
|
a = n.owner,
|
|
l = (new On).addComponent(new Gr(3.5, o));
|
|
a.addEntity(l, !0),
|
|
s.add(l)
|
|
}
|
|
} else
|
|
r()
|
|
}
|
|
(t.indexOf("loop") >= 0, t, u)
|
|
} else
|
|
n.removeInteraction(), l()
|
|
})()
|
|
} else
|
|
e.play(!1).completed(l), this.enableInteraction((function (t) {
|
|
l()
|
|
}))
|
|
},
|
|
$M: function () {
|
|
this.$L.length > 0 ? this.$m(this.$L.shift()) : this.$n()
|
|
},
|
|
$n: function () {
|
|
this.$g()
|
|
},
|
|
$g: function () {},
|
|
__class__: Zi
|
|
});
|
|
var Qi = function (t) {
|
|
var e;
|
|
switch (t) {
|
|
case 1:
|
|
e = ["game1_intro1_anim", "game1_intro2_anim"];
|
|
break;
|
|
case 2:
|
|
e = ["game2_intro1_anim", "game2_intro2_anim"];
|
|
break;
|
|
case 3:
|
|
e = ["game3_cutscene2_anim"]
|
|
}
|
|
Zi.call(this, e),
|
|
g.current = t,
|
|
this.$s = t,
|
|
Un.renderer.backgroundColor = 0,
|
|
this.$E(this.$s)
|
|
};
|
|
Qi.__name__ = !0,
|
|
Qi.__super__ = Zi,
|
|
Qi.prototype = o(Zi.prototype, {
|
|
$g: function () {
|
|
Un.get_sceneManager().goto(S.scenes.game(new j(this.$s)))
|
|
},
|
|
__class__: Qi
|
|
});
|
|
var tn = function () {
|
|
Zi.call(this, ["game3_ending"]),
|
|
g.current = 3,
|
|
Un.renderer.backgroundColor = 0,
|
|
this.$E(3)
|
|
};
|
|
tn.__name__ = !0,
|
|
tn.__super__ = Zi,
|
|
tn.prototype = o(Zi.prototype, {
|
|
$n: function () {
|
|
var t = this,
|
|
e = Un.root.$V_;
|
|
(e instanceof ki ? e : null).fade(8),
|
|
this.containers.main.addEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.get("game3_game_not_over_anim", S.animationLibraries.get_currentCutscene()).setXY(.5 * this.sceneWidth, 0)), Rn.EComponent(new Kr((function () {
|
|
t.owner.addEntity((new On).addComponent(new Gr(2.5, cs(t, t.$g))), !0)
|
|
})))])))
|
|
},
|
|
$j: function () {
|
|
var t = this;
|
|
this.containers.main.addEntity((new On).add(Rn.EArray([Rn.EComponent(new So(To.fromString("auto"), To.fromString("auto"), Oo.Relative(135), Oo.Relative(200), To.fromString("50%"), To.fromString("50%"))), Rn.EComponent(new Fi(S.files.game3.manifest.fileNames[0])), Rn.EComponent(new no((function (e) {
|
|
t.$k()
|
|
})))]))),
|
|
this.containers.main.addEntity((new On).add(Rn.EArray([Rn.EComponent(new So(To.fromString("auto"), To.fromString("auto"), Oo.Relative(293), Oo.Relative(200), To.fromString("50%"), To.fromString("50%"))), Rn.EComponent(new Fi(S.files.game3.manifest.fileNames[6])), Rn.EComponent(new no((function (e) {
|
|
t.$J()
|
|
})))])))
|
|
},
|
|
$J: function () {
|
|
this.$A.goto(S.scenes.title(1))
|
|
},
|
|
$k: function () {
|
|
bn.exit()
|
|
},
|
|
$g: function () {
|
|
xn.isNativeChinese() ? this.$j() : this.$k()
|
|
},
|
|
__class__: tn
|
|
});
|
|
var en = function (t) {
|
|
var e;
|
|
switch (t) {
|
|
case 1:
|
|
e = [];
|
|
break;
|
|
case 2:
|
|
e = ["game2_prologue1_anim", "game2_prologue2_anim"];
|
|
break;
|
|
case 3:
|
|
e = ["game3_prologue1_anim"]
|
|
}
|
|
Zi.call(this, e),
|
|
g.current = t,
|
|
this.$s = t,
|
|
Un.renderer.backgroundColor = 0,
|
|
this.$E(this.$s)
|
|
};
|
|
en.__name__ = !0,
|
|
en.__super__ = Zi,
|
|
en.prototype = o(Zi.prototype, {
|
|
$g: function () {
|
|
Un.get_sceneManager().goto(S.scenes.title(this.$s))
|
|
},
|
|
__class__: en
|
|
});
|
|
var nn = function () {};
|
|
nn.__name__ = !0,
|
|
nn.__isInterface__ = !0,
|
|
nn.prototype = {
|
|
__class__: nn
|
|
};
|
|
var rn = function () {
|
|
this.terminal = new fn,
|
|
this.$V = 0,
|
|
Ji.call(this),
|
|
Un.renderer.backgroundColor = 361193
|
|
};
|
|
rn.__name__ = !0,
|
|
rn.__interfaces__ = [nn],
|
|
rn.__super__ = Ji,
|
|
rn.prototype = o(Ji.prototype, {
|
|
show: function () {
|
|
this.containers.main.add(Rn.EEntity((new On).add(Rn.EComponent(new zr(Un.renderer.backgroundColor, 1.5 * this.sceneWidth, this.sceneHeight, !0, 0, 1).setXY(.25 * -this.sceneWidth, 0))))),
|
|
this.containers.main.add(Rn.EEntity((new On).add(Rn.EComponent(this.terminal.setFill(16777215).setFontSize(18).setXY(30, 30))))),
|
|
this.terminal.pointerTapSignal.connect((function (t) {
|
|
Un.get_soundManager().play(S.sounds.shared.PRELOADER_CLICK, 1),
|
|
PIXI.utils.isMobile.android.device && Un.stage.requestFullScreen()
|
|
}))
|
|
},
|
|
setProgress: function (t) {
|
|
this.$V = t,
|
|
null != this.owner && this.terminal.setProgress(this.$V)
|
|
},
|
|
__class__: rn
|
|
});
|
|
var on = function (t) {
|
|
var e;
|
|
switch (this.$o = !1, this.$N = !1, t.gameId) {
|
|
case 1:
|
|
e = ["game1_easteregg1_anim", "game1_easteregg2_anim"];
|
|
break;
|
|
case 2:
|
|
e = ["game2_easteregg1_anim", "game2_easteregg2_anim"];
|
|
break;
|
|
case 3:
|
|
e = ["game3_boss_intro_anim"]
|
|
}
|
|
Zi.call(this, e),
|
|
this.$i = t,
|
|
Un.renderer.backgroundColor = 0,
|
|
this.$E(this.$i.gameId)
|
|
};
|
|
on.__name__ = !0,
|
|
on.__super__ = Zi,
|
|
on.prototype = o(Zi.prototype, {
|
|
onStart: function () {
|
|
Zi.prototype.onStart.call(this);
|
|
var t = g.getNext(this.$i.gameId);
|
|
null != t ? this.owner.add(Rn.EComponent(new X(t, cs(this, this.$O)))) : this.$O()
|
|
},
|
|
$O: function () {
|
|
this.$o = !0,
|
|
this.$g()
|
|
},
|
|
$n: function () {
|
|
this.$N = !0,
|
|
this.$g()
|
|
},
|
|
$g: function () {
|
|
if (this.$o && this.$N) {
|
|
var t = g.getNext(this.$i.gameId);
|
|
3 != this.$i.gameId ? Un.get_sceneManager().goto(S.scenes.prologue(t), new ur(0, .25)) : Un.get_sceneManager().goto(S.scenes.bossBattle(new j(3)))
|
|
}
|
|
},
|
|
__class__: on
|
|
});
|
|
var sn = function (t) {
|
|
Ji.call(this),
|
|
this.$i = t,
|
|
Un.renderer.backgroundColor = 0,
|
|
this.$E(this.$i.gameId)
|
|
};
|
|
sn.__name__ = !0,
|
|
sn.__super__ = Ji,
|
|
sn.prototype = o(Ji.prototype, {
|
|
onStart: function () {
|
|
Ji.prototype.onStart.call(this),
|
|
this.$I(),
|
|
this.$j()
|
|
},
|
|
$I: function () {},
|
|
$j: function () {
|
|
var t,
|
|
e,
|
|
i = this;
|
|
switch (this.$i.gameId) {
|
|
case 1:
|
|
t = {
|
|
x: 520,
|
|
y: 415
|
|
};
|
|
break;
|
|
case 2:
|
|
t = {
|
|
x: 255,
|
|
y: 210
|
|
};
|
|
break;
|
|
case 3:
|
|
t = {
|
|
x: 135,
|
|
y: 200
|
|
}
|
|
}
|
|
switch (this.containers.main.addEntity((new On).add(Rn.EArray([Rn.EComponent(new So(To.fromString("auto"), To.fromString("auto"), Oo.Relative(t.x), Oo.Relative(t.y), To.fromString("50%"), To.fromString("50%"))), Rn.EComponent(new Fi(S.files.game1.manifest.fileNames[2])), Rn.EComponent(new no((function (t) {
|
|
i.$k()
|
|
})))]))), this.$i.gameId) {
|
|
case 1:
|
|
e = {
|
|
x: 698,
|
|
y: 415
|
|
};
|
|
break;
|
|
case 2:
|
|
e = {
|
|
x: 340,
|
|
y: 210
|
|
};
|
|
break;
|
|
case 3:
|
|
e = {
|
|
x: 293,
|
|
y: 200
|
|
}
|
|
}
|
|
this.containers.main.addEntity((new On).add(Rn.EArray([Rn.EComponent(new So(To.fromString("auto"), To.fromString("auto"), Oo.Relative(e.x), Oo.Relative(e.y), To.fromString("50%"), To.fromString("50%"))), Rn.EComponent(new Fi(S.files.game1.manifest.fileNames[6])), Rn.EComponent(new no((function (t) {
|
|
i.$J()
|
|
})))])))
|
|
},
|
|
$J: function () {
|
|
Un.get_soundManager().play(S.sounds.shared.UI_CLICK_1),
|
|
PIXI.utils.isMobile.android.device && Un.stage.requestFullScreen();
|
|
var t,
|
|
e = this.$A,
|
|
i = e.history.length > 1 ? e.history[1] : null;
|
|
switch (i._hx_index) {
|
|
case 0:
|
|
t = {
|
|
getInstance: i.c,
|
|
name: i.name,
|
|
layer: 0
|
|
};
|
|
break;
|
|
case 1:
|
|
t = {
|
|
getInstance: i.c,
|
|
name: i.name,
|
|
layer: i.layer
|
|
}
|
|
}
|
|
t.name.indexOf("bossbattle") >= 0 ? this.gotoScene(S.scenes.bossBattle(new j(3))) : this.gotoScene(S.scenes.game(new j(this.$i.gameId)))
|
|
},
|
|
$k: function () {
|
|
Un.get_soundManager().play(S.sounds.shared.UI_CLICK_2),
|
|
bn.exit()
|
|
},
|
|
__class__: sn
|
|
});
|
|
var an = function (t) {
|
|
sn.call(this, t)
|
|
};
|
|
an.__name__ = !0,
|
|
an.__super__ = sn,
|
|
an.prototype = o(sn.prototype, {
|
|
$I: function () {
|
|
this.containers.main.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer("game" + this.$i.gameId + "_game_over_anim", S.animationLibraries.get_currentCutscene()).setXY(.5 * this.sceneWidth, 0)), Rn.EComponent(new un)]))))
|
|
},
|
|
__class__: an
|
|
});
|
|
var hn = function (t) {
|
|
sn.call(this, t)
|
|
};
|
|
hn.__name__ = !0,
|
|
hn.__super__ = sn,
|
|
hn.prototype = o(sn.prototype, {
|
|
$I: function () {
|
|
this.containers.main.add(Rn.EEntity((new On).add(Rn.EArray([Rn.EComponent(S.animations.getMovieSpritePlayer("game" + this.$i.gameId + "_win_anim", S.animationLibraries.get_currentCutscene()).setXY(.5 * this.sceneWidth, 0)), Rn.EComponent(new un)]))))
|
|
},
|
|
__class__: hn
|
|
});
|
|
var ln = function (t) {
|
|
Ji.call(this),
|
|
this.$f = t,
|
|
g.current = t,
|
|
Un.renderer.backgroundColor = 0,
|
|
this.$E(t)
|
|
};
|
|
ln.__name__ = !0,
|
|
ln.__super__ = Ji,
|
|
ln.prototype = o(Ji.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
Ji.prototype.onStart.call(this);
|
|
var e,
|
|
i = Un.root.$V_;
|
|
(i instanceof ki ? i : null).start(null),
|
|
Un.get_soundManager().play(S.sounds.shared.UI_START_GAME),
|
|
this.containers.main.add(Rn.EEntity((new On).add(Rn.EComponent(new zr(Un.renderer.backgroundColor, 1.5 * this.sceneWidth, this.sceneHeight, !0, 0, 1).setXY(.25 * -this.sceneWidth, 0)))));
|
|
var n = this.containers.main,
|
|
r = new On;
|
|
e = S.animations.getMovieSpritePlayer("game" + this.$f + "_title_anim", S.animationLibraries.get_currentCutscene()).setXY(.5 * this.sceneWidth, 0),
|
|
n.add(Rn.EEntity(r.add(Rn.EArray([Rn.EComponent(e)]))));
|
|
var o = function () {
|
|
!function () {
|
|
var i;
|
|
switch (t.$f) {
|
|
case 1:
|
|
i = {
|
|
x: t.sceneWidth / 2,
|
|
y: 410
|
|
};
|
|
break;
|
|
case 2:
|
|
i = {
|
|
x: t.sceneWidth / 2,
|
|
y: 203
|
|
};
|
|
break;
|
|
case 3:
|
|
i = {
|
|
x: t.sceneWidth / 2,
|
|
y: 212
|
|
}
|
|
}
|
|
var n = new Ln(!1);
|
|
hs.create(t.owner, .1, 5, (function () {
|
|
n.set__(!n._value)
|
|
}));
|
|
var r = t.containers.main,
|
|
o = new On,
|
|
s = Rn.EComponent(new So(To.fromString("auto"), To.fromString("auto"), Oo.Relative(i.x), Oo.Relative(i.y), To.fromString("50%"), To.fromString("50%"))),
|
|
a = Rn.EComponent(new Fi(S.files.game1.manifest.fileNames[7]));
|
|
r.addEntity(t.$F = o.add(Rn.EArray([s, a, Rn.EComponent(new Jr(n))])));
|
|
o = Rn.EComponent(new no((function (i) {
|
|
Un.get_soundManager().play(S.sounds.shared.UI_CLICK_1),
|
|
t.containers.main.$aa.dispose(),
|
|
t.$F.add(Rn.EComponent(new Gr)),
|
|
PIXI.utils.isMobile.android.device && Un.stage.requestFullScreen(),
|
|
e.getLabels().hasLabel("start") ? e.gotoLabelAndPlayRange("start").completed(cs(t, t.$g)) : t.$g()
|
|
})));
|
|
t.containers.main.add(o)
|
|
}
|
|
(),
|
|
e.getLabels().hasLabel("loop") ? e.gotoLabelAndPlayRange("loop", !0) : e.play(!0)
|
|
};
|
|
e.getLabels().hasLabel("intro") ? e.gotoLabelAndPlayRange("intro", !1).completed(o) : o()
|
|
},
|
|
$g: function () {
|
|
this.$A.goto(S.scenes.intro(this.$f))
|
|
},
|
|
$B: function () {
|
|
Ji.prototype.$B.call(this),
|
|
X.disposeAssets(g.getPrevious(this.$f))
|
|
},
|
|
__class__: ln
|
|
});
|
|
var un = function () {
|
|
this.onStartLoop = new Mr,
|
|
f.call(this)
|
|
};
|
|
un.__name__ = !0,
|
|
un.__super__ = f,
|
|
un.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this._movieSprite && (this._movieSprite = this.owner.$w),
|
|
f.prototype.onStart.call(this),
|
|
this._movieSprite.getLabels().hasLabel("intro") ? this._movieSprite.gotoLabelAndPlay("intro", !1).completed((function () {
|
|
t.onStartLoop.emit(),
|
|
t._movieSprite.gotoLabelAndPlayRange("loop", !0)
|
|
})) : this._movieSprite.play(!0)
|
|
},
|
|
get_name: function () {
|
|
return "$K"
|
|
},
|
|
onAdded: function () {
|
|
null == this._movieSprite && (this._movieSprite = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: un
|
|
});
|
|
var cn = function () {
|
|
Vt.call(this, this.$H_ = new PIXI.Graphics)
|
|
};
|
|
cn.__name__ = !0,
|
|
cn.__super__ = Vt,
|
|
cn.prototype = o(Vt.prototype, {
|
|
onStart: function () {
|
|
null == this.$Te && (this.$Te = this.owner._internal_getFromParents("$_", Ji)),
|
|
Vt.prototype.onStart.call(this),
|
|
this.$Ue = this.$Te.sceneWidth / this.$Te.sceneHeight,
|
|
this.$H_.beginFill(0).drawRect(0, -cn.$ue, this.$Te.sceneWidth, cn.$ue).drawRect(0, this.$Te.sceneHeight, this.$Te.sceneWidth, cn.$ue).endFill(),
|
|
this.$H_.cacheAsBitmap = !0
|
|
},
|
|
onUpdate: function (t) {
|
|
Vt.prototype.onUpdate.call(this, t),
|
|
this.container.visible = (Un.renderer.width / Un.renderer.resolution | 0) / (Un.renderer.height / Un.renderer.resolution | 0) < this.$Ue
|
|
},
|
|
__class__: cn
|
|
});
|
|
var pn = function (t, e, i, n, r, o) {
|
|
var s;
|
|
null == r && (r = 0),
|
|
null == n && (n = 16777215),
|
|
null == i && (i = 0),
|
|
null == e && (e = 30),
|
|
null == t && (t = 300),
|
|
this.$V = 0,
|
|
this.$H_ = new PIXI.Graphics,
|
|
Vt.call(this, this.$H_),
|
|
this.frontColor = n,
|
|
this.backColor = i,
|
|
this.$I_ = e,
|
|
this.$i_ = t,
|
|
this.$J_ = r,
|
|
s = null == o ? o = bo.CENTER : o,
|
|
this.$j_ = s
|
|
};
|
|
pn.__name__ = !0,
|
|
pn.__interfaces__ = [nn],
|
|
pn.__super__ = Vt,
|
|
pn.prototype = o(Vt.prototype, {
|
|
setProgress: function (t) {
|
|
this.$V = t,
|
|
this.draw()
|
|
},
|
|
draw: function () {
|
|
if (this.$K_(), this.$H_.clear(), this.$i_ > this.$I_)
|
|
this.$H_.beginFill(this.backColor, 1).drawRect(this.$k_.x, this.$k_.y, this.$i_, this.$I_).endFill().beginFill(this.frontColor, 1).drawRect(this.$k_.x + this.$J_, this.$k_.y + this.$J_, Math.max(this.$V * this.$i_ - 2 * this.$J_, 0), this.$I_ - 2 * this.$J_).endFill();
|
|
else {
|
|
var t = this.$V * this.$I_ - 2 * this.$J_;
|
|
this.$H_.beginFill(this.backColor, 1).drawRect(this.$k_.x, this.$k_.y, this.$i_, this.$I_).endFill().beginFill(this.frontColor, 1).drawRect(this.$k_.x + this.$J_, this.$k_.y + this.$J_ + (this.$I_ - t), this.$i_ - 2 * this.$J_, Math.max(t, 0)).endFill()
|
|
}
|
|
},
|
|
$K_: function () {
|
|
var t;
|
|
switch (this.$j_._hx_index) {
|
|
case 4:
|
|
t = new PIXI.Point(0, -this.$I_);
|
|
break;
|
|
case 5:
|
|
t = new PIXI.Point(-this.$i_, -this.$I_);
|
|
break;
|
|
case 6:
|
|
t = new PIXI.Point(0, 0);
|
|
break;
|
|
case 7:
|
|
t = new PIXI.Point(-this.$i_, 0);
|
|
break;
|
|
case 8:
|
|
t = new PIXI.Point(-this.$i_ / 2, -this.$I_ / 2);
|
|
break;
|
|
default:
|
|
t = new PIXI.Point(0, 0)
|
|
}
|
|
this.$k_ = t
|
|
},
|
|
__class__: pn
|
|
});
|
|
var dn = function (t) {
|
|
null == t && (t = "");
|
|
var e = this;
|
|
Vt.call(this, this.$c_ = new PIXI.Text(t)),
|
|
null != dn.defaultStyle && (this.$c_.style = dn.defaultStyle),
|
|
this.text = new Ln(t, (function (t, i) {
|
|
e.$c_.text = t
|
|
}))
|
|
};
|
|
dn.__name__ = !0,
|
|
dn.__super__ = Vt,
|
|
dn.prototype = o(Vt.prototype, {
|
|
setFill: function (t) {
|
|
return this.$c_.style.fill = t,
|
|
this
|
|
},
|
|
setFontSize: function (t) {
|
|
return this.$c_.style.fontSize = t,
|
|
this
|
|
},
|
|
__class__: dn
|
|
});
|
|
var fn = function () {
|
|
this.$F_ = [_n.Prompt("C:\\8-BIT>", "Hello 8-Bit. Welcome to 8-Bit.", !1), _n.Newline, _n.Line("Bad or missing C:\\Who.exe"), _n.Line("Bad or missing C:\\Whatis8bit.exe"), _n.Newline, _n.Line("Truth lies inside medium density fiberboard."), _n.Newline, _n.Line("To extract or compress truth"), _n.Line("Error in CONFIG.SYS line 86"), _n.Newline, _n.Newline, _n.Line("It eats at your soul."), _n.Newline, _n.Prompt("Reading source file(s)", " ....", !1), _n.Prompt("C:\\LOG>", "echo lies.log", !1), _n.Line("Your nagging psyche keeps you from discovering who and what you truly are. "), _n.Newline, _n.Loader("$PROGRESS Memory Restored"), _n.Newline, _n.Line("Warning! You will now enter the memory core of 8-Bit."), _n.Line("Do you want to continue the program?"), _n.Prompt("[Y] [Y] ", "Y", !0)],
|
|
this.$f_ = "",
|
|
this.$E_ = 0,
|
|
this.$V = 0,
|
|
this.pointerTapSignal = new sr,
|
|
this.completedSignal = new Mr,
|
|
dn.call(this)
|
|
};
|
|
fn.__name__ = !0,
|
|
fn.__super__ = dn,
|
|
fn.prototype = o(dn.prototype, {
|
|
$g_: function (t, e) {
|
|
var i = t;
|
|
null == t && (i = 0),
|
|
this.owner.addEntity((new On).addComponent(new Gr(i, e)), !0)
|
|
},
|
|
$G_: function (t) {
|
|
var e = this;
|
|
if (this.$F_.length > 0) {
|
|
var n = t;
|
|
null == t && (n = 0),
|
|
this.owner.addEntity((new On).addComponent(new Gr(n, (function () {
|
|
e.$h_(e.$F_.shift())
|
|
}))), !0)
|
|
} else
|
|
this.$g_(1, cs(i = this.completedSignal, i.emit))
|
|
},
|
|
$h_: function (t) {
|
|
var e = this;
|
|
switch (t._hx_index) {
|
|
case 0:
|
|
var i = this;
|
|
this.text.set__(i.$f_ += t.line + "\n"),
|
|
this.$G_(.12);
|
|
break;
|
|
case 1:
|
|
var n = t.userInput;
|
|
i = this;
|
|
this.text.set__(i.$f_ += t.cmd);
|
|
var r = function () {
|
|
for (var t = n.split(""), i = 0; i < t.length; ) {
|
|
var r = t[i++];
|
|
e.$g_(.05 * (i - 1 + 7) - .05 * Math.random(), function (t) {
|
|
return function () {
|
|
var i = e;
|
|
e.text.set__(i.$f_ += t[0])
|
|
}
|
|
}
|
|
([r]))
|
|
}
|
|
e.$g_(.05 * (n.length + 7), (function () {
|
|
var t = e;
|
|
e.text.set__(t.$f_ += "\n")
|
|
})),
|
|
e.$G_(.05 * (n.length + 8))
|
|
};
|
|
if (t.waitForTap) {
|
|
var o = null;
|
|
o = new no((function (t) {
|
|
e.pointerTapSignal.emit(t),
|
|
r(),
|
|
o.dispose()
|
|
})),
|
|
this.owner.parent.add(Rn.EComponent(o))
|
|
} else
|
|
r();
|
|
break;
|
|
case 2:
|
|
i = this;
|
|
this.text.set__(i.$f_ += "\n"),
|
|
this.$G_(.06);
|
|
break;
|
|
case 3:
|
|
this.$f_ = "",
|
|
this.text.set__(""),
|
|
this.$G_(.06);
|
|
break;
|
|
case 4:
|
|
this.$E_ += .1,
|
|
this.$E_ = Math.min(this.$E_, this.$V);
|
|
var s = c.replace(t.line, "$PROGRESS", (100 * this.$E_ | 0) + "%");
|
|
if (this.text.set__(this.$f_ + s), this.$E_ < 1) {
|
|
var a = cs(this, this.$h_),
|
|
h = t;
|
|
this.$g_(.016666666666666666, (function () {
|
|
a(h)
|
|
}))
|
|
} else {
|
|
i = this;
|
|
this.text.set__(i.$f_ += s + "\n"),
|
|
this.$G_(.12)
|
|
}
|
|
}
|
|
},
|
|
onStart: function () {
|
|
dn.prototype.onStart.call(this),
|
|
this.$G_(0)
|
|
},
|
|
setProgress: function (t) {
|
|
this.$V = t
|
|
},
|
|
__class__: fn
|
|
});
|
|
var _n = r["com.mediamonks.ui.TerminalEntry"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["Line", "Prompt", "Newline", "Clear", "Loader"],
|
|
Line: (i = function (t) {
|
|
return {
|
|
_hx_index: 0,
|
|
line: t,
|
|
__enum__: "com.mediamonks.ui.TerminalEntry",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["line"], i),
|
|
Prompt: (i = function (t, e, i) {
|
|
return {
|
|
_hx_index: 1,
|
|
cmd: t,
|
|
userInput: e,
|
|
waitForTap: i,
|
|
__enum__: "com.mediamonks.ui.TerminalEntry",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["cmd", "userInput", "waitForTap"], i),
|
|
Newline: {
|
|
_hx_index: 2,
|
|
__enum__: "com.mediamonks.ui.TerminalEntry",
|
|
toString: n
|
|
},
|
|
Clear: {
|
|
_hx_index: 3,
|
|
__enum__: "com.mediamonks.ui.TerminalEntry",
|
|
toString: n
|
|
},
|
|
Loader: (i = function (t) {
|
|
return {
|
|
_hx_index: 4,
|
|
line: t,
|
|
__enum__: "com.mediamonks.ui.TerminalEntry",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["line"], i)
|
|
},
|
|
mn = function (t, e) {
|
|
null == e && (e = 50),
|
|
this.$me = new Wo(0, 0, 0, .3),
|
|
this.$Le = new Wo(0, 0, 0, .2),
|
|
this.isDown = new Ln(!1),
|
|
this.upSignal = new sr,
|
|
this.downSignal = new sr,
|
|
Bi.call(this),
|
|
this.$S_ = t,
|
|
this.$le = e
|
|
};
|
|
mn.__name__ = !0,
|
|
mn.__super__ = Bi,
|
|
mn.prototype = o(Bi.prototype, {
|
|
onAdded: function () {
|
|
this.$s_ = new PIXI.Graphics,
|
|
this.$ne(this.$Le),
|
|
this.$q_ = new PIXI.Text(this.$S_, new PIXI.TextStyle({
|
|
fontSize: 16,
|
|
fontFamily: dn.defaultStyle.fontFamily,
|
|
fontWeight: dn.defaultStyle.fontWeight,
|
|
fill: 16777215
|
|
})),
|
|
this.$q_.anchor.set(.5),
|
|
this.container.addChild(this.$s_, this.$q_),
|
|
this.setHitArea(-this.$le, -this.$le, 2 * this.$le, 2 * this.$le),
|
|
Bi.prototype.onAdded.call(this)
|
|
},
|
|
$ne: function (t) {
|
|
this.$s_.clear().lineStyle(4, 16777215, 1).beginFill(Math.round((t._value >> 16 & 255) / 255 * 255) << 16 | Math.round((t._value >> 8 & 255) / 255 * 255) << 8 | Math.round((255 & t._value) / 255 * 255), t.a).drawCircle(0, 0, this.$le)
|
|
},
|
|
$N_: function () {
|
|
Bi.prototype.$N_.call(this),
|
|
this.$ne(this.$me),
|
|
this.isDown.set__(!0),
|
|
this.downSignal.emit(this)
|
|
},
|
|
$n_: function () {
|
|
Bi.prototype.$n_.call(this),
|
|
this.$ne(this.$Le),
|
|
this.isDown.set__(!1),
|
|
this.upSignal.emit(this)
|
|
},
|
|
__class__: mn
|
|
});
|
|
var yn = function () {
|
|
this.isDown = new Ln(!1),
|
|
this.upSignal = new sr,
|
|
this.downSignal = new sr,
|
|
Bi.call(this)
|
|
};
|
|
yn.__name__ = !0,
|
|
yn.__super__ = Bi,
|
|
yn.prototype = o(Bi.prototype, {
|
|
$N_: function () {
|
|
Bi.prototype.$N_.call(this),
|
|
this.isDown.set__(!0),
|
|
this.downSignal.emit(this)
|
|
},
|
|
$n_: function () {
|
|
Bi.prototype.$n_.call(this),
|
|
this.isDown.set__(!1),
|
|
this.upSignal.emit(this)
|
|
},
|
|
__class__: yn
|
|
});
|
|
var gn = function () {};
|
|
gn.__name__ = !0,
|
|
gn.addSpeedAdjusterKeys = function () {};
|
|
var vn = {
|
|
fromFlag: function (t) {
|
|
return [t]
|
|
}
|
|
},
|
|
wn = function () {};
|
|
wn.__name__ = !0,
|
|
wn.addHtmlCss = function () {
|
|
var t = window.document.documentElement;
|
|
PIXI.utils.isMobile.any ? (t.classList.add("is-mobile"), PIXI.utils.isMobile.phone ? t.classList.add("is-phone") : PIXI.utils.isMobile.tablet && t.classList.add("is-tablet")) : t.classList.add("is-desktop");
|
|
var e = function (e, i) {
|
|
var n = i > e;
|
|
t.classList.add(n ? "is-portrait" : "is-landscape"),
|
|
t.classList.remove(n ? "is-landscape" : "is-portrait")
|
|
};
|
|
return e(Un.renderer.width / Un.renderer.resolution | 0, Un.renderer.height / Un.renderer.resolution | 0),
|
|
Un.stage.resizeSignal.connect(e)
|
|
};
|
|
var xn = function () {};
|
|
xn.__name__ = !0,
|
|
xn.isNativeChinese = function () {
|
|
return "cn_cn" == En.language || "cn_en" == En.language
|
|
};
|
|
var bn = function () {};
|
|
bn.__name__ = !0,
|
|
bn.exit = function () {
|
|
var t;
|
|
if (Ro.trackEvent("redirect", "exit"), xn.isNativeChinese())
|
|
if (PIXI.utils.isMobile.android.device)
|
|
t = "https://brawlstars.com";
|
|
else
|
|
switch (En.language) {
|
|
case "cn_cn":
|
|
t = "https://link.brawlstars.cn/cn";
|
|
break;
|
|
case "cn_en":
|
|
t = "https://link.brawlstars.cn/en";
|
|
break;
|
|
default:
|
|
t = "https://link.brawlstars.cn/cn"
|
|
}
|
|
else
|
|
t = "https://link.brawlstars.com/" + En.language;
|
|
e.location.href = t
|
|
};
|
|
var En = function () {};
|
|
En.__name__ = !0,
|
|
En.init = function () {
|
|
var t = Un.url.getQueryString("params", "en").split("/");
|
|
En.language = t.shift(),
|
|
null == En.language && (En.language = "en"),
|
|
En.id1 = t.shift(),
|
|
En.id2 = t.shift()
|
|
};
|
|
var $n = function () {};
|
|
$n.__name__ = !0,
|
|
$n.__isInterface__ = !0,
|
|
$n.prototype = {
|
|
__class__: $n
|
|
};
|
|
var An = function () {
|
|
this._transformers = []
|
|
};
|
|
An.__name__ = !0,
|
|
An.prototype = {
|
|
unwrap: function (t, e, i) {
|
|
var n = [];
|
|
return null == i && (i = {
|
|
x: 0,
|
|
y: 0
|
|
}),
|
|
this.doUnwrap(t, e, n, i),
|
|
n
|
|
},
|
|
doUnwrap: function (t, e, i, n) {
|
|
var r = this;
|
|
return h.iter(S.animations.getMovieSprite(t, e).$fF, (function (t) {
|
|
var o = t.layer;
|
|
if (null != t.content.$w) {
|
|
var s = o.keyframes[0];
|
|
if (null == s.symbol)
|
|
return;
|
|
!function (t, o) {
|
|
if (o.symbolName.indexOf("prefab") >= 0) {
|
|
var s = {
|
|
x: n.x,
|
|
y: n.y
|
|
};
|
|
s.x += o.x - o.pivotX,
|
|
s.y += o.y - o.pivotY,
|
|
r.doUnwrap(o.symbolName, e, i, s)
|
|
} else {
|
|
for (var a = new In(t, o, e), h = [], l = 0, u = r._transformers; l < u.length; ) {
|
|
var c = u[l];
|
|
++l,
|
|
c.isMatch(a) && (a = c.transformInfo(a), h.push(c))
|
|
}
|
|
if (!a.willSkip) {
|
|
var p;
|
|
if (a.willInstantiateSymbol)
|
|
if (o.symbolName.indexOf("tile_") >= 0 && (1 != o.scaleX || 1 != o.scaleY) && o.symbol instanceof vr) {
|
|
var d = o.symbol,
|
|
f = S.animations.getTexture(d._name, a.libraryName);
|
|
f.baseTexture.mipmap = PIXI.MIPMAP_MODES.OFF,
|
|
(p = new Vt(new PIXI.TilingSprite(f, Math.ceil(d.texture.width * o.scaleX), Math.ceil(d.texture.height * o.scaleY)))).container.setTransform(o.x - o.pivotX * o.scaleX, o.y - o.pivotY * o.scaleY, 1, 1, null, -o.skewX, o.skewY, 0, 0)
|
|
} else
|
|
p = S.animations.get(a.symbolName, a.libraryName), r.applyKeyframeTransformToDisplay(p, a.keyframe);
|
|
else
|
|
p = new Vt, r.applyKeyframeTransformToDisplay(p, a.keyframe);
|
|
p.container.x += n.x,
|
|
p.container.y += n.y;
|
|
var _ = (new On).add(Rn.EComponent(p));
|
|
for (l = 0; l < h.length; )
|
|
_ = h[l++].decorateEntity(_, a);
|
|
i.push(_)
|
|
}
|
|
}
|
|
}
|
|
(t, s)
|
|
}
|
|
})),
|
|
i
|
|
},
|
|
registerTransformer: function (t) {
|
|
return this._transformers.push(t),
|
|
t
|
|
},
|
|
applyKeyframeTransformToDisplay: function (t, e) {
|
|
var i = e.x,
|
|
n = e.y,
|
|
r = e.scaleX,
|
|
o = e.scaleY,
|
|
s = e.skewX,
|
|
a = e.skewY,
|
|
h = e.alpha,
|
|
l = e.tintColor,
|
|
u = e.tintAmount;
|
|
0 != u ? (null == e.tintFilter ? e.tintFilter = new yr(l, u) : e.tintFilter.update(l, u), null != t.container.filters && t.container.filters[0] == e.tintFilter || (t.container.filters = [e.tintFilter])) : null != t.container.filters && (t.container.filters = null),
|
|
t.container.setTransform(i, n, r, o, null, -s, a, e.pivotX, e.pivotY),
|
|
t.container.alpha = h
|
|
},
|
|
__class__: An
|
|
};
|
|
var Sn = function (t) {
|
|
this._override = t
|
|
};
|
|
Sn.__name__ = !0,
|
|
Sn.__interfaces__ = [$n],
|
|
Sn.prototype = {
|
|
isMatch: function (t) {
|
|
return null != this._override && null != this._override.isMatch && this._override.isMatch(t)
|
|
},
|
|
transformInfo: function (t) {
|
|
return null != this._override && null != this._override.transformInfo ? this._override.transformInfo(t) : t
|
|
},
|
|
decorateEntity: function (t, e) {
|
|
return null != this._override && null != this._override.decorateEntity ? this._override.decorateEntity(t, e) : t
|
|
},
|
|
__class__: Sn
|
|
};
|
|
var Tn = function (t, e) {
|
|
Sn.call(this, e),
|
|
this._symbolNameSubstring = t,
|
|
null != e && null != e.isMatch && Dn.warn("IsMatch of the override will not be used")
|
|
};
|
|
Tn.__name__ = !0,
|
|
Tn.__super__ = Sn,
|
|
Tn.prototype = o(Sn.prototype, {
|
|
isMatch: function (t) {
|
|
return t.symbolName.indexOf(this._symbolNameSubstring) >= 0
|
|
},
|
|
__class__: Tn
|
|
});
|
|
var Cn = function (t, e) {
|
|
Sn.call(this, e),
|
|
this._regex = t,
|
|
null != e && null != e.isMatch && Dn.warn("IsMatch of the override will not be used")
|
|
};
|
|
Cn.__name__ = !0,
|
|
Cn.__super__ = Sn,
|
|
Cn.prototype = o(Sn.prototype, {
|
|
isMatch: function (t) {
|
|
return this._regex.match(t.symbolName)
|
|
},
|
|
__class__: Cn
|
|
});
|
|
var Mn = function (t, e, i) {
|
|
Sn.call(this, i),
|
|
this._symbolNameSubstring = t,
|
|
this._replaceBy = e,
|
|
null != i && (null != i.isMatch && Dn.warn("IsMatch of the override will not be used"), null != i.transformInfo && Dn.warn("transformInfo of the override will not be used"))
|
|
};
|
|
Mn.__name__ = !0,
|
|
Mn.__super__ = Sn,
|
|
Mn.prototype = o(Sn.prototype, {
|
|
isMatch: function (t) {
|
|
return t.symbolName.indexOf(this._symbolNameSubstring) >= 0
|
|
},
|
|
transformInfo: function (t) {
|
|
return t.symbolName = c.replace(t.symbolName, this._symbolNameSubstring, this._replaceBy),
|
|
t
|
|
},
|
|
__class__: Mn
|
|
});
|
|
var In = function (t, e, i) {
|
|
this.willInstantiateSymbol = !0,
|
|
this.willSkip = !1,
|
|
this.animator = t,
|
|
this.keyframe = e,
|
|
this.libraryName = i,
|
|
this.symbolName = this.keyframe.symbolName
|
|
};
|
|
In.__name__ = !0,
|
|
In.prototype = {
|
|
__class__: In
|
|
};
|
|
var Pn = function () {
|
|
f.call(this),
|
|
this.$MF = []
|
|
};
|
|
Pn.__name__ = !0,
|
|
Pn.__super__ = f,
|
|
Pn.prototype = o(f.prototype, {
|
|
add: function (t) {
|
|
return this.$MF.push(t),
|
|
this
|
|
},
|
|
onRemoved: function () {
|
|
this.$nF()
|
|
},
|
|
dispose: function () {
|
|
f.prototype.dispose.call(this),
|
|
this.$nF()
|
|
},
|
|
$nF: function () {
|
|
var t = this.$MF;
|
|
this.$MF = [];
|
|
for (var e = 0; e < t.length; )
|
|
t[e++].dispose()
|
|
},
|
|
get_name: function () {
|
|
return "$mF"
|
|
},
|
|
__class__: Pn
|
|
});
|
|
var On = function () {
|
|
this.timeScale = 1,
|
|
this.firstComponent = null,
|
|
this.next = null,
|
|
this.firstChild = null,
|
|
this.parent = null
|
|
};
|
|
On.__name__ = !0,
|
|
On.__interfaces__ = [d],
|
|
On.prototype = {
|
|
setTimeScale: function (t) {
|
|
return this.timeScale = t,
|
|
this
|
|
},
|
|
add: function (t) {
|
|
switch (t._hx_index) {
|
|
case 0:
|
|
this.addEntity(t.entity);
|
|
break;
|
|
case 1:
|
|
this.addComponent(t.component);
|
|
break;
|
|
case 2:
|
|
for (var e = t.structure, i = 0; i < e.length; )
|
|
this.add(e[i++])
|
|
}
|
|
return this
|
|
},
|
|
addComponent: function (t) {
|
|
null != t.owner && t.owner.removeComponent(t);
|
|
var e = t.get_name(),
|
|
i = this[e];
|
|
null != i && this.removeComponent(i),
|
|
this[e] = t;
|
|
for (var n = null, r = this.firstComponent; null != r; )
|
|
n = r, r = r.next;
|
|
return null != n ? n.next = t : this.firstComponent = t,
|
|
t.owner = this,
|
|
t.next = null,
|
|
t.onAdded(),
|
|
this
|
|
},
|
|
removeComponent: function (t) {
|
|
for (var e = null, i = this.firstComponent; null != i; ) {
|
|
var n = i.next;
|
|
if (i == t)
|
|
return null == e ? this.firstComponent = n : (e.owner = this, e.next = n), delete this[i.get_name()], 0 != (1 & i._flags) && (i.onStop(), i._flags &= -2), i.onRemoved(), i.owner = null, i.next = null, !0;
|
|
e = i,
|
|
i = n
|
|
}
|
|
return !1
|
|
},
|
|
addEntity: function (t, e) {
|
|
if (null == e && (e = !0), null != t.parent && t.parent.removeEntity(t), t.parent = this, e) {
|
|
for (var i = null, n = this.firstChild; null != n; )
|
|
i = n, n = n.next;
|
|
null != i ? i.next = t : this.firstChild = t
|
|
} else
|
|
t.next = this.firstChild, this.firstChild = t;
|
|
return this
|
|
},
|
|
removeEntity: function (t) {
|
|
for (var e = null, i = this.firstChild; null != i; ) {
|
|
var n = i.next;
|
|
if (i == t) {
|
|
null == e ? this.firstChild = n : e.next = n,
|
|
i.parent = null,
|
|
i.next = null;
|
|
break
|
|
}
|
|
e = i,
|
|
i = n
|
|
}
|
|
},
|
|
disposeChildren: function () {
|
|
for (; null != this.firstChild; )
|
|
this.firstChild.dispose()
|
|
},
|
|
dispose: function () {
|
|
for (null != this.parent && this.parent.removeEntity(this); null != this.firstComponent; )
|
|
this.firstComponent.dispose();
|
|
this.disposeChildren()
|
|
},
|
|
_internal_getFromParents: function (t, e) {
|
|
for (var i = this; ; ) {
|
|
var n = i[t];
|
|
if (null != e && (n = Vr.__downcastCheck(n, e) ? n : null), null != n)
|
|
return n;
|
|
if (null == (i = i.parent))
|
|
break
|
|
}
|
|
return null
|
|
},
|
|
_internal_getFromChildren: function (t, e) {
|
|
var i = this[t];
|
|
if (null != e && (i = Vr.__downcastCheck(i, e) ? i : null), null != i)
|
|
return i;
|
|
for (var n = this.firstChild; null != n; ) {
|
|
if (null != (i = n._internal_getFromChildren(t, e)))
|
|
return i;
|
|
n = n.next
|
|
}
|
|
return null
|
|
},
|
|
__class__: On
|
|
};
|
|
var Rn = r["flambe._Entity.EntityType"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["EEntity", "EComponent", "EArray"],
|
|
EEntity: (i = function (t) {
|
|
return {
|
|
_hx_index: 0,
|
|
entity: t,
|
|
__enum__: "flambe._Entity.EntityType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["entity"], i),
|
|
EComponent: (i = function (t) {
|
|
return {
|
|
_hx_index: 1,
|
|
component: t,
|
|
__enum__: "flambe._Entity.EntityType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["component"], i),
|
|
EArray: (i = function (t) {
|
|
return {
|
|
_hx_index: 2,
|
|
structure: t,
|
|
__enum__: "flambe._Entity.EntityType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["structure"], i)
|
|
},
|
|
Dn = function () {};
|
|
Dn.__name__ = !0,
|
|
Dn.warn = function (t, e) {
|
|
Dn.log(2, Pr.withFields(t, e))
|
|
},
|
|
Dn.log = function (t, i) {
|
|
switch (i = Dn._tagPrefix + i, t) {
|
|
case 1:
|
|
e.console.info(i);
|
|
break;
|
|
case 2:
|
|
e.console.warn(i);
|
|
break;
|
|
case 3:
|
|
e.console.error(i)
|
|
}
|
|
};
|
|
var Ln = function (t, e) {
|
|
this._value = t,
|
|
this._changed = null != e ? new Nn(e) : null
|
|
};
|
|
Ln.__name__ = !0,
|
|
Ln.prototype = {
|
|
watch: function (t, e) {
|
|
return null == e && (e = !0),
|
|
e && t(this._value, this._value),
|
|
this.get_changed().connect(t)
|
|
},
|
|
set__: function (t) {
|
|
var e = this._value;
|
|
return t != e && (this._value = t, null != this._changed && this._changed.emit(t, e)),
|
|
t
|
|
},
|
|
get_changed: function () {
|
|
return null == this._changed && (this._changed = new Nn),
|
|
this._changed
|
|
},
|
|
dispose: function () {
|
|
this._value = null,
|
|
null != this._changed && this._changed.dispose()
|
|
},
|
|
setValue: function (t) {
|
|
this._value = t
|
|
},
|
|
__class__: Ln
|
|
};
|
|
var kn = function (t, e) {
|
|
this._next = null,
|
|
this._signal = t,
|
|
this._listener = e,
|
|
this.stayInList = !0
|
|
};
|
|
kn.__name__ = !0,
|
|
kn.__interfaces__ = [d],
|
|
kn.prototype = {
|
|
once: function () {
|
|
return this.stayInList = !1,
|
|
this
|
|
},
|
|
dispose: function () {
|
|
null != this._signal && (this._signal.disconnect(this), this._signal = null)
|
|
},
|
|
__class__: kn
|
|
};
|
|
var Fn = function (t) {
|
|
this._head = null != t ? new kn(this, t) : null,
|
|
this._deferredTasks = null
|
|
};
|
|
Fn.__name__ = !0,
|
|
Fn.prototype = {
|
|
connectImpl: function (t, e) {
|
|
var i = this,
|
|
n = new kn(this, t);
|
|
return this._head == Fn.DISPATCHING_SENTINEL ? this.defer((function () {
|
|
i.listAdd(n, e)
|
|
})) : this.listAdd(n, e),
|
|
n
|
|
},
|
|
disconnect: function (t) {
|
|
var e = this;
|
|
this._head == Fn.DISPATCHING_SENTINEL ? this.defer((function () {
|
|
e.listRemove(t)
|
|
})) : this.listRemove(t)
|
|
},
|
|
defer: function (t) {
|
|
for (var e = null, i = this._deferredTasks; null != i; )
|
|
e = i, i = i.next;
|
|
var n = new Ir(t);
|
|
null != e ? e.next = n : this._deferredTasks = n
|
|
},
|
|
willEmit: function () {
|
|
var t = this._head;
|
|
return this._head = Fn.DISPATCHING_SENTINEL,
|
|
t
|
|
},
|
|
didEmit: function (t) {
|
|
this._head = t;
|
|
var e = this._deferredTasks;
|
|
for (this._deferredTasks = null; null != e; )
|
|
e.fn(), e = e.next
|
|
},
|
|
listAdd: function (t, e) {
|
|
if (e)
|
|
t._next = this._head, this._head = t;
|
|
else {
|
|
for (var i = null, n = this._head; null != n; )
|
|
i = n, n = n._next;
|
|
null != i ? i._next = t : this._head = t
|
|
}
|
|
},
|
|
listRemove: function (t) {
|
|
for (var e = null, i = this._head; null != i; ) {
|
|
if (i == t) {
|
|
var n = i._next;
|
|
return void(null == e ? this._head = n : e._next = n)
|
|
}
|
|
e = i,
|
|
i = i._next
|
|
}
|
|
},
|
|
dispose: function () {
|
|
for (; null != this._head; ) {
|
|
var t = this._head._next;
|
|
this._head.dispose(),
|
|
this._head = t
|
|
}
|
|
},
|
|
__class__: Fn
|
|
};
|
|
var Nn = function (t) {
|
|
Fn.call(this, t)
|
|
};
|
|
Nn.__name__ = !0,
|
|
Nn.__super__ = Fn,
|
|
Nn.prototype = o(Fn.prototype, {
|
|
connect: function (t, e) {
|
|
return null == e && (e = !1),
|
|
this.connectImpl(t, e)
|
|
},
|
|
emit: function (t, e) {
|
|
var i = this;
|
|
this._head == Fn.DISPATCHING_SENTINEL ? this.defer((function () {
|
|
i.emitImpl(t, e)
|
|
})) : this.emitImpl(t, e)
|
|
},
|
|
emitImpl: function (t, e) {
|
|
for (var i = this.willEmit(), n = i; null != n; )
|
|
n._listener(t, e), n.stayInList || n.dispose(), n = n._next;
|
|
this.didEmit(i)
|
|
},
|
|
__class__: Nn
|
|
});
|
|
var Bn = function (t) {
|
|
this._parts = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"],
|
|
this.url = t;
|
|
var e = new s("^(?:(?![^:@]+:[^:@/]*@)([^:/?#.]+):)?(?://)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\\d*))?)(((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[?#]|$)))*/?)?([^?#/]*))(?:\\?([^#]*))?(?:#(.*))?)", "");
|
|
e.match(t);
|
|
for (var i, n = 0, r = this._parts.length; n < r; ) {
|
|
var o = n++;
|
|
this[this._parts[o]] = e.matched(o)
|
|
}
|
|
if (null != this.query) {
|
|
n = new Ur,
|
|
r = 0;
|
|
for (var a = this.query.split("&"); r < a.length; ) {
|
|
var h = a[r];
|
|
++r,
|
|
n.h[h.split("=")[0]] = h.split("=")[1]
|
|
}
|
|
i = n
|
|
} else
|
|
i = new Ur;
|
|
this.queryString = i
|
|
};
|
|
Bn.__name__ = !0,
|
|
Bn.parse = function (t) {
|
|
return new Bn(t)
|
|
},
|
|
Bn.prototype = {
|
|
toString: function () {
|
|
for (var t = "URL: " + this.url + "\n", e = 0, i = this._parts.length; e < i; ) {
|
|
var n = e++;
|
|
t += this._parts[n] + ": " + u.string(l.field(this, this._parts[n])) + (n == this._parts.length - 1 ? "" : "\n")
|
|
}
|
|
return t
|
|
},
|
|
getQueryString: function (t, e) {
|
|
return Object.prototype.hasOwnProperty.call(this.queryString.h, t) ? this.queryString.h[t] : e
|
|
},
|
|
getQueryStringAsInt: function (t, e) {
|
|
return Object.prototype.hasOwnProperty.call(this.queryString.h, t) ? u.parseInt(this.queryString.h[t]) : e
|
|
},
|
|
getQueryStringAsFloat: function (t, e) {
|
|
return Object.prototype.hasOwnProperty.call(this.queryString.h, t) ? parseFloat(this.queryString.h[t]) : e
|
|
},
|
|
getQueryStringAsBool: function (t, e) {
|
|
return Object.prototype.hasOwnProperty.call(this.queryString.h, t) ? "true" == this.queryString.h[t] : e
|
|
},
|
|
__class__: Bn
|
|
};
|
|
var Un = function () {};
|
|
Un.__name__ = !0,
|
|
Un.__interfaces__ = [d],
|
|
Un.init = function (t, e) {
|
|
var i = new Pn;
|
|
Un.root = (new On).addComponent(new Vt).addComponent(i),
|
|
PIXI.utils.skipHello(),
|
|
Un.renderer = new PIXI.Renderer(e),
|
|
t.appendChild(Un.renderer.view),
|
|
i.add(Un.platform = new rr),
|
|
i.add(Un.stage = new mr(t)),
|
|
i.add(Un.assets = new qn),
|
|
i.add(wn.addHtmlCss()),
|
|
i.add(Un.hidden.get_changed().connect(Un.onHiddenChanged)),
|
|
i.add(Un.stage.resizeSignal.connect(Un.onResize, !0))
|
|
},
|
|
Un.getResolution = function () {
|
|
var t = 2;
|
|
Object.prototype.hasOwnProperty.call(Un.url.queryString.h, "quality") && "low" == Un.url.queryString.h.quality && (t = 1);
|
|
var e = window.devicePixelRatio;
|
|
return (null == e || isNaN(e)) && (e = 1),
|
|
Math.min(e, t)
|
|
},
|
|
Un.get_soundManager = function () {
|
|
return null == Un.soundManager ? (Un.root.$mF.add(Un.soundManager = new Ho(null)), Un.soundManager) : Un.soundManager
|
|
},
|
|
Un.onResize = function (t, e) {},
|
|
Un.onHiddenChanged = function (t, e) {
|
|
t ? Howler.mute(!0) : Howler.mute(Un.get_soundManager().muted._value)
|
|
},
|
|
Un.get_sceneManager = function () {
|
|
return null == Un.sceneManager ? (Un.root.addEntity((new On).addComponent(new Vt).addComponent(Un.sceneManager = new pr(3))), Un.sceneManager) : Un.sceneManager
|
|
},
|
|
Un.get_keyboard = function () {
|
|
return null == Un.keyboard ? Un.keyboard = Un.platform.getKeyboard() : Un.keyboard
|
|
},
|
|
Un.prototype = {
|
|
dispose: function () {
|
|
x.dispose(),
|
|
Un.root.dispose()
|
|
},
|
|
__class__: Un
|
|
};
|
|
var Xn = function (t, e) {
|
|
null == t && (t = 1),
|
|
this._realDt = 0,
|
|
f.call(this),
|
|
this.$te = e,
|
|
this.scale = new Vn(t)
|
|
};
|
|
Xn.__name__ = !0,
|
|
Xn.__super__ = f,
|
|
Xn.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
f.prototype.onStart.call(this),
|
|
null == this.$te && (this.$te = this.owner)
|
|
},
|
|
onUpdate: function (t) {
|
|
this._realDt > 0 && (t = this._realDt, this._realDt = 0),
|
|
this.scale.update(t),
|
|
this.$te.timeScale = this.scale._value
|
|
},
|
|
get_name: function () {
|
|
return "$Se"
|
|
},
|
|
__class__: Xn
|
|
});
|
|
var jn = function (t) {
|
|
this._capacity = 2147483647,
|
|
this._allocator = t,
|
|
this._freeObjects = []
|
|
};
|
|
jn.__name__ = !0,
|
|
jn.__interfaces__ = [d],
|
|
jn.prototype = {
|
|
take: function () {
|
|
return this._freeObjects.length > 0 ? this._freeObjects.pop() : this._allocator()
|
|
},
|
|
put: function (t) {
|
|
this._freeObjects.length < this._capacity && this._freeObjects.push(t)
|
|
},
|
|
dispose: function () {
|
|
if (this._allocator = null, null != this._freeObjects)
|
|
for (; this._freeObjects.length > 0; ) {
|
|
var t = this._freeObjects.shift();
|
|
Vr.__implements(t, d) && Vr.__cast(t, d).dispose()
|
|
}
|
|
},
|
|
__class__: jn
|
|
};
|
|
var Vn = function (t, e, i) {
|
|
this._behavior = null,
|
|
Ln.call(this, t),
|
|
null != e && null != i && this.setBounds(e, i)
|
|
};
|
|
Vn.__name__ = !0,
|
|
Vn.take = function (t, e, i, n) {
|
|
var r = Vn.POOL.take();
|
|
return r.setValue(t),
|
|
null != e && null != i ? r.setBounds(e, i) : r.clearBounds(),
|
|
null != n && r.get_changed().connect(n),
|
|
r
|
|
},
|
|
Vn.put = function (t) {
|
|
return null != t && (t.dispose(), Vn.POOL.put(t)),
|
|
null
|
|
},
|
|
Vn.allocate = function () {
|
|
return new Vn(NaN)
|
|
},
|
|
Vn.__super__ = Ln,
|
|
Vn.prototype = o(Ln.prototype, {
|
|
setBounds: function (t, e) {
|
|
null != this.bounds ? this.bounds.set(t, e) : this.bounds = new rt(t, e),
|
|
this.set__(this._value)
|
|
},
|
|
clearBounds: function () {
|
|
this.bounds = null
|
|
},
|
|
set__: function (t) {
|
|
return this._behavior = null,
|
|
null == this.bounds ? Ln.prototype.set__.call(this, t) : Ln.prototype.set__.call(this, this.bounds.clamp(t))
|
|
},
|
|
onLeaderValueChanged: function (t, e) {
|
|
null != this.bounds && null != this.leader.bounds ? this.set__(this.leader.bounds.translate(t, this.bounds)) : this.set__(t)
|
|
},
|
|
follow: function (t, e) {
|
|
null == e && (e = !0),
|
|
null != this.leaderConnection && this.leaderConnection.dispose(),
|
|
this.leader = t,
|
|
this.leaderConnection = e ? this.leader.watch(cs(this, this.onLeaderValueChanged)) : this.leader.get_changed().connect(cs(this, this.onLeaderValueChanged))
|
|
},
|
|
update: function (t) {
|
|
null != this._behavior && (Ln.prototype.set__.call(this, this._behavior.update(t)), null != this._behavior && this._behavior.isComplete() && (this._behavior = null))
|
|
},
|
|
animate: function (t, e, i, n, r, o) {
|
|
null == o && (o = 0),
|
|
this.set__(t),
|
|
this.animateTo(e, i, n, r, o)
|
|
},
|
|
animateTo: function (t, e, i, n, r) {
|
|
null == r && (r = 0),
|
|
this.set_behavior(new Wn(this._value, t, e, i, n, r))
|
|
},
|
|
set_behavior: function (t) {
|
|
return this._behavior = t,
|
|
this.update(0),
|
|
t
|
|
},
|
|
dispose: function () {
|
|
this._behavior = null,
|
|
Ln.prototype.dispose.call(this)
|
|
},
|
|
__class__: Vn
|
|
});
|
|
var Hn = function () {};
|
|
Hn.__name__ = !0,
|
|
Hn.__isInterface__ = !0,
|
|
Hn.prototype = {
|
|
__class__: Hn
|
|
};
|
|
var Gn = function () {};
|
|
Gn.__name__ = !0,
|
|
Gn.linear = function (t) {
|
|
return t
|
|
},
|
|
Gn.quadIn = function (t) {
|
|
return t * t
|
|
},
|
|
Gn.quintOut = function (t) {
|
|
return --t * t * t * t * t + 1
|
|
},
|
|
Gn.sineIn = function (t) {
|
|
return 1 - Math.cos(Gn.PIhalf * t)
|
|
},
|
|
Gn.sineOut = function (t) {
|
|
return Math.sin(Gn.PIhalf * t)
|
|
},
|
|
Gn.backOut = function (t) {
|
|
return 1 - --t * t * (-2.70158 * t - 1.70158)
|
|
};
|
|
var Yn = function (t, e, i, n, r) {
|
|
null == r && (r = 0),
|
|
null == n && (n = 0),
|
|
null == i && (i = 1),
|
|
this.start = t,
|
|
this.end = e,
|
|
this.cycles = n,
|
|
this.speed = new Vn(i),
|
|
this._count = Kn.HALF_PI + r * (Math.PI / i),
|
|
this._distance = .5 * (t - e),
|
|
this._center = e + this._distance
|
|
};
|
|
Yn.__name__ = !0,
|
|
Yn.__interfaces__ = [Hn],
|
|
Yn.prototype = {
|
|
update: function (t) {
|
|
return this.speed.update(t),
|
|
this._count += t * (Math.PI / this.speed._value),
|
|
this.isComplete() ? this.end : this._center + Math.sin(this._count) * this._distance
|
|
},
|
|
isComplete: function () {
|
|
return this.cycles > 0 && (this._count - Kn.HALF_PI) / Math.PI * .5 >= this.cycles
|
|
},
|
|
__class__: Yn
|
|
};
|
|
var Wn = function (t, e, i, n, r, o) {
|
|
null == o && (o = 0),
|
|
this._from = t,
|
|
this._to = e,
|
|
this._duration = i,
|
|
this.elapsed = 0,
|
|
this._easing = null != n ? n : Gn.linear,
|
|
this._onComplete = r,
|
|
this._delay = o
|
|
};
|
|
Wn.__name__ = !0,
|
|
Wn.__interfaces__ = [Hn],
|
|
Wn.prototype = {
|
|
update: function (t) {
|
|
return this.elapsed += t,
|
|
this.elapsed - this._delay >= this._duration ? (null != this._onComplete && (this._onComplete(), this._onComplete = null), this._to) : this.elapsed > this._delay ? this._from + (this._to - this._from) * this._easing((this.elapsed - this._delay) / this._duration) : this._from
|
|
},
|
|
isComplete: function () {
|
|
return this.elapsed - this._delay >= this._duration
|
|
},
|
|
__class__: Wn
|
|
};
|
|
var zn = function (t, e) {
|
|
null == e && (e = ""),
|
|
this._embeddedJSON = new Ur,
|
|
this._embeddedTextures = new Ur,
|
|
this.loader = new PIXI.Loader,
|
|
this._baseUrl = e,
|
|
this.manifest = t,
|
|
this.loaded = new sr
|
|
};
|
|
zn.__name__ = !0,
|
|
zn.__interfaces__ = [d],
|
|
zn.prototype = {
|
|
load: function () {
|
|
for (var t = this, e = this.manifest.fileNames.slice(), i = 0; i < e.length; ) {
|
|
var n = e[i];
|
|
if (++i, "json" == Xr.extension(n) && -1 != n.indexOf("multispine")) {
|
|
var r = this._baseUrl + this.manifest.path + Xr.directory(n) + "/multispine.atlas";
|
|
this.loader.add(this.manifest.path + n, this._baseUrl + this.manifest.path + n, {
|
|
metadata: {
|
|
spineAtlasFile: r,
|
|
imageNamePrefix: r
|
|
}
|
|
})
|
|
} else
|
|
this.loader.add(this.manifest.path + n, this._baseUrl + this.manifest.path + n)
|
|
}
|
|
this.loader.load((function () {
|
|
null != t.loader && t.loaded.emit(t)
|
|
}))
|
|
},
|
|
hasResource: function (t) {
|
|
return !!Object.prototype.hasOwnProperty.call(this._embeddedJSON.h, t) || (!!Object.prototype.hasOwnProperty.call(this._embeddedTextures.h, t) || Object.prototype.hasOwnProperty.call(this.loader.resources, t))
|
|
},
|
|
get_progress: function () {
|
|
return null == this._progress && (this._progress = new Ln(this.loader.progress), this.loader.on("progress", cs(this, this.onPreload))),
|
|
this._progress
|
|
},
|
|
onPreload: function () {
|
|
this._progress.set__(this.loader.progress / 100)
|
|
},
|
|
dispose: function () {
|
|
if (null != this.loader) {
|
|
for (var t = Ur.valueIterator(this._embeddedTextures.h); t.hasNext(); )
|
|
t.next().destroy(!0);
|
|
this._embeddedTextures = null,
|
|
this._embeddedJSON = null,
|
|
this.loader.off("progress", cs(this, this.onPreload));
|
|
for (var e = 0, i = l.fields(this.loader.resources); e < i.length; ) {
|
|
var n = i[e];
|
|
++e;
|
|
var r = this.loader.resources[n];
|
|
r.type == PIXI.LoaderResource.TYPE.IMAGE && null != r.texture && r.texture.destroy(!0),
|
|
l.deleteField(this.loader.resources, n)
|
|
}
|
|
this.loader.reset(),
|
|
this.loader = null
|
|
}
|
|
this.loaded.dispose()
|
|
},
|
|
__class__: zn
|
|
};
|
|
var qn = function (t) {
|
|
null == t && (t = ""),
|
|
this.assetPackByName = new Ur,
|
|
this.baseUrl = t
|
|
};
|
|
qn.__name__ = !0,
|
|
qn.__interfaces__ = [d],
|
|
qn.prototype = {
|
|
loadPack: function (t, e) {
|
|
var i = t.path;
|
|
Object.prototype.hasOwnProperty.call(this.assetPackByName.h, i) && (Object.prototype.hasOwnProperty.call(this.assetPackByName.h, i), Object.prototype.hasOwnProperty.call(this.assetPackByName.h, i));
|
|
var n = new zn(t, this.baseUrl);
|
|
return this.assetPackByName.h[i] = n,
|
|
null != e && n.loaded.connect(e),
|
|
n.load(),
|
|
n
|
|
},
|
|
getJson: function (t, e) {
|
|
if (null == e) {
|
|
for (var i = Ur.valueIterator(this.assetPackByName.h); i.hasNext(); ) {
|
|
var n = i.next();
|
|
if (n.hasResource(t))
|
|
return Object.prototype.hasOwnProperty.call(n._embeddedJSON.h, t) ? n._embeddedJSON.h[t] : (n.hasResource(t), n.hasResource(t), n.loader.resources[t].data);
|
|
if (n.hasResource(n.manifest.path + t)) {
|
|
var r = n.manifest.path + t;
|
|
return Object.prototype.hasOwnProperty.call(n._embeddedJSON.h, r) ? n._embeddedJSON.h[r] : (n.hasResource(r), n.hasResource(r), n.loader.resources[r].data)
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
var o = this.assetPackByName.h[e];
|
|
r = e + t;
|
|
return Object.prototype.hasOwnProperty.call(o._embeddedJSON.h, r) ? o._embeddedJSON.h[r] : (o.hasResource(r), o.hasResource(r), o.loader.resources[r].data)
|
|
},
|
|
getTexture: function (t, e) {
|
|
if (null == e) {
|
|
for (var i = Ur.valueIterator(this.assetPackByName.h); i.hasNext(); ) {
|
|
var n = i.next();
|
|
if (n.hasResource(t)) {
|
|
var r = n.manifest.path + t;
|
|
return Object.prototype.hasOwnProperty.call(n._embeddedTextures.h, r) ? n._embeddedTextures.h[r] : (n.hasResource(r), n.hasResource(r), n.loader.resources[r].texture)
|
|
}
|
|
if (n.hasResource(n.manifest.path + t)) {
|
|
var o = n.manifest.path + t;
|
|
return Object.prototype.hasOwnProperty.call(n._embeddedTextures.h, o) ? n._embeddedTextures.h[o] : (n.hasResource(o), n.hasResource(o), n.loader.resources[o].texture)
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
var s = this.assetPackByName.h[e];
|
|
r = e + t;
|
|
return Object.prototype.hasOwnProperty.call(s._embeddedTextures.h, r) ? s._embeddedTextures.h[r] : (s.hasResource(r), s.hasResource(r), s.loader.resources[r].texture)
|
|
},
|
|
disposePack: function (t) {
|
|
Object.prototype.hasOwnProperty.call(this.assetPackByName.h, t),
|
|
this.assetPackByName.h[t].dispose();
|
|
var e = this.assetPackByName;
|
|
Object.prototype.hasOwnProperty.call(e.h, t) && delete e.h[t]
|
|
},
|
|
dispose: function () {
|
|
for (var t = Ur.valueIterator(this.assetPackByName.h); t.hasNext(); )
|
|
t.next().dispose();
|
|
this.assetPackByName = null
|
|
},
|
|
__class__: qn
|
|
};
|
|
var Jn = function () {
|
|
this.init(0, null)
|
|
};
|
|
Jn.__name__ = !0,
|
|
Jn.prototype = {
|
|
init: function (t, e) {
|
|
this.id = t,
|
|
this.key = e
|
|
},
|
|
__class__: Jn
|
|
};
|
|
var Kn = function () {};
|
|
Kn.__name__ = !0,
|
|
Kn.smoothDamp = function (t, e, i, n, r, o) {
|
|
null == o && (o = 179769313486231e294),
|
|
1e-4 > n && (n = 1e-4);
|
|
var s = 2 / n,
|
|
a = s * r,
|
|
h = 1 / (1 + a + .48 * a * a + .235 * a * a * a),
|
|
l = t - e,
|
|
u = e,
|
|
c = o * n,
|
|
p = -c;
|
|
l < p ? l = p : l > c && (l = c),
|
|
e = t - l;
|
|
var d = (i._value + s * l) * r;
|
|
i.set__((i._value - s * d) * h);
|
|
var f = e + (l + d) * h;
|
|
return u - t > 0 == f > u && (f = u, i.set__((u - u) / r)),
|
|
f
|
|
},
|
|
Kn.lineSegmentIntersection = function (t, e, i, n, r) {
|
|
var o = e.x - t.x,
|
|
s = e.y - t.y,
|
|
a = n.x - i.x,
|
|
h = n.y - i.y,
|
|
l = o * h - s * a;
|
|
if (0 == l)
|
|
return !1;
|
|
var u = i.x - t.x,
|
|
c = i.y - t.y,
|
|
p = (u * h - c * a) / l;
|
|
if (p < 0 || p > 1)
|
|
return !1;
|
|
var d = (u * s - c * o) / l;
|
|
if (d < 0 || d > 1)
|
|
return !1;
|
|
if (null != r) {
|
|
var f = t.x + p * o,
|
|
_ = t.y + p * s;
|
|
r.x = f,
|
|
r.y = null == _ ? f : _
|
|
}
|
|
return !0
|
|
};
|
|
var Zn = function () {};
|
|
Zn.__name__ = !0,
|
|
Zn.__isInterface__ = !0,
|
|
Zn.prototype = {
|
|
__class__: Zn
|
|
};
|
|
var Qn = function () {
|
|
this._keyStates = new Nr,
|
|
this.backButton = new Mr,
|
|
this.up = new sr,
|
|
this.down = new sr
|
|
};
|
|
Qn.__name__ = !0,
|
|
Qn.__interfaces__ = [Zn],
|
|
Qn.prototype = {
|
|
isDown: function (t) {
|
|
return this._keyStates.h.hasOwnProperty(ir.toKeyCode(t))
|
|
},
|
|
submitDown: function (t) {
|
|
return 16777238 == t ? null != this.backButton._head && (this.backButton.emit(), !0) : (this._keyStates.h.hasOwnProperty(t) || (this._keyStates.h[t] = !0, Qn._sharedEvent.init(Qn._sharedEvent.id + 1, ir.toKey(t)), this.down.emit(Qn._sharedEvent)), !0)
|
|
},
|
|
submitUp: function (t) {
|
|
this._keyStates.h.hasOwnProperty(t) && (this._keyStates.remove(t), Qn._sharedEvent.init(Qn._sharedEvent.id + 1, ir.toKey(t)), this.up.emit(Qn._sharedEvent))
|
|
},
|
|
connect: function (t, e) {
|
|
return this.down.connect((function (i) {
|
|
i.key == t && e()
|
|
}))
|
|
},
|
|
__class__: Qn
|
|
};
|
|
var tr = function () {
|
|
this._entries = []
|
|
};
|
|
tr.__name__ = !0,
|
|
tr.__interfaces__ = [d],
|
|
tr.prototype = {
|
|
addListener: function (t, e, i, n) {
|
|
null == n && (n = !1),
|
|
t.addEventListener(e, i, n),
|
|
this._entries.push(new er(t, e, i))
|
|
},
|
|
dispose: function () {
|
|
for (var t = 0, e = this._entries; t < e.length; ) {
|
|
var i = e[t];
|
|
++t,
|
|
i.dispatcher.removeEventListener(i.type, i.listener, !1)
|
|
}
|
|
this._entries = []
|
|
},
|
|
__class__: tr
|
|
};
|
|
var er = function (t, e, i) {
|
|
this.dispatcher = t,
|
|
this.type = e,
|
|
this.listener = i
|
|
};
|
|
er.__name__ = !0,
|
|
er.prototype = {
|
|
__class__: er
|
|
};
|
|
var ir = function () {};
|
|
ir.__name__ = !0,
|
|
ir.toKey = function (t) {
|
|
return t
|
|
},
|
|
ir.toKeyCode = function (t) {
|
|
return t
|
|
};
|
|
var nr = function () {
|
|
this._tickables = [],
|
|
this.enabled = !0
|
|
};
|
|
nr.__name__ = !0,
|
|
nr.updateEntity = function (t, e) {
|
|
var i = t.$Se;
|
|
if (null != i && (i._realDt = e, (e *= i.scale._value) <= 0))
|
|
i.onUpdate(e);
|
|
else {
|
|
for (var n = t.firstComponent; null != n; ) {
|
|
var r = n.next;
|
|
null == t.parent && t != Un.root || (0 == (1 & n._flags) && (n._flags |= 1, n.onStart()), n.onUpdate(e * t.timeScale)),
|
|
n = r
|
|
}
|
|
var o = 0;
|
|
for (n = t.firstChild; null != n; ) {
|
|
r = n.next;
|
|
n.layerIndex = o++,
|
|
nr.updateEntity(n, e * t.timeScale),
|
|
n = r
|
|
}
|
|
}
|
|
},
|
|
nr.prototype = {
|
|
update: function (t) {
|
|
if (this.enabled)
|
|
if (t <= 0)
|
|
Dn.warn("Zero or negative time elapsed since the last frame!", ["dt", t]);
|
|
else {
|
|
t > 1 && (t = 1);
|
|
for (var e = 0; e < this._tickables.length; ) {
|
|
var i = this._tickables[e];
|
|
null == i || i.update(t) ? this._tickables.splice(e, 1) : ++e
|
|
}
|
|
nr.updateEntity(Un.root, t)
|
|
}
|
|
},
|
|
__class__: nr
|
|
};
|
|
var rr = function () {
|
|
this._events = new tr,
|
|
this._disposer = new Pn,
|
|
this.mainLoop = new nr,
|
|
this._disposer.add(this._events),
|
|
this.addMainLoop(),
|
|
this.addHidden()
|
|
};
|
|
rr.__name__ = !0,
|
|
rr.__interfaces__ = [d],
|
|
rr.prototype = {
|
|
addMainLoop: function () {
|
|
var t = this,
|
|
e = window.performance,
|
|
i = null != e && ar.polyfill("now", e);
|
|
this._lastUpdate = Date.now(),
|
|
this._mainEvent = kr.add((function () {
|
|
t.update(i ? e.now() : Date.now())
|
|
}))
|
|
},
|
|
addHidden: function () {
|
|
var t = this,
|
|
e = ar.loadExtension("hidden", window.document);
|
|
if (null != e.value) {
|
|
var i = function (t) {
|
|
Un.hidden.set__(l.field(window.document, e.field))
|
|
};
|
|
i(),
|
|
this._events.addListener(window.document, e.prefix + "visibilitychange", i)
|
|
} else {
|
|
var n = function (t) {
|
|
Un.hidden.set__("pagehide" == t.type)
|
|
};
|
|
this._events.addListener(window, "pageshow", n),
|
|
this._events.addListener(window, "pagehide", n)
|
|
}
|
|
this._disposer.add(Un.hidden.get_changed().connect((function (e, i) {
|
|
e || (t._skipFrame = !0)
|
|
}))),
|
|
this._skipFrame = !1
|
|
},
|
|
update: function (t) {
|
|
var e = (t - this._lastUpdate) / 1e3;
|
|
this._lastUpdate = t,
|
|
this._skipFrame ? this._skipFrame = !1 : (this.mainLoop.update(e), Vt.render(Un.root, Un.renderer))
|
|
},
|
|
getKeyboard: function () {
|
|
var t = new Qn,
|
|
e = function (e) {
|
|
switch (e.type) {
|
|
case "keydown":
|
|
t.submitDown(e.keyCode);
|
|
break;
|
|
case "keyup":
|
|
t.submitUp(e.keyCode)
|
|
}
|
|
};
|
|
return this._events.addListener(window, "keydown", e),
|
|
this._events.addListener(window, "keyup", e),
|
|
t
|
|
},
|
|
dispose: function () {
|
|
this._mainEvent.stop(),
|
|
this._mainEvent = null;
|
|
var t = this._disposer;
|
|
null != t && t.dispose(),
|
|
this._disposer = null
|
|
},
|
|
__class__: rr
|
|
};
|
|
var or = function () {};
|
|
or.__name__ = !0,
|
|
or.__isInterface__ = !0,
|
|
or.prototype = {
|
|
__class__: or
|
|
};
|
|
var sr = function (t) {
|
|
Fn.call(this, t)
|
|
};
|
|
sr.__name__ = !0,
|
|
sr.__super__ = Fn,
|
|
sr.prototype = o(Fn.prototype, {
|
|
connect: function (t, e) {
|
|
return null == e && (e = !1),
|
|
this.connectImpl(t, e)
|
|
},
|
|
emit: function (t) {
|
|
var e = this;
|
|
this._head == Fn.DISPATCHING_SENTINEL ? this.defer((function () {
|
|
e.emitImpl(t)
|
|
})) : this.emitImpl(t)
|
|
},
|
|
emitImpl: function (t) {
|
|
for (var e = this.willEmit(), i = e; null != i; )
|
|
i._listener(t), i.stayInList || i.dispose(), i = i._next;
|
|
this.didEmit(e)
|
|
},
|
|
__class__: sr
|
|
});
|
|
var ar = function () {};
|
|
ar.__name__ = !0,
|
|
ar.isIframe = function () {
|
|
try {
|
|
return window.self != window.top
|
|
} catch (t) {
|
|
return !0
|
|
}
|
|
},
|
|
ar.callLater = function (t, e) {
|
|
null == e && (e = 0),
|
|
window.setTimeout(t, e)
|
|
},
|
|
ar.hideMobileBrowser = function () {
|
|
window.scrollTo(1, 0)
|
|
},
|
|
ar.loadExtension = function (t, e) {
|
|
if (null == e && (e = window), null != (s = l.field(e, t)))
|
|
return {
|
|
prefix: "",
|
|
field: t,
|
|
value: s
|
|
};
|
|
for (var i = t.charAt(0).toUpperCase() + a.substr(t, 1, null), n = 0, r = ar.VENDOR_PREFIXES; n < r.length; ) {
|
|
var o = r[n];
|
|
++n;
|
|
var s,
|
|
h = o + i;
|
|
if (null != (s = l.field(e, h)))
|
|
return {
|
|
prefix: o,
|
|
field: h,
|
|
value: s
|
|
}
|
|
}
|
|
return {
|
|
prefix: null,
|
|
field: null,
|
|
value: null
|
|
}
|
|
},
|
|
ar.polyfill = function (t, e) {
|
|
null == e && (e = window);
|
|
var i = ar.loadExtension(t, e).value;
|
|
return null != i && (e[t] = i, !0)
|
|
},
|
|
ar.orientation = function (t) {
|
|
switch (t) {
|
|
case -90:
|
|
case 90:
|
|
return 2;
|
|
default:
|
|
return 1
|
|
}
|
|
};
|
|
var hr = function () {};
|
|
hr.__name__ = !0,
|
|
hr.prototype = {
|
|
init: function (t, e) {
|
|
this._from = t,
|
|
this._to = e
|
|
},
|
|
update: function (t) {
|
|
return !0
|
|
},
|
|
complete: function () {},
|
|
__class__: hr
|
|
};
|
|
var lr = function (t, e) {
|
|
this.duration = t,
|
|
this._ease = null != e ? e : Gn.linear
|
|
};
|
|
lr.__name__ = !0,
|
|
lr.__super__ = hr,
|
|
lr.prototype = o(hr.prototype, {
|
|
init: function (t, e) {
|
|
hr.prototype.init.call(this, t, e),
|
|
this._elapsed = 0
|
|
},
|
|
update: function (t) {
|
|
var e = this._elapsed += t,
|
|
i = this.duration;
|
|
return this._elapsed = e < i ? e : i,
|
|
this._elapsed >= this.duration
|
|
},
|
|
interp: function (t, e) {
|
|
return t + (e - t) * this._ease(this._elapsed / this.duration)
|
|
},
|
|
__class__: lr
|
|
});
|
|
var ur = function (t, e, i) {
|
|
this._fadeOutGraphics = new PIXI.Graphics,
|
|
this._fadeInGraphics = new PIXI.Graphics,
|
|
lr.call(this, e, Gn.linear),
|
|
this.color = t,
|
|
null != i && (this._fadeInGraphics.blendMode = i, this._fadeOutGraphics.blendMode = i)
|
|
};
|
|
ur.__name__ = !0,
|
|
ur.__super__ = lr,
|
|
ur.prototype = o(lr.prototype, {
|
|
init: function (t, e) {
|
|
var i;
|
|
lr.prototype.init.call(this, t, e),
|
|
(i = this._fadeInGraphics).beginFill(this.color),
|
|
i.drawRect(0, 0, Un.renderer.width / Un.renderer.resolution | 0, Un.renderer.height / Un.renderer.resolution | 0),
|
|
i.endFill(),
|
|
i.alpha = 0,
|
|
(i = this._fadeOutGraphics).beginFill(this.color),
|
|
i.drawRect(0, 0, Un.renderer.width / Un.renderer.resolution | 0, Un.renderer.height / Un.renderer.resolution | 0),
|
|
i.endFill(),
|
|
i.alpha = 0,
|
|
this._from.addEntity((new On).addComponent(new Vt(this._fadeInGraphics))),
|
|
this._to.addEntity((new On).addComponent(new Vt(this._fadeOutGraphics)))
|
|
},
|
|
update: function (t) {
|
|
var e = lr.prototype.update.call(this, t);
|
|
return this._elapsed / this.duration < .5 ? (this._fadeInGraphics.alpha = this.interp(0, 2), this._from.$w.setAlpha(1), this._to.$w.setAlpha(0)) : (this._fadeOutGraphics.alpha = this.interp(2, 0), this._from.$w.setAlpha(0), this._to.$w.setAlpha(1)),
|
|
e
|
|
},
|
|
complete: function () {
|
|
this._fadeInGraphics.alpha = 0,
|
|
this._to.$w.setAlpha(1),
|
|
this._from.$w.setAlpha(0)
|
|
},
|
|
__class__: ur
|
|
});
|
|
var cr = function () {
|
|
this.top = (new On).addComponent(new Vt),
|
|
this.main = (new On).addComponent(new Vt),
|
|
this.bottom = (new On).addComponent(new Vt),
|
|
f.call(this)
|
|
};
|
|
cr.__name__ = !0,
|
|
cr.__super__ = f,
|
|
cr.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
this.owner.addEntity(this.bottom).addEntity(this.main).addEntity(this.top)
|
|
},
|
|
get_name: function () {
|
|
return "$se"
|
|
},
|
|
__class__: cr
|
|
});
|
|
var pr = function (t) {
|
|
null == t && (t = 3),
|
|
this.currentSceneDefinition = new Ln(null),
|
|
this.layers = [],
|
|
this.history = [],
|
|
f.call(this);
|
|
for (var e = 0; e < t; ) {
|
|
var i = (new On).addComponent(new Vt);
|
|
this.layers.push(i);
|
|
var n = _r.Popup((function () {
|
|
return new fr
|
|
}), "empty", e++),
|
|
r = [n.c, n.layer][0]();
|
|
r.id = n,
|
|
i.addEntity(this.$lF(r))
|
|
}
|
|
};
|
|
pr.__name__ = !0,
|
|
pr.__super__ = f,
|
|
pr.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
f.prototype.onAdded.call(this);
|
|
for (var t = 0, e = this.layers; t < e.length; )
|
|
this.owner.addEntity(e[t++])
|
|
},
|
|
getScene: function (t) {
|
|
return null == t && (t = 0),
|
|
this.getLayer(t),
|
|
this.getLayer(t).$_
|
|
},
|
|
getLayer: function (t) {
|
|
return null == t && (t = 0),
|
|
this.layers[t].firstChild
|
|
},
|
|
goto: function (t, e) {
|
|
var i;
|
|
switch (null == e && (e = this.defaultTransition), t._hx_index) {
|
|
case 0:
|
|
i = {
|
|
getInstance: t.c,
|
|
name: t.name,
|
|
layer: 0
|
|
};
|
|
break;
|
|
case 1:
|
|
i = {
|
|
getInstance: t.c,
|
|
name: t.name,
|
|
layer: t.layer
|
|
}
|
|
}
|
|
var n = this.getScene(i.layer),
|
|
r = n.owner;
|
|
n.isTransitioning = !0,
|
|
0 == t._hx_index && this.history.unshift(t);
|
|
var o = i.getInstance();
|
|
o.id = t;
|
|
var s = this.$lF(o);
|
|
return o.isTransitioning = !0,
|
|
this.currentSceneDefinition.set__(t),
|
|
this.layers[i.layer].addEntity(s),
|
|
n.$b = new dr(r, s, e, (function () {
|
|
null != s && s.$_.$B(),
|
|
null != r && r.$_.$c()
|
|
})),
|
|
s
|
|
},
|
|
$lF: function (t) {
|
|
return (new On).addComponent(new Vt).addComponent(t)
|
|
},
|
|
get_name: function () {
|
|
return "$kF"
|
|
},
|
|
__class__: pr
|
|
});
|
|
var dr = function (t, e, i, n) {
|
|
this.from = t,
|
|
this.to = e,
|
|
this.transition = i,
|
|
this._onComplete = n,
|
|
null != i && this.transition.init(t, e)
|
|
};
|
|
dr.__name__ = !0,
|
|
dr.prototype = {
|
|
update: function (t) {
|
|
return null == this.transition || this.transition.update(t)
|
|
},
|
|
complete: function () {
|
|
null != this.transition && this.transition.complete(),
|
|
this._onComplete()
|
|
},
|
|
__class__: dr
|
|
};
|
|
var fr = function () {
|
|
qi.call(this)
|
|
};
|
|
fr.__name__ = !0,
|
|
fr.__super__ = qi,
|
|
fr.prototype = o(qi.prototype, {
|
|
__class__: fr
|
|
});
|
|
var _r = r["flambe.scene.SceneDefinition"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["Page", "Popup"],
|
|
Page: (i = function (t, e) {
|
|
return {
|
|
_hx_index: 0,
|
|
c: t,
|
|
name: e,
|
|
__enum__: "flambe.scene.SceneDefinition",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["c", "name"], i),
|
|
Popup: (i = function (t, e, i) {
|
|
return {
|
|
_hx_index: 1,
|
|
c: t,
|
|
name: e,
|
|
layer: i,
|
|
__enum__: "flambe.scene.SceneDefinition",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["c", "name", "layer"], i)
|
|
},
|
|
mr = function (t) {
|
|
this.resizeSignal = new Nn,
|
|
this._events = new tr,
|
|
this.orientation = new Ln(null),
|
|
this._containerDiv = t,
|
|
this.updateContainerSize(),
|
|
null != window.orientation && (this._events.addListener(window, "orientationchange", cs(this, this.onOrientationChange)), this.onOrientationChange(null))
|
|
};
|
|
mr.__name__ = !0,
|
|
mr.__interfaces__ = [d],
|
|
mr.prototype = {
|
|
onOrientationChange: function (t) {
|
|
this.orientation.set__(ar.orientation(window.orientation)),
|
|
ar.SHOULD_HIDE_MOBILE_BROWSER && this.hideMobileBrower()
|
|
},
|
|
hideMobileBrower: function () {
|
|
var t = window.document.documentElement.style,
|
|
e = u.string(window.innerHeight + 100);
|
|
t.height = e + "px";
|
|
e = u.string(window.innerWidth);
|
|
t.width = e + "px",
|
|
t.overflow = "visible",
|
|
ar.callLater((function () {
|
|
ar.hideMobileBrowser(),
|
|
ar.callLater((function () {
|
|
var e = u.string(window.innerHeight);
|
|
t.height = e + "px"
|
|
}), 100)
|
|
}))
|
|
},
|
|
updateContainerSize: function () {
|
|
var t,
|
|
e;
|
|
return PIXI.utils.isMobile.any ? (t = window.innerWidth, e = window.innerHeight) : (t = Un.renderer.view.parentElement.offsetWidth, e = Un.renderer.view.parentElement.offsetHeight),
|
|
(this._containerWidth != t || this._containerHeight != e) && (this._containerWidth = t, this._containerHeight = e, PIXI.utils.isMobile.any && window.scrollTo(0, -1), this.resizeCanvas(), !0)
|
|
},
|
|
resizeCanvas: function () {
|
|
var t = Un.renderer.view,
|
|
e = this._containerWidth / 1 | 0,
|
|
i = this._containerHeight / 1 | 0;
|
|
return (t.width != e || t.height != i) && (Un.renderer.resize(e, i), this.rescaleHTMLElement(Un.renderer.view, e, i), PIXI.utils.isMobile.any && this.rescaleHTMLElement(this._containerDiv, e, i), this.resizeSignal.emit(e, i), !0)
|
|
},
|
|
requestFullScreen: function () {
|
|
if (null == ar.loadExtension("fullscreenElement", window.document).value) {
|
|
var t = ar.loadExtension("requestFullScreen", this._containerDiv);
|
|
if (null != t.field)
|
|
try {
|
|
t.value.apply(this._containerDiv, [])
|
|
} catch (t) {}
|
|
}
|
|
},
|
|
rescaleHTMLElement: function (t, e, i) {
|
|
t.style.width = e + "px",
|
|
t.style.height = i + "px"
|
|
},
|
|
dispose: function () {
|
|
var t = this._events;
|
|
null != t && t.dispose(),
|
|
this._events = null
|
|
},
|
|
__class__: mr
|
|
};
|
|
var yr = function (t, e) {
|
|
null == e && (e = 1),
|
|
PIXI.Filter.call(this, null, this.getFragmentSrc()),
|
|
this.uniforms.color = this.hex2array(t),
|
|
this.uniforms.multiplier = .5
|
|
};
|
|
yr.__name__ = !0,
|
|
yr.__super__ = PIXI.Filter,
|
|
yr.prototype = o(PIXI.Filter.prototype, {
|
|
getFragmentSrc: function () {
|
|
return "precision mediump float;varying vec2 vTextureCoord;uniform sampler2D uSampler;uniform vec3 color;uniform float multiplier;",
|
|
"precision mediump float;varying vec2 vTextureCoord;uniform sampler2D uSampler;uniform vec3 color;uniform float multiplier;void main () { gl_FragColor = texture2D(uSampler, vTextureCoord);",
|
|
"gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, multiplier) * gl_FragColor.a;",
|
|
"}",
|
|
"precision mediump float;varying vec2 vTextureCoord;uniform sampler2D uSampler;uniform vec3 color;uniform float multiplier;void main () { gl_FragColor = texture2D(uSampler, vTextureCoord);gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, multiplier) * gl_FragColor.a;}"
|
|
},
|
|
hex2array: function (t) {
|
|
return [p.toFloat(t >>> 16 & 255) / p.toFloat(255), p.toFloat(t >>> 8 & 255) / p.toFloat(255), p.toFloat(255 & t) / p.toFloat(255)]
|
|
},
|
|
update: function (t, e) {
|
|
null == e && (e = 1),
|
|
this.color = t,
|
|
this.multiplier = e,
|
|
PIXI.utils.hex2rgb(t, this.uniforms.color),
|
|
this.uniforms.multiplier = e
|
|
},
|
|
__class__: yr
|
|
});
|
|
var gr = function () {};
|
|
gr.__name__ = !0,
|
|
gr.__isInterface__ = !0,
|
|
gr.prototype = {
|
|
__class__: gr
|
|
};
|
|
var vr = function (t, e) {
|
|
this._name = t.symbol,
|
|
this._data = t.data;
|
|
var i = t.rect;
|
|
this.texture = new PIXI.Texture(e.baseTexture, new PIXI.Rectangle(i[0], i[1], i[2], i[3]));
|
|
var n = t.origin;
|
|
null != n ? (this.anchorX = n[0], this.anchorY = n[1]) : (this.anchorX = 0, this.anchorY = 0)
|
|
};
|
|
vr.__name__ = !0,
|
|
vr.__interfaces__ = [gr],
|
|
vr.prototype = {
|
|
createSprite: function (t) {
|
|
var e = new PIXI.Sprite(this.texture),
|
|
i = new Vt(e);
|
|
return i.useLayerIndex = !0,
|
|
e.pivot.set(this.anchorX, this.anchorY),
|
|
i
|
|
},
|
|
__class__: vr
|
|
};
|
|
var wr = function (t, e) {
|
|
var i,
|
|
n = t.manifest.path + e + "library.json";
|
|
Object.prototype.hasOwnProperty.call(t._embeddedJSON.h, n) ? i = t._embeddedJSON.h[n] : (t.hasResource(n), t.hasResource(n), i = t.loader.resources[n].data);
|
|
var r = i;
|
|
this._symbols = new Ur,
|
|
this.frameRate = r.frameRate;
|
|
for (var o = [], s = 0, a = r.movies; s < a.length; ) {
|
|
var h = new Ar(this, a[s++]);
|
|
o.push(h),
|
|
this._symbols.h[h._name] = h
|
|
}
|
|
var l = r.textureGroups;
|
|
(1 != l[0].scaleFactor || l.length > 1) && Dn.warn("Flambe doesn't support Flump's Additional Scale Factors. Use Base Scales and load from different asset packs instead.");
|
|
var u = l[0].atlases;
|
|
for (s = 0; s < u.length; ) {
|
|
var c = u[s];
|
|
++s;
|
|
var p;
|
|
n = t.manifest.path + e + c.file;
|
|
Object.prototype.hasOwnProperty.call(t._embeddedTextures.h, n) ? p = t._embeddedTextures.h[n] : (t.hasResource(n), t.hasResource(n), p = t.loader.resources[n].texture);
|
|
a = 0;
|
|
for (var d = c.textures; a < d.length; ) {
|
|
var f = new vr(d[a++], p);
|
|
this._symbols.h[f._name] = f
|
|
}
|
|
}
|
|
for (s = 0; s < o.length; )
|
|
for (a = 0, d = o[s++].layers; a < d.length; )
|
|
for (var _ = d[a++].keyframes, m = _.length, y = 0; y < m; ) {
|
|
var g = y++,
|
|
v = _[g];
|
|
if (null != v.symbolName && (v.symbol = this._symbols.h[v.symbolName]), v.tweened && 1 == v.duration && g + 1 < m) {
|
|
var w = _[g + 1];
|
|
w.visible && null != w.symbolName || (v.visible = !1)
|
|
}
|
|
}
|
|
};
|
|
wr.__name__ = !0,
|
|
wr.prototype = {
|
|
createSprite: function (t, e, i) {
|
|
null == e && (e = !0);
|
|
var n = this._symbols.h[t];
|
|
if (null == n) {
|
|
if (e)
|
|
throw Dr.thrown(Pr.withFields("Missing symbol", ["name", t]));
|
|
return null
|
|
}
|
|
return n.createSprite(i)
|
|
},
|
|
__class__: wr
|
|
};
|
|
var xr = function (t) {
|
|
this.$aF = null,
|
|
this.$_F = null,
|
|
f.call(this),
|
|
this.$tf = t,
|
|
this.$Zf = new On,
|
|
this.movie = new Ln(null),
|
|
this.setCache(!0)
|
|
};
|
|
xr.__name__ = !0,
|
|
xr.__super__ = f,
|
|
xr.prototype = o(f.prototype, {
|
|
setCache: function (t) {
|
|
return this.$Tf = t ? new Ur : null,
|
|
this
|
|
},
|
|
onAdded: function () {
|
|
this.owner.addEntity(this.$Zf)
|
|
},
|
|
onRemoved: function () {
|
|
this.$Zf.dispose(),
|
|
this.$_F = this.$aF = null,
|
|
this.movie.set__(null)
|
|
},
|
|
onUpdate: function (t) {
|
|
null != this.$_F && this.$_F.$jc + t > this.$_F.symbol.duration && (this.$_F = null, this.$cF(this.$aF))
|
|
},
|
|
$cF: function (t) {
|
|
return this.$Zf.addComponent(t),
|
|
this.movie.set__(t)
|
|
},
|
|
get_name: function () {
|
|
return "$zf"
|
|
},
|
|
__class__: xr
|
|
});
|
|
var br = function (t, e) {
|
|
this.startedAtFrame = 0,
|
|
this.$FF = null,
|
|
Vt.call(this),
|
|
this.useLayerIndex = !0,
|
|
this.symbol = t,
|
|
this.speed = new Vn(1),
|
|
this.$fF = new Array(t.layers.length);
|
|
for (var i = 0, n = this.$fF.length; i < n; ) {
|
|
var r = i++;
|
|
this.$fF[r] = new Er(t.layers[r], e)
|
|
}
|
|
this.$ja = 0,
|
|
this.$jc = 0,
|
|
this.$gF(1)
|
|
};
|
|
br.__name__ = !0,
|
|
br.__super__ = Vt,
|
|
br.prototype = o(Vt.prototype, {
|
|
onStart: function () {
|
|
Vt.prototype.onStart.call(this);
|
|
for (var t = 0, e = this.symbol.layers; t < e.length; ) {
|
|
var i = e[t];
|
|
if (++t, null != i.mask) {
|
|
this.getLayer(i.name);
|
|
var n = [this.getLayer(i.name).$w.container];
|
|
this.getLayer(i.mask);
|
|
var r = this.getLayer(i.mask).$w.container.getBounds(),
|
|
o = [(new PIXI.Graphics).beginFill(0).drawRect(r.x, r.y, r.width, r.height).endFill()];
|
|
ss.create(this.owner, 1, function (t, e) {
|
|
return function () {
|
|
e[0].parent.addChild(t[0]),
|
|
e[0].mask = t[0]
|
|
}
|
|
}
|
|
(o, n))
|
|
}
|
|
}
|
|
},
|
|
getLayer: function (t, e) {
|
|
null == e && (e = !0);
|
|
for (var i = 0, n = this.$fF; i < n.length; ) {
|
|
var r = n[i];
|
|
if (++i, r.layer.name == t)
|
|
return r.content
|
|
}
|
|
if (e)
|
|
throw Dr.thrown(Pr.withFields("Missing layer", ["name", t]));
|
|
return null
|
|
},
|
|
onAdded: function () {
|
|
Vt.prototype.onAdded.call(this);
|
|
for (var t = 0, e = this.$fF; t < e.length; )
|
|
this.owner.addEntity(e[t++].content)
|
|
},
|
|
setDeepPosition: function (t) {
|
|
0 == (256 & this._flags) && (this.$hF(t), this.$ja = -1, this.onUpdate(0));
|
|
for (var e = 0, i = this.$fF; e < i.length; ) {
|
|
var n = i[e++].content.$w,
|
|
r = n instanceof br ? n : null;
|
|
null != r && r.setDeepPosition((t - r.startedAtFrame / this.symbol.frameRate) % r.symbol.duration)
|
|
}
|
|
},
|
|
onRemoved: function () {
|
|
Vt.prototype.onRemoved.call(this);
|
|
for (var t = 0, e = this.$fF; t < e.length; )
|
|
this.owner.removeEntity(e[t++].content)
|
|
},
|
|
onUpdate: function (t) {
|
|
Vt.prototype.onUpdate.call(this, t),
|
|
this.speed.update(t);
|
|
var e = 768 & this._flags;
|
|
0 == e ? (this.$jc += this.speed._value * t, this.$jc > this.symbol.duration && (this.$jc %= this.symbol.duration, null != this.$FF && this.$FF.emit())) : 512 == e && (this._flags &= -513),
|
|
this.$gF(this.$jc * this.symbol.frameRate)
|
|
},
|
|
$gF: function (t) {
|
|
if (this.$ja != t) {
|
|
if (t < this.$ja)
|
|
for (var e = 0, i = this.$fF; e < i.length; ) {
|
|
var n = i[e];
|
|
++e,
|
|
n.needsKeyframeUpdate = !0,
|
|
n.keyframeIdx = 0
|
|
}
|
|
for (e = 0, i = this.$fF; e < i.length; )
|
|
i[e++].composeFrame(t);
|
|
this.$ja = t
|
|
}
|
|
},
|
|
$hF: function (t) {
|
|
var e = this.symbol.duration;
|
|
return this.$jc = t < 0 ? 0 : t > e ? e : t
|
|
},
|
|
$iF: function (t) {
|
|
return this._flags = Cr.set(this._flags, 256, t),
|
|
t
|
|
},
|
|
$Wf: function () {
|
|
return null == this.$FF && (this.$FF = new Mr),
|
|
this.$FF
|
|
},
|
|
rewind: function () {
|
|
this.$jc = 0,
|
|
this._flags |= 512
|
|
},
|
|
dispose: function () {
|
|
if (null != this.$fF)
|
|
for (var t = 0, e = this.$fF; t < e.length; )
|
|
e[t++].dispose();
|
|
Vt.prototype.dispose.call(this)
|
|
},
|
|
__class__: br
|
|
});
|
|
var Er = function (t, e) {
|
|
if (this.keyframeIdx = 0, this.needsKeyframeUpdate = !1, this.content = new On, this.layer = t, this._decorator = e, null != e && (this._decoratedSymbols = new Br), t.empty)
|
|
this._sprites = null;
|
|
else {
|
|
this._sprites = new Array(t.keyframes.length);
|
|
for (var i = 0, n = this._sprites.length; i < n; ) {
|
|
var r = i++,
|
|
o = t.keyframes[r];
|
|
if (r > 0 && t.keyframes[r - 1].symbol == o.symbol)
|
|
this._sprites[r] = this._sprites[r - 1];
|
|
else if (null == o.symbol)
|
|
null == this._emptySprite && (this._emptySprite = new $r), this._sprites[r] = this._emptySprite;
|
|
else if (null != e) {
|
|
var s = o.symbol;
|
|
if (null != this._decoratedSymbols.h.__keys__[s.__id__])
|
|
this._sprites[r] = this._decoratedSymbols.h[s.__id__].createSprite(e);
|
|
else if (o.symbol instanceof Ar)
|
|
this._sprites[r] = o.symbol.createSprite(e), this._sprites[r].startedAtFrame = r;
|
|
else {
|
|
var a = e(o.symbol);
|
|
s != a && this._decoratedSymbols.set(s, a),
|
|
this._sprites[r] = a.createSprite(null)
|
|
}
|
|
} else
|
|
this._sprites[r] = o.symbol.createSprite(null), o.symbol instanceof Ar && (this._sprites[r].startedAtFrame = r)
|
|
}
|
|
this.content.addComponent(this._sprites[0])
|
|
}
|
|
};
|
|
Er.__name__ = !0,
|
|
Er.__interfaces__ = [d],
|
|
Er.prototype = {
|
|
composeFrame: function (t) {
|
|
if (null != this._sprites) {
|
|
var e,
|
|
i = this.layer.keyframes,
|
|
n = i.length - 1;
|
|
if (t > this.layer.frames)
|
|
return this.content.$w.container.visible = !1, this.keyframeIdx = n, void(this.needsKeyframeUpdate = !0);
|
|
for (; this.keyframeIdx < n && i[this.keyframeIdx + 1].index <= t; )
|
|
++this.keyframeIdx, this.needsKeyframeUpdate = !0;
|
|
if (this.needsKeyframeUpdate ? (this.needsKeyframeUpdate = !1, (e = this._sprites[this.keyframeIdx]) != this.content.$w && (e instanceof br && e.rewind(), this.content.addComponent(e))) : e = this.content.$w, null != e) {
|
|
var r = i[this.keyframeIdx],
|
|
o = r.visible && null != r.symbol;
|
|
if (e.container.visible = o, o) {
|
|
var s = r.x,
|
|
a = r.y,
|
|
h = r.scaleX,
|
|
l = r.scaleY,
|
|
u = r.skewX,
|
|
c = r.skewY,
|
|
p = r.alpha,
|
|
d = r.tintColor,
|
|
f = r.tintAmount;
|
|
if (r.tweened && this.keyframeIdx < n) {
|
|
var _ = (t - r.index) / r.duration,
|
|
m = r.ease;
|
|
if (0 != m) {
|
|
var y;
|
|
if (m < 0) {
|
|
var g = 1 - _;
|
|
y = 1 - g * g,
|
|
m = -m
|
|
} else
|
|
y = _ * _;
|
|
_ = m * y + (1 - m) * _
|
|
}
|
|
var v = i[this.keyframeIdx + 1];
|
|
s += (v.x - s) * _,
|
|
a += (v.y - a) * _,
|
|
h += (v.scaleX - h) * _,
|
|
l += (v.scaleY - l) * _,
|
|
u += (v.skewX - u) * _,
|
|
c += (v.skewY - c) * _,
|
|
p += (v.alpha - p) * _;
|
|
var w = v.tintColor,
|
|
x = Math.round(256 * _),
|
|
b = 256 - x;
|
|
d = (16711935 & d) * b + (16711935 & w) * x >> 8 & 16711935 | (65280 & d) * b + (65280 & w) * x >> 8 & 65280,
|
|
f += (v.tintAmount - f) * _
|
|
}
|
|
0 != f ? (null == r.tintFilter ? r.tintFilter = new yr(d, f) : r.tintFilter.update(d, f), null != e.container.filters && e.container.filters[0] == r.tintFilter || (e.container.filters = [r.tintFilter])) : null != e.container.filters && (e.container.filters = null),
|
|
e.container.setTransform(s, a, h, l, null, -u, c, r.pivotX, r.pivotY),
|
|
e.container.alpha = p,
|
|
this.layer.isMask && (e.container.visible = !1)
|
|
}
|
|
}
|
|
}
|
|
},
|
|
dispose: function () {
|
|
this._decoratedSymbols = null,
|
|
this._decorator = null,
|
|
this._sprites = null
|
|
},
|
|
__class__: Er
|
|
};
|
|
var $r = function () {
|
|
Vt.call(this),
|
|
this.useLayerIndex = !0
|
|
};
|
|
$r.__name__ = !0,
|
|
$r.__super__ = Vt,
|
|
$r.prototype = o(Vt.prototype, {
|
|
__class__: $r
|
|
});
|
|
var Ar = function (t, e) {
|
|
this._name = e.id,
|
|
this._data = e.data,
|
|
this._baseClass = e.baseClass,
|
|
this.frameRate = t.frameRate,
|
|
this.frames = 0,
|
|
this.layers = new Array(e.layers.length);
|
|
for (var i = [], n = 0, r = this.layers.length; n < r; ) {
|
|
var o = n++,
|
|
s = new Sr(e.layers[o]);
|
|
this.frames = Math.max(s.frames, this.frames),
|
|
this.layers[o] = s,
|
|
null != s.mask && i.push(s.mask)
|
|
}
|
|
for (n = 0, r = this.layers; n < r.length; ) {
|
|
s = r[n];
|
|
++n,
|
|
-1 != i.indexOf(s.name) && s.setIsMask(!0)
|
|
}
|
|
this.duration = this.frames / this.frameRate
|
|
};
|
|
Ar.__name__ = !0,
|
|
Ar.__interfaces__ = [gr],
|
|
Ar.prototype = {
|
|
createSprite: function (t) {
|
|
return new br(this, t)
|
|
},
|
|
__class__: Ar
|
|
};
|
|
var Sr = function (t) {
|
|
this.empty = !0,
|
|
this.isMask = !1,
|
|
this.name = t.name,
|
|
this.mask = t.mask;
|
|
var e = null;
|
|
this.keyframes = new Array(t.keyframes.length);
|
|
for (var i = 0, n = this.keyframes.length; i < n; ) {
|
|
var r = i++;
|
|
e = new Tr(t.keyframes[r], e),
|
|
this.keyframes[r] = e,
|
|
this.empty = this.empty && null == e.symbolName
|
|
}
|
|
this.frames = null != e ? e.index + e.duration : 0
|
|
};
|
|
Sr.__name__ = !0,
|
|
Sr.prototype = {
|
|
setIsMask: function (t) {
|
|
this.isMask = t
|
|
},
|
|
__class__: Sr
|
|
};
|
|
var Tr = function (t, e) {
|
|
this.tintAmount = 0,
|
|
this.tintColor = 0,
|
|
this.ease = 0,
|
|
this.tweened = !0,
|
|
this.visible = !0,
|
|
this.alpha = 1,
|
|
this.pivotY = 0,
|
|
this.pivotX = 0,
|
|
this.skewY = 0,
|
|
this.skewX = 0,
|
|
this.scaleY = 1,
|
|
this.scaleX = 1,
|
|
this.y = 0,
|
|
this.x = 0,
|
|
this.symbol = null,
|
|
this.index = null != e ? e.index + e.duration : 0,
|
|
this.duration = t.duration,
|
|
this.label = t.label,
|
|
this.symbolName = t.ref,
|
|
this.data = t.data;
|
|
var i = t.tint;
|
|
null != i && (this.tintAmount = i[0], this.tintColor = u.parseInt("0x" + i[1].substring(1)));
|
|
var n = t.loc;
|
|
null != n && (this.x = n[0], this.y = n[1]);
|
|
var r = t.scale;
|
|
null != r && (this.scaleX = r[0], this.scaleY = r[1]);
|
|
var o = t.skew;
|
|
null != o && (this.skewX = o[0], this.skewY = o[1]);
|
|
var s = t.pivot;
|
|
null != s && (this.pivotX = s[0], this.pivotY = s[1]),
|
|
null != t.alpha && (this.alpha = t.alpha),
|
|
null != t.visible && (this.visible = t.visible),
|
|
null != t.tweened && (this.tweened = t.tweened),
|
|
null != t.ease && (this.ease = t.ease)
|
|
};
|
|
Tr.__name__ = !0,
|
|
Tr.prototype = {
|
|
__class__: Tr
|
|
};
|
|
var Cr = function () {};
|
|
Cr.__name__ = !0,
|
|
Cr.set = function (t, e, i) {
|
|
return i ? t | e : t & ~e
|
|
};
|
|
var Mr = function (t) {
|
|
Fn.call(this, t)
|
|
};
|
|
Mr.__name__ = !0,
|
|
Mr.__super__ = Fn,
|
|
Mr.prototype = o(Fn.prototype, {
|
|
connect: function (t, e) {
|
|
return null == e && (e = !1),
|
|
this.connectImpl(t, e)
|
|
},
|
|
emit: function () {
|
|
var t = this;
|
|
this._head == Fn.DISPATCHING_SENTINEL ? this.defer((function () {
|
|
t.emitImpl()
|
|
})) : this.emitImpl()
|
|
},
|
|
emitImpl: function () {
|
|
for (var t = this.willEmit(), e = t; null != e; )
|
|
e._listener(), e.stayInList || e.dispose(), e = e._next;
|
|
this.didEmit(t)
|
|
},
|
|
__class__: Mr
|
|
});
|
|
var Ir = function (t) {
|
|
this.next = null,
|
|
this.fn = t
|
|
};
|
|
Ir.__name__ = !0,
|
|
Ir.prototype = {
|
|
__class__: Ir
|
|
};
|
|
var Pr = function () {};
|
|
Pr.__name__ = !0,
|
|
Pr.getFileExtension = function (t) {
|
|
var e = t.lastIndexOf(".");
|
|
return e > 0 ? a.substr(t, e + 1, null) : null
|
|
},
|
|
Pr.removeFileExtension = function (t) {
|
|
var e = t.lastIndexOf(".");
|
|
return e > 0 ? a.substr(t, 0, e) : t
|
|
},
|
|
Pr.withFields = function (t, e) {
|
|
if (null != e) {
|
|
var i = e.length;
|
|
if (i > 0) {
|
|
t += t.length > 0 ? " [" : "[";
|
|
for (var n = 0; n < i; ) {
|
|
n > 0 && (t += ", ");
|
|
var r = e[n + 1];
|
|
if (r instanceof Error) {
|
|
var o = r.stack;
|
|
null != o && (r = o)
|
|
}
|
|
t += e[n] + "=" + u.string(r),
|
|
n += 2
|
|
}
|
|
t += "]"
|
|
}
|
|
}
|
|
return t
|
|
};
|
|
var Or = function () {};
|
|
Or.__name__ = !0,
|
|
Or.__isInterface__ = !0,
|
|
Or.prototype = {
|
|
__class__: Or
|
|
};
|
|
var Rr = function () {};
|
|
Rr.__name__ = !0,
|
|
Rr.processEvents = function () {
|
|
for (; ; ) {
|
|
var t = Rr.pending.shift();
|
|
if (null == t)
|
|
break;
|
|
t()
|
|
}
|
|
var e = kr.tick();
|
|
return kr.hasEvents() || 0 != Rr.threadCount ? e : -1
|
|
},
|
|
Rr.run = function () {
|
|
var t = Rr.processEvents();
|
|
if ("undefined" != typeof window) {
|
|
var e = window,
|
|
i = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame;
|
|
null != i ? i(Rr.run) : t >= 0 && setTimeout(Rr.run, 1e3 * t)
|
|
} else
|
|
t >= 0 && setTimeout(Rr.run, 1e3 * t)
|
|
};
|
|
var Dr = function (t, e, i) {
|
|
Error.call(this, t),
|
|
this.message = t,
|
|
this.__previousException = e,
|
|
this.__nativeException = null != i ? i : this
|
|
};
|
|
Dr.__name__ = !0,
|
|
Dr.thrown = function (t) {
|
|
return t instanceof Dr ? t.get_native() : t instanceof Error ? t : new Fr(t)
|
|
},
|
|
Dr.__super__ = Error,
|
|
Dr.prototype = o(Error.prototype, {
|
|
get_native: function () {
|
|
return this.__nativeException
|
|
},
|
|
__class__: Dr
|
|
});
|
|
var Lr = function (t, e) {
|
|
this.isBlocking = !0,
|
|
this.f = t,
|
|
this.priority = e,
|
|
this.nextRun = -1 / 0
|
|
};
|
|
Lr.__name__ = !0,
|
|
Lr.prototype = {
|
|
stop: function () {
|
|
null != this.f && (this.f = null, this.nextRun = -1 / 0, null == this.prev ? kr.pending = this.next : this.prev.next = this.next, null != this.next && (this.next.prev = this.prev))
|
|
},
|
|
__class__: Lr
|
|
};
|
|
var kr = function () {};
|
|
kr.__name__ = !0,
|
|
kr.hasEvents = function () {
|
|
for (var t = kr.pending; null != t; ) {
|
|
if (t.isBlocking)
|
|
return !0;
|
|
t = t.next
|
|
}
|
|
return !1
|
|
},
|
|
kr.add = function (t, e) {
|
|
if (null == e && (e = 0), null == t)
|
|
throw Dr.thrown("Event function is null");
|
|
var i = new Lr(t, e),
|
|
n = kr.pending;
|
|
return null != n && (n.prev = i),
|
|
i.next = n,
|
|
kr.pending = i,
|
|
i
|
|
},
|
|
kr.sortEvents = function () {
|
|
var t = kr.pending;
|
|
if (null != t) {
|
|
for (var e, i, n, r, o, s = 1, a = 0, h = 0; ; ) {
|
|
for (i = t, t = null, o = null, e = 0; null != i; ) {
|
|
++e,
|
|
n = i,
|
|
a = 0;
|
|
for (var l = 0, u = s; l < u && (++l, ++a, null != (n = n.next)); );
|
|
for (h = s; a > 0 || h > 0 && null != n; )
|
|
0 == a ? (r = n, n = n.next, --h) : 0 == h || null == n || i.priority > n.priority || i.priority == n.priority && i.nextRun <= n.nextRun ? (r = i, i = i.next, --a) : (r = n, n = n.next, --h), null != o ? o.next = r : t = r, r.prev = o, o = r;
|
|
i = n
|
|
}
|
|
if (o.next = null, e <= 1)
|
|
break;
|
|
s *= 2
|
|
}
|
|
t.prev = null,
|
|
kr.pending = t
|
|
}
|
|
},
|
|
kr.tick = function () {
|
|
kr.sortEvents();
|
|
for (var t = kr.pending, e = a.now() / 1e3, i = 1e9; null != t; ) {
|
|
var n = t.next,
|
|
r = t.nextRun - e;
|
|
r <= 0 ? (i = 0, null != t.f && t.f()) : i > r && (i = r),
|
|
t = n
|
|
}
|
|
return i
|
|
};
|
|
var Fr = function (t, e, i) {
|
|
Dr.call(this, String(t), e, i),
|
|
this.value = t
|
|
};
|
|
Fr.__name__ = !0,
|
|
Fr.__super__ = Dr,
|
|
Fr.prototype = o(Dr.prototype, {
|
|
__class__: Fr
|
|
});
|
|
var Nr = function () {
|
|
this.h = {}
|
|
};
|
|
Nr.__name__ = !0,
|
|
Nr.__interfaces__ = [Or],
|
|
Nr.prototype = {
|
|
set: function (t, e) {
|
|
this.h[t] = e
|
|
},
|
|
get: function (t) {
|
|
return this.h[t]
|
|
},
|
|
exists: function (t) {
|
|
return this.h.hasOwnProperty(t)
|
|
},
|
|
remove: function (t) {
|
|
return !!this.h.hasOwnProperty(t) && (delete this.h[t], !0)
|
|
},
|
|
keys: function () {
|
|
var t = [];
|
|
for (var e in this.h)
|
|
this.h.hasOwnProperty(e) && t.push(0 | e);
|
|
return new jr(t)
|
|
},
|
|
__class__: Nr
|
|
};
|
|
var Br = function () {
|
|
this.h = {
|
|
__keys__: {}
|
|
}
|
|
};
|
|
Br.__name__ = !0,
|
|
Br.__interfaces__ = [Or],
|
|
Br.prototype = {
|
|
set: function (t, i) {
|
|
var n = t.__id__;
|
|
null == n && (n = t.__id__ = e.$haxeUID++),
|
|
this.h[n] = i,
|
|
this.h.__keys__[n] = t
|
|
},
|
|
get: function (t) {
|
|
return this.h[t.__id__]
|
|
},
|
|
exists: function (t) {
|
|
return null != this.h.__keys__[t.__id__]
|
|
},
|
|
remove: function (t) {
|
|
var e = t.__id__;
|
|
return null != this.h.__keys__[e] && (delete this.h[e], delete this.h.__keys__[e], !0)
|
|
},
|
|
keys: function () {
|
|
var t = [];
|
|
for (var e in this.h.__keys__)
|
|
this.h.hasOwnProperty(e) && t.push(this.h.__keys__[e]);
|
|
return new jr(t)
|
|
},
|
|
__class__: Br
|
|
};
|
|
var Ur = function () {
|
|
this.h = Object.create(null)
|
|
};
|
|
Ur.__name__ = !0,
|
|
Ur.__interfaces__ = [Or],
|
|
Ur.valueIterator = function (t) {
|
|
var e = Object.keys(t),
|
|
i = e.length,
|
|
n = 0;
|
|
return {
|
|
hasNext: function () {
|
|
return n < i
|
|
},
|
|
next: function () {
|
|
return t[e[(n += 1) - 1]]
|
|
}
|
|
}
|
|
},
|
|
Ur.prototype = {
|
|
exists: function (t) {
|
|
return Object.prototype.hasOwnProperty.call(this.h, t)
|
|
},
|
|
get: function (t) {
|
|
return this.h[t]
|
|
},
|
|
set: function (t, e) {
|
|
this.h[t] = e
|
|
},
|
|
remove: function (t) {
|
|
return !!Object.prototype.hasOwnProperty.call(this.h, t) && (delete this.h[t], !0)
|
|
},
|
|
__class__: Ur
|
|
};
|
|
var Xr = function (t) {
|
|
switch (t) {
|
|
case ".":
|
|
case "..":
|
|
return this.dir = t,
|
|
void(this.file = "")
|
|
}
|
|
var e = t.lastIndexOf("/"),
|
|
i = t.lastIndexOf("\\");
|
|
e < i ? (this.dir = a.substr(t, 0, i), t = a.substr(t, i + 1, null), this.backslash = !0) : i < e ? (this.dir = a.substr(t, 0, e), t = a.substr(t, e + 1, null)) : this.dir = null;
|
|
var n = t.lastIndexOf(".");
|
|
-1 != n ? (this.ext = a.substr(t, n + 1, null), this.file = a.substr(t, 0, n)) : (this.ext = null, this.file = t)
|
|
};
|
|
Xr.__name__ = !0,
|
|
Xr.withoutExtension = function (t) {
|
|
var e = new Xr(t);
|
|
return e.ext = null,
|
|
e.toString()
|
|
},
|
|
Xr.directory = function (t) {
|
|
var e = new Xr(t);
|
|
return null == e.dir ? "" : e.dir
|
|
},
|
|
Xr.extension = function (t) {
|
|
var e = new Xr(t);
|
|
return null == e.ext ? "" : e.ext
|
|
},
|
|
Xr.prototype = {
|
|
toString: function () {
|
|
return (null == this.dir ? "" : this.dir + (this.backslash ? "\\" : "/")) + this.file + (null == this.ext ? "" : "." + this.ext)
|
|
},
|
|
__class__: Xr
|
|
};
|
|
var jr = function (t) {
|
|
this.current = 0,
|
|
this.array = t
|
|
};
|
|
jr.__name__ = !0,
|
|
jr.prototype = {
|
|
hasNext: function () {
|
|
return this.current < this.array.length
|
|
},
|
|
next: function () {
|
|
return this.array[this.current++]
|
|
},
|
|
__class__: jr
|
|
};
|
|
var Vr = function () {};
|
|
Vr.__name__ = !0,
|
|
Vr.getClass = function (t) {
|
|
if (null == t)
|
|
return null;
|
|
if (t instanceof Array)
|
|
return Array;
|
|
var e = t.__class__;
|
|
if (null != e)
|
|
return e;
|
|
var i = Vr.__nativeClassName(t);
|
|
return null != i ? Vr.__resolveNativeClass(i) : null
|
|
},
|
|
Vr.__string_rec = function (t, e) {
|
|
if (null == t)
|
|
return "null";
|
|
if (e.length >= 5)
|
|
return "<...>";
|
|
var i = typeof t;
|
|
switch ("function" == i && (t.__name__ || t.__ename__) && (i = "object"), i) {
|
|
case "function":
|
|
return "<function>";
|
|
case "object":
|
|
if (t.__enum__) {
|
|
var n = r[t.__enum__],
|
|
o = n.__constructs__[t._hx_index],
|
|
s = n[o];
|
|
return s.__params__ ? (e += "\t", o + "(" + function (i) {
|
|
for (var n = [], r = 0, o = s.__params__; r < o.length; ) {
|
|
var a = o[r];
|
|
r += 1,
|
|
n.push(Vr.__string_rec(t[a], e))
|
|
}
|
|
return n
|
|
}
|
|
().join(",") + ")") : o
|
|
}
|
|
if (t instanceof Array) {
|
|
var a = "[";
|
|
e += "\t";
|
|
for (var h = 0, l = t.length; h < l; ) {
|
|
var u = h++;
|
|
a += (u > 0 ? "," : "") + Vr.__string_rec(t[u], e)
|
|
}
|
|
return a += "]"
|
|
}
|
|
var c;
|
|
try {
|
|
c = t.toString
|
|
} catch (h) {
|
|
return "???"
|
|
}
|
|
if (null != c && c != Object.toString && "function" == typeof c) {
|
|
var p = t.toString();
|
|
if ("[object Object]" != p)
|
|
return p
|
|
}
|
|
a = "{\n";
|
|
e += "\t";
|
|
var d = null != t.hasOwnProperty,
|
|
f = null;
|
|
for (f in t)
|
|
d && !t.hasOwnProperty(f) || "prototype" != f && "__class__" != f && "__super__" != f && "__interfaces__" != f && "__properties__" != f && (2 != a.length && (a += ", \n"), a += e + f + " : " + Vr.__string_rec(t[f], e));
|
|
return a += "\n" + (e = e.substring(1)) + "}";
|
|
case "string":
|
|
return t;
|
|
default:
|
|
return String(t)
|
|
}
|
|
},
|
|
Vr.__interfLoop = function (t, e) {
|
|
for (; ; ) {
|
|
if (null == t)
|
|
return !1;
|
|
if (t == e)
|
|
return !0;
|
|
var i = t.__interfaces__;
|
|
if (null != i)
|
|
for (var n = 0, r = i.length; n < r; ) {
|
|
var o = i[n++];
|
|
if (o == e || Vr.__interfLoop(o, e))
|
|
return !0
|
|
}
|
|
t = t.__super__
|
|
}
|
|
},
|
|
Vr.__instanceof = function (t, e) {
|
|
if (null == e)
|
|
return !1;
|
|
switch (e) {
|
|
case Array:
|
|
return t instanceof Array;
|
|
case _s:
|
|
return "boolean" == typeof t;
|
|
case ds:
|
|
return null != t;
|
|
case fs:
|
|
return "number" == typeof t;
|
|
case ps:
|
|
return "number" == typeof t && (0 | t) === t;
|
|
case String:
|
|
return "string" == typeof t;
|
|
default:
|
|
if (null == t)
|
|
return !1;
|
|
if ("function" == typeof e) {
|
|
if (Vr.__downcastCheck(t, e))
|
|
return !0
|
|
} else if ("object" == typeof e && Vr.__isNativeObj(e) && t instanceof e)
|
|
return !0;
|
|
return e == ms && null != t.__name__ || (e == ys && null != t.__ename__ || null != t.__enum__ && r[t.__enum__] == e)
|
|
}
|
|
},
|
|
Vr.__downcastCheck = function (t, e) {
|
|
return t instanceof e || !!e.__isInterface__ && Vr.__interfLoop(Vr.getClass(t), e)
|
|
},
|
|
Vr.__implements = function (t, e) {
|
|
return Vr.__interfLoop(Vr.getClass(t), e)
|
|
},
|
|
Vr.__cast = function (t, e) {
|
|
if (null == t || Vr.__instanceof(t, e))
|
|
return t;
|
|
throw Dr.thrown("Cannot cast " + u.string(t) + " to " + u.string(e))
|
|
},
|
|
Vr.__nativeClassName = function (t) {
|
|
var e = Vr.__toStr.call(t).slice(8, -1);
|
|
return "Object" == e || "Function" == e || "Math" == e || "JSON" == e ? null : e
|
|
},
|
|
Vr.__isNativeObj = function (t) {
|
|
return null != Vr.__nativeClassName(t)
|
|
},
|
|
Vr.__resolveNativeClass = function (t) {
|
|
return e[t]
|
|
};
|
|
var Hr = function () {};
|
|
Hr.__name__ = !0,
|
|
Hr.__isInterface__ = !0;
|
|
var Gr = function (t, e) {
|
|
null == t && (t = 0),
|
|
this.$Re = [],
|
|
f.call(this),
|
|
this.$NA = t > 0 ? t : 0,
|
|
this.$Re.push(e)
|
|
};
|
|
Gr.__name__ = !0,
|
|
Gr.create = function (t, e, i) {
|
|
if (null == e && (e = 0), null == t.$re)
|
|
t.add(Rn.EComponent(new Gr(e, i)));
|
|
else {
|
|
var n = t.$re;
|
|
null != n.$NA && (n.$NA = Math.min(e, n.$NA), n.$Re.push(i))
|
|
}
|
|
return t.$re
|
|
},
|
|
Gr.__super__ = f,
|
|
Gr.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
var e;
|
|
if (null != this.$NA) {
|
|
e = (this.$NA -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
if (e) {
|
|
for (var i = 0, n = this.$Re; i < n.length; ) {
|
|
var r = n[i];
|
|
++i,
|
|
null != r && r()
|
|
}
|
|
null != this.owner && this.owner.dispose(),
|
|
this.$NA = null
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$re"
|
|
},
|
|
__class__: Gr
|
|
});
|
|
var Yr = function (t) {
|
|
f.call(this),
|
|
this.update = new Nn(t)
|
|
};
|
|
Yr.__name__ = !0,
|
|
Yr.__super__ = f,
|
|
Yr.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
this.update.emit(this.owner, t)
|
|
},
|
|
get_name: function () {
|
|
return "$NF"
|
|
},
|
|
__class__: Yr
|
|
});
|
|
var Wr = function (t, e, i) {
|
|
switch (null == i && (i = 0), this.isVirtual = !1, this.$ME = new lo(0, 0), this.$mE = 0, this.$LE = 0, this.height = 0, this.width = 0, this.$KE = !0, this.useBounds = !0, this.lockY = !1, this.lockX = !1, this.offset = new lo(0, 0), this.smoothTimeY = 0, this.smoothTimeX = 0, this.zoom = new Vn(1), this.$JE = 1, this.target = {
|
|
x: 0,
|
|
y: 0
|
|
}, this.position = {
|
|
x: 0,
|
|
y: 0
|
|
}, this.afterUpdateSignal = new Mr, this.beforeUpdateSignal = new Mr, f.call(this), this.viewArea = new PIXI.Rectangle(0, 0, t, e), this.$PE(t), this.$qE(e), this.align = i) {
|
|
case 0:
|
|
this.$LE = this.$mE = .5;
|
|
break;
|
|
case 1:
|
|
this.$LE = 0,
|
|
this.$mE = 0
|
|
}
|
|
this.$oE(),
|
|
this.$OE()
|
|
};
|
|
Wr.__name__ = !0,
|
|
Wr.__super__ = f,
|
|
Wr.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onStart.call(this),
|
|
this.owner.parent.addEntity(this.$lE = (new On).addComponent(new Yr(cs(this, this.$nE)))),
|
|
this.$KE && this.$NE()
|
|
},
|
|
$nE: function (t, e) {
|
|
if (this.$KE) {
|
|
this.beforeUpdateSignal.emit(),
|
|
this.zoom.update(e);
|
|
var i = this.offset;
|
|
i.x.update(e),
|
|
i.y.update(e),
|
|
this.lockX || (this.position.x = Kn.smoothDamp(this.position.x, this.target.x, this.$ME.x, this.smoothTimeX, e)),
|
|
this.lockY || (this.position.y = Kn.smoothDamp(this.position.y, this.target.y, this.$ME.y, this.smoothTimeY, e)),
|
|
this.$NE(),
|
|
this.onAfterLateUpdate(),
|
|
this.afterUpdateSignal.emit()
|
|
}
|
|
},
|
|
onAfterLateUpdate: function () {},
|
|
$NE: function () {
|
|
var t = this.zoom._value;
|
|
if (this.$JE != t && (this.$oE(), this.$JE = t), this.viewArea.x = (this.position.x * t - this.width * this.$LE + this.offset.x._value) / t, this.viewArea.y = (this.position.y * t - this.height * this.$mE + this.offset.y._value) / t, this.$OE(), !this.isVirtual && null != this.$ya) {
|
|
var e = this.$ya.setXY(.5 * this.width, .5 * this.height);
|
|
e.container.pivot.set(this.viewArea.x + .5 * this.viewArea.width, this.viewArea.y + .5 * this.viewArea.height),
|
|
e.container.scale.set(t)
|
|
}
|
|
},
|
|
$oE: function () {
|
|
var t = this.zoom._value;
|
|
this.viewArea.width = this.width / t,
|
|
this.viewArea.height = this.height / t
|
|
},
|
|
$OE: function () {
|
|
if (null != this.$kE && this.useBounds) {
|
|
var t = this.$kE;
|
|
this.viewArea.x < t.x && (this.viewArea.x = t.x),
|
|
this.viewArea.y < t.y && (this.viewArea.y = t.y),
|
|
this.viewArea.x + this.viewArea.width > t.x + t.width && (this.viewArea.x = t.x + t.width - this.viewArea.width),
|
|
this.viewArea.y + this.viewArea.height > t.y + t.height && (this.viewArea.y = t.y + t.height - this.viewArea.height)
|
|
}
|
|
},
|
|
$pE: function () {
|
|
return null == this.$kE && (this.$kE = new PIXI.Rectangle(-898846567431155e293, -898846567431155e293, 179769313486231e294, 179769313486231e294)),
|
|
this.$kE
|
|
},
|
|
setBounds: function (t, e, i, n) {
|
|
var r = this.$pE();
|
|
r.x = t,
|
|
r.y = e,
|
|
r.width = i,
|
|
r.height = n
|
|
},
|
|
$PE: function (t) {
|
|
return this.width = t,
|
|
this.viewArea.width = t / this.zoom._value,
|
|
t
|
|
},
|
|
$qE: function (t) {
|
|
return this.height = t,
|
|
this.viewArea.height = t / this.zoom._value,
|
|
t
|
|
},
|
|
dispose: function () {
|
|
this.bounds = null,
|
|
null != this.$lE && (this.$lE.dispose(), this.$lE = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$jE"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Wr
|
|
});
|
|
var zr = function (t, e, i, n, r, o) {
|
|
null == o && (o = 1),
|
|
null == r && (r = 1),
|
|
null == n && (n = !0),
|
|
null == i && (i = 100),
|
|
null == e && (e = 100),
|
|
null == t && (t = 16711680),
|
|
this.$fE = !0,
|
|
this.rectColor = Vn.take(t, null, null, cs(this, this.$FE)),
|
|
this.rectWidth = Vn.take(e, null, null, cs(this, this.$FE)),
|
|
this.rectHeight = Vn.take(i, null, null, cs(this, this.$FE)),
|
|
this.rectStrokeWidth = Vn.take(r, null, null, cs(this, this.$FE)),
|
|
this.rectAlpha = Vn.take(o, null, null, cs(this, this.$FE)),
|
|
this.rectSolid = new Ln(n, cs(this, this.$FE)),
|
|
Vt.call(this, new PIXI.Graphics)
|
|
};
|
|
zr.__name__ = !0,
|
|
zr.__super__ = Vt,
|
|
zr.prototype = o(Vt.prototype, {
|
|
onUpdate: function (t) {
|
|
Vt.prototype.onUpdate.call(this, t),
|
|
this.rectWidth.update(t),
|
|
this.rectHeight.update(t),
|
|
this.rectColor.update(t),
|
|
this.rectStrokeWidth.update(t),
|
|
this.rectAlpha.update(t),
|
|
this.$fE && (this.redraw(), this.$fE = !1)
|
|
},
|
|
redraw: function () {
|
|
var t = this.container;
|
|
t.clear(),
|
|
this.rectSolid._value ? t.beginFill(0 | this.rectColor._value, this.rectAlpha._value) : t.lineStyle(this.rectStrokeWidth._value, 0 | this.rectColor._value, this.rectAlpha._value),
|
|
t.drawRect(0, 0, this.rectWidth._value, this.rectHeight._value),
|
|
t.endFill()
|
|
},
|
|
$FE: function (t, e) {
|
|
this.$fE = !0
|
|
},
|
|
dispose: function () {
|
|
Vn.put(this.rectColor),
|
|
Vn.put(this.rectWidth),
|
|
Vn.put(this.rectHeight),
|
|
Vn.put(this.rectAlpha),
|
|
Vn.put(this.rectStrokeWidth),
|
|
Vt.prototype.dispose.call(this)
|
|
},
|
|
__class__: zr
|
|
});
|
|
var qr = function () {
|
|
this.$Pe = new lo(0, 0),
|
|
this.$oB = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
f.call(this)
|
|
};
|
|
qr.__name__ = !0,
|
|
qr.__super__ = f,
|
|
qr.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onStart.call(this);
|
|
var t = this.$oB,
|
|
e = this.$ya.container.position;
|
|
t.x = e.x,
|
|
t.y = e.y
|
|
},
|
|
shakeItBaby: function (t, e, i, n) {
|
|
null == n && (n = !0),
|
|
null == i && (i = 0),
|
|
null == e && (e = .25),
|
|
null == t && (t = 10);
|
|
var r = this;
|
|
if (n)
|
|
try {
|
|
if (zo.util.any) {
|
|
var o = e / 2 * 1e3 | 0;
|
|
window.navigator.vibrate([o])
|
|
}
|
|
} catch (t) {}
|
|
0 != i ? ss.create(this.owner, 0, (function () {
|
|
r.$qe(t, e),
|
|
r.microStutter(i)
|
|
})) : this.$qe(t, e)
|
|
},
|
|
$qe: function (t, e) {
|
|
this.$Pe.x.set_behavior(new Yo(this.$oB.x, t, e)),
|
|
this.$Pe.y.set_behavior(new Yo(this.$oB.y, t, e))
|
|
},
|
|
microStutter: function (t) {
|
|
null == t && (t = 1);
|
|
var e = this;
|
|
this.owner.timeScale = 0;
|
|
var i = t / 60;
|
|
null == i && (i = 0),
|
|
this.owner.parent.addEntity((new On).addComponent(new Gr(i, (function () {
|
|
e.owner.timeScale = 1
|
|
}))), !0)
|
|
},
|
|
onUpdate: function (t) {
|
|
if (f.prototype.onUpdate.call(this, t), this.$Qe() && 0 != this.owner.timeScale) {
|
|
var e = this.$Pe;
|
|
e.x.update(t),
|
|
e.y.update(t),
|
|
this.$ya.setXY(this.$Pe.x._value, this.$Pe.y._value)
|
|
}
|
|
},
|
|
dispose: function () {
|
|
null != this.$ya && null != this.$ya.container && null != this.$ya.container.transform && this.$ya.container.position.set(this.$oB.x, this.$oB.y),
|
|
this.$Pe.x.set_behavior(null),
|
|
this.$Pe.y.set_behavior(null),
|
|
this.$Pe.dispose(),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
$Qe: function () {
|
|
return null != this.$Pe && null != this.$Pe.x && null != this.$Pe.x._behavior && !this.$Pe.x._behavior.isComplete()
|
|
},
|
|
get_name: function () {
|
|
return "$pe"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: qr
|
|
});
|
|
var Jr = function (t) {
|
|
f.call(this),
|
|
this.visible = t
|
|
};
|
|
Jr.__name__ = !0,
|
|
Jr.__super__ = f,
|
|
Jr.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
null == this._display && (this._display = this.owner.$w),
|
|
f.prototype.onStart.call(this),
|
|
this.$h = this.visible.watch((function (e, i) {
|
|
t._display.container.visible = e
|
|
}))
|
|
},
|
|
get_name: function () {
|
|
return "$G"
|
|
},
|
|
onAdded: function () {
|
|
null == this._display && (this._display = this.owner.$w),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Jr
|
|
});
|
|
var Kr = function (t) {
|
|
f.call(this),
|
|
this.$eD = t
|
|
};
|
|
Kr.__name__ = !0,
|
|
Kr.__super__ = f,
|
|
Kr.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
if (this.owner.$w, null != ((t = this.owner.$w)instanceof br ? t : null)) {
|
|
var t = this.owner.$w;
|
|
this.$h = (t instanceof br ? t : null).$Wf().connect(cs(this, this.$pC))
|
|
} else {
|
|
if (null != ((t = this.owner.$w)instanceof eo ? t : null)) {
|
|
t = this.owner.$w;
|
|
this.$h = (t instanceof eo ? t : null).$Vf().connect(cs(this, this.$pC))
|
|
}
|
|
}
|
|
},
|
|
$pC: function () {
|
|
null != this.$eD && this.$eD(),
|
|
null != this.owner && this.owner.dispose()
|
|
},
|
|
dispose: function () {
|
|
this.$eD = null,
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$DD"
|
|
},
|
|
__class__: Kr
|
|
});
|
|
var Zr = function (t) {
|
|
f.call(this),
|
|
this.$oC = t
|
|
};
|
|
Zr.__name__ = !0,
|
|
Zr.__super__ = f,
|
|
Zr.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
this.$OC()
|
|
},
|
|
$OC: function () {
|
|
if (null != this.owner) {
|
|
var t = this.owner.$w,
|
|
e = t instanceof br ? t : null;
|
|
null == e && null != this.owner.$zf && (e = this.owner.$zf.movie._value),
|
|
null != e && (this.$h = e.$Wf().connect(cs(this, this.$pC)))
|
|
}
|
|
},
|
|
onUpdate: function (t) {
|
|
null == this.$h && this.$OC()
|
|
},
|
|
$pC: function () {
|
|
var t = this.owner.$w,
|
|
e = t instanceof br ? t : null;
|
|
e.setDeepPosition(e.symbol.duration),
|
|
e.$iF(!0),
|
|
null != this.$oC && this.$oC()
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
this.$oC = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$NC"
|
|
},
|
|
__class__: Zr
|
|
});
|
|
var Qr = function (t) {
|
|
this.currentLabel = new Ln(null),
|
|
f.call(this),
|
|
this.$bB = t
|
|
};
|
|
Qr.__name__ = !0,
|
|
Qr.__super__ = f,
|
|
Qr.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
var t = this;
|
|
f.prototype.onStart.call(this),
|
|
this.$_B = this.owner._internal_getFromChildren("$w", eo),
|
|
null == this.$_B && (this.$Cb = this.owner._internal_getFromChildren("$zf"), null != this.$Cb ? (this.$a = new Pn, this.$a.add(this.$Cb.movie.watch((function (e, i) {
|
|
t.$AB = Qo.getLabels(e, t.$bB)
|
|
})))) : (this.$aB = this.owner._internal_getFromChildren("$w", br), null != this.$aB && (this.$AB = Qo.getLabels(this.$aB, this.$bB))))
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t);
|
|
var e = this.$AB,
|
|
i = this.$aB;
|
|
if (null == i && (null != this.$_B && null != this.$_B.movieSprite ? (e = this.$_B.getLabels(), i = this.$_B.movieSprite) : null != this.$Cb && null != this.$Cb.movie._value && (e = this.$AB, i = this.$Cb.movie._value)), null != e) {
|
|
for (var n = !1, r = 0, o = e.list; r < o.length; ) {
|
|
var s = o[r];
|
|
if (++r, null != s.name && e.isAtLabel(i, s.name)) {
|
|
this.currentLabel.set__(s.name),
|
|
n = !0;
|
|
break
|
|
}
|
|
}
|
|
n || this.currentLabel.set__(null)
|
|
}
|
|
},
|
|
dispose: function () {
|
|
var t = this.$a;
|
|
null != t && t.dispose(),
|
|
this.$a = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$Zb"
|
|
},
|
|
__class__: Qr
|
|
});
|
|
var to = function (t) {
|
|
this._isDisposed = !1,
|
|
this._player = t,
|
|
this.playRange = this._player.playRange
|
|
};
|
|
to.__name__ = !0,
|
|
to.__interfaces__ = [d],
|
|
to.prototype = {
|
|
completed: function (t) {
|
|
return this._isDisposed || (null != this._completedSignalConnection && this._completedSignalConnection.dispose(), this._completedSignalConnection = this._player.$Vf().connect(t).once()),
|
|
this
|
|
},
|
|
get_time: function () {
|
|
return null != this._player && null != this._player.movieSprite ? this._player.movieSprite.$jc : null
|
|
},
|
|
dispose: function () {
|
|
var t;
|
|
this._player = null,
|
|
this.playRange = null,
|
|
null != (t = this._completedSignalConnection) && t.dispose(),
|
|
this._completedSignalConnection = null,
|
|
null != (t = this._loopedSignalConnection) && t.dispose(),
|
|
this._loopedSignalConnection = null,
|
|
this._isDisposed = !0
|
|
},
|
|
__class__: to
|
|
};
|
|
var eo = function (t, e) {
|
|
this.$Sf = !1,
|
|
Vt.call(this, new PIXI.Container),
|
|
this.$tf = t,
|
|
this.$te = new On,
|
|
this.$Tf = new Ur,
|
|
null != e && this.setMovie(e)
|
|
};
|
|
eo.__name__ = !0,
|
|
eo.__super__ = Vt,
|
|
eo.prototype = o(Vt.prototype, {
|
|
onAdded: function () {
|
|
null == this.$te && (this.$te = new On),
|
|
this.owner.addEntity(this.$te),
|
|
Vt.prototype.onAdded.call(this)
|
|
},
|
|
onUpdate: function (t) {
|
|
null != this.movieSprite && this.movieSprite.$jc + t >= this.playRange.endTime && (this.isLooping ? (null != this.$Rf && this.$Rf.emit(), 0 == this.playRange.startTime && this.playRange.endTime == this.movieSprite.symbol.duration || this.movieSprite.$hF(this.playRange.startTime + (this.movieSprite.$jc + t) % this.playRange.endTime)) : 0 == (256 & this.movieSprite._flags) && (this.movieSprite.$iF(!0), this.movieSprite.$hF(this.playRange.endTime - this.movieSprite.symbol.duration / this.movieSprite.symbol.frames * .01), null != this.$rf && this.$rf.emit())),
|
|
Vt.prototype.onUpdate.call(this, t)
|
|
},
|
|
onRemoved: function () {
|
|
null != this.$te && this.owner.removeEntity(this.$te),
|
|
Vt.prototype.onRemoved.call(this)
|
|
},
|
|
setMovie: function (t) {
|
|
return (null != this.movieSprite ? this.movieSprite.symbol._name : null) != t && (null != this.movieSprite && (this.movieSprite.$iF(!0), this.movieSprite.$hF(0), this.$te.removeComponent(this.movieSprite)), this.$AB = null, this.movieSprite = this.$yf(t), this.$te.addComponent(this.movieSprite), null != this.playback && (this.playback.dispose(), this.playback = null), this.playRange = new es("", null, 0, this.movieSprite.symbol.duration), this.movieSprite.$iF(!0), this.movieSprite.$hF(0), null != this.$sf && this.$sf.emit(this.movieSprite)),
|
|
this
|
|
},
|
|
play: function (t, e) {
|
|
return null == e && (e = !1),
|
|
null == t && (t = !1),
|
|
this.isLooping = t,
|
|
this.playRange.name = "",
|
|
this.playRange.startTime = 0,
|
|
this.playRange.endTime = this.movieSprite.symbol.duration,
|
|
e && this.movieSprite.$hF(0),
|
|
this.resume(),
|
|
this.$uf()
|
|
},
|
|
$uf: function () {
|
|
return null != this.playback && this.playback.dispose(),
|
|
this.playback = new to(this),
|
|
this.playback
|
|
},
|
|
pause: function () {
|
|
return this.isPaused = !0,
|
|
this.movieSprite.$iF(!0),
|
|
this.playback
|
|
},
|
|
resume: function () {
|
|
return this.isPaused = !1,
|
|
this.movieSprite.$iF(!1),
|
|
this.playback
|
|
},
|
|
gotoAndPlay: function (t, e) {
|
|
return null == e && (e = !1),
|
|
this.isLooping = e,
|
|
this.playRange.name = "",
|
|
this.playRange.startTime = 0,
|
|
this.playRange.endTime = this.movieSprite.symbol.duration,
|
|
this.movieSprite.$hF(t),
|
|
this.resume(),
|
|
this.$uf()
|
|
},
|
|
gotoLabelAndPlay: function (t, e) {
|
|
null == e && (e = !1),
|
|
this.isLooping = e;
|
|
var i = this.getLabels().getLabelInfoByName(t);
|
|
return null != i && (this.playRange.name = i.name, this.playRange.startTime = 0, this.playRange.endTime = this.movieSprite.symbol.duration, this.movieSprite.$hF(i.startTime), this.resume()),
|
|
this.$uf()
|
|
},
|
|
gotoLabelAndPlayRange: function (t, e, i) {
|
|
null == i && (i = 0),
|
|
null == e && (e = !1),
|
|
this.isLooping = e;
|
|
var n = this.getLabels().getLabelInfoByName(t);
|
|
return null != n && (this.playRange.name = n.name, this.playRange.startTime = n.startTime, this.playRange.endTime = n.endTime - i, this.movieSprite.$hF(this.playRange.startTime), this.resume()),
|
|
this.$uf()
|
|
},
|
|
gotoAndPause: function (t) {
|
|
return this.movieSprite.$hF(t),
|
|
this.pause(),
|
|
this.$uf()
|
|
},
|
|
getLabels: function () {
|
|
return null == this.movieSprite ? null : (null == this.$AB && (this.$AB = Qo.getLabels(this.movieSprite, "labels")), this.$AB)
|
|
},
|
|
$Vf: function () {
|
|
return null == this.$rf && (this.$rf = new Mr),
|
|
this.$rf
|
|
},
|
|
$xf: function () {
|
|
return this.$Sf
|
|
},
|
|
$yf: function (t) {
|
|
if (this.$xf() && Object.prototype.hasOwnProperty.call(this.$Tf.h, t)) {
|
|
var e = this.$Tf.h[t];
|
|
return e.$hF(0),
|
|
e
|
|
}
|
|
return this.$Yf(t)
|
|
},
|
|
$Yf: function (t) {
|
|
var e = this.$tf.createSprite(t, !1);
|
|
return this.$xf() && (this.$Tf.h[t] = e),
|
|
e
|
|
},
|
|
dispose: function () {
|
|
var t;
|
|
this.$tf = null,
|
|
this.$Rf = null,
|
|
this.$rf = null,
|
|
this.$sf = null,
|
|
this.$AB = null,
|
|
this.playRange = null,
|
|
null != (t = this.movieSprite) && t.dispose(),
|
|
this.movieSprite = null,
|
|
null != (t = this.playback) && t.dispose(),
|
|
this.playback = null,
|
|
null != (t = this.$te) && t.dispose(),
|
|
this.$te = null,
|
|
this.$Tf = null,
|
|
Vt.prototype.dispose.call(this)
|
|
},
|
|
__class__: eo
|
|
});
|
|
var io = function (t, e, i) {
|
|
null == i && (i = !0),
|
|
f.call(this),
|
|
this.$Y_ = t,
|
|
this.$z_ = e,
|
|
this.$Z_ = i
|
|
};
|
|
io.__name__ = !0,
|
|
io.__super__ = f,
|
|
io.prototype = o(f.prototype, {
|
|
enable: function () {
|
|
null != this.owner && null == this.owner.$w || (this.$_a = this.owner.$w.container, this.$_a.interactive = !0, this.$_a.buttonMode = this.$Z_, this.$_a.on(this.$Y_, this.$z_))
|
|
},
|
|
emit: function () {
|
|
null != this.$_a && this.$z_(null)
|
|
},
|
|
disable: function () {
|
|
null != this.$_a && (this.$_a.buttonMode = !1, this.$_a.interactive = !1, this.$_a.off(this.$Y_, this.$z_))
|
|
},
|
|
onStart: function () {
|
|
this.enable()
|
|
},
|
|
dispose: function () {
|
|
this.disable(),
|
|
this.$z_ = null,
|
|
this.$_a = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$y_"
|
|
},
|
|
__class__: io
|
|
});
|
|
var no = function (t, e) {
|
|
null == e && (e = !0),
|
|
io.call(this, "pointertap", t, e)
|
|
};
|
|
no.__name__ = !0,
|
|
no.__super__ = io,
|
|
no.prototype = o(io.prototype, {
|
|
get_name: function () {
|
|
return "$aa"
|
|
},
|
|
__class__: no
|
|
});
|
|
var ro = function (t, e) {
|
|
null == e && (e = !0),
|
|
io.call(this, "pointerdown", t, e)
|
|
};
|
|
ro.__name__ = !0,
|
|
ro.__super__ = io,
|
|
ro.prototype = o(io.prototype, {
|
|
get_name: function () {
|
|
return "$Ke"
|
|
},
|
|
__class__: ro
|
|
});
|
|
var oo = function (t, e) {
|
|
null == e && (e = !0),
|
|
io.call(this, "pointermove", t, e)
|
|
};
|
|
oo.__name__ = !0,
|
|
oo.__super__ = io,
|
|
oo.prototype = o(io.prototype, {
|
|
get_name: function () {
|
|
return "$ke"
|
|
},
|
|
__class__: oo
|
|
});
|
|
var so = function (t, e) {
|
|
f.call(this),
|
|
null == t && (t = ao.UP_OUT),
|
|
this.state = new Ln(t, e)
|
|
};
|
|
so.__name__ = !0,
|
|
so.__super__ = f,
|
|
so.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
this.$_a = this.owner.$w.container,
|
|
this.$_a.on("pointerover", cs(this, this.$Of)),
|
|
this.$_a.on("pointerout", cs(this, this.$pf)),
|
|
this.$_a.on("pointerup", cs(this, this.$Pf)),
|
|
this.$_a.on("pointerupoutside", cs(this, this.$Pf)),
|
|
this.$_a.on("pointerdown", cs(this, this.$qf))
|
|
},
|
|
$Of: function (t) {
|
|
this.isPointerOver = !0,
|
|
this.$ff()
|
|
},
|
|
$pf: function (t) {
|
|
this.isPointerOver = !1,
|
|
this.$ff()
|
|
},
|
|
$Pf: function (t) {
|
|
this.isPointerDown = !1,
|
|
this.$ff()
|
|
},
|
|
$qf: function (t) {
|
|
this.isPointerDown = !0,
|
|
this.$ff()
|
|
},
|
|
$ff: function () {
|
|
this.isPointerDown ? this.state.set__(this.isPointerOver ? ao.DOWN_OVER : ao.DOWN_OUT) : this.state.set__(this.isPointerOver ? ao.UP_OVER : ao.UP_OUT)
|
|
},
|
|
dispose: function () {
|
|
this.$_a.off("pointerover", cs(this, this.$Of)),
|
|
this.$_a.off("pointerout", cs(this, this.$pf)),
|
|
this.$_a.off("pointerup", cs(this, this.$Pf)),
|
|
this.$_a.off("pointerupoutside", cs(this, this.$Pf)),
|
|
this.$_a.off("pointerdown", cs(this, this.$qf)),
|
|
this.$_a = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$of"
|
|
},
|
|
__class__: so
|
|
});
|
|
var ao = r["temple.components.pointer.PointerState"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["UP_OVER", "UP_OUT", "DOWN_OVER", "DOWN_OUT"],
|
|
UP_OVER: {
|
|
_hx_index: 0,
|
|
__enum__: "temple.components.pointer.PointerState",
|
|
toString: n
|
|
},
|
|
UP_OUT: {
|
|
_hx_index: 1,
|
|
__enum__: "temple.components.pointer.PointerState",
|
|
toString: n
|
|
},
|
|
DOWN_OVER: {
|
|
_hx_index: 2,
|
|
__enum__: "temple.components.pointer.PointerState",
|
|
toString: n
|
|
},
|
|
DOWN_OUT: {
|
|
_hx_index: 3,
|
|
__enum__: "temple.components.pointer.PointerState",
|
|
toString: n
|
|
}
|
|
},
|
|
ho = function (t) {
|
|
this.$Mf = new sr,
|
|
this.$mf = new sr,
|
|
this.$Lf = new sr,
|
|
f.call(this),
|
|
this.$df = new os(cs(i = this.$mf, i.emit), t)
|
|
};
|
|
ho.__name__ = !0,
|
|
ho.__super__ = f,
|
|
ho.prototype = o(f.prototype, {
|
|
connect: function (t, e) {
|
|
return null == e && (e = !1),
|
|
this.$mf.connect(t, e)
|
|
},
|
|
connectBefore: function (t, e) {
|
|
return null == e && (e = !1),
|
|
this.$Lf.connect(t, e)
|
|
},
|
|
connectAfter: function (t, e) {
|
|
return null == e && (e = !1),
|
|
this.$Mf.connect(t, e)
|
|
},
|
|
onUpdate: function (t) {
|
|
this.$Lf.emit(t),
|
|
this.$df.update(t),
|
|
this.$Mf.emit(this.$df.alpha)
|
|
},
|
|
dispose: function () {
|
|
this.$Lf.dispose(),
|
|
this.$mf.dispose(),
|
|
this.$Mf.dispose(),
|
|
this.$df.dispose(),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$lf"
|
|
},
|
|
__class__: ho
|
|
});
|
|
var lo = function (t, e) {
|
|
this.x = Vn.take(t),
|
|
this.y = Vn.take(e)
|
|
};
|
|
lo.__name__ = !0,
|
|
lo.__interfaces__ = [d],
|
|
lo.prototype = {
|
|
set: function (t, e) {
|
|
this.x.set__(t),
|
|
this.y.set__(null != e ? e : t)
|
|
},
|
|
dispose: function () {
|
|
this.x = Vn.put(this.x),
|
|
this.y = Vn.put(this.y)
|
|
},
|
|
__class__: lo
|
|
};
|
|
var uo = function (t) {
|
|
null == t && (t = !1),
|
|
f.call(this),
|
|
this.$if = t
|
|
};
|
|
uo.__name__ = !0,
|
|
uo.__super__ = f,
|
|
uo.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
null == this.$ya && (this.$ya = this.owner.$w),
|
|
f.prototype.onAdded.call(this),
|
|
null != this.$ya && (this.$_a = this.$ya.container)
|
|
},
|
|
onStart: function () {
|
|
if (null == this.$ya && (this.$ya = this.owner.$w), f.prototype.onStart.call(this), this.$_a = this.$ya.container, this.$if) {
|
|
var t = this.owner.$mF;
|
|
null == t && (t = new Pn, this.owner.addComponent(t)),
|
|
t.add(this.owner._internal_getFromParents("$lf").connect(cs(this, this.$kf)))
|
|
}
|
|
},
|
|
$Y: function () {
|
|
return null == this.$NB && (this.$NB = new lo(null != this.$_a ? this.$_a.position.x : 0, null != this.$_a ? this.$_a.position.y : 0)),
|
|
this.$NB
|
|
},
|
|
$z: function () {
|
|
return null == this.$_A && (this.$_A = new lo(null != this.$_a ? this.$_a.scale.x : 1, null != this.$_a ? this.$_a.scale.y : 1)),
|
|
this.$_A
|
|
},
|
|
$A_: function () {
|
|
return null == this.$Jf && (this.$Jf = Vn.take(null != this.$_a ? this.$_a.alpha : 1)),
|
|
this.$Jf
|
|
},
|
|
$kf: function (t) {
|
|
this.$Kf(t)
|
|
},
|
|
onUpdate: function (t) {
|
|
f.prototype.onUpdate.call(this, t),
|
|
this.$if || this.$Kf(t)
|
|
},
|
|
$Kf: function (t) {
|
|
if (null != this.$_a) {
|
|
var e;
|
|
if (null != this.$NB)
|
|
(e = this.$NB).x.update(t), e.y.update(t), this.$_a.position.set(this.$NB.x._value, this.$NB.y._value);
|
|
if (null != this.$_A)
|
|
(e = this.$_A).x.update(t), e.y.update(t), this.$_a.scale.set(this.$_A.x._value, this.$_A.y._value);
|
|
if (null != this.$jf)
|
|
(e = this.$jf).x.update(t), e.y.update(t), this.$_a.pivot.set(this.$jf.x._value, this.$jf.y._value);
|
|
null != this.$If && (this.$If.update(t), this.$_a.rotation = this.$If._value),
|
|
null != this.$Jf && (this.$Jf.update(t), this.$_a.alpha = this.$Jf._value)
|
|
}
|
|
},
|
|
dispose: function () {
|
|
null != this.$NB && (this.$NB.dispose(), this.$NB = null),
|
|
null != this.$If && (this.$If.dispose(), this.$If = null),
|
|
null != this.$_A && (this.$_A.dispose(), this.$_A = null),
|
|
null != this.$jf && (this.$jf.dispose(), this.$jf = null),
|
|
null != this.$Jf && (this.$Jf.dispose(), this.$Jf = null),
|
|
this.$_a = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$Hf"
|
|
},
|
|
__class__: uo
|
|
});
|
|
var co = function (t, e) {
|
|
null == e && (e = !0),
|
|
this.isExecuting = !1,
|
|
this._tasks = null != t ? t : [],
|
|
this.continueOnErrors = e
|
|
};
|
|
co.__name__ = !0,
|
|
co.prototype = {
|
|
execute: function (t) {
|
|
return this.onComplete = t,
|
|
this.isExecuting = !0,
|
|
this.nextTask(),
|
|
this
|
|
},
|
|
nextTask: function () {
|
|
var t = this;
|
|
null != this.currentTask && (this.currentTask.dispose(), this.currentTask = null),
|
|
this._tasks.length > 0 ? (this.currentTask = this._tasks.shift(), this.currentTask.onComplete = function (e) {
|
|
null != t.onTaskComplete && t.onTaskComplete(e),
|
|
t.nextTask()
|
|
}, this.currentTask.onError = function (e, i) {
|
|
null != t.onTaskError && t.onTaskError(e, i),
|
|
t.continueOnErrors && t.nextTask()
|
|
}, this.currentTask.execute()) : (this.isExecuting = !1, null != this.onComplete && this.onComplete())
|
|
},
|
|
__class__: co
|
|
};
|
|
var po = function () {
|
|
this._disposer = new Pn
|
|
};
|
|
po.__name__ = !0,
|
|
po.__interfaces__ = [d],
|
|
po.prototype = {
|
|
execute: function () {},
|
|
complete: function () {
|
|
null != this.onComplete && this.onComplete(this)
|
|
},
|
|
error: function (t) {
|
|
null != this.onError && this.onError(this, t)
|
|
},
|
|
dispose: function () {
|
|
this.onError = null,
|
|
this.onComplete = null,
|
|
this._disposer.dispose(),
|
|
this._disposer = null
|
|
},
|
|
__class__: po
|
|
};
|
|
var fo = function (t) {
|
|
po.call(this),
|
|
this._preloader = t,
|
|
fo.NUM_PRELOADER_STEPS++,
|
|
this._currentPreloaderStep = fo.NUM_PRELOADER_STEPS
|
|
};
|
|
fo.__name__ = !0,
|
|
fo.__super__ = po,
|
|
fo.prototype = o(po.prototype, {
|
|
calcProgress: function (t) {
|
|
var e = 1 / fo.NUM_PRELOADER_STEPS;
|
|
return (this._currentPreloaderStep - 1) * e + t * e
|
|
},
|
|
dispose: function () {
|
|
this._preloader = null,
|
|
po.prototype.dispose.call(this)
|
|
},
|
|
__class__: fo
|
|
});
|
|
var _o = function (t, e) {
|
|
fo.call(this, e),
|
|
this._manifest = t
|
|
};
|
|
_o.__name__ = !0,
|
|
_o.__super__ = fo,
|
|
_o.prototype = o(fo.prototype, {
|
|
execute: function () {
|
|
var t = this,
|
|
e = this._manifest;
|
|
0 == e.fileNames.length || Object.prototype.hasOwnProperty.call(Un.assets.assetPackByName.h, e.path) ? this.complete() : (this._pack = Un.assets.loadPack(e, (function (i) {
|
|
null != t._preloader && t._preloader.setProgress(t.calcProgress(1));
|
|
for (var n = 0, r = i.manifest.fileNames; n < r.length; ) {
|
|
var o = r[n];
|
|
if (++n, o.indexOf("library.json") > -1) {
|
|
var s = (e.path + o).split("/");
|
|
s.pop();
|
|
var a = o.split("/");
|
|
a.pop();
|
|
var h = s[s.length - 1],
|
|
l = new wr(i, a.join("/") + "/");
|
|
x._libraryByName.set(h, l)
|
|
}
|
|
}
|
|
t.complete()
|
|
})), null != this._preloader && this._disposer.add(this._pack.get_progress().watch((function (e, i) {
|
|
t._preloader.setProgress(t.calcProgress(e))
|
|
}))))
|
|
},
|
|
__class__: _o
|
|
});
|
|
var mo = function (t, e) {
|
|
null == e && (e = 3),
|
|
po.call(this),
|
|
this._fontName = t,
|
|
this._maxWaitTime = e
|
|
};
|
|
mo.__name__ = !0,
|
|
mo.__super__ = po,
|
|
mo.prototype = o(po.prototype, {
|
|
execute: function () {
|
|
new FontFaceObserver(this._fontName).load(null, 1e3 * this._maxWaitTime).then(cs(this, this.onLoadComplete), cs(this, this.onLoadError))
|
|
},
|
|
onLoadComplete: function (t) {
|
|
this.complete()
|
|
},
|
|
onLoadError: function (t) {
|
|
this.error("Given up on loading font '" + t.family + "' after waiting for " + this._maxWaitTime + " seconds")
|
|
},
|
|
__class__: mo
|
|
});
|
|
var yo = function (t, e, i) {
|
|
this._fontStyle = "normal",
|
|
this._fontWeight = "normal",
|
|
po.call(this),
|
|
this._fontName = t,
|
|
this._extensions = e,
|
|
this._path = i
|
|
};
|
|
yo.__name__ = !0,
|
|
yo.__super__ = po,
|
|
yo.prototype = o(po.prototype, {
|
|
execute: function () {
|
|
for (var t = "" + this._path + this._fontName, e = [], i = 0, n = this._extensions; i < n.length; ) {
|
|
var r = n[i];
|
|
switch (++i, r.toLowerCase()) {
|
|
case "eot":
|
|
o = 'url("' + t + '.eot?#iefix") format("embedded-opentype")';
|
|
break;
|
|
case "otf":
|
|
o = 'url("' + t + '.otf") format("opentype")';
|
|
break;
|
|
case "svg":
|
|
o = 'url("' + t + ".svg?#" + this._fontName + '") format("svg")';
|
|
break;
|
|
case "ttf":
|
|
o = 'url("' + t + '.ttf") format("truetype")';
|
|
break;
|
|
case "woff":
|
|
o = 'url("' + t + '.woff") format("woff")';
|
|
break;
|
|
case "woff2":
|
|
o = 'url("' + t + '.woff2") format("woff2")';
|
|
break;
|
|
default:
|
|
o = ""
|
|
}
|
|
e.push(o)
|
|
}
|
|
var o = e.join(", "),
|
|
s = -1 != this._extensions.indexOf("eot") ? 'src: url("' + t + '.eot"); src: ' + o : "src: " + o,
|
|
a = '@font-face {\n\t\t\tfont-family: "' + this._fontName + '";\n\t\t\t' + s + ";\n\t\t\tfont-weight: " + this._fontWeight + ";\n\t\t\tfont-style: " + this._fontStyle + "; \n\t\t}",
|
|
h = window.document.createElement("style");
|
|
h.type = "text/css",
|
|
h.styleSheet ? h.styleSheet.cssText = a : h.appendChild(window.document.createTextNode(a)),
|
|
window.document.head.appendChild(h),
|
|
this.complete()
|
|
},
|
|
__class__: yo
|
|
});
|
|
var go = function (t) {
|
|
po.call(this),
|
|
this._method = t
|
|
};
|
|
go.__name__ = !0,
|
|
go.__super__ = po,
|
|
go.prototype = o(po.prototype, {
|
|
execute: function () {
|
|
po.prototype.execute.call(this),
|
|
null != this._method && this._method(),
|
|
this.complete()
|
|
},
|
|
__class__: go
|
|
});
|
|
var vo = function (t) {
|
|
this._isExecuted = !1,
|
|
this._isEmitted = !1;
|
|
var e = this;
|
|
po.call(this),
|
|
this._signal = t,
|
|
this._connection = this._signal.connect((function () {
|
|
e._isEmitted = !0,
|
|
e.tryComplete()
|
|
}))
|
|
};
|
|
vo.__name__ = !0,
|
|
vo.__super__ = po,
|
|
vo.prototype = o(po.prototype, {
|
|
tryComplete: function () {
|
|
this._isEmitted && this._isExecuted && this.complete()
|
|
},
|
|
execute: function () {
|
|
po.prototype.execute.call(this),
|
|
this._isExecuted = !0,
|
|
this.tryComplete()
|
|
},
|
|
__class__: vo
|
|
});
|
|
var wo = function (t, e, i) {
|
|
if (this._numConcurrentLoads = 4, fo.call(this, i), this._soundManager = e, -1 != window.navigator.userAgent.indexOf("Edge"))
|
|
for (var n = 0, r = t.fileNames; n < r.length; ) {
|
|
var o = r[n];
|
|
++n;
|
|
for (var s = new Jo(o, o.length - 1, 0, 1); s.hasNext(); ) {
|
|
var h = s.next();
|
|
-1 == h.value.toLowerCase().indexOf(".mp3") && a.remove(o, h.value)
|
|
}
|
|
}
|
|
this._loader = new Vo(t.fileNames),
|
|
this._preloader = i
|
|
};
|
|
wo.__name__ = !0,
|
|
wo.__super__ = fo,
|
|
wo.prototype = o(fo.prototype, {
|
|
execute: function () {
|
|
var t = this;
|
|
fo.prototype.execute.call(this),
|
|
null != this._preloader && (this._loader.onProgress = function (e) {
|
|
t._preloader.setProgress(t.calcProgress(t._loader.progress))
|
|
}),
|
|
this._loader.onComplete = function () {
|
|
null != t._preloader && t._preloader.setProgress(t.calcProgress(1)),
|
|
t.complete()
|
|
},
|
|
this._loader.load(this._numConcurrentLoads)
|
|
},
|
|
complete: function () {
|
|
this._soundManager.registerSounds(this._loader.sounds),
|
|
fo.prototype.complete.call(this)
|
|
},
|
|
dispose: function () {
|
|
this._loader.onProgress = null,
|
|
this._loader.onComplete = null,
|
|
this._loader = null,
|
|
fo.prototype.dispose.call(this)
|
|
},
|
|
__class__: wo
|
|
});
|
|
var xo = function (t) {
|
|
po.call(this),
|
|
this._manifest = t
|
|
};
|
|
xo.__name__ = !0,
|
|
xo.__super__ = po,
|
|
xo.prototype = o(po.prototype, {
|
|
execute: function () {
|
|
for (var t = this, e = Object.create(null), i = [], n = 0, r = this._manifest.fileNames; n < r.length; ) {
|
|
var o = r[n];
|
|
++n;
|
|
var s = Pr.removeFileExtension(o),
|
|
a = Pr.getFileExtension(o);
|
|
-1 != xo.FONT_EXTENSIONS.indexOf(a) && (Object.prototype.hasOwnProperty.call(e, s) || (e[s] = []), e[s].push(a), -1 == i.indexOf(s) && i.push(s))
|
|
}
|
|
for (var h = Ur.valueIterator(e); h.hasNext(); )
|
|
h.next().sort((function (t, e) {
|
|
var i = xo.FONT_EXTENSIONS.indexOf(t),
|
|
n = xo.FONT_EXTENSIONS.indexOf(e);
|
|
return i == n ? 0 : i > n ? 1 : -1
|
|
}));
|
|
for (var l = [], u = 0; u < i.length; ) {
|
|
var c = i[u++];
|
|
l.push(new yo(c, e[c], this._manifest.path)),
|
|
l.push(new mo(c))
|
|
}
|
|
this._sequence = new co(l),
|
|
this._sequence.onTaskError = function (e, i) {
|
|
t.error(i)
|
|
},
|
|
this._sequence.execute(cs(this, this.complete))
|
|
},
|
|
__class__: xo
|
|
});
|
|
var bo = r["temple.enums.Align"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["LEFT", "RIGHT", "TOP", "BOTTOM", "BOTTOM_LEFT", "BOTTOM_RIGHT", "TOP_LEFT", "TOP_RIGHT", "CENTER"],
|
|
LEFT: {
|
|
_hx_index: 0,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
RIGHT: {
|
|
_hx_index: 1,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
TOP: {
|
|
_hx_index: 2,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
BOTTOM: {
|
|
_hx_index: 3,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
BOTTOM_LEFT: {
|
|
_hx_index: 4,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
BOTTOM_RIGHT: {
|
|
_hx_index: 5,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
TOP_LEFT: {
|
|
_hx_index: 6,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
TOP_RIGHT: {
|
|
_hx_index: 7,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
},
|
|
CENTER: {
|
|
_hx_index: 8,
|
|
__enum__: "temple.enums.Align",
|
|
toString: n
|
|
}
|
|
},
|
|
Eo = function (t, e) {
|
|
this.point1 = null != t ? t : {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.point2 = null != e ? e : {
|
|
x: 0,
|
|
y: 0
|
|
}
|
|
};
|
|
Eo.__name__ = !0,
|
|
Eo.prototype = {
|
|
__class__: Eo
|
|
};
|
|
var $o = {
|
|
distanceTo: function (t, e) {
|
|
var i,
|
|
n,
|
|
r = t.x,
|
|
o = t.y;
|
|
return i = r - e.x,
|
|
n = o - e.y,
|
|
Math.sqrt(i * i + n * n)
|
|
},
|
|
normalize: function (t) {
|
|
if (0 == t.x && 0 == t.y)
|
|
return t;
|
|
var e = Math.sqrt(t.x * t.x + t.y * t.y);
|
|
return t.x /= e,
|
|
t.y /= e,
|
|
t
|
|
},
|
|
angle: function (t) {
|
|
return Math.atan2(t.y, t.x)
|
|
}
|
|
},
|
|
Ao = {
|
|
empty: function () {
|
|
return {
|
|
x: 0,
|
|
y: 0,
|
|
z: 0
|
|
}
|
|
}
|
|
},
|
|
So = function (t, e, i, n, r, o) {
|
|
this.$bE = 0,
|
|
this.$AE = 0,
|
|
this.$aE = [],
|
|
this.$_E = 2,
|
|
this.doApply = !0,
|
|
this.maxScale = 2147483647,
|
|
this.$Ye = Po.None,
|
|
this.scale = 1,
|
|
this.$ye = Oo.Auto,
|
|
this.pivotY = 0,
|
|
this.$Xe = Oo.Auto,
|
|
this.pivotX = 0,
|
|
this.$xe = Oo.Auto,
|
|
this.height = 0,
|
|
this.$We = Oo.Auto,
|
|
this.width = 0,
|
|
this.$we = Oo.Auto,
|
|
this.y = 0,
|
|
this.$Ve = Oo.Auto,
|
|
this.x = 0,
|
|
f.call(this),
|
|
null != i && this.setX(i),
|
|
null != n && this.setY(n),
|
|
null != t && this.setWidth(t),
|
|
null != e && this.setHeight(e),
|
|
null != r && this.setPivotX(r),
|
|
null != o && this.setPivotY(o)
|
|
};
|
|
So.__name__ = !0,
|
|
So.__super__ = f,
|
|
So.prototype = o(f.prototype, {
|
|
onAdded: function () {
|
|
f.prototype.onAdded.call(this);
|
|
try {
|
|
this.onStart()
|
|
} catch (t) {}
|
|
},
|
|
onStart: function () {
|
|
if (f.prototype.onStart.call(this), this.$_a = this.owner.$w.container, null != this.owner.parent) {
|
|
var t = this.owner.parent._internal_getFromParents("$ve");
|
|
if (null != t) {
|
|
var e = t;
|
|
e.$CE(this),
|
|
this.$AE = e.width,
|
|
this.$bE = e.height
|
|
}
|
|
}
|
|
this.$DE(),
|
|
this.update()
|
|
},
|
|
onStop: function () {
|
|
if (f.prototype.onStop.call(this), null != this.owner.parent) {
|
|
var t = this.owner.parent._internal_getFromParents("$ve");
|
|
null != t && t.$dE(this)
|
|
}
|
|
},
|
|
setScaleMode: function (t) {
|
|
return this.$Ye = t,
|
|
this.$DE(),
|
|
this
|
|
},
|
|
$CE: function (t) {
|
|
-1 == this.$aE.indexOf(t) && (this.$aE.push(t), this.$DE())
|
|
},
|
|
$dE: function (t) {
|
|
-1 == this.$aE.indexOf(t) && (a.remove(this.$aE, t), this.$DE())
|
|
},
|
|
setWidth: function (t) {
|
|
return this.$We = t,
|
|
this.$DE(),
|
|
this
|
|
},
|
|
setHeight: function (t) {
|
|
return this.$xe = t,
|
|
this.$DE(),
|
|
this
|
|
},
|
|
setX: function (t) {
|
|
return this.$Ve = t,
|
|
this.$DE(),
|
|
this
|
|
},
|
|
setY: function (t) {
|
|
return this.$we = t,
|
|
this.$DE(),
|
|
this
|
|
},
|
|
setPivotX: function (t) {
|
|
return this.$Xe = t,
|
|
this.$DE(),
|
|
this
|
|
},
|
|
setPivotY: function (t) {
|
|
return this.$ye = t,
|
|
this.$DE(),
|
|
this
|
|
},
|
|
resize: function (t, e) {
|
|
this.$DE(),
|
|
this.$AE = t,
|
|
this.$bE = e,
|
|
this.update();
|
|
for (var i = 0, n = this.$aE; i < n.length; )
|
|
n[i++].resize(this.width, this.height)
|
|
},
|
|
$DE: function () {
|
|
this.$_E = 2
|
|
},
|
|
update: function () {
|
|
if (!(this.$_E <= 0 || null == this.$_a || null == this.owner)) {
|
|
this.$_E--,
|
|
this.width = this.$EE(this.$We, this.$_a.width, this.$AE),
|
|
this.height = this.$EE(this.$xe, this.$_a.height, this.$bE),
|
|
this.x = this.$EE(this.$Ve, this.$_a.x, this.$AE),
|
|
this.y = this.$EE(this.$we, this.$_a.y, this.$bE);
|
|
var t,
|
|
e = this.$Ye;
|
|
switch (e._hx_index) {
|
|
case 0:
|
|
t = 1;
|
|
break;
|
|
case 1:
|
|
t = e.value;
|
|
break;
|
|
case 2:
|
|
var i = null;
|
|
null != this.owner.parent && (i = this.owner.parent._internal_getFromParents("$ve")),
|
|
t = null != (r = i) ? Math.min(r.width / this.width, r.height / this.height) : 1;
|
|
break;
|
|
case 3:
|
|
i = null;
|
|
null != this.owner.parent && (i = this.owner.parent._internal_getFromParents("$ve"));
|
|
var n = null != (r = i) ? Math.min(r.width / e.w, r.height / e.h) : 1;
|
|
this.width /= n,
|
|
this.height /= n,
|
|
t = n;
|
|
break;
|
|
case 4:
|
|
i = null;
|
|
null != this.owner.parent && (i = this.owner.parent._internal_getFromParents("$ve")),
|
|
t = null != (r = i) ? Math.max(r.width / this.width, r.height / this.height) : 1;
|
|
break;
|
|
case 5:
|
|
i = null;
|
|
null != this.owner.parent && (i = this.owner.parent._internal_getFromParents("$ve"));
|
|
n = null != (r = i) ? Math.min(r.width / e.w, r.height / e.h) : 1;
|
|
this.width /= n,
|
|
this.height /= n,
|
|
t = n;
|
|
break;
|
|
case 6:
|
|
i = null;
|
|
null != this.owner.parent && (i = this.owner.parent._internal_getFromParents("$ve")),
|
|
t = null != (r = i) ? r.height / this.height : 1;
|
|
break;
|
|
case 7:
|
|
var r;
|
|
i = null;
|
|
null != this.owner.parent && (i = this.owner.parent._internal_getFromParents("$ve")),
|
|
t = null != (r = i) ? r.width / this.width : 1
|
|
}
|
|
this.scale = t,
|
|
this.scale = Math.min(this.scale, this.maxScale),
|
|
this.pivotX = this.$EE(this.$Xe, this.$_a.pivot.x, this.width),
|
|
this.pivotY = this.$EE(this.$ye, this.$_a.pivot.y, this.height),
|
|
this.doApply && this.$eE(),
|
|
null != (r = this.$ze) && r.emit()
|
|
}
|
|
},
|
|
$eE: function () {
|
|
this.$_a.position.set(this.x, this.y),
|
|
this.$_a.pivot.set(this.pivotX, this.pivotY),
|
|
this.$Ye != Po.None && this.$_a.scale.set(this.scale, this.scale)
|
|
},
|
|
onUpdate: function (t) {
|
|
this.$_E > 0 && this.update()
|
|
},
|
|
$EE: function (t, e, i) {
|
|
switch (t._hx_index) {
|
|
case 0:
|
|
return e;
|
|
case 1:
|
|
return i * t.percentage;
|
|
case 2:
|
|
return t.observable._value;
|
|
case 3:
|
|
return t.value;
|
|
case 4:
|
|
return Io.calculate(i, t.calculations)
|
|
}
|
|
},
|
|
get_name: function () {
|
|
return "$ve"
|
|
},
|
|
dispose: function () {
|
|
null != this.$cE && (this.$cE.dispose(), this.$cE = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: So
|
|
});
|
|
var To = {
|
|
fromString: function (t) {
|
|
return "auto" == t ? Oo.Auto : new s("^[0-9.]{1,}%$", "").match(t) ? Oo.Percent(parseFloat(a.substr(t, 0, t.length - 1)) / 100) : Oo.Calc(Io.parse(t))
|
|
}
|
|
},
|
|
Co = r["temple.layout.LayoutCalculationOperator"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["Add", "Substract", "Multiply", "Divide"],
|
|
Add: {
|
|
_hx_index: 0,
|
|
__enum__: "temple.layout.LayoutCalculationOperator",
|
|
toString: n
|
|
},
|
|
Substract: {
|
|
_hx_index: 1,
|
|
__enum__: "temple.layout.LayoutCalculationOperator",
|
|
toString: n
|
|
},
|
|
Multiply: {
|
|
_hx_index: 2,
|
|
__enum__: "temple.layout.LayoutCalculationOperator",
|
|
toString: n
|
|
},
|
|
Divide: {
|
|
_hx_index: 3,
|
|
__enum__: "temple.layout.LayoutCalculationOperator",
|
|
toString: n
|
|
}
|
|
},
|
|
Mo = function (t, e) {
|
|
this.value = t,
|
|
this.unit = e
|
|
};
|
|
Mo.__name__ = !0,
|
|
Mo.prototype = {
|
|
__class__: Mo
|
|
};
|
|
var Io = function () {};
|
|
Io.__name__ = !0,
|
|
Io.parse = function (t) {
|
|
for (var e = t.split(" "), i = [], n = 0; n < e.length; )
|
|
i.push(Io.parsePart(e[n])), ++n;
|
|
return i
|
|
},
|
|
Io.parsePart = function (t) {
|
|
var e = Io._operatorLookup.indexOf(t);
|
|
if (e >= 0)
|
|
return Io._operators[e];
|
|
var i,
|
|
n,
|
|
r = new s("([\\+\\-]?[0-9\\.]+)(%|px|vw|vh)?", ""),
|
|
o = r.match(t);
|
|
try {
|
|
i = r.matched(1)
|
|
} catch (t) {
|
|
i = null
|
|
}
|
|
try {
|
|
n = r.matched(2)
|
|
} catch (t) {
|
|
n = null
|
|
}
|
|
var a = null != n ? n : "px";
|
|
if (o) {
|
|
var h = parseFloat(null != i ? r.matched(1) : r.matched(0));
|
|
return new Mo(null != h ? h : 0, a)
|
|
}
|
|
h = parseFloat(t);
|
|
return new Mo(null != h ? h : 0, a)
|
|
},
|
|
Io.calculate = function (t, e) {
|
|
for (var i = Io.processUnit(t, e[0]), n = 2, r = e.length; n < r; )
|
|
i = Io.processOperator(i, e[n - 1], Io.processUnit(t, e[n])), n += 2;
|
|
return i
|
|
},
|
|
Io.processOperator = function (t, e, i) {
|
|
switch (e._hx_index) {
|
|
case 0:
|
|
return t + i;
|
|
case 1:
|
|
return t - i;
|
|
case 2:
|
|
return t * i;
|
|
case 3:
|
|
return t / i
|
|
}
|
|
},
|
|
Io.processUnit = function (t, e) {
|
|
switch (e.unit) {
|
|
case "%":
|
|
return t * (e.value / 100);
|
|
case "px":
|
|
return e.value;
|
|
case "vh":
|
|
return t * (Un.renderer.height / Un.renderer.resolution | 0);
|
|
case "vw":
|
|
return t * (Un.renderer.width / Un.renderer.resolution | 0)
|
|
}
|
|
};
|
|
var Po = r["temple.layout.LayoutScaleMode"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["None", "Fixed", "Contain", "Contained", "Cover", "Covered", "FitToHeight", "FitToWidth"],
|
|
None: {
|
|
_hx_index: 0,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
},
|
|
Fixed: (i = function (t) {
|
|
return {
|
|
_hx_index: 1,
|
|
value: t,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["value"], i),
|
|
Contain: {
|
|
_hx_index: 2,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
},
|
|
Contained: (i = function (t, e) {
|
|
return {
|
|
_hx_index: 3,
|
|
w: t,
|
|
h: e,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["w", "h"], i),
|
|
Cover: {
|
|
_hx_index: 4,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
},
|
|
Covered: (i = function (t, e) {
|
|
return {
|
|
_hx_index: 5,
|
|
w: t,
|
|
h: e,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["w", "h"], i),
|
|
FitToHeight: {
|
|
_hx_index: 6,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
},
|
|
FitToWidth: {
|
|
_hx_index: 7,
|
|
__enum__: "temple.layout.LayoutScaleMode",
|
|
toString: n
|
|
}
|
|
},
|
|
Oo = r["temple.layout.LayoutType"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["Auto", "Percent", "Observable", "Relative", "Calc"],
|
|
Auto: {
|
|
_hx_index: 0,
|
|
__enum__: "temple.layout.LayoutType",
|
|
toString: n
|
|
},
|
|
Percent: (i = function (t) {
|
|
return {
|
|
_hx_index: 1,
|
|
percentage: t,
|
|
__enum__: "temple.layout.LayoutType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["percentage"], i),
|
|
Observable: (i = function (t) {
|
|
return {
|
|
_hx_index: 2,
|
|
observable: t,
|
|
__enum__: "temple.layout.LayoutType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["observable"], i),
|
|
Relative: (i = function (t) {
|
|
return {
|
|
_hx_index: 3,
|
|
value: t,
|
|
__enum__: "temple.layout.LayoutType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["value"], i),
|
|
Calc: (i = function (t) {
|
|
return {
|
|
_hx_index: 4,
|
|
calculations: t,
|
|
__enum__: "temple.layout.LayoutType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["calculations"], i)
|
|
},
|
|
Ro = function () {};
|
|
Ro.__name__ = !0,
|
|
Ro.trackPageview = function (t) {
|
|
if (Ro.enabled)
|
|
try {
|
|
null == t ? ga("send", "pageview") : ga("send", "pageview", t)
|
|
} catch (t) {}
|
|
},
|
|
Ro.trackEvent = function (t, e, i, n) {
|
|
if (Ro.enabled)
|
|
try {
|
|
ga("send", "event", t, e, i, n)
|
|
} catch (t) {}
|
|
};
|
|
var Do = function () {
|
|
this.$Ef = .03333333333333333,
|
|
this.$a = new Pn,
|
|
this.$Df = [],
|
|
this.player = new Ln(null),
|
|
this.$Cf = [],
|
|
this.$cf = [],
|
|
this.updateComplete = new Mr,
|
|
this.physicsUpdate = new sr,
|
|
f.call(this),
|
|
this.$ef = this.$Ef
|
|
};
|
|
Do.__name__ = !0,
|
|
Do.__super__ = f,
|
|
Do.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$df && (this.$df = this.owner._internal_getFromParents("$lf")),
|
|
f.prototype.onStart.call(this),
|
|
this.$a.add(this.$df.connectBefore(cs(this, this.updateBefore))),
|
|
this.$a.add(this.$df.connect(cs(this, this.$ff))),
|
|
this.$a.add(this.$df.connectAfter(cs(this, this.$Ff)))
|
|
},
|
|
updateBefore: function (t) {
|
|
for (var e = this.$cf.length, i = this.$Cf.length, n = 0, r = e > i ? e : i; n < r; ) {
|
|
var o = n++;
|
|
o < e && this.$cf[o].updateBefore(t),
|
|
o < i && this.$Cf[o].updateBefore(t)
|
|
}
|
|
this.$gf(),
|
|
this.updateComplete.emit()
|
|
},
|
|
$ff: function (t) {
|
|
null != this.$ef && (this.$ef -= t);
|
|
t = this.$df.$df._fixedTimestep;
|
|
for (var e = this.$cf.length, i = this.$Cf.length, n = 0, r = e > i ? e : i; n < r; ) {
|
|
var o = n++;
|
|
if (o < e) {
|
|
var s = this.$cf[o];
|
|
s.physicsEnabled && null != s.owner && s.updatePhysics(t)
|
|
}
|
|
if (o < i)
|
|
(c = this.$Cf[o]).physicsEnabled && null != c.owner && c.updatePhysics(t)
|
|
}
|
|
this.physicsUpdate.emit(this.$df.$df._fixedTimestep);
|
|
for (var a = this.$Cf, h = 0; h < a.length; ) {
|
|
var l = a[h],
|
|
u = h++;
|
|
if (l.collisionsEnabled)
|
|
for (n = u + 1, r = this.$Cf.length; n < r; ) {
|
|
(f = this.$Cf[n++]).collisionsEnabled && Xo.report(l, f)
|
|
}
|
|
}
|
|
for (n = 0, r = this.$Cf; n < r.length; ) {
|
|
var c = r[n];
|
|
if (++n, c.collisionsEnabled)
|
|
for (var p = 0, d = this.$cf; p < d.length; ) {
|
|
var f = d[p];
|
|
++p,
|
|
f.collisionsEnabled && Xo.report(c, f)
|
|
}
|
|
}
|
|
},
|
|
$Ff: function (t) {
|
|
for (var e = this.$cf.length, i = this.$Cf.length, n = 0, r = e > i ? e : i; n < r; ) {
|
|
var o = n++;
|
|
if (o < e) {
|
|
var s = this.$cf[o];
|
|
s.physicsEnabled && null != s.owner && s.updateAfter(t),
|
|
null != (l = this.$ef) && l <= 0 && s.pruneCurrentCollisions()
|
|
}
|
|
if (o < i) {
|
|
var a = this.$Cf[o];
|
|
a.physicsEnabled && null != a.owner && a.updateAfter(t);
|
|
var h = this.$ef;
|
|
null != h && h <= 0 && a.pruneCurrentCollisions()
|
|
}
|
|
}
|
|
var l;
|
|
null != (l = this.$ef) && l <= 0 && (this.$ef = this.$Ef)
|
|
},
|
|
$gf: function () {
|
|
for (; this.$Df.length > 0; ) {
|
|
var t = this.$Df.pop();
|
|
a.remove(this.$cf, t),
|
|
a.remove(this.$Cf, t)
|
|
}
|
|
},
|
|
remove: function (t) {
|
|
t.disableCollisions(),
|
|
t.disablePhysics(),
|
|
-1 == this.$Df.indexOf(t) && this.$Df.push(t)
|
|
},
|
|
add: function (t) {
|
|
var e;
|
|
switch (t.type) {
|
|
case 1:
|
|
e = this.$Cf;
|
|
break;
|
|
case 2:
|
|
case 3:
|
|
e = this.$cf
|
|
}
|
|
-1 == e.indexOf(t) && e.push(t),
|
|
a.remove(this.$Df, t)
|
|
},
|
|
get_name: function () {
|
|
return "$Bf"
|
|
},
|
|
dispose: function () {
|
|
null != this.physicsUpdate && (this.physicsUpdate.dispose(), this.physicsUpdate = null),
|
|
null != this.updateComplete && (this.updateComplete.dispose(), this.updateComplete = null),
|
|
null != this.player && (this.player.dispose(), this.player = null),
|
|
null != this.$a && (this.$a.dispose(), this.$a = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: Do
|
|
});
|
|
var Lo = function (t) {
|
|
null == t && (t = !0),
|
|
this.$rE = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$vc = Lo.$Uc,
|
|
f.call(this),
|
|
this.updateEveryFrame = t
|
|
};
|
|
Lo.__name__ = !0,
|
|
Lo.__super__ = f,
|
|
Lo.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
null == this.$ya && (this.$ya = this.owner._internal_getFromParents("$w")),
|
|
this.updatePosition()
|
|
},
|
|
onUpdate: function (t) {
|
|
this.updateEveryFrame && this.updatePosition()
|
|
},
|
|
updatePosition: function () {
|
|
var t;
|
|
null != this.$ya && null != this.$ya.container && null != this.$ya.container.parent && (this.$ya.container.parent.toLocal(Lo.$Uc, this.$ya.container, this.$rE), null != this.$_b ? ((t = this.$_b).position.x = t.step.x = t.$wE.x = this.$rE.x + this.$vc.x, (t = this.$_b).position.y = t.step.y = t.$wE.y = this.$rE.y + this.$vc.y) : (this.$ya.container.x = this.$rE.x + this.$vc.x, this.$ya.container.y = this.$rE.y + this.$vc.y))
|
|
},
|
|
get_name: function () {
|
|
return "$QE"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
__class__: Lo
|
|
});
|
|
var ko = function (t) {
|
|
this.$Sc = new PIXI.Rectangle,
|
|
this.enabled = !0,
|
|
f.call(this),
|
|
this.$Rc = t
|
|
};
|
|
ko.__name__ = !0,
|
|
ko.getBoxToBoxIntersection = function (t, e, i, n, r) {
|
|
var o = (a = t.step.x + e.left) > (h = i.step.x + n.left) ? a : h,
|
|
s = (a = t.step.x + e.right) < (h = i.step.x + n.right) ? a : h;
|
|
if (o > s)
|
|
return null;
|
|
var a,
|
|
h,
|
|
l = (a = t.step.y + e.top) > (h = i.step.y + n.top) ? a : h,
|
|
u = (a = t.step.y + e.bottom) < (h = i.step.y + n.bottom) ? a : h;
|
|
return l > u ? null : (r.x = o, r.y = l, r.width = s - o, r.height = u - l, r)
|
|
},
|
|
ko.__super__ = f,
|
|
ko.prototype = o(f.prototype, {
|
|
onStart: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
f.prototype.onStart.call(this),
|
|
this.$h = this.$_b.$Tc().connect(cs(this, this.$tc))
|
|
},
|
|
$tc: function (t) {
|
|
if (this.enabled && this.isValidHit(t)) {
|
|
var e = t.type;
|
|
switch (e._hx_index) {
|
|
case 0:
|
|
var i = e.otherBounds,
|
|
n = e.currentBounds,
|
|
r = e.currentSides;
|
|
if (1 == r.length)
|
|
switch (r[0]) {
|
|
case 1:
|
|
(s = t.other).position.x = s.step.x = s.$wE.x = t.current.position.x - i.width - i.x + n.x,
|
|
t.other.velocity.x = 0;
|
|
break;
|
|
case 2:
|
|
(s = t.other).position.y = s.step.y = s.$wE.y = t.current.position.y - i.height - i.y + n.y,
|
|
t.other.velocity.y = 0;
|
|
break;
|
|
case 4:
|
|
(s = t.other).position.x = s.step.x = s.$wE.x = t.current.position.x + n.width - i.x + n.x,
|
|
t.other.velocity.x = 0;
|
|
break;
|
|
case 8:
|
|
(s = t.other).position.y = s.step.y = s.$wE.y = t.current.position.y + n.height - i.y + n.y,
|
|
t.other.velocity.y = 0
|
|
}
|
|
else {
|
|
var o = ko.getBoxToBoxIntersection(t.current, n, t.other, i, this.$Sc);
|
|
if (null != o)
|
|
if (o.width >= o.height) {
|
|
if (-1 != r.indexOf(2))
|
|
(s = t.other).position.y = s.step.y = s.$wE.y = t.current.position.y - i.height - i.y + n.y, t.other.velocity.y = 0;
|
|
else if (-1 != r.indexOf(8)) {
|
|
(s = t.other).position.y = s.step.y = s.$wE.y = t.current.position.y + n.height - i.y + n.y,
|
|
t.other.velocity.y = 0
|
|
}
|
|
} else if (-1 != r.indexOf(1)) {
|
|
(s = t.other).position.x = s.step.x = s.$wE.x = t.current.position.x - i.width - i.x + n.x,
|
|
t.other.velocity.x = 0
|
|
} else if (-1 != r.indexOf(4)) {
|
|
var s;
|
|
(s = t.other).position.x = s.step.x = s.$wE.x = t.current.position.x + n.width - i.x + n.x,
|
|
t.other.velocity.x = 0
|
|
}
|
|
}
|
|
}
|
|
null != this.$sc && this.$sc.emit(t)
|
|
}
|
|
},
|
|
isValidHit: function (t) {
|
|
return null == this.$Rc || 0 == (this.$_b.filterFlags & t.other.flags)
|
|
},
|
|
get_name: function () {
|
|
return "$rc"
|
|
},
|
|
onAdded: function () {
|
|
null == this.$_b && (this.$_b = this.owner.$RE),
|
|
f.prototype.onAdded.call(this)
|
|
},
|
|
dispose: function () {
|
|
null != this.$h && (this.$h.dispose(), this.$h = null),
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
__class__: ko
|
|
});
|
|
var Fo = function (t, e, i, n, r) {
|
|
null == r && (r = No.Exclusive),
|
|
null == n && (n = 0),
|
|
null == i && (i = 0),
|
|
this.filterFlagsMethod = No.Exclusive,
|
|
this.$YE = -1,
|
|
this.$yE = -1,
|
|
this.$xE = !1,
|
|
this.$WE = 0,
|
|
this.prevPosition = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$wE = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.$VE = [],
|
|
this.$vE = [],
|
|
this.$UE = [],
|
|
this.friction = {
|
|
x: 1,
|
|
y: 1
|
|
},
|
|
this.step = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.impulse = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.velocity = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.position = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
this.collisionsEnabled = !0,
|
|
this.physicsEnabled = !0,
|
|
f.call(this),
|
|
this.shape = t,
|
|
this.type = e,
|
|
this.flags = i,
|
|
this.filterFlags = n,
|
|
this.debugColor = 1 == e ? 16763904 : 52479
|
|
};
|
|
Fo.__name__ = !0,
|
|
Fo.__super__ = f,
|
|
Fo.prototype = o(f.prototype, {
|
|
setMass: function (t) {
|
|
return this.$WE = t,
|
|
this
|
|
},
|
|
setData: function (t) {
|
|
return this.data = t,
|
|
this
|
|
},
|
|
setFilterFlagsMethod: function (t) {
|
|
return this.filterFlagsMethod = t,
|
|
this
|
|
},
|
|
onStart: function () {
|
|
null == this.engine && (this.engine = this.owner._internal_getFromParents("$Bf")),
|
|
this.$zE(),
|
|
this.setXY(this.position.x, this.position.y),
|
|
this.$XE = this.engine.$df.$df._fixedTimestep
|
|
},
|
|
$zE: function () {
|
|
this.engine.add(this)
|
|
},
|
|
onRemoved: function () {
|
|
null != this.engine && this.engine.remove(this)
|
|
},
|
|
setXY: function (t, e) {
|
|
return this.position.x = this.step.x = this.$wE.x = t,
|
|
this.position.y = this.step.y = this.$wE.y = e,
|
|
this
|
|
},
|
|
updateBefore: function (t) {
|
|
var e = this.$tE;
|
|
null != e && e.emit()
|
|
},
|
|
updatePhysics: function (t) {
|
|
var e = this.$wE,
|
|
i = this.step;
|
|
e.x = i.x,
|
|
e.y = i.y;
|
|
e = this.step;
|
|
var n = this.impulse,
|
|
r = this.velocity,
|
|
o = (u = n.x, c = n.y, u = u + r.x),
|
|
s = c = c + r.y;
|
|
if (o = u * t, s = c * t, e.x += o, e.y += s, -1 != this.$yE) {
|
|
var a = this.$yE,
|
|
h = this.step.y;
|
|
this.step.y = a < h ? a : h,
|
|
this.step.y == this.$yE && (this.velocity.y = 0)
|
|
}
|
|
if (-1 != this.$YE) {
|
|
a = this.$YE,
|
|
h = this.step.y;
|
|
this.step.y = a > h ? a : h,
|
|
this.step.y == this.$YE && (this.velocity.y = 0)
|
|
}
|
|
e = this.position,
|
|
i = this.step;
|
|
e.x = i.x,
|
|
e.y = i.y,
|
|
0 != this.$WE && (this.velocity.y += this.$WE * Fo.gravity * t);
|
|
e = this.velocity,
|
|
u = (n = this.friction).x,
|
|
c = n.y,
|
|
o = u *= t,
|
|
s = c *= t;
|
|
o = u / (l = this.$XE),
|
|
s = c / l,
|
|
e.x *= o,
|
|
e.y *= s;
|
|
var l,
|
|
u,
|
|
c;
|
|
e = this.impulse,
|
|
u = (n = this.friction).x,
|
|
c = n.y,
|
|
o = u *= t,
|
|
s = c *= t;
|
|
o = u / (l = this.$XE),
|
|
s = c / l,
|
|
e.x *= o,
|
|
e.y *= s,
|
|
null != (e = this.$uE) && e.emit(t)
|
|
},
|
|
updateAfter: function (t) {
|
|
var e = this.prevPosition,
|
|
i = this.position;
|
|
e.x = i.x,
|
|
e.y = i.y,
|
|
this.step.x != this.$wE.x && (this.position.x = this.step.x * t + this.$wE.x * (1 - t)),
|
|
this.step.y != this.$wE.y && (this.position.y = this.step.y * t + this.$wE.y * (1 - t)),
|
|
null != (e = this.$TE) && e.emit(t)
|
|
},
|
|
disablePhysics: function () {
|
|
return this.physicsEnabled = !1,
|
|
this
|
|
},
|
|
disableCollisions: function () {
|
|
return this.collisionsEnabled = !1,
|
|
this
|
|
},
|
|
enableCollisions: function () {
|
|
return this.collisionsEnabled = !0,
|
|
this
|
|
},
|
|
reportCollision: function (t) {
|
|
if (null != this.owner && null != t.other.owner) {
|
|
if (this.filterFlagsMethod == No.Exclusive) {
|
|
if (0 != (t.other.flags & this.filterFlags))
|
|
return
|
|
} else if (0 == (t.other.flags & this.filterFlags))
|
|
return;
|
|
var e;
|
|
if (this.$VE.push(t.other), -1 == this.$UE.indexOf(t.other))
|
|
if (this.$UE.push(t.other), -1 == this.$vE.indexOf(t.other))
|
|
this.$vE.push(t.other), null != (e = this.$sE) && e.emit(t);
|
|
null != (e = this.$sc) && e.emit(t)
|
|
}
|
|
},
|
|
$Tc: function () {
|
|
return null != this.$sc ? this.$sc : this.$sc = new sr
|
|
},
|
|
$ZE: function () {
|
|
return null != this.$sE ? this.$sE : this.$sE = new sr
|
|
},
|
|
pruneCurrentCollisions: function () {
|
|
for (var t = 0, e = this.$vE; t < e.length; ) {
|
|
var i = e[t];
|
|
if (++t, -1 == this.$VE.indexOf(i)) {
|
|
a.remove(this.$UE, i);
|
|
var n = this.$SE;
|
|
null != n && n.emit(i)
|
|
}
|
|
}
|
|
this.$vE = this.$UE.slice(),
|
|
this.$VE = []
|
|
},
|
|
dispose: function () {
|
|
this.$xE || (null != this.engine && this.engine.remove(this), this.$xE = !0, f.prototype.dispose.call(this))
|
|
},
|
|
get_name: function () {
|
|
return "$RE"
|
|
},
|
|
__class__: Fo
|
|
});
|
|
var No = r["temple.physics.core.FilterFlagsMethod"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["Inclusive", "Exclusive"],
|
|
Inclusive: {
|
|
_hx_index: 0,
|
|
__enum__: "temple.physics.core.FilterFlagsMethod",
|
|
toString: n
|
|
},
|
|
Exclusive: {
|
|
_hx_index: 1,
|
|
__enum__: "temple.physics.core.FilterFlagsMethod",
|
|
toString: n
|
|
}
|
|
},
|
|
Bo = function () {};
|
|
Bo.__name__ = !0,
|
|
Bo.prototype = {
|
|
set: function (t, e, i, n, r) {
|
|
return this.other = e,
|
|
this.current = t,
|
|
this.type = i,
|
|
this.currentShape = n,
|
|
this.otherShape = r,
|
|
this
|
|
},
|
|
__class__: Bo
|
|
};
|
|
var Uo = r["temple.physics.core.CollisionType"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["BoxToBox", "LineToBox"],
|
|
BoxToBox: (i = function (t, e, i, r) {
|
|
return {
|
|
_hx_index: 0,
|
|
currentSides: t,
|
|
currentBounds: e,
|
|
otherSides: i,
|
|
otherBounds: r,
|
|
__enum__: "temple.physics.core.CollisionType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["currentSides", "currentBounds", "otherSides", "otherBounds"], i),
|
|
LineToBox: (i = function (t, e, i) {
|
|
return {
|
|
_hx_index: 1,
|
|
contactPoints: t,
|
|
line: e,
|
|
boxBounds: i,
|
|
__enum__: "temple.physics.core.CollisionType",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["contactPoints", "line", "boxBounds"], i)
|
|
},
|
|
Xo = function () {};
|
|
Xo.__name__ = !0,
|
|
Xo.report = function (t, e) {
|
|
Xo.reportCollision(t.shape, t, e.shape, e)
|
|
},
|
|
Xo.reportCollision = function (t, e, i, n) {
|
|
switch (t._hx_index) {
|
|
case 0:
|
|
var r = t.bounds;
|
|
switch (i._hx_index) {
|
|
case 0:
|
|
var o = i.bounds,
|
|
s = Xo.getBoxToBox(e, r, n, o);
|
|
if (0 != s.length) {
|
|
var a = Xo.getBoxToBox(n, o, e, r);
|
|
e.reportCollision(Xo.collision.set(e, n, Uo.BoxToBox(s, r, a, o), t, i)),
|
|
n.reportCollision(Xo.collision.set(n, e, Uo.BoxToBox(a, o, s, r), i, t))
|
|
}
|
|
break;
|
|
case 1:
|
|
o = i.line;
|
|
(h = Xo.lineToBox(n, o, e, r)).length > 0 && (e.reportCollision(Xo.collision.set(e, n, Uo.LineToBox(h, o, r), t, i)), n.reportCollision(Xo.collision.set(n, e, Uo.LineToBox(h, o, r), i, t)));
|
|
break;
|
|
case 2:
|
|
for (r = i.shapes, o = 0; o < r.length; )
|
|
Xo.reportCollision(t, e, r[o++], n)
|
|
}
|
|
break;
|
|
case 1:
|
|
r = t.line;
|
|
switch (i._hx_index) {
|
|
case 0:
|
|
var h;
|
|
o = i.bounds;
|
|
(h = Xo.lineToBox(e, r, n, o)).length > 0 && (e.reportCollision(Xo.collision.set(e, n, Uo.LineToBox(h, r, o), t, i)), n.reportCollision(Xo.collision.set(n, e, Uo.LineToBox(h, r, o), i, t)));
|
|
break;
|
|
case 1:
|
|
break;
|
|
case 2:
|
|
for (r = i.shapes, o = 0; o < r.length; )
|
|
Xo.reportCollision(t, e, r[o++], n)
|
|
}
|
|
break;
|
|
case 2:
|
|
for (r = t.shapes, o = 0; o < r.length; )
|
|
Xo.reportCollision(r[o++], e, i, n)
|
|
}
|
|
},
|
|
Xo.getBoxToBox = function (t, e, i, n) {
|
|
var r = t.position.x + e.x,
|
|
o = t.position.y + e.y,
|
|
s = e.width,
|
|
a = e.height,
|
|
h = i.position.x + n.x,
|
|
l = i.position.y + n.y,
|
|
u = n.width,
|
|
c = n.height,
|
|
p = [];
|
|
return l > o - c && l < o + a && r - h < u && r - h > 0 && p.push(1),
|
|
l > o - c && l < o + a && h > r + s - u && h < r + s && p.push(4),
|
|
h > r - u && h < r + s && o - l < c && o - l > 0 && p.push(2),
|
|
h > r - u && h < r + s && l > o + a - c && l < o + a && p.push(8),
|
|
0 == p.length && (l > o - c && l < o + a && r - h <= 0 && r - h > -s / 2 + u / 2 && p.push(1), l > o - c && l < o + a && r - h < -s / 2 + u / 2 && r - h >= -s + u && p.push(4), h > r - u && h < r + s && o - l <= c / 2 && o - l > -a / 2 + c / 2 && p.push(2), h > r - u && h < r + s && o - l < -a / 2 + c / 2 && o - l >= -a + c && p.push(8)),
|
|
p
|
|
},
|
|
Xo.lineToBox = function (t, e, i, n) {
|
|
var r = [],
|
|
o = e.point1,
|
|
s = e.point2,
|
|
a = new Eo({
|
|
x: o.x,
|
|
y: o.y
|
|
}, {
|
|
x: s.x,
|
|
y: s.y
|
|
});
|
|
a.point1.x += t.step.x,
|
|
a.point1.y += t.step.y,
|
|
a.point2.x += t.step.x,
|
|
a.point2.y += t.step.y;
|
|
var h = new Eo;
|
|
h.point1.x = i.step.x - n.left,
|
|
h.point1.y = i.step.y - n.top,
|
|
h.point2.x = i.step.x + n.right,
|
|
h.point2.y = i.step.y - n.top;
|
|
var l = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
Kn.lineSegmentIntersection(h.point1, h.point2, a.point1, a.point2, l) && r.push(l),
|
|
h.point1.x = i.step.x + n.right,
|
|
h.point1.y = i.step.y - n.top,
|
|
h.point2.x = i.step.x + n.right,
|
|
h.point2.y = i.step.y + n.bottom;
|
|
l = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
Kn.lineSegmentIntersection(h.point1, h.point2, a.point1, a.point2, l) && r.push(l),
|
|
h.point1.x = i.step.x - n.left,
|
|
h.point1.y = i.step.y + n.bottom,
|
|
h.point2.x = i.step.x + n.right,
|
|
h.point2.y = i.step.y + n.bottom;
|
|
l = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
Kn.lineSegmentIntersection(h.point1, h.point2, a.point1, a.point2, l) && r.push(l),
|
|
h.point1.x = i.step.x - n.left,
|
|
h.point1.y = i.step.y - n.top,
|
|
h.point2.x = i.step.x - n.left,
|
|
h.point2.y = i.step.y + n.bottom;
|
|
l = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
return Kn.lineSegmentIntersection(h.point1, h.point2, a.point1, a.point2, l) && r.push(l),
|
|
r
|
|
};
|
|
var jo = r["temple.physics.core.Shape"] = {
|
|
__ename__: !0,
|
|
__constructs__: ["BoxShape", "LineShape", "Group"],
|
|
BoxShape: (i = function (t) {
|
|
return {
|
|
_hx_index: 0,
|
|
bounds: t,
|
|
__enum__: "temple.physics.core.Shape",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["bounds"], i),
|
|
LineShape: (i = function (t) {
|
|
return {
|
|
_hx_index: 1,
|
|
line: t,
|
|
__enum__: "temple.physics.core.Shape",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["line"], i),
|
|
Group: (i = function (t) {
|
|
return {
|
|
_hx_index: 2,
|
|
shapes: t,
|
|
__enum__: "temple.physics.core.Shape",
|
|
toString: n
|
|
}
|
|
}, i.__params__ = ["shapes"], i)
|
|
},
|
|
Vo = function (t) {
|
|
this._currentLoadList = [],
|
|
this._loadedList = [],
|
|
this.progress = 0,
|
|
this.isLoading = !1,
|
|
this.isCompleted = !1,
|
|
this.sounds = new Br,
|
|
this.sources = t,
|
|
this._toLoadList = this.sources.slice()
|
|
};
|
|
Vo.__name__ = !0,
|
|
Vo.prototype = {
|
|
load: function (t) {
|
|
if (null == t && (t = 1), 0 == this._toLoadList.length)
|
|
return this.isCompleted = !0, this.isLoading = !1, void this.onComplete();
|
|
for (var e = 0, i = this._toLoadList.length, n = t < i ? t : i; e < n; )
|
|
++e, this.loadNext();
|
|
this.isLoading = !0,
|
|
this.isCompleted = !1
|
|
},
|
|
loadNext: function () {
|
|
var t = this;
|
|
if (this.isLoading = !0, !this.isCompleted && this._toLoadList.length > 0) {
|
|
for (var e = this._toLoadList.pop(), i = new Array(e.length), n = 0, r = e.length; n < r; ) {
|
|
var o = n++;
|
|
i[o] = Un.assets.baseUrl + e[o]
|
|
}
|
|
var s = new Howl({
|
|
src: i,
|
|
autoplay: !1,
|
|
preload: !1
|
|
});
|
|
this.sounds.set(e, s),
|
|
s.once("load", (function () {
|
|
a.remove(t._currentLoadList, s),
|
|
t._loadedList.push(e),
|
|
t.progress = t._loadedList.length / t.sources.length,
|
|
t.onProgress(t.progress),
|
|
t.loadNext()
|
|
})),
|
|
this._currentLoadList.push(s),
|
|
s.load()
|
|
} else
|
|
this.isCompleted || this._loadedList.length != this.sources.length || (this.isCompleted = !0, this.isLoading = !1, this.onComplete())
|
|
},
|
|
onComplete: function () {},
|
|
onProgress: function (t) {},
|
|
__class__: Vo
|
|
};
|
|
var Ho = function (t) {
|
|
this._disposer = new Pn,
|
|
this.sounds = null != t ? t : new Br,
|
|
this.muted = new Ln(!1),
|
|
this._disposer.add(this.muted.watch(cs(this, this.onMuteChanged)))
|
|
};
|
|
Ho.__name__ = !0,
|
|
Ho.__interfaces__ = [d],
|
|
Ho.prototype = {
|
|
registerSounds: function (t) {
|
|
for (var e = t.keys(); e.hasNext(); ) {
|
|
var i = e.next();
|
|
this.sounds.set(i, t.h[i.__id__])
|
|
}
|
|
},
|
|
loop: function (t, e) {
|
|
if (null == e && (e = 1), Ho.SOUND_SUPPORTED) {
|
|
var i = this.sounds.h[t.__id__],
|
|
n = i.play();
|
|
return i.volume(e, n),
|
|
i.loop(!0, n),
|
|
new Go(i, n)
|
|
}
|
|
return null
|
|
},
|
|
play: function (t, e) {
|
|
if (null == e && (e = 1), Ho.SOUND_SUPPORTED) {
|
|
var i = this.sounds.h[t.__id__],
|
|
n = i.play();
|
|
return i.volume(e, n),
|
|
i.loop(!1, n),
|
|
new Go(i, n)
|
|
}
|
|
return null
|
|
},
|
|
onMuteChanged: function (t, e) {
|
|
Howler.mute(t)
|
|
},
|
|
dispose: function () {
|
|
var t = this._disposer;
|
|
null != t && t.dispose(),
|
|
this._disposer = null,
|
|
Howler.unload()
|
|
},
|
|
__class__: Ho
|
|
};
|
|
var Go = t.temple.sound.SoundPlayback = function (t, e) {
|
|
this.howl = t,
|
|
this.id = e
|
|
};
|
|
Go.__name__ = !0,
|
|
Go.__interfaces__ = [d],
|
|
Go.prototype = {
|
|
play: function () {
|
|
return this.howl.play(this.id),
|
|
this
|
|
},
|
|
pause: function () {
|
|
return this.howl.pause(this.id),
|
|
this
|
|
},
|
|
stop: function () {
|
|
return this.howl.stop(this.id),
|
|
this
|
|
},
|
|
mute: function (t) {
|
|
return null == t && (t = !0),
|
|
this.howl.mute(t, this.id),
|
|
this
|
|
},
|
|
set_volume: function (t) {
|
|
return this.howl.volume(t, this.id),
|
|
t
|
|
},
|
|
setStereo: function (t) {
|
|
return this.howl.stereo(t, this.id),
|
|
this
|
|
},
|
|
fade: function (t, e, i) {
|
|
return this.howl.fade(t, e, Math.round(1e3 * i), this.id),
|
|
this
|
|
},
|
|
fadeTo: function (t, e) {
|
|
return this.howl.fade(this.howl.volume(this.id), t, Math.round(1e3 * e), this.id),
|
|
this
|
|
},
|
|
fadeFrom: function (t, e) {
|
|
return this.howl.fade(t, this.howl.volume(this.id), Math.round(1e3 * e), this.id),
|
|
this
|
|
},
|
|
on: function (t, e) {
|
|
return this.howl.on(t, e, this.id),
|
|
this
|
|
},
|
|
off: function (t, e) {
|
|
return this.howl.off(t, e, this.id),
|
|
this
|
|
},
|
|
once: function (t, e) {
|
|
return this.howl.once(t, e, this.id),
|
|
this
|
|
},
|
|
get_volume: function () {
|
|
return this.howl.volume(this.id)
|
|
},
|
|
get_stereo: function () {
|
|
return this.howl.stereo(this.id)
|
|
},
|
|
get_isLooping: function () {
|
|
return this.howl.loop(this.id)
|
|
},
|
|
get_isPlaying: function () {
|
|
return this.howl.playing(this.id)
|
|
},
|
|
get_duration: function () {
|
|
return this.howl.duration()
|
|
},
|
|
get_position: function () {
|
|
return this.howl.seek(this.id)
|
|
},
|
|
set_position: function (t) {
|
|
return this.howl.seek(Math.round(t), this.id),
|
|
t
|
|
},
|
|
dispose: function () {
|
|
this.howl.stop(this.id)
|
|
},
|
|
__class__: Go
|
|
};
|
|
var Yo = function (t, e, i, n) {
|
|
null == n && (n = .016666666666666666),
|
|
this._currentValue = 0,
|
|
this._elapsed = 0,
|
|
this.base = t,
|
|
this.strength = e,
|
|
this.duration = i,
|
|
this.interval = n,
|
|
this._cooldown = 0
|
|
};
|
|
Yo.__name__ = !0,
|
|
Yo.__interfaces__ = [Hn],
|
|
Yo.prototype = {
|
|
update: function (t) {
|
|
if (this._elapsed += t, this._elapsed >= this.duration)
|
|
return this.base;
|
|
var e;
|
|
if (null != this._cooldown) {
|
|
e = (this._cooldown -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
if (e) {
|
|
var i = (this.duration - this._elapsed) / this.duration * this.strength;
|
|
this._currentValue = this.base + 2 * Math.random() * i - i,
|
|
this._cooldown = this.interval
|
|
}
|
|
return this._currentValue
|
|
},
|
|
isComplete: function () {
|
|
return this._elapsed >= this.duration
|
|
},
|
|
__class__: Yo
|
|
};
|
|
var Wo = function (t, e, i, n) {
|
|
null == n && (n = 1),
|
|
null == i && (i = 0),
|
|
null == e && (e = 0),
|
|
null == t && (t = 0),
|
|
this.setRgba(t, e, i, n)
|
|
};
|
|
Wo.__name__ = !0,
|
|
Wo.prototype = {
|
|
setRgba: function (t, e, i, n) {
|
|
return null == n && (n = 1),
|
|
null == i && (i = 0),
|
|
null == e && (e = 0),
|
|
null == t && (t = 0),
|
|
this._value = Math.round(255 * t) << 16 | Math.round(255 * e) << 8 | Math.round(255 * i),
|
|
this.a = n,
|
|
this
|
|
},
|
|
__class__: Wo
|
|
};
|
|
var zo = function () {};
|
|
zo.__name__ = !0;
|
|
var qo = function () {};
|
|
qo.__name__ = !0,
|
|
qo.__isInterface__ = !0;
|
|
var Jo = function (t, e, i, n) {
|
|
this.array = t,
|
|
this.index = e,
|
|
this.end = i,
|
|
this.step = n
|
|
};
|
|
Jo.__name__ = !0,
|
|
Jo.__interfaces__ = [qo],
|
|
Jo.prototype = {
|
|
hasNext: function () {
|
|
return this.index >= this.end
|
|
},
|
|
next: function () {
|
|
return new Ko(this.index, this.array[(this.index -= this.step) + this.step], this.index >= this.end, this.step)
|
|
},
|
|
__class__: Jo
|
|
};
|
|
var Ko = function (t, e, i, n) {
|
|
this.index = t,
|
|
this.value = e,
|
|
this.hasNext = i,
|
|
this.step = n
|
|
};
|
|
Ko.__name__ = !0,
|
|
Ko.prototype = {
|
|
__class__: Ko
|
|
};
|
|
var Zo = function (t, e) {
|
|
this.index = 0,
|
|
this.array = t.slice(),
|
|
this.randomGenerator = null == e ? new ns : e,
|
|
this.random = new rs(this.randomGenerator)
|
|
};
|
|
Zo.__name__ = !0,
|
|
Zo.__interfaces__ = [qo],
|
|
Zo.prototype = {
|
|
next: function () {
|
|
if (this.array.length > 2 && 0 == this.index) {
|
|
var t = this.array,
|
|
e = t[t.length - 1];
|
|
if (ls.shuffle(this.array, this.randomGenerator), this.array[0] == e) {
|
|
var i = this.array.shift(),
|
|
n = this.array,
|
|
r = this.random.intRange(1, this.array.length);
|
|
n.splice(r, 0, i)
|
|
}
|
|
}
|
|
var o = this.array[this.index];
|
|
return this.index = (this.index + 1) % this.array.length,
|
|
o
|
|
},
|
|
__class__: Zo
|
|
};
|
|
var Qo = function () {};
|
|
Qo.__name__ = !0,
|
|
Qo.getLabels = function (t, e) {
|
|
for (var i = [], n = t.symbol, r = 0, o = n.layers; r < o.length; ) {
|
|
var s = o[r];
|
|
if (++r, null == e || c.startsWith(s.name, e)) {
|
|
for (var a = null, h = 0; h < s.keyframes.length; ) {
|
|
var l = s.keyframes[h];
|
|
if (null != l.label) {
|
|
var u = l.index / (n.frames - 1) * n.duration;
|
|
null != a && (a.endTime = u),
|
|
a = new es(l.label, s.name, u, 0),
|
|
i.push(a)
|
|
}
|
|
++h
|
|
}
|
|
null != a && (a.endTime = n.duration)
|
|
}
|
|
}
|
|
return new ts(i)
|
|
};
|
|
var ts = function (t) {
|
|
this.list = t
|
|
};
|
|
ts.__name__ = !0,
|
|
ts.prototype = {
|
|
getLabelInfoByName: function (t) {
|
|
for (var e = 0, i = this.list; e < i.length; ) {
|
|
var n = i[e];
|
|
if (++e, n.name == t)
|
|
return n
|
|
}
|
|
return null
|
|
},
|
|
hasLabel: function (t) {
|
|
return null != this.getLabelInfoByName(t)
|
|
},
|
|
isAtLabel: function (t, e) {
|
|
var i = this.getLabelInfoByName(e);
|
|
return null != i && t.$jc >= i.startTime && t.$jc <= i.endTime
|
|
},
|
|
__class__: ts
|
|
};
|
|
var es = function (t, e, i, n) {
|
|
this.name = t,
|
|
this.layerName = e,
|
|
this.startTime = i,
|
|
this.endTime = n
|
|
};
|
|
es.__name__ = !0,
|
|
es.prototype = {
|
|
__class__: es
|
|
};
|
|
var is = function () {};
|
|
is.__name__ = !0,
|
|
is.__isInterface__ = !0,
|
|
is.prototype = {
|
|
__class__: is
|
|
};
|
|
var ns = function () {};
|
|
ns.__name__ = !0,
|
|
ns.__interfaces__ = [is],
|
|
ns.prototype = {
|
|
next: function () {
|
|
return Math.random()
|
|
},
|
|
__class__: ns
|
|
};
|
|
var rs = function (t) {
|
|
this._random = t
|
|
};
|
|
rs.__name__ = !0,
|
|
rs.__interfaces__ = [is],
|
|
rs.prototype = {
|
|
range: function (t, e) {
|
|
if (t > e) {
|
|
var i = e;
|
|
e = t,
|
|
t = i
|
|
}
|
|
return t + this._random.next() * (e - t)
|
|
},
|
|
to: function (t) {
|
|
return this._random.next() * t
|
|
},
|
|
intRange: function (t, e) {
|
|
return t + (this._random.next() * (e - t + 1) | 0)
|
|
},
|
|
fromArray: function (t, e) {
|
|
return null == e && (e = !1),
|
|
ls.randomElement(t, this, e)
|
|
},
|
|
next: function () {
|
|
return this._random.next()
|
|
},
|
|
__class__: rs
|
|
};
|
|
var os = function (t, e) {
|
|
this._accumulator = 0,
|
|
this.alpha = 0,
|
|
this._callback = t,
|
|
this._fixedTimestep = e
|
|
};
|
|
os.__name__ = !0,
|
|
os.__interfaces__ = [d],
|
|
os.prototype = {
|
|
update: function (t) {
|
|
for (this._accumulator += t; this._accumulator >= this._fixedTimestep; )
|
|
null != this._callback && this._callback(this._fixedTimestep), this._accumulator -= this._fixedTimestep;
|
|
this.alpha = this._accumulator / this._fixedTimestep
|
|
},
|
|
set_fixedTimestep: function (t) {
|
|
return this._fixedTimestep = t,
|
|
this._accumulator %= this._fixedTimestep,
|
|
this._fixedTimestep
|
|
},
|
|
dispose: function () {
|
|
this._callback = null
|
|
},
|
|
__class__: os
|
|
};
|
|
var ss = function (t, e) {
|
|
null == t && (t = 1),
|
|
this.$jF = !1,
|
|
f.call(this),
|
|
this.$JF = t,
|
|
this.$MD = e,
|
|
this.$jF = t <= 1
|
|
};
|
|
ss.__name__ = !0,
|
|
ss.create = function (t, e, i, n) {
|
|
null == n && (n = !0),
|
|
null == e && (e = 1);
|
|
var r = (new On).addComponent(new ss(e, i));
|
|
return t.addEntity(r, n),
|
|
r
|
|
},
|
|
ss.__super__ = f,
|
|
ss.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
this.$jF ? (null != this.$MD && this.$MD(), this.dispose()) : (this.$JF--, this.$jF = this.$JF <= 1)
|
|
},
|
|
dispose: function () {
|
|
this.$MD = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$IF"
|
|
},
|
|
__class__: ss
|
|
});
|
|
var as = function (t) {
|
|
null == t && (t = -1),
|
|
this.lastCooldown = -1,
|
|
this.time = 0,
|
|
this.isEnabled = !1,
|
|
this.reset(t)
|
|
};
|
|
as.__name__ = !0,
|
|
as.prototype = {
|
|
reset: function (t) {
|
|
null == t ? this.time = this.lastCooldown : (this.time = t, this.lastCooldown = t),
|
|
this.time > 0 && (this.isEnabled = !0)
|
|
},
|
|
update: function (t) {
|
|
if (this.isEnabled) {
|
|
return (this.time -= t) <= 0
|
|
}
|
|
return !1
|
|
},
|
|
__class__: as
|
|
};
|
|
var hs = function (t, e, i) {
|
|
this.$NA = null,
|
|
f.call(this),
|
|
this.$mD = e,
|
|
this.$LD = t,
|
|
this.$MD = i,
|
|
this.$NA = t
|
|
};
|
|
hs.__name__ = !0,
|
|
hs.create = function (t, e, i, n, r) {
|
|
null == r && (r = !0),
|
|
null == i && (i = -1),
|
|
null == e && (e = .1);
|
|
var o = (new On).addComponent(new hs(e, i, n));
|
|
return t.addEntity(o, r),
|
|
o
|
|
},
|
|
hs.__super__ = f,
|
|
hs.prototype = o(f.prototype, {
|
|
onUpdate: function (t) {
|
|
var e;
|
|
if (null != this.$NA) {
|
|
e = (this.$NA -= t) <= 0
|
|
} else
|
|
e = !1;
|
|
e && (0 != this.$mD-- ? (this.$NA = this.$LD, this.$MD()) : this.owner.dispose())
|
|
},
|
|
dispose: function () {
|
|
this.$MD = null,
|
|
f.prototype.dispose.call(this)
|
|
},
|
|
get_name: function () {
|
|
return "$lD"
|
|
},
|
|
__class__: hs
|
|
});
|
|
var ls = function () {};
|
|
ls.__name__ = !0,
|
|
ls.randomElement = function (t, e, i) {
|
|
if (null == i && (i = !1), null == e && (e = rs.native), null != t && t.length > 0) {
|
|
var n = e.next() * t.length | 0,
|
|
r = t[n];
|
|
return i && t.splice(n, 1),
|
|
r
|
|
}
|
|
return null
|
|
},
|
|
ls.shuffle = function (t, e) {
|
|
for (var i, n, r = t.length; r > 0; )
|
|
n = Math.floor(e.next() * r--), i = t[r], t[r] = t[n], t[n] = i;
|
|
return t
|
|
};
|
|
var us = function () {};
|
|
function cs(t, i) {
|
|
return null == i ? null : (null == i.__id__ && (i.__id__ = e.$haxeUID++), null == t.hx__closures__ ? t.hx__closures__ = {}
|
|
: n = t.hx__closures__[i.__id__], null == n && (n = i.bind(t), t.hx__closures__[i.__id__] = n), n);
|
|
var n
|
|
}
|
|
us.__name__ = !0,
|
|
us.depthSort = function (t, e, i) {
|
|
for (var n = [], r = null, o = t.firstChild; null != o; ) {
|
|
var s = o[e];
|
|
null != s ? n.push(s) : (null == r && (r = []), r.push(o)),
|
|
o = o.next
|
|
}
|
|
n.sort(i),
|
|
t.firstChild = null;
|
|
var a = n.length;
|
|
for (null != r && (a += r.length); 0 != n.length; ) {
|
|
--a,
|
|
(h = n.pop().owner).layerIndex = a,
|
|
h.next = t.firstChild,
|
|
t.firstChild = h
|
|
}
|
|
if (null != r)
|
|
for (; 0 != r.length; ) {
|
|
var h;
|
|
--a,
|
|
(h = r.pop()).layerIndex = a,
|
|
h.next = t.firstChild,
|
|
t.firstChild = h
|
|
}
|
|
return t
|
|
},
|
|
e.$haxeUID |= 0,
|
|
"undefined" != typeof performance && "function" == typeof performance.now && (a.now = performance.now.bind(performance)),
|
|
null == String.fromCodePoint && (String.fromCodePoint = function (t) {
|
|
return t < 65536 ? String.fromCharCode(t) : String.fromCharCode(55232 + (t >> 10)) + String.fromCharCode(56320 + (1023 & t))
|
|
}),
|
|
String.prototype.__class__ = String,
|
|
String.__name__ = !0,
|
|
Array.__name__ = !0,
|
|
Date.prototype.__class__ = Date,
|
|
Date.__name__ = "Date";
|
|
var ps = {},
|
|
ds = {},
|
|
fs = Number,
|
|
_s = Boolean,
|
|
ms = {},
|
|
ys = {};
|
|
Br.count = 0,
|
|
Vr.__toStr = {}
|
|
.toString,
|
|
g.current = 1,
|
|
x.scaleByLibraryName = new Ur,
|
|
x._libraryByName = new Ur,
|
|
S.files = new b,
|
|
S.sounds = new A,
|
|
S.animationLibraries = new w,
|
|
S.animations = x,
|
|
S.fonts = new E,
|
|
S.scenes = new $,
|
|
W.explosions = [S.sounds.game1.EXPLOSION1_VAR1, S.sounds.game1.EXPLOSION1_VAR2],
|
|
K.SMALL_EXPLOSION_SYMBOLS = ["explosion_medium", "explosion_medium_02"],
|
|
ot._spawnIntervalRange = new rt(1, 2.5),
|
|
ut.shootPatterns = [[.2, .2, .2, .2, 3], [.2, .2, .2, 2.5], [.2, .2, 2]],
|
|
pt.rocketLauncherPatterns = [[.5333333333333333]],
|
|
pt.gunPatterns = [[3, .2, .2, .2, 2]],
|
|
xt._spawnIntervalRange = new rt(.3, 1),
|
|
Pt.bulletSpeed = new rt(350, 400),
|
|
qt.projectileSounds = [S.sounds.game2.SHOOT_A_VAR1, S.sounds.game2.SHOOT_B_VAR1, S.sounds.game2.SHOOT_B_VAR2],
|
|
ye.$Ua = 800,
|
|
Ze._NAME_IDLE = "player_idle",
|
|
Ze._NAME_MOVE = "player_move",
|
|
li.$Uc = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
_i.Left = new _i(-1, 0),
|
|
_i.Right = new _i(1, 0),
|
|
_i.Up = new _i(0, -1),
|
|
_i.Down = new _i(0, 1),
|
|
ji.$Uc = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
Vi.$Uc = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
Zi.$l = ["intro", "intro1", "intro1_loop", "intro1_outro", "intro2", "intro2_loop", "intro2_outro", "intro3", "intro3_loop", "intro3_outro", "intro4", "intro4_loop", "intro4_outro", "loop", "outro", "outro_loop"],
|
|
cn.$ue = 250,
|
|
Dn._tagPrefix = "",
|
|
Fn.DISPATCHING_SENTINEL = new kn(null, null),
|
|
Un.url = new Bn(e.location.href.toString()),
|
|
Un.hidden = new Ln(!1),
|
|
Vn.POOL = new jn(Vn.allocate),
|
|
Gn.PIhalf = Math.PI / 2,
|
|
Kn.HALF_PI = .5 * Math.PI,
|
|
Qn._sharedEvent = new Jn,
|
|
ar.VENDOR_PREFIXES = ["webkit", "moz", "ms", "o", "khtml"],
|
|
ar.SHOULD_HIDE_MOBILE_BROWSER = !!PIXI.utils.isMobile.apple.device && !ar.isIframe(),
|
|
Rr.pending = [],
|
|
Rr.threadCount = 0,
|
|
fo.NUM_PRELOADER_STEPS = 0,
|
|
xo.FONT_EXTENSIONS = ["woff2", "woff", "ttf", "otf", "eot", "svg"],
|
|
Io._operators = [Co.Add, Co.Substract, Co.Multiply, Co.Divide],
|
|
Io._operatorLookup = "+-*/",
|
|
Ro.enabled = !0,
|
|
Lo.$Uc = {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
Fo.gravity = .994,
|
|
Xo.collision = new Bo,
|
|
Ho.SOUND_SUPPORTED = !0,
|
|
zo.util = PIXI.utils.isMobile,
|
|
rs.native = new rs(new ns),
|
|
m.main(),
|
|
Rr.run()
|
|
}
|
|
("undefined" != typeof exports ? exports : "undefined" != typeof window ? window : "undefined" != typeof self ? self : this, "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this); |