Commit 6fd2ea06 authored by rockyl's avatar rockyl

提交一波

parent 5753aeeb
...@@ -30,6 +30,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -30,6 +30,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
HashObject._object_id = 0; HashObject._object_id = 0;
return HashObject; return HashObject;
}()); }());
//# sourceMappingURL=HashObject.js.map
var Event = (function (_super) { var Event = (function (_super) {
tslib_1.__extends(Event, _super); tslib_1.__extends(Event, _super);
...@@ -90,6 +91,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -90,6 +91,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Event.UPDATE_DATA = "UPDATE_DATA"; Event.UPDATE_DATA = "UPDATE_DATA";
return Event; return Event;
}(HashObject)); }(HashObject));
//# sourceMappingURL=Event.js.map
var EventDispatcher = (function (_super) { var EventDispatcher = (function (_super) {
tslib_1.__extends(EventDispatcher, _super); tslib_1.__extends(EventDispatcher, _super);
...@@ -293,6 +295,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -293,6 +295,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return EE; return EE;
}()); }());
//# sourceMappingURL=EventDispatcher.js.map
var ObservablePoint = (function (_super) { var ObservablePoint = (function (_super) {
tslib_1.__extends(ObservablePoint, _super); tslib_1.__extends(ObservablePoint, _super);
...@@ -356,6 +359,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -356,6 +359,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return ObservablePoint; return ObservablePoint;
}(HashObject)); }(HashObject));
//# sourceMappingURL=ObservablePoint.js.map
var Point = (function (_super) { var Point = (function (_super) {
tslib_1.__extends(Point, _super); tslib_1.__extends(Point, _super);
...@@ -392,6 +396,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -392,6 +396,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Point; return Point;
}(HashObject)); }(HashObject));
//# sourceMappingURL=Point.js.map
var VERSION = "1.0"; var VERSION = "1.0";
var devicePixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1; var devicePixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1;
...@@ -554,6 +559,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -554,6 +559,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
SCROLL_DIRECTION["HORIZONTAL"] = "horizontal"; SCROLL_DIRECTION["HORIZONTAL"] = "horizontal";
SCROLL_DIRECTION["VERTICAL"] = "vertical"; SCROLL_DIRECTION["VERTICAL"] = "vertical";
})(exports.SCROLL_DIRECTION || (exports.SCROLL_DIRECTION = {})); })(exports.SCROLL_DIRECTION || (exports.SCROLL_DIRECTION = {}));
//# sourceMappingURL=const.js.map
var Matrix = (function (_super) { var Matrix = (function (_super) {
tslib_1.__extends(Matrix, _super); tslib_1.__extends(Matrix, _super);
...@@ -824,6 +830,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -824,6 +830,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Matrix; return Matrix;
}(HashObject)); }(HashObject));
//# sourceMappingURL=Matrix.js.map
var Transform = (function (_super) { var Transform = (function (_super) {
tslib_1.__extends(Transform, _super); tslib_1.__extends(Transform, _super);
...@@ -931,6 +938,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -931,6 +938,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Transform; return Transform;
}(HashObject)); }(HashObject));
//# sourceMappingURL=Transform.js.map
var Rectangle = (function (_super) { var Rectangle = (function (_super) {
tslib_1.__extends(Rectangle, _super); tslib_1.__extends(Rectangle, _super);
...@@ -1132,6 +1140,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1132,6 +1140,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Rectangle; return Rectangle;
}(HashObject)); }(HashObject));
//# sourceMappingURL=Rectangle.js.map
var DisplayObject = (function (_super) { var DisplayObject = (function (_super) {
tslib_1.__extends(DisplayObject, _super); tslib_1.__extends(DisplayObject, _super);
...@@ -1261,6 +1270,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1261,6 +1270,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var bounds = this.getBounds(false, rect); var bounds = this.getBounds(false, rect);
this.parent = parentRef; this.parent = parentRef;
this.transform = transformRef; this.transform = transformRef;
if (this.parent && this.stage) {
this.updateTransform();
}
return bounds; return bounds;
}; };
DisplayObject.prototype.calculateBounds = function () { DisplayObject.prototype.calculateBounds = function () {
...@@ -1551,6 +1563,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1551,6 +1563,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}(EventDispatcher)); }(EventDispatcher));
DisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform; DisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;
DisplayObject.prototype.displayObjectHitTestPoint = DisplayObject.prototype.hitTestPoint; DisplayObject.prototype.displayObjectHitTestPoint = DisplayObject.prototype.hitTestPoint;
//# sourceMappingURL=DisplayObject.js.map
var GDispatcher = (function () { var GDispatcher = (function () {
function GDispatcher() { function GDispatcher() {
...@@ -1598,6 +1611,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1598,6 +1611,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
GDispatcher.thisObjPool = {}; GDispatcher.thisObjPool = {};
return GDispatcher; return GDispatcher;
}()); }());
//# sourceMappingURL=GDispatcher.js.map
var MouseEvent = (function (_super) { var MouseEvent = (function (_super) {
tslib_1.__extends(MouseEvent, _super); tslib_1.__extends(MouseEvent, _super);
...@@ -1630,6 +1644,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1630,6 +1644,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
MouseEvent.MOUSE_OUT = "onMouseOut"; MouseEvent.MOUSE_OUT = "onMouseOut";
return MouseEvent; return MouseEvent;
}(Event)); }(Event));
//# sourceMappingURL=MouseEvent.js.map
function applyAutoAdjust(ctor) { function applyAutoAdjust(ctor) {
ctor.prototype.applyAutoAdjust = function () { ctor.prototype.applyAutoAdjust = function () {
...@@ -1759,6 +1774,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1759,6 +1774,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function t(v) { function t(v) {
return !isNaN(v) && v !== null && v !== undefined; return !isNaN(v) && v !== null && v !== undefined;
} }
//# sourceMappingURL=auto-adjust.js.map
var ESCAPE_REG_EXP = /\$\{[\u4e00-\u9fa5_a-zA-Z0-9\|]+\}/g; var ESCAPE_REG_EXP = /\$\{[\u4e00-\u9fa5_a-zA-Z0-9\|]+\}/g;
var linkedFlag = '$_linked_$'; var linkedFlag = '$_linked_$';
...@@ -1776,7 +1792,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1776,7 +1792,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
function objClone(obj) { function objClone(obj) {
return JSON.parse(JSON.stringify(obj)); return obj ? JSON.parse(JSON.stringify(obj)) : obj;
} }
var percentKeys = ['width', 'height']; var percentKeys = ['width', 'height'];
function propertyParse(key, node, properties) { function propertyParse(key, node, properties) {
...@@ -2013,6 +2029,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2013,6 +2029,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
//# sourceMappingURL=utils.js.map
function transPoint(str, sep) { function transPoint(str, sep) {
if (sep === void 0) { sep = ','; } if (sep === void 0) { sep = ','; }
...@@ -2024,6 +2041,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2024,6 +2041,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
} }
} }
//# sourceMappingURL=math.js.map
var rotateLeft = function (lValue, iShiftBits) { var rotateLeft = function (lValue, iShiftBits) {
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
...@@ -2215,6 +2233,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2215,6 +2233,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d); var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
return tempValue.toLowerCase(); return tempValue.toLowerCase();
} }
//# sourceMappingURL=md5.js.map
var ObjectPool = (function () { var ObjectPool = (function () {
function ObjectPool() { function ObjectPool() {
...@@ -2278,6 +2297,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2278,6 +2297,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
ObjectPool.pools = {}; ObjectPool.pools = {};
return ObjectPool; return ObjectPool;
}()); }());
//# sourceMappingURL=ObjectPool.js.map
var scriptDefs = {}; var scriptDefs = {};
function applyScript(ctor) { function applyScript(ctor) {
...@@ -2420,6 +2440,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2420,6 +2440,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return ScriptsProxy; return ScriptsProxy;
}()); }());
//# sourceMappingURL=scripts.js.map
var DataCenter = (function (_super) { var DataCenter = (function (_super) {
tslib_1.__extends(DataCenter, _super); tslib_1.__extends(DataCenter, _super);
...@@ -2548,6 +2569,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2548,6 +2569,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return DataCenter; return DataCenter;
}(EventDispatcher)); }(EventDispatcher));
var dataCenter = new DataCenter(); var dataCenter = new DataCenter();
//# sourceMappingURL=data-center.js.map
var env = {}; var env = {};
function injectEnv(data) { function injectEnv(data) {
...@@ -2558,6 +2580,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2558,6 +2580,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
//# sourceMappingURL=enviroment.js.map
var storeKey = 'zlog-switch'; var storeKey = 'zlog-switch';
(function (Logs) { (function (Logs) {
...@@ -2575,6 +2598,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2575,6 +2598,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function getLogSwitch(id) { function getLogSwitch(id) {
return typeof store === 'object' ? store[id] : !!store; return typeof store === 'object' ? store[id] : !!store;
} }
//# sourceMappingURL=log-switch.js.map
var logConfig = getLogSwitch(exports.Logs.PROCESS); var logConfig = getLogSwitch(exports.Logs.PROCESS);
function logProcess(meta, vm, process) { function logProcess(meta, vm, process) {
...@@ -2641,10 +2665,11 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2641,10 +2665,11 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
Process.prototype.execute = function (args) { Process.prototype.execute = function (args) {
return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__awaiter(this, void 0, void 0, function () {
var metaConfig, meta, result, p, i, li, key, scriptResult, subProcessResult; var payload, metaConfig, meta, result, p, i, li, key, scriptResult, subProcessResult;
return tslib_1.__generator(this, function (_a) { return tslib_1.__generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: case 0:
payload = objClone(args);
metaConfig = this._config.meta; metaConfig = this._config.meta;
if (metaConfig) { if (metaConfig) {
this._meta = meta = this.getProcessMeta(metaConfig); this._meta = meta = this.getProcessMeta(metaConfig);
...@@ -2661,7 +2686,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2661,7 +2686,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
case 1: case 1:
if (!(i < li)) return [3, 5]; if (!(i < li)) return [3, 5];
key = meta.output[i]; key = meta.output[i];
p = this._executeNextProcess(key, args); p = this._executeNextProcess(key, payload);
if (!(i === li - 1)) return [3, 3]; if (!(i === li - 1)) return [3, 3];
return [4, p]; return [4, p];
case 2: case 2:
...@@ -2676,7 +2701,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2676,7 +2701,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
i++; i++;
return [3, 1]; return [3, 1];
case 5: return [3, 12]; case 5: return [3, 12];
case 6: return [4, this._executeMetaScript('', args, metaConfig)]; case 6: return [4, this._executeMetaScript('', payload, metaConfig)];
case 7: case 7:
scriptResult = _a.sent(); scriptResult = _a.sent();
subProcessResult = void 0; subProcessResult = void 0;
...@@ -2871,6 +2896,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2871,6 +2896,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function warpAsyncScript(source) { function warpAsyncScript(source) {
return "return new Promise(function(resolve, reject){\n\t" + source + "\n\t\n\tfunction next(type, payload){resolve({type: type, payload: payload})}\n\t});"; return "return new Promise(function(resolve, reject){\n\t" + source + "\n\t\n\tfunction next(type, payload){resolve({type: type, payload: payload})}\n\t});";
} }
//# sourceMappingURL=Process.js.map
var ID_INK = 0; var ID_INK = 0;
var VM = (function () { var VM = (function () {
...@@ -2933,6 +2959,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2933,6 +2959,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}); });
return VM; return VM;
}()); }());
//# sourceMappingURL=VM.js.map
var log = getLogSwitch(exports.Logs.PROCESS); var log = getLogSwitch(exports.Logs.PROCESS);
var processMetaLibs = []; var processMetaLibs = [];
...@@ -2972,11 +2999,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2972,11 +2999,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
.then(function (result) { .then(function (result) {
return result; return result;
}, function (e) { }, function (e) {
if (log) {
console.log("[" + vm.id + "] terminate:", e); console.log("[" + vm.id + "] terminate:", e);
}
}); });
} }
//# sourceMappingURL=index.js.map
var _a; var _a;
var eventsMapping = (_a = {}, var eventsMapping = (_a = {},
...@@ -3075,6 +3101,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3075,6 +3101,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return EventsProxy; return EventsProxy;
}(HashObject)); }(HashObject));
//# sourceMappingURL=events.js.map
function afterConstructor(ctor) { function afterConstructor(ctor) {
ctor.prototype.afterConstructor = function () { ctor.prototype.afterConstructor = function () {
...@@ -3083,6 +3110,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3083,6 +3110,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
this.applyEvents(); this.applyEvents();
}; };
} }
//# sourceMappingURL=after-constructor.js.map
var Container = (function (_super) { var Container = (function (_super) {
tslib_1.__extends(Container, _super); tslib_1.__extends(Container, _super);
...@@ -3375,24 +3403,27 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3375,24 +3403,27 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Rectangle.createFromRects(this._bounds, child._bounds); Rectangle.createFromRects(this._bounds, child._bounds);
} }
} }
};
Container.prototype._calculateBounds = function () {
var widthSetted = !!this._width && this._width !== 0; var widthSetted = !!this._width && this._width !== 0;
var heightSetted = !!this._height && this._height !== 0; var heightSetted = !!this._height && this._height !== 0;
if (widthSetted) { if (widthSetted || heightSetted) {
this._bounds.width = this._width; var rect = this._localBoundsSelf;
} var matrix = this.transform.worldMatrix;
if (heightSetted) { matrix.transformPoint(rect.x, rect.y, DisplayObject._p1);
this._bounds.height = this._height; matrix.transformPoint(rect.x + rect.width, rect.y, DisplayObject._p2);
matrix.transformPoint(rect.x + rect.width, rect.y + rect.height, DisplayObject._p3);
matrix.transformPoint(rect.x, rect.y + rect.height, DisplayObject._p4);
Rectangle.createFromPoints(this._bounds, DisplayObject._p1, DisplayObject._p2, DisplayObject._p3, DisplayObject._p4);
} }
}; };
Container.prototype._calculateBounds = function () {
};
Container.prototype.hitTestPoint = function (globalPoint, isMouseEvent) { Container.prototype.hitTestPoint = function (globalPoint, isMouseEvent) {
if (isMouseEvent === void 0) { isMouseEvent = false; } if (isMouseEvent === void 0) { isMouseEvent = false; }
if (!this.visible) if (!this.visible)
return null; return null;
var result = this.hitTestSelf(globalPoint); if (isMouseEvent && !this.mouseChildren) {
if (isMouseEvent && !this.mouseChildren) return this.hitTestSelf(globalPoint);
return result; }
var children = this.children; var children = this.children;
var length = children.length; var length = children.length;
var child, hitDisplayObject; var child, hitDisplayObject;
...@@ -3406,7 +3437,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3406,7 +3437,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (hitDisplayObject) if (hitDisplayObject)
return hitDisplayObject; return hitDisplayObject;
} }
return this.hitTestSelf(globalPoint); return this.displayObjectHitTestPoint(globalPoint, isMouseEvent);
}; };
Container.prototype.hitTestSelf = function (globalPoint) { Container.prototype.hitTestSelf = function (globalPoint) {
if (this.mouseEnabled) { if (this.mouseEnabled) {
...@@ -3415,8 +3446,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3415,8 +3446,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return null; return null;
}; };
Container.prototype.hitTestSelfBounds = function (globalPoint) { Container.prototype.hitTestSelfBounds = function (globalPoint) {
if (this.width && this.height) { if (this._width && this._height) {
var _a = this.getBounds(), tx = _a.x, ty = _a.y; var _a = this.worldMatrix, tx = _a.tx, ty = _a.ty;
var x = globalPoint.x, y = globalPoint.y; var x = globalPoint.x, y = globalPoint.y;
if (x > tx && if (x > tx &&
x < tx + this.width && x < tx + this.width &&
...@@ -3507,6 +3538,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3507,6 +3538,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
set: function (value) { set: function (value) {
if (this._width !== value) { if (this._width !== value) {
this._width = value; this._width = value;
this._localBoundsSelf.width = value;
this.dispatchEvent(Event.RESIZE); this.dispatchEvent(Event.RESIZE);
} }
}, },
...@@ -3520,6 +3552,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3520,6 +3552,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
set: function (value) { set: function (value) {
if (this._height !== value) { if (this._height !== value) {
this._height = value; this._height = value;
this._localBoundsSelf.height = value;
this.dispatchEvent(Event.RESIZE); this.dispatchEvent(Event.RESIZE);
} }
}, },
...@@ -3605,6 +3638,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3605,6 +3638,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return Container; return Container;
}(DisplayObject)); }(DisplayObject));
Container.prototype.containerUpdateTransform = Container.prototype.updateTransform; Container.prototype.containerUpdateTransform = Container.prototype.updateTransform;
//# sourceMappingURL=Container.js.map
var container; var container;
var el$1; var el$1;
...@@ -3772,6 +3806,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3772,6 +3806,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return FloatDisplay; return FloatDisplay;
}(DisplayObject)); }(DisplayObject));
//# sourceMappingURL=FloatDisplay.js.map
var ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]; var ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];
var uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1]; var uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];
...@@ -3870,6 +3905,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3870,6 +3905,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
matrix.append(mat); matrix.append(mat);
}, },
}; };
//# sourceMappingURL=GroupD8.js.map
var INT_BITS = 32; var INT_BITS = 32;
var INT_BITS1 = 32; var INT_BITS1 = 32;
...@@ -4025,6 +4061,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4025,6 +4061,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var t = v | (v - 1); var t = v | (v - 1);
return (t + 1) | (((~t & -~t) - 1) >>> (countTrailingZeros(v) + 1)); return (t + 1) | (((~t & -~t) - 1) >>> (countTrailingZeros(v) + 1));
} }
//# sourceMappingURL=twiddle.js.map
var tempMatrix = new Matrix(); var tempMatrix = new Matrix();
var SystemRenderer = (function (_super) { var SystemRenderer = (function (_super) {
...@@ -4080,6 +4117,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4080,6 +4117,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}); });
return SystemRenderer; return SystemRenderer;
}(EventDispatcher)); }(EventDispatcher));
//# sourceMappingURL=SystemRenderer.js.map
var CanvasGraphicsRenderer = (function () { var CanvasGraphicsRenderer = (function () {
function CanvasGraphicsRenderer(renderer) { function CanvasGraphicsRenderer(renderer) {
...@@ -4313,6 +4351,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4313,6 +4351,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
sum = sum + vector[vector.length - 2] * vector[1] - vector[vector.length - 1] * vector[0]; sum = sum + vector[vector.length - 2] * vector[1] - vector[vector.length - 1] * vector[0];
return !(sum > 0); return !(sum > 0);
} }
//# sourceMappingURL=CanvasGraphicsRenderer.js.map
var CanvasMaskManager = (function (_super) { var CanvasMaskManager = (function (_super) {
tslib_1.__extends(CanvasMaskManager, _super); tslib_1.__extends(CanvasMaskManager, _super);
...@@ -4411,6 +4450,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4411,6 +4450,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return CanvasMaskManager; return CanvasMaskManager;
}(HashObject)); }(HashObject));
//# sourceMappingURL=CanvasMaskManager.js.map
var CanvasRenderTarget = (function () { var CanvasRenderTarget = (function () {
function CanvasRenderTarget(width, height) { function CanvasRenderTarget(width, height) {
...@@ -4452,6 +4492,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4452,6 +4492,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}); });
return CanvasRenderTarget; return CanvasRenderTarget;
}()); }());
//# sourceMappingURL=CanvasRenderTarget.js.map
var canvasRenderWorldTransform = new Matrix(); var canvasRenderWorldTransform = new Matrix();
var CanvasSpriteRenderer = (function () { var CanvasSpriteRenderer = (function () {
...@@ -4507,6 +4548,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4507,6 +4548,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return CanvasSpriteRenderer; return CanvasSpriteRenderer;
}()); }());
//# sourceMappingURL=CanvasSpriteRenderer.js.map
var CanvasRenderer = (function (_super) { var CanvasRenderer = (function (_super) {
tslib_1.__extends(CanvasRenderer, _super); tslib_1.__extends(CanvasRenderer, _super);
...@@ -4624,6 +4666,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4624,6 +4666,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return CanvasRenderer; return CanvasRenderer;
}(SystemRenderer)); }(SystemRenderer));
//# sourceMappingURL=CanvasRenderer.js.map
var _dRender = null; var _dRender = null;
var tempMatrix$1 = new Matrix(); var tempMatrix$1 = new Matrix();
...@@ -4664,6 +4707,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4664,6 +4707,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
_dRender.render(obj, null, tempMatrix$1); _dRender.render(obj, null, tempMatrix$1);
return _dRender.htmlElement.toDataURL("image/" + typeInfo.type, typeInfo.quality); return _dRender.htmlElement.toDataURL("image/" + typeInfo.type, typeInfo.quality);
} }
//# sourceMappingURL=toDisplayDataURL.js.map
function determineCrossOrigin(url, loc) { function determineCrossOrigin(url, loc) {
if (loc === void 0) { loc = window.location; } if (loc === void 0) { loc = window.location; }
...@@ -4672,6 +4716,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4672,6 +4716,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return 'anonymous'; return 'anonymous';
} }
//# sourceMappingURL=determineCrossOrigin.js.map
var BaseTexture = (function (_super) { var BaseTexture = (function (_super) {
tslib_1.__extends(BaseTexture, _super); tslib_1.__extends(BaseTexture, _super);
...@@ -4892,6 +4937,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4892,6 +4937,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return BaseTexture; return BaseTexture;
}(EventDispatcher)); }(EventDispatcher));
//# sourceMappingURL=BaseTexture.js.map
var TextureUvs = (function () { var TextureUvs = (function () {
function TextureUvs() { function TextureUvs() {
...@@ -4952,6 +4998,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4952,6 +4998,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return TextureUvs; return TextureUvs;
}()); }());
//# sourceMappingURL=TextureUvs.js.map
var Texture = (function (_super) { var Texture = (function (_super) {
tslib_1.__extends(Texture, _super); tslib_1.__extends(Texture, _super);
...@@ -5195,6 +5242,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5195,6 +5242,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Texture.WHITE = createWhiteTexture(); Texture.WHITE = createWhiteTexture();
removeAllHandlers(Texture.WHITE); removeAllHandlers(Texture.WHITE);
removeAllHandlers(Texture.WHITE.baseTexture); removeAllHandlers(Texture.WHITE.baseTexture);
//# sourceMappingURL=Texture.js.map
var padding = 2; var padding = 2;
function DrawAllToCanvas(images, callback) { function DrawAllToCanvas(images, callback) {
...@@ -5335,6 +5383,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5335,6 +5383,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return imageInfo; return imageInfo;
}()); }());
//# sourceMappingURL=DrawAllToCanvas.js.map
var nextUid = 0; var nextUid = 0;
function uid() { function uid() {
...@@ -5493,7 +5542,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5493,7 +5542,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
startTime: 0 startTime: 0
}; };
function isWebGLSupported() { function isWebGLSupported() {
var contextOptions = { stencil: true, failIfMajorPerformanceCaveat: true }; var contextOptions = { stencil: true };
try { try {
if (!window["WebGLRenderingContext"]) { if (!window["WebGLRenderingContext"]) {
return false; return false;
...@@ -5550,6 +5599,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5550,6 +5599,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
array[exports.BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_COLOR]; array[exports.BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_COLOR];
return array; return array;
} }
//# sourceMappingURL=index.js.map
var indices = new Uint16Array([0, 1, 2, 0, 2, 3]); var indices = new Uint16Array([0, 1, 2, 0, 2, 3]);
var Sprite = (function (_super) { var Sprite = (function (_super) {
...@@ -5819,6 +5869,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5819,6 +5869,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Sprite; return Sprite;
}(Container)); }(Container));
//# sourceMappingURL=Sprite.js.map
var BatchDrawCall = (function () { var BatchDrawCall = (function () {
function BatchDrawCall() { function BatchDrawCall() {
...@@ -5830,6 +5881,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5830,6 +5881,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return BatchDrawCall; return BatchDrawCall;
}()); }());
//# sourceMappingURL=BatchDrawCall.js.map
var ObjectRenderer = (function () { var ObjectRenderer = (function () {
function ObjectRenderer(renderer) { function ObjectRenderer(renderer) {
...@@ -5854,6 +5906,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5854,6 +5906,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return ObjectRenderer; return ObjectRenderer;
}()); }());
//# sourceMappingURL=ObjectRenderer.js.map
function createContext(canvas, options) { function createContext(canvas, options) {
var gl = canvas.getContext('webgl', options) || var gl = canvas.getContext('webgl', options) ||
...@@ -5863,6 +5916,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5863,6 +5916,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return gl; return gl;
} }
//# sourceMappingURL=createContext.js.map
var fragTemplate = [ var fragTemplate = [
'precision mediump float;', 'precision mediump float;',
...@@ -5914,6 +5968,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5914,6 +5968,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return src; return src;
} }
//# sourceMappingURL=checkMaxIfStatementsInShader.js.map
var BatchBuffer = (function () { var BatchBuffer = (function () {
function BatchBuffer(size) { function BatchBuffer(size) {
...@@ -5929,6 +5984,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5929,6 +5984,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return BatchBuffer; return BatchBuffer;
}()); }());
//# sourceMappingURL=BatchBuffer.js.map
var GLTexture = (function () { var GLTexture = (function () {
function GLTexture(gl, width, height, format, type) { function GLTexture(gl, width, height, format, type) {
...@@ -6060,6 +6116,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6060,6 +6116,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return GLTexture; return GLTexture;
}()); }());
var FLOATING_POINT_AVAILABLE = false; var FLOATING_POINT_AVAILABLE = false;
//# sourceMappingURL=GLTexture.js.map
var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0); var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0);
var GLBuffer = (function () { var GLBuffer = (function () {
...@@ -6106,6 +6163,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6106,6 +6163,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return GLBuffer; return GLBuffer;
}()); }());
//# sourceMappingURL=GLBuffer.js.map
function setVertexAttribArrays(gl, attribs, state) { function setVertexAttribArrays(gl, attribs, state) {
var i; var i;
...@@ -6136,6 +6194,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6136,6 +6194,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
//# sourceMappingURL=setVertexAttribArrays.js.map
var VertexArrayObject = (function () { var VertexArrayObject = (function () {
function VertexArrayObject(gl, state) { function VertexArrayObject(gl, state) {
...@@ -6253,6 +6312,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6253,6 +6312,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
VertexArrayObject.FORCE_NATIVE = false; VertexArrayObject.FORCE_NATIVE = false;
return VertexArrayObject; return VertexArrayObject;
}()); }());
//# sourceMappingURL=VertexArrayObject.js.map
var GLFramebuffer = (function () { var GLFramebuffer = (function () {
function GLFramebuffer(gl, width, height) { function GLFramebuffer(gl, width, height) {
...@@ -6335,6 +6395,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6335,6 +6395,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return GLFramebuffer; return GLFramebuffer;
}()); }());
//# sourceMappingURL=GLFramebuffer.js.map
function compileProgram(gl, vertexSrc, fragmentSrc, attributeLocations) { function compileProgram(gl, vertexSrc, fragmentSrc, attributeLocations) {
var glVertShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc); var glVertShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);
...@@ -6372,6 +6433,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6372,6 +6433,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return shader; return shader;
}; };
//# sourceMappingURL=compileProgram.js.map
function mapType(gl, type) { function mapType(gl, type) {
if (!GL_TABLE) { if (!GL_TABLE) {
...@@ -6403,6 +6465,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6403,6 +6465,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
'FLOAT_MAT4': 'mat4', 'FLOAT_MAT4': 'mat4',
'SAMPLER_2D': 'sampler2D' 'SAMPLER_2D': 'sampler2D'
}; };
//# sourceMappingURL=mapType.js.map
function mapSize(type) { function mapSize(type) {
return GLSL_TO_SIZE[type]; return GLSL_TO_SIZE[type];
...@@ -6425,6 +6488,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6425,6 +6488,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
'mat4': 16, 'mat4': 16,
'sampler2D': 1 'sampler2D': 1
}; };
//# sourceMappingURL=mapSize.js.map
function extractAttributes(gl, program) { function extractAttributes(gl, program) {
var attributes = {}; var attributes = {};
...@@ -6447,6 +6511,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6447,6 +6511,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return attributes; return attributes;
} }
//# sourceMappingURL=extractAttributes.js.map
function defaultValue(type, size) { function defaultValue(type, size) {
switch (type) { switch (type) {
...@@ -6496,6 +6561,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6496,6 +6561,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return array; return array;
}; };
//# sourceMappingURL=defaultValue.js.map
function extractUniforms(gl, program) { function extractUniforms(gl, program) {
var uniforms = {}; var uniforms = {};
...@@ -6513,6 +6579,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6513,6 +6579,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return uniforms; return uniforms;
} }
//# sourceMappingURL=extractUniforms.js.map
function setPrecision(src, precision) { function setPrecision(src, precision) {
if (src.substring(0, 9) !== 'precision') { if (src.substring(0, 9) !== 'precision') {
...@@ -6520,6 +6587,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6520,6 +6587,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return src; return src;
} }
//# sourceMappingURL=setPrecision.js.map
function generateUniformAccessObject(gl, uniformData) { function generateUniformAccessObject(gl, uniformData) {
var uniforms = { data: {} }; var uniforms = { data: {} };
...@@ -6657,6 +6725,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6657,6 +6725,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return cur; return cur;
} }
//# sourceMappingURL=generateUniformAccessObject.js.map
var GLShader = (function () { var GLShader = (function () {
function GLShader(gl, vertexSrc, fragmentSrc, precision, attributeLocations) { function GLShader(gl, vertexSrc, fragmentSrc, precision, attributeLocations) {
...@@ -6683,6 +6752,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6683,6 +6752,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return GLShader; return GLShader;
}()); }());
//# sourceMappingURL=GLShader.js.map
var VSHADER_SOURCE = "precision highp float;" + var VSHADER_SOURCE = "precision highp float;" +
"attribute vec2 aVertexPosition;" + "attribute vec2 aVertexPosition;" +
...@@ -6744,6 +6814,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6744,6 +6814,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
src += '\n'; src += '\n';
return src; return src;
} }
//# sourceMappingURL=generateMultiTextureShader.js.map
var TICK = 0; var TICK = 0;
var BatchRenderer = (function (_super) { var BatchRenderer = (function (_super) {
...@@ -6967,6 +7038,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -6967,6 +7038,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return BatchRenderer; return BatchRenderer;
}(ObjectRenderer)); }(ObjectRenderer));
//# sourceMappingURL=BatchRenderer.js.map
var RenderTarget = (function () { var RenderTarget = (function () {
function RenderTarget(gl, width, height, scaleMode, root) { function RenderTarget(gl, width, height, scaleMode, root) {
...@@ -7073,6 +7145,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7073,6 +7145,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return RenderTarget; return RenderTarget;
}()); }());
//# sourceMappingURL=RenderTarget.js.map
var TextureManager = (function () { var TextureManager = (function () {
function TextureManager(renderer) { function TextureManager(renderer) {
...@@ -7274,6 +7347,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7274,6 +7347,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return TextureManager; return TextureManager;
}()); }());
//# sourceMappingURL=TextureManager.js.map
var TextureGarbageCollector = (function () { var TextureGarbageCollector = (function () {
function TextureGarbageCollector(renderer) { function TextureGarbageCollector(renderer) {
...@@ -7328,6 +7402,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7328,6 +7402,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return TextureGarbageCollector; return TextureGarbageCollector;
}()); }());
//# sourceMappingURL=TextureGarbageCollector.js.map
var BLEND = 0; var BLEND = 0;
var DEPTH_TEST = 1; var DEPTH_TEST = 1;
...@@ -7430,6 +7505,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7430,6 +7505,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return WebGLState; return WebGLState;
}()); }());
//# sourceMappingURL=WebGLState.js.map
var BatchManager = (function () { var BatchManager = (function () {
function BatchManager(renderer) { function BatchManager(renderer) {
...@@ -7453,6 +7529,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7453,6 +7529,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return BatchManager; return BatchManager;
}()); }());
//# sourceMappingURL=BatchManager.js.map
var MaskManager = (function () { var MaskManager = (function () {
function MaskManager(renderer) { function MaskManager(renderer) {
...@@ -7501,6 +7578,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7501,6 +7578,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return MaskManager; return MaskManager;
}()); }());
//# sourceMappingURL=MaskManager.js.map
var StencilManager = (function () { var StencilManager = (function () {
function StencilManager(renderer) { function StencilManager(renderer) {
...@@ -7573,6 +7651,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7573,6 +7651,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return StencilManager; return StencilManager;
}()); }());
//# sourceMappingURL=StencilManager.js.map
var CONTEXT_UID = 0; var CONTEXT_UID = 0;
var WebglRenderer = (function (_super) { var WebglRenderer = (function (_super) {
...@@ -7785,6 +7864,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7785,6 +7864,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return WebglRenderer; return WebglRenderer;
}(SystemRenderer)); }(SystemRenderer));
WebglRenderer.registerPlugin('batch', BatchRenderer); WebglRenderer.registerPlugin('batch', BatchRenderer);
//# sourceMappingURL=WebglRenderer.js.map
var requestAnimationFrame = (function () { var requestAnimationFrame = (function () {
var lastTime = 0; var lastTime = 0;
...@@ -8387,6 +8467,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8387,6 +8467,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Stage.allUpdateObjList = []; Stage.allUpdateObjList = [];
return Stage; return Stage;
}(Container)); }(Container));
//# sourceMappingURL=Stage.js.map
var GraphicsData = (function (_super) { var GraphicsData = (function (_super) {
tslib_1.__extends(GraphicsData, _super); tslib_1.__extends(GraphicsData, _super);
...@@ -8419,6 +8500,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8419,6 +8500,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return GraphicsData; return GraphicsData;
}(HashObject)); }(HashObject));
//# sourceMappingURL=GraphicsData.js.map
var BaseRenderTexture = (function (_super) { var BaseRenderTexture = (function (_super) {
tslib_1.__extends(BaseRenderTexture, _super); tslib_1.__extends(BaseRenderTexture, _super);
...@@ -8455,6 +8537,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8455,6 +8537,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return BaseRenderTexture; return BaseRenderTexture;
}(BaseTexture)); }(BaseTexture));
//# sourceMappingURL=BaseRenderTexture.js.map
var RenderTexture = (function (_super) { var RenderTexture = (function (_super) {
tslib_1.__extends(RenderTexture, _super); tslib_1.__extends(RenderTexture, _super);
...@@ -8482,6 +8565,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8482,6 +8565,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return RenderTexture; return RenderTexture;
}(Texture)); }(Texture));
//# sourceMappingURL=RenderTexture.js.map
var Circle = (function () { var Circle = (function () {
function Circle(x, y, radius) { function Circle(x, y, radius) {
...@@ -8512,6 +8596,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8512,6 +8596,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Circle; return Circle;
}()); }());
//# sourceMappingURL=Circle.js.map
var Ellipse = (function () { var Ellipse = (function () {
function Ellipse(x, y, width, height) { function Ellipse(x, y, width, height) {
...@@ -8543,6 +8628,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8543,6 +8628,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Ellipse; return Ellipse;
}()); }());
//# sourceMappingURL=Ellipse.js.map
var Polygon = (function () { var Polygon = (function () {
function Polygon() { function Polygon() {
...@@ -8592,6 +8678,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8592,6 +8678,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Polygon; return Polygon;
}()); }());
//# sourceMappingURL=Polygon.js.map
var RoundedRectangle = (function () { var RoundedRectangle = (function () {
function RoundedRectangle(x, y, width, height, radius) { function RoundedRectangle(x, y, width, height, radius) {
...@@ -8649,6 +8736,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8649,6 +8736,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return RoundedRectangle; return RoundedRectangle;
}()); }());
//# sourceMappingURL=RoundedRectangle.js.map
function earcut(data, holeIndices, dim) { function earcut(data, holeIndices, dim) {
dim = dim || 2; dim = dim || 2;
...@@ -9110,6 +9198,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9110,6 +9198,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return result; return result;
}; };
//# sourceMappingURL=earcut.js.map
var buildPoly = { var buildPoly = {
build: function (graphicsData) { build: function (graphicsData) {
...@@ -9143,6 +9232,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9143,6 +9232,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
}, },
}; };
//# sourceMappingURL=buildPoly.js.map
var buildCircle = { var buildCircle = {
build: function (graphicsData) { build: function (graphicsData) {
...@@ -9186,6 +9276,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9186,6 +9276,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
}, },
}; };
//# sourceMappingURL=buildCircle.js.map
var buildRectangle = { var buildRectangle = {
build: function (graphicsData) { build: function (graphicsData) {
...@@ -9206,6 +9297,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9206,6 +9297,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
graphics.indices.push(vertPos, vertPos + 1, vertPos + 2, vertPos + 1, vertPos + 2, vertPos + 3); graphics.indices.push(vertPos, vertPos + 1, vertPos + 2, vertPos + 1, vertPos + 2, vertPos + 3);
}, },
}; };
//# sourceMappingURL=buildRectangle.js.map
var buildRoundedRectangle = { var buildRoundedRectangle = {
build: function (graphicsData) { build: function (graphicsData) {
...@@ -9265,6 +9357,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9265,6 +9357,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return points; return points;
} }
//# sourceMappingURL=buildRoundedRectangle.js.map
function buildLine (graphicsData, graphicsGeometry) { function buildLine (graphicsData, graphicsGeometry) {
buildLine$1(graphicsData, graphicsGeometry); buildLine$1(graphicsData, graphicsGeometry);
...@@ -9393,6 +9486,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9393,6 +9486,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
indexStart++; indexStart++;
} }
} }
//# sourceMappingURL=buildLine.js.map
var FillStyle = (function () { var FillStyle = (function () {
function FillStyle() { function FillStyle() {
...@@ -9422,6 +9516,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9422,6 +9516,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return FillStyle; return FillStyle;
}()); }());
//# sourceMappingURL=FillStyle.js.map
var LineStyle = (function (_super) { var LineStyle = (function (_super) {
tslib_1.__extends(LineStyle, _super); tslib_1.__extends(LineStyle, _super);
...@@ -9449,6 +9544,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9449,6 +9544,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return LineStyle; return LineStyle;
}(FillStyle)); }(FillStyle));
//# sourceMappingURL=LineStyle.js.map
function bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, n, path) { function bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, n, path) {
if (path === void 0) { path = []; } if (path === void 0) { path = []; }
...@@ -9469,6 +9565,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9469,6 +9565,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return path; return path;
} }
//# sourceMappingURL=bezierCurveTo.js.map
var GRAPHICS_CURVES = { var GRAPHICS_CURVES = {
adaptive: false, adaptive: false,
...@@ -9540,6 +9637,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -9540,6 +9637,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return result; return result;
} }
//# sourceMappingURL=index.js.map
var canvasRenderer; var canvasRenderer;
var tempMatrix$2 = new Matrix(); var tempMatrix$2 = new Matrix();
...@@ -10427,6 +10525,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -10427,6 +10525,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return geoBatchPart; return geoBatchPart;
}()); }());
//# sourceMappingURL=Graphics.js.map
var Shape = (function (_super) { var Shape = (function (_super) {
tslib_1.__extends(Shape, _super); tslib_1.__extends(Shape, _super);
...@@ -10900,6 +10999,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -10900,6 +10999,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Shape; return Shape;
}(Sprite)); }(Sprite));
//# sourceMappingURL=Shape.js.map
var TextureSheet = (function () { var TextureSheet = (function () {
function TextureSheet(baseTexture, data) { function TextureSheet(baseTexture, data) {
...@@ -10975,10 +11075,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -10975,10 +11075,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return TextureSheet; return TextureSheet;
}()); }());
//# sourceMappingURL=TextureSheet.js.map
function getTexture(str) { function getTexture(str) {
return TextureCache[str] || null; return TextureCache[str] || null;
} }
//# sourceMappingURL=index.js.map
var queryParams = {}; var queryParams = {};
var search = window.location.search; var search = window.location.search;
...@@ -10992,28 +11094,25 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -10992,28 +11094,25 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var arr = item.split('='); var arr = item.split('=');
queryParams[arr[0]] = arr.length === 1 ? true : arr[1]; queryParams[arr[0]] = arr.length === 1 ? true : arr[1];
} }
if (queryParams.appID) { function appendScript(script, parent) {
env.appID = queryParams.appID; if (parent === void 0) { parent = document.body; }
} if (!script) {
if (queryParams.channelType) { return;
env.channelType = queryParams.channelType;
}
if (queryParams.projectID) {
env.projectID = queryParams.projectID;
}
else if (window.location.pathname.match(new RegExp("/projectx/(\\S+)/index(\\S+)", "g"))) {
env.projectID = window.location.pathname.replace(new RegExp("/projectx/(\\S+)/index(\\S+)", "g"), "$1");
} }
exports.newUser = true; var scriptContent;
var key = 'nu_' + env.appID + '_' + env.projectID; if (script.indexOf('<script') === 0) {
var v = localStorage.getItem(key); var temp = document.createElement('div');
if (v) { temp.innerHTML = script;
exports.newUser = false; scriptContent = temp.children[0].innerHTML;
} }
else { else {
localStorage.setItem(key, '1'); scriptContent = script;
}
var scriptEl = document.createElement('script');
scriptEl.innerHTML = scriptContent;
parent.appendChild(scriptEl);
} }
console.log(exports.newUser); //# sourceMappingURL=web.js.map
function httpRequest(url, method, params, type, headers) { function httpRequest(url, method, params, type, headers) {
if (method === void 0) { method = 'get'; } if (method === void 0) { method = 'get'; }
...@@ -11182,6 +11281,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11182,6 +11281,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
}, false); }, false);
} }
//# sourceMappingURL=net.js.map
function createTextureSheet(baseTexture, altaData) { function createTextureSheet(baseTexture, altaData) {
var frames = altaData; var frames = altaData;
...@@ -11207,6 +11307,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11207,6 +11307,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
frameIndex++; frameIndex++;
} }
} }
//# sourceMappingURL=texture-sheet.js.map
var prefix = 'font-'; var prefix = 'font-';
var fonts = {}; var fonts = {};
...@@ -11242,6 +11343,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11242,6 +11343,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function getFont(name) { function getFont(name) {
return fonts[name]; return fonts[name];
} }
//# sourceMappingURL=bmp-text-manager.js.map
var assetsConfig = []; var assetsConfig = [];
var loaderMapping = { var loaderMapping = {
...@@ -11257,7 +11359,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11257,7 +11359,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
'.mp3': 'Sound', '.mp3': 'Sound',
'': 'Raw', '': 'Raw',
}; };
function loadAssetGroup(config, onProgress, onComplete) { function loadAssets(config, onProgress, onComplete) {
var total = config.length; var total = config.length;
var loaded = 0; var loaded = 0;
var failedList = []; var failedList = [];
...@@ -11333,6 +11435,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11333,6 +11435,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
//# sourceMappingURL=assets-manager.js.map
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
...@@ -14548,6 +14651,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14548,6 +14651,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
keep: true, keep: true,
}; };
} }
//# sourceMappingURL=sound.js.map
var Loader = (function (_super) { var Loader = (function (_super) {
tslib_1.__extends(Loader, _super); tslib_1.__extends(Loader, _super);
...@@ -14634,8 +14738,15 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14634,8 +14738,15 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return Loader; return Loader;
}(EventDispatcher)); }(EventDispatcher));
var globalLoader = new Loader(); var globalLoader = new Loader();
//# sourceMappingURL=Loader.js.map
var padding$1 = 10; var padding$1 = 10;
var styleFields = {
color: 'fillStyle',
stroke: 'lineWidth',
strokeColor: 'strokeStyle',
font: 'font',
};
var TextField = (function (_super) { var TextField = (function (_super) {
tslib_1.__extends(TextField, _super); tslib_1.__extends(TextField, _super);
function TextField() { function TextField() {
...@@ -14643,10 +14754,11 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14643,10 +14754,11 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
_this._textAlpha = 1; _this._textAlpha = 1;
_this._textAlign = exports.TEXT_ALIGN.LEFT; _this._textAlign = exports.TEXT_ALIGN.LEFT;
_this._verticalAlign = exports.VERTICAL_ALIGN.UP; _this._verticalAlign = exports.VERTICAL_ALIGN.UP;
_this._lineSpacing = 14; _this._lineSpacing = 0;
_this._lineType = exports.TEXT_lINETYPE.SINGLE; _this._lineType = exports.TEXT_lINETYPE.SINGLE;
_this._text = ""; _this._text = "";
_this._pureText = ''; _this._pureText = '';
_this._styleCache = [];
_this._font = "Arial"; _this._font = "Arial";
_this._size = 12; _this._size = 12;
_this._fillColor = "#000"; _this._fillColor = "#000";
...@@ -14792,6 +14904,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14792,6 +14904,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
set: function (value) { set: function (value) {
this._textFlow = value; this._textFlow = value;
this.dirty = true; this.dirty = true;
this._styleCache.splice(0);
var text = ''; var text = '';
for (var _i = 0, _a = this._textFlow; _i < _a.length; _i++) { for (var _i = 0, _a = this._textFlow; _i < _a.length; _i++) {
var item = _a[_i]; var item = _a[_i];
...@@ -14820,6 +14933,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14820,6 +14933,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (!this.textFlow) { if (!this.textFlow) {
return null; return null;
} }
if (this._styleCache[index]) {
return this._styleCache[index];
}
var targetItem; var targetItem;
var count = 0; var count = 0;
for (var _i = 0, _a = this._textFlow; _i < _a.length; _i++) { for (var _i = 0, _a = this._textFlow; _i < _a.length; _i++) {
...@@ -14830,6 +14946,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14830,6 +14946,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
break; break;
} }
} }
if (targetItem && targetItem.style) {
this._styleCache[index] = targetItem.style;
}
return targetItem.style; return targetItem.style;
}; };
Object.defineProperty(TextField.prototype, "font", { Object.defineProperty(TextField.prototype, "font", {
...@@ -14936,20 +15055,23 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14936,20 +15055,23 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
TextField.prototype._setupFont = function (font, size, bold, italic) {
var fontStyle = size;
fontStyle += "px ";
fontStyle += font;
if (bold) {
fontStyle = "bold " + fontStyle;
}
if (italic) {
fontStyle = "italic " + fontStyle;
}
return fontStyle;
};
TextField.prototype._prepContext = function (ctx) { TextField.prototype._prepContext = function (ctx) {
var s = this; var s = this;
var font = s.size || 12; ctx.font = this._setupFont(s._font, s._size, s._bold, s._italic);
font += "px "; ctx.textAlign = s.isPureText ? (s._textAlign || exports.TEXT_ALIGN.LEFT) : exports.TEXT_ALIGN.LEFT;
font += s.font; ctx.textBaseline = s.isPureText ? 'top' : 'bottom';
if (s._bold) {
font = "bold " + font;
}
if (s._italic) {
font = "italic " + font;
}
ctx.font = font;
ctx.textAlign = s._textAlign || exports.TEXT_ALIGN.LEFT;
ctx.textBaseline = "top";
if (typeof (s._fillColor) == "number") if (typeof (s._fillColor) == "number")
s._fillColor = hex2string(s._fillColor); s._fillColor = hex2string(s._fillColor);
ctx.fillStyle = s._textAlpha === 1 ? s._fillColor : getRGBA(s._fillColor, s._textAlpha); ctx.fillStyle = s._textAlpha === 1 ? s._fillColor : getRGBA(s._fillColor, s._textAlpha);
...@@ -14969,18 +15091,30 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14969,18 +15091,30 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
TextField.prototype._getMeasuredWidth = function (text) { TextField.prototype._getMeasuredWidth = function (text, style) {
var ctx = this.context; var ctx = this.context;
ctx.save();
if (style && style.font) {
ctx.font = style.font;
}
var w = ctx.measureText(text).width; var w = ctx.measureText(text).width;
ctx.restore();
return w; return w;
}; };
TextField.prototype._getFontSize = function (style) {
if (style && style.font) {
return parseInt(style.font);
}
};
TextField.prototype.updateText = function () { TextField.prototype.updateText = function () {
var s = this; var s = this;
var text = s.pureText; var text = s.pureText;
if (!text) { if (!text) {
s.canvas.width = 0; s.canvas.width = 0;
s.canvas.height = 0; s.canvas.height = 0;
if (!this._width && !this._height) {
s._localBoundsSelf.clear(); s._localBoundsSelf.clear();
}
this.anchorTexture = { x: 0, y: 0 }; this.anchorTexture = { x: 0, y: 0 };
this.updateTexture(); this.updateTexture();
return; return;
...@@ -14989,15 +15123,18 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -14989,15 +15123,18 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (!s.dirty) if (!s.dirty)
return; return;
s.dirty = false; s.dirty = false;
var isPureText = s.isPureText;
text += ""; text += "";
var can = s.canvas; var can = s.canvas;
var ctx = s.context; var ctx = s.context;
var hardLines = text.toString().split(/(?:\r\n|\r|\n)/); var hardLines = text.toString().split(/(?:\r\n|\r|\n)/);
var realLines = []; var realLines = [];
var lineWidths = [];
var lineHeights = [];
s.realLines = realLines; s.realLines = realLines;
s._prepContext(ctx); s._prepContext(ctx);
var textWidth = s._width; var textWidth = s._width;
if (text.indexOf("\n") < 0 && s.lineType == exports.TEXT_lINETYPE.SINGLE) { if (isPureText && text.indexOf("\n") < 0 && s.lineType == exports.TEXT_lINETYPE.SINGLE) {
realLines[realLines.length] = hardLines[0]; realLines[realLines.length] = hardLines[0];
var str = hardLines[0]; var str = hardLines[0];
var lineW = s._getMeasuredWidth(str); var lineW = s._getMeasuredWidth(str);
...@@ -15022,6 +15159,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15022,6 +15159,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
else { else {
var shouldMeasureTextWidth = !textWidth; var shouldMeasureTextWidth = !textWidth;
var index_1 = 0;
for (var i = 0, l = hardLines.length; i < l; i++) { for (var i = 0, l = hardLines.length; i < l; i++) {
var str = hardLines[i]; var str = hardLines[i];
if (!str) if (!str)
...@@ -15029,49 +15167,71 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15029,49 +15167,71 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var lineWidth = 0; var lineWidth = 0;
for (var _i = 0, str_1 = str; _i < str_1.length; _i++) { for (var _i = 0, str_1 = str; _i < str_1.length; _i++) {
var char = str_1[_i]; var char = str_1[_i];
var charWidth = measureChar(char); var charWidth = measureChar(char, index_1);
lineWidth += charWidth; lineWidth += charWidth;
index_1++;
} }
if (shouldMeasureTextWidth) { if (shouldMeasureTextWidth) {
textWidth = Math.max(lineWidth, textWidth); textWidth = Math.max(lineWidth, textWidth);
} }
} }
index_1 = 0;
for (var i = 0, l = hardLines.length; i < l; i++) { for (var i = 0, l = hardLines.length; i < l; i++) {
var str = hardLines[i]; var str = hardLines[i];
if (!str) if (!str)
continue; continue;
var w = measureCache[str[0]]; var w = measureChar(str[0], index_1++);
var lineStr = str[0]; var lineStr = str[0];
var wordW = 0; var wordW = 0;
var strLen = str.length; var strLen = str.length;
var lineHeight = 0;
for (var j = 1; j < strLen; j++) { for (var j = 1; j < strLen; j++) {
wordW = measureCache[str[j]]; wordW = measureChar(str[j], index_1);
w += wordW; w += wordW;
if (w > textWidth) { if (w > textWidth) {
realLines[realLines.length] = lineStr; realLines[realLines.length] = lineStr;
lineWidths.push(w - wordW);
lineHeights.push(lineHeight || s.size);
lineStr = str[j]; lineStr = str[j];
w = wordW; w = wordW;
lineHeight = 0;
} }
else { else {
lineStr += str[j]; lineStr += str[j];
} }
var style = this.getStyle(index_1);
var size = this._getFontSize(style);
if (size) {
if (size > lineHeight) {
lineHeight = size;
}
}
index_1++;
} }
realLines[realLines.length] = lineStr; realLines[realLines.length] = lineStr;
lineWidths.push(w);
lineHeights.push(lineHeight || s.size);
} }
} }
var trueHeight = s.size * realLines.length + s._lineSpacing * (realLines.length - 1); var maxH, trueHeight;
var maxH = s._height || trueHeight; if (isPureText) {
var maxW = textWidth; trueHeight = s.size * realLines.length + s._lineSpacing * (realLines.length - 1);
var tx = 0;
if (s._textAlign == exports.TEXT_ALIGN.CENTER) {
tx = maxW * 0.5;
} }
else if (s._textAlign == exports.TEXT_ALIGN.RIGHT) { else {
tx = maxW; trueHeight = lineHeights.reduce(function (a, b) {
return a + b;
}, 0) + s._lineSpacing * (realLines.length - 1);
}
if (s._height) {
maxH = s._height;
}
else {
maxH = trueHeight;
} }
var maxW = textWidth;
can.width = maxW + padding$1 * 2; can.width = maxW + padding$1 * 2;
can.height = maxH + padding$1 * 2; can.height = maxH + padding$1 * 2;
ctx.clearRect(0, 0, can.width, can.width); ctx.clearRect(0, 0, can.width, can.height);
if (s.border) { if (s.border) {
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = "#000"; ctx.strokeStyle = "#000";
...@@ -15079,6 +15239,15 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15079,6 +15239,15 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
ctx.strokeRect(padding$1 + 0.5, padding$1 + 0.5, maxW, maxH); ctx.strokeRect(padding$1 + 0.5, padding$1 + 0.5, maxW, maxH);
ctx.closePath(); ctx.closePath();
} }
var tx = 0;
if (isPureText) {
if (s._textAlign == exports.TEXT_ALIGN.CENTER) {
tx = maxW * 0.5;
}
else if (s._textAlign == exports.TEXT_ALIGN.RIGHT) {
tx = maxW;
}
}
ctx.setTransform(1, 0, 0, 1, tx + padding$1, padding$1); ctx.setTransform(1, 0, 0, 1, tx + padding$1, padding$1);
s._prepContext(ctx); s._prepContext(ctx);
var lineH = s._lineSpacing + s.size; var lineH = s._lineSpacing + s.size;
...@@ -15092,9 +15261,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15092,9 +15261,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
var index = 0; var index = 0;
var lineY = upY;
for (var i = 0; i < realLines.length; i++) { for (var i = 0; i < realLines.length; i++) {
var line = realLines[i]; var line = realLines[i];
if (s.isPureText) { if (isPureText) {
var y = upY + i * lineH; var y = upY + i * lineH;
if (s.stroke) { if (s.stroke) {
ctx.strokeStyle = s.strokeColor; ctx.strokeStyle = s.strokeColor;
...@@ -15104,38 +15274,37 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15104,38 +15274,37 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
ctx.fillText(line, 0, y, maxW); ctx.fillText(line, 0, y, maxW);
} }
else { else {
var lineWidth = 0; var lineWidth = lineWidths[i];
for (var _a = 0, line_1 = line; _a < line_1.length; _a++) { var lineHeight = lineHeights[i];
var char = line_1[_a]; lineY += s._lineSpacing + lineHeight;
var charWidth = measureChar(char); var x = 0;
lineWidth += charWidth; if (s._textAlign == exports.TEXT_ALIGN.CENTER) {
x = (maxW - lineWidth) * 0.5;
}
else if (s._textAlign == exports.TEXT_ALIGN.RIGHT) {
x = maxW - lineWidth;
} }
var x = -lineWidth / 2;
for (var j = 0, lj = line.length; j < lj; j++) { for (var j = 0, lj = line.length; j < lj; j++) {
var char = line[j]; var char = line[j];
var style = s.getStyle(index); var style = s.getStyle(index);
if (style) { if (style) {
if (style.hasOwnProperty('color')) { ctx.save();
ctx.fillStyle = style.color; for (var field in styleFields) {
if (style.hasOwnProperty(field)) {
ctx[styleFields[field]] = style[field];
} }
if (style.hasOwnProperty('stroke')) {
ctx.lineWidth = style.stroke * 2;
} }
if (style.hasOwnProperty('strokeColor')) {
ctx.strokeStyle = style.strokeColor;
} }
} if (s.stroke) {
else {
ctx.fillStyle = s.fillColor;
ctx.lineWidth = s.stroke;
ctx.strokeStyle = s.strokeColor; ctx.strokeStyle = s.strokeColor;
ctx.lineWidth = s.stroke * 2;
ctx.strokeText(char, x, lineY);
} }
var y = upY + i * lineH; ctx.fillText(char, x, lineY);
if (ctx.lineWidth > 0) { if (style) {
ctx.strokeText(char, x, y); ctx.restore();
} }
ctx.fillText(char, x, y); x += measureChar(char, index);
x += measureChar(char);
index++; index++;
} }
} }
...@@ -15146,10 +15315,18 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15146,10 +15315,18 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
s._localBoundsSelf.width = maxW; s._localBoundsSelf.width = maxW;
s._localBoundsSelf.height = maxH; s._localBoundsSelf.height = maxH;
s.updateTexture(); s.updateTexture();
function measureChar(char) { function measureChar(char, index) {
var w = measureCache[char]; var key = char + ':';
var style;
if (!isPureText && index !== undefined) {
style = s.getStyle(index);
if (style && style.font) {
key += style.font;
}
}
var w = measureCache[key];
if (w === undefined) { if (w === undefined) {
w = measureCache[char] = s._getMeasuredWidth(char); w = measureCache[char] = s._getMeasuredWidth(char, style);
} }
return w; return w;
} }
...@@ -15181,6 +15358,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15181,6 +15358,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return TextField; return TextField;
}(Sprite)); }(Sprite));
//# sourceMappingURL=TextField.js.map
var InputText = (function (_super) { var InputText = (function (_super) {
tslib_1.__extends(InputText, _super); tslib_1.__extends(InputText, _super);
...@@ -15378,6 +15556,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15378,6 +15556,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
InputText._inputTypeList = ["input", "password", "textarea"]; InputText._inputTypeList = ["input", "password", "textarea"];
return InputText; return InputText;
}(FloatDisplay)); }(FloatDisplay));
//# sourceMappingURL=InputText.js.map
var EditableText = (function (_super) { var EditableText = (function (_super) {
tslib_1.__extends(EditableText, _super); tslib_1.__extends(EditableText, _super);
...@@ -15479,6 +15658,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15479,6 +15658,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}); });
return EditableText; return EditableText;
}(TextField)); }(TextField));
//# sourceMappingURL=EditableText.js.map
var ScrollViewBase = (function (_super) { var ScrollViewBase = (function (_super) {
tslib_1.__extends(ScrollViewBase, _super); tslib_1.__extends(ScrollViewBase, _super);
...@@ -15604,7 +15784,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15604,7 +15784,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
configurable: true configurable: true
}); });
ScrollViewBase.prototype.calMaxDistance = function () { ScrollViewBase.prototype.calMaxDistance = function () {
return this.viewPort[this.paramSize]; return this.viewPort[this.paramSize] + this.viewPort.getLocalBounds()[this.paramXY];
}; };
Object.defineProperty(ScrollViewBase.prototype, "direction", { Object.defineProperty(ScrollViewBase.prototype, "direction", {
get: function () { get: function () {
...@@ -15735,6 +15915,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15735,6 +15915,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return ScrollViewBase; return ScrollViewBase;
}(Container)); }(Container));
//# sourceMappingURL=ScrollViewBase.js.map
function fieldChanged(onModify) { function fieldChanged(onModify) {
return function (target, key) { return function (target, key) {
...@@ -15777,6 +15958,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15777,6 +15958,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
}); });
//# sourceMappingURL=decorators.js.map
var ScrollListItemBase = (function (_super) { var ScrollListItemBase = (function (_super) {
tslib_1.__extends(ScrollListItemBase, _super); tslib_1.__extends(ScrollListItemBase, _super);
...@@ -15975,6 +16157,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -15975,6 +16157,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
], ScrollListBase.prototype, "itemClass", void 0); ], ScrollListBase.prototype, "itemClass", void 0);
return ScrollListBase; return ScrollListBase;
}(ScrollViewBase)); }(ScrollViewBase));
//# sourceMappingURL=ScrollListBase.js.map
var Tween = (function () { var Tween = (function () {
function Tween(target, props, pluginData) { function Tween(target, props, pluginData) {
...@@ -16380,6 +16563,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -16380,6 +16563,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Tween._lastTime = 0; Tween._lastTime = 0;
return Tween; return Tween;
}()); }());
//# sourceMappingURL=Tween.js.map
var Ease = (function () { var Ease = (function () {
function Ease() { function Ease() {
...@@ -16526,6 +16710,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -16526,6 +16710,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Ease.elasticInOut = Ease.getElasticInOut(1, 0.3 * 1.5); Ease.elasticInOut = Ease.getElasticInOut(1, 0.3 * 1.5);
return Ease; return Ease;
}()); }());
//# sourceMappingURL=Ease.js.map
var Node$1 = (function (_super) { var Node$1 = (function (_super) {
tslib_1.__extends(Node, _super); tslib_1.__extends(Node, _super);
...@@ -16536,6 +16721,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -16536,6 +16721,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return Node; return Node;
}(Container)); }(Container));
//# sourceMappingURL=Node.js.map
var StackContainer = (function (_super) { var StackContainer = (function (_super) {
tslib_1.__extends(StackContainer, _super); tslib_1.__extends(StackContainer, _super);
...@@ -16568,7 +16754,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -16568,7 +16754,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
StackContainer.prototype.pop = function (dispatch) { StackContainer.prototype.pop = function (dispatch) {
if (dispatch === void 0) { dispatch = true; } if (dispatch === void 0) { dispatch = true; }
var len = this.children.length; var len = this.children.length;
if (len <= 1) { if (len <= 0) {
return false; return false;
} }
this.removeChildAt(len - 1); this.removeChildAt(len - 1);
...@@ -16592,6 +16778,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -16592,6 +16778,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return StackContainer; return StackContainer;
}(Node$1)); }(Node$1));
//# sourceMappingURL=StackContainer.js.map
var colorName = { var colorName = {
"aliceblue": [240, 248, 255], "aliceblue": [240, 248, 255],
...@@ -18786,6 +18973,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -18786,6 +18973,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Circle; return Circle;
}(ShapeBase)); }(ShapeBase));
//# sourceMappingURL=shapes.js.map
var assetScheme = 'asset://'; var assetScheme = 'asset://';
var Image$1 = (function (_super) { var Image$1 = (function (_super) {
...@@ -18793,6 +18981,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -18793,6 +18981,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function Image() { function Image() {
var _this = _super !== null && _super.apply(this, arguments) || this; var _this = _super !== null && _super.apply(this, arguments) || this;
_this.isUI = true; _this.isUI = true;
_this.crossOrigin = true;
_this._escapes = []; _this._escapes = [];
_this._registeredEvents = []; _this._registeredEvents = [];
return _this; return _this;
...@@ -18823,7 +19012,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -18823,7 +19012,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
url = assetConfig.uuid; url = assetConfig.uuid;
} }
} }
this.texture = Texture.fromImage(url); this.texture = Texture.fromImage(url, this.crossOrigin);
} }
else { else {
this.texture = null; this.texture = null;
...@@ -18874,6 +19063,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -18874,6 +19063,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Image; return Image;
}(Sprite)); }(Sprite));
//# sourceMappingURL=Image.js.map
var Label = (function (_super) { var Label = (function (_super) {
tslib_1.__extends(Label, _super); tslib_1.__extends(Label, _super);
...@@ -18950,6 +19140,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -18950,6 +19140,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Label; return Label;
}(TextField)); }(TextField));
//# sourceMappingURL=Label.js.map
var timer; var timer;
function delayScrollTop() { function delayScrollTop() {
...@@ -19141,7 +19332,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19141,7 +19332,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
TextInput.prototype.onClickStatic = function () { TextInput.prototype.onClickStatic = function () {
this.setFocus(); this.setFocus();
this.stage.once(MouseEvent.CLICK, this.onClickStage, this); this.stage.once(MouseEvent.MOUSE_DOWN, this.onClickStage, this);
}; };
TextInput.prototype.onResize = function () { TextInput.prototype.onResize = function () {
var pl = this._placeholderLabel; var pl = this._placeholderLabel;
...@@ -19186,6 +19377,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19186,6 +19377,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
], TextInput.prototype, "charRegStr", void 0); ], TextInput.prototype, "charRegStr", void 0);
return TextInput; return TextInput;
}(Label)); }(Label));
//# sourceMappingURL=TextInput.js.map
var proxyMethods = [ var proxyMethods = [
'onChildrenChange', 'onChildrenChange',
...@@ -19213,6 +19405,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19213,6 +19405,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return ScrollView; return ScrollView;
}(ScrollViewBase)); }(ScrollViewBase));
//# sourceMappingURL=ScrollView.js.map
var ScrollListItem = (function (_super) { var ScrollListItem = (function (_super) {
tslib_1.__extends(ScrollListItem, _super); tslib_1.__extends(ScrollListItem, _super);
...@@ -19255,6 +19448,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19255,6 +19448,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return ScrollList; return ScrollList;
}(ScrollListBase)); }(ScrollListBase));
//# sourceMappingURL=ScrollList.js.map
var BitmapText = (function (_super) { var BitmapText = (function (_super) {
tslib_1.__extends(BitmapText, _super); tslib_1.__extends(BitmapText, _super);
...@@ -19351,6 +19545,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19351,6 +19545,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
], BitmapText.prototype, "letterSpacing", void 0); ], BitmapText.prototype, "letterSpacing", void 0);
return BitmapText; return BitmapText;
}(Container)); }(Container));
//# sourceMappingURL=BitmapText.js.map
var HtmlView = (function (_super) { var HtmlView = (function (_super) {
tslib_1.__extends(HtmlView, _super); tslib_1.__extends(HtmlView, _super);
...@@ -19362,6 +19557,27 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19362,6 +19557,27 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
HtmlView.prototype.afterConstructor = function () { HtmlView.prototype.afterConstructor = function () {
}; };
Object.defineProperty(HtmlView.prototype, "$store", {
get: function () {
var p = this;
do {
if (p['$isViewRoot']) {
break;
}
p = p.parent;
} while (p.parent);
if (p) {
return p['$_store'];
}
},
enumerable: true,
configurable: true
});
HtmlView.prototype.findChildByUUID = function (uuid) {
if (this['uuid'] === uuid) {
return this;
}
};
HtmlView = tslib_1.__decorate([ HtmlView = tslib_1.__decorate([
afterConstructor, afterConstructor,
applyAutoAdjust, applyAutoAdjust,
...@@ -19370,10 +19586,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19370,10 +19586,12 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
], HtmlView); ], HtmlView);
return HtmlView; return HtmlView;
}(FloatDisplay)); }(FloatDisplay));
//# sourceMappingURL=HtmlView.js.map
function isUI(obj) { function isUI(obj) {
return obj.isUI; return obj.isUI;
} }
//# sourceMappingURL=IUIComponent.js.map
var nodeTypeMapping = { var nodeTypeMapping = {
node: Node$1, node: Node$1,
...@@ -19426,6 +19644,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19426,6 +19644,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return node; return node;
} }
//# sourceMappingURL=view-interpreter.js.map
var Toast = (function (_super) { var Toast = (function (_super) {
tslib_1.__extends(Toast, _super); tslib_1.__extends(Toast, _super);
...@@ -19519,6 +19738,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19519,6 +19738,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Toast; return Toast;
}(Node$1)); }(Node$1));
//# sourceMappingURL=Toast.js.map
function createEvalFunc(exp) { function createEvalFunc(exp) {
var func; var func;
...@@ -19549,6 +19769,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19549,6 +19769,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function runExp(exp, scope) { function runExp(exp, scope) {
createRunFunc(exp)(scope); createRunFunc(exp)(scope);
} }
//# sourceMappingURL=Utils.js.map
var Watcher = (function () { var Watcher = (function () {
function Watcher(entity, target, exp, scope, callback) { function Watcher(entity, target, exp, scope, callback) {
...@@ -19637,6 +19858,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19637,6 +19858,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Watcher._uid = 0; Watcher._uid = 0;
return Watcher; return Watcher;
}()); }());
//# sourceMappingURL=Watcher.js.map
var Dep = (function () { var Dep = (function () {
function Dep() { function Dep() {
...@@ -19655,6 +19877,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19655,6 +19877,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Dep; return Dep;
}()); }());
//# sourceMappingURL=Dep.js.map
var Mutator = (function () { var Mutator = (function () {
function Mutator() { function Mutator() {
...@@ -19768,6 +19991,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19768,6 +19991,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
]; ];
return Mutator; return Mutator;
}()); }());
//# sourceMappingURL=Mutator.js.map
var commands = { var commands = {
set: function (context) { set: function (context) {
...@@ -19782,6 +20006,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19782,6 +20006,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return context.target; return context.target;
} }
}; };
//# sourceMappingURL=Commands.js.map
var defaultCmdRegExp = /^(data\-)?z[\-_](\w+)([:\$](.+))?$/; var defaultCmdRegExp = /^(data\-)?z[\-_](\w+)([:\$](.+))?$/;
var Zri = (function () { var Zri = (function () {
...@@ -19848,6 +20073,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19848,6 +20073,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return Zri; return Zri;
}()); }());
//# sourceMappingURL=Zri.js.map
var commands$1 = { var commands$1 = {
prop: function (context) { prop: function (context) {
...@@ -20031,6 +20257,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20031,6 +20257,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return context.target; return context.target;
} }
}; };
//# sourceMappingURL=ZriCommands.js.map
var interruptCmds = ['for', 'if']; var interruptCmds = ['for', 'if'];
var ZriCompiler = (function () { var ZriCompiler = (function () {
...@@ -20100,6 +20327,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20100,6 +20327,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return ZriCompiler; return ZriCompiler;
}()); }());
//# sourceMappingURL=ZriCompiler.js.map
function bind(store, view, options) { function bind(store, view, options) {
var compiler = new ZriCompiler(view); var compiler = new ZriCompiler(view);
...@@ -20120,6 +20348,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20120,6 +20348,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return store; return store;
} }
//# sourceMappingURL=index.js.map
var customMap = {}; var customMap = {};
function registerCustomModules(customs) { function registerCustomModules(customs) {
...@@ -20182,6 +20411,87 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20182,6 +20411,87 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function getProps(id) { function getProps(id) {
return customMap[id].props || {}; return customMap[id].props || {};
} }
//# sourceMappingURL=custom-module.js.map
function dealPxEnv() {
if (queryParams.appID) {
env.appID = queryParams.appID;
}
if (queryParams.channelType) {
env.channelType = queryParams.channelType;
}
if (queryParams.projectID) {
env.projectID = queryParams.projectID;
}
else {
var result = window.location.pathname.match(/\/projectx\/(.*?)\/.*?/);
if (result) {
env.projectID = result[1];
}
}
if (queryParams.is_from_share) {
env.fromShare = true;
}
var newUser = true;
var key = 'nu_' + env.appID + '_' + env.projectID;
var v = localStorage.getItem(key);
if (v) {
newUser = false;
}
else {
localStorage.setItem(key, '1');
}
env.newUser = newUser;
if (window['isSharePage']) {
accessLog(506);
}
}
function cleanNewUser() {
var key = 'nu_' + env.appID + '_' + env.projectID;
localStorage.removeItem(key);
}
function dealPageRemainTime() {
var startTimer = new Date().getTime();
var endTimer;
var visibilityChange;
if (typeof document.hidden !== 'undefined') {
visibilityChange = 'visibilitychange';
}
else if (typeof document['msHidden'] !== 'undefined') {
visibilityChange = 'msvisibilitychange';
}
else if (typeof document['webkitHidden'] !== 'undefined') {
visibilityChange = 'webkitvisibilitychange';
}
var handleVisibilityChange = function (e) {
if (document.visibilityState == "visible") {
startTimer = new Date().getTime();
}
if (document.visibilityState == "hidden") {
endTimer = new Date().getTime();
sendData();
}
};
var sendData = function () {
var t0 = endTimer - startTimer;
accessLog(156, {
remain: t0,
});
};
document.addEventListener(visibilityChange, handleVisibilityChange, false);
document.body['onbeforeunload'] = function () {
endTimer = new Date().getTime();
return sendData();
};
}
function accessLog(pagebizid, params) {
var p = {
pagebizid: pagebizid,
};
injectProp(p, params);
return httpRequest('buriedPoint', 'get', p);
}
//# sourceMappingURL=px-logics.js.map
var GameStage = (function (_super) { var GameStage = (function (_super) {
tslib_1.__extends(GameStage, _super); tslib_1.__extends(GameStage, _super);
...@@ -20240,7 +20550,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20240,7 +20550,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
GameStage.prototype.launch = function (config, onPreloadAssetsProgress, onPreloadAssetsComplete, onStart) { GameStage.prototype.launch = function (config, onAssetsProgress, onAssetsComplete, onStart) {
return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__awaiter(this, void 0, void 0, function () {
function p() { function p() {
loaded++; loaded++;
...@@ -20265,7 +20575,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20265,7 +20575,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
return [4, loadAssetGroup(assets, p).catch(function (e) { return [4, loadAssets(assets, p).catch(function (e) {
console.log(e); console.log(e);
})]; })];
case 1: case 1:
...@@ -20277,7 +20587,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20277,7 +20587,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (!(_a < customs_2.length)) return [3, 5]; if (!(_a < customs_2.length)) return [3, 5];
custom = customs_2[_a]; custom = customs_2[_a];
if (!custom.assets) return [3, 4]; if (!custom.assets) return [3, 4];
return [4, loadAssetGroup(custom.assets, p).catch(function (e) { return [4, loadAssets(custom.assets, p).catch(function (e) {
console.log(e); console.log(e);
})]; })];
case 3: case 3:
...@@ -20288,6 +20598,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20288,6 +20598,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return [3, 2]; return [3, 2];
case 5: case 5:
this.start(); this.start();
dealPxEnv();
dealPageRemainTime();
onStart && onStart(); onStart && onStart();
return [2]; return [2];
} }
...@@ -20363,6 +20675,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20363,6 +20675,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
return GameStage; return GameStage;
}(Node$1)); }(Node$1));
//# sourceMappingURL=GameStage.js.map
var template = "\n<div class=\"zeroing-loading-wrapper\">\n\t<div class=\"zeroing-loading-content\">\n\t</div>\n</div>\n"; var template = "\n<div class=\"zeroing-loading-wrapper\">\n\t<div class=\"zeroing-loading-content\">\n\t</div>\n</div>\n";
var style = "\n.zeroing-loading-wrapper{\n\tposition: absolute;\n\ttop:0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tdisplay: flex;\n\tdisplay: -webkit-flex;\n\tjustify-content: center;\n\t-webkit-justify-content: center;\n\talign-items: center;\n\t-webkit-align-items: center;\n}\n@keyframes part-body\n{\n\t0%,40% {transform: scale(1);}\n\t20% {transform: scale(1.5);}\n}\n.zeroing-loading-part {\n\ttransform-origin: 2px 12px;\n\tposition: absolute;\n}\n.zeroing-loading-part-body{\n\tbackground-color: dimgray;\n\twidth: 4px;\n\theight: 6px;\n\tborder-radius: 2px;\n\ttransform-origin: 2px 6px;\n\tanimation: part-body 1500ms linear infinite;\n}\n"; var style = "\n.zeroing-loading-wrapper{\n\tposition: absolute;\n\ttop:0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tdisplay: flex;\n\tdisplay: -webkit-flex;\n\tjustify-content: center;\n\t-webkit-justify-content: center;\n\talign-items: center;\n\t-webkit-align-items: center;\n}\n@keyframes part-body\n{\n\t0%,40% {transform: scale(1);}\n\t20% {transform: scale(1.5);}\n}\n.zeroing-loading-part {\n\ttransform-origin: 2px 12px;\n\tposition: absolute;\n}\n.zeroing-loading-part-body{\n\tbackground-color: dimgray;\n\twidth: 4px;\n\theight: 6px;\n\tborder-radius: 2px;\n\ttransform-origin: 2px 6px;\n\tanimation: part-body 1500ms linear infinite;\n}\n";
...@@ -20402,6 +20715,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20402,6 +20715,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
}, },
}; };
//# sourceMappingURL=LoadingView.js.map
var _stage; var _stage;
function initAutoLayout(stage) { function initAutoLayout(stage) {
...@@ -20447,7 +20761,44 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20447,7 +20761,44 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
//# sourceMappingURL=auto-layout.js.map
var EditorStage = (function (_super) {
tslib_1.__extends(EditorStage, _super);
function EditorStage(stage) {
var _this = _super.call(this) || this;
_this.name = 'editor-stage';
_this.addEventListener('modify-props', _this.onModifyProps, _this);
return _this;
}
EditorStage.prototype.launch = function (onStart) {
onStart();
};
EditorStage.prototype.showView = function (viewConfig) {
if (this._view) {
this.removeChild(this._view);
}
var view = this._view = instantiate(viewConfig);
this.addChild(view);
};
EditorStage.prototype.getNodeProps = function (nodePath) {
return this._view.getChildByIndexPath(nodePath);
};
EditorStage.prototype.onModifyProps = function (e) {
console.log(e.data);
var _a = e.data, nodePath = _a.nodePath, props = _a.props;
var node = this._view.getChildByIndexPath(nodePath);
if (node) {
injectProperties(node, props);
}
else {
console.warn('node not found:', nodePath);
}
};
return EditorStage;
}(Node$1));
exports.editorMode = false;
function launch(url, loadingDelegate, onStart) { function launch(url, loadingDelegate, onStart) {
if (queryParams.__proxy_mode__) { if (queryParams.__proxy_mode__) {
return Promise.resolve('cancel launch'); return Promise.resolve('cancel launch');
...@@ -20483,30 +20834,39 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20483,30 +20834,39 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
case 1: case 1:
_a.sent(); _a.sent();
return [4, new Promise(function (resolve) { return [4, new Promise(function (resolve) {
var _a = config.options, containerId = _a.containerId, designWidth = _a.designWidth, designHeight = _a.designHeight, frameRate = _a.frameRate, scaleMode = _a.scaleMode, rendererType = _a.rendererType; var _a = config.options, containerId = _a.containerId, designWidth = _a.designWidth, designHeight = _a.designHeight, frameRate = _a.frameRate, scaleMode = _a.scaleMode, rendererType = _a.rendererType, _editorMode = _a.editorMode;
exports.editorMode = _editorMode;
var stage = window['stage'] = new Stage(containerId || "game-container", designWidth || 750, designHeight || 1334, frameRate || 60, scaleMode || StageScaleMode.FIXED_WIDTH, rendererType || exports.RENDERER_TYPE.WEBGL); var stage = window['stage'] = new Stage(containerId || "game-container", designWidth || 750, designHeight || 1334, frameRate || 60, scaleMode || StageScaleMode.FIXED_WIDTH, rendererType || exports.RENDERER_TYPE.WEBGL);
initAutoLayout(stage); initAutoLayout(stage);
Stage.flushAll(); Stage.flushAll();
stage.addEventListener(Event.ON_INIT_STAGE, function () { stage.addEventListener(Event.ON_INIT_STAGE, function () {
if (exports.editorMode) {
exports.editorStage = new EditorStage(stage);
stage.addChild(exports.editorStage);
exports.editorStage.launch(onStart);
}
else {
exports.gameStage = new GameStage(stage); exports.gameStage = new GameStage(stage);
setGlobalContext({ setGlobalContext({
gameStage: exports.gameStage gameStage: exports.gameStage
}); });
stage.addChild(exports.gameStage); stage.addChild(exports.gameStage);
var delegate = loadingDelegate || builtinLoadingView; var delegate_1 = loadingDelegate || builtinLoadingView;
exports.gameStage.launch(config, function (done, total) { exports.gameStage.launch(config, function (done, total) {
delegate.onProgress && delegate.onProgress(done, total); delegate_1.onProgress && delegate_1.onProgress(done, total);
}, function () { }, function () {
delegate.onComplete && delegate.onComplete(); delegate_1.onComplete && delegate_1.onComplete();
}, onStart); }, onStart);
}
}); });
resolve(exports.gameStage); resolve();
})]; })];
case 2: return [2, _a.sent()]; case 2: return [2, _a.sent()];
} }
}); });
}); });
} }
//# sourceMappingURL=launcher.js.map
var emojiRegex = function () { var emojiRegex = function () {
// https://mths.be/emoji // https://mths.be/emoji
...@@ -20605,8 +20965,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20605,8 +20965,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return value; return value;
} }
//# sourceMappingURL=index.es.js.map
var emojiRegexp = emojiRegex(); var emojiRegexp = emojiRegex();
//# sourceMappingURL=index.js.map
exports.BaseTexture = BaseTexture; exports.BaseTexture = BaseTexture;
exports.BaseTextureCache = BaseTextureCache; exports.BaseTextureCache = BaseTextureCache;
...@@ -20670,11 +21032,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20670,11 +21032,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports.URL_FILE_EXTENSION = URL_FILE_EXTENSION; exports.URL_FILE_EXTENSION = URL_FILE_EXTENSION;
exports.VERSION = VERSION; exports.VERSION = VERSION;
exports.abs = abs; exports.abs = abs;
exports.accessLog = accessLog;
exports.addCustomModule = addCustomModule; exports.addCustomModule = addCustomModule;
exports.appendScript = appendScript;
exports.applyEvents = applyEvents; exports.applyEvents = applyEvents;
exports.applyScript = applyScript; exports.applyScript = applyScript;
exports.arrayFind = arrayFind; exports.arrayFind = arrayFind;
exports.backupCanvas = backupCanvas; exports.backupCanvas = backupCanvas;
exports.cleanNewUser = cleanNewUser;
exports.clearTextureCache = clearTextureCache; exports.clearTextureCache = clearTextureCache;
exports.cmdOldPrefix = cmdOldPrefix; exports.cmdOldPrefix = cmdOldPrefix;
exports.cmdPrefix = cmdPrefix; exports.cmdPrefix = cmdPrefix;
...@@ -20737,7 +21102,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20737,7 +21102,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports.launchWithWindowVariable = launchWithWindowVariable; exports.launchWithWindowVariable = launchWithWindowVariable;
exports.linkScheme = linkScheme; exports.linkScheme = linkScheme;
exports.linkedFlag = linkedFlag; exports.linkedFlag = linkedFlag;
exports.loadAssetGroup = loadAssetGroup; exports.loadAssets = loadAssets;
exports.log10 = log10; exports.log10 = log10;
exports.log2 = log2; exports.log2 = log2;
exports.mapWebGLBlendModesToPixi = mapWebGLBlendModesToPixi; exports.mapWebGLBlendModesToPixi = mapWebGLBlendModesToPixi;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -61,9 +61,7 @@ export function executeBehavior(sequence, subEntry = 'main', target, args?) { ...@@ -61,9 +61,7 @@ export function executeBehavior(sequence, subEntry = 'main', target, args?) {
return result; return result;
}, },
e => { e => {
if(log){
console.log(`[${vm.id}] terminate:`, e); console.log(`[${vm.id}] terminate:`, e);
} }
}
); );
} }
/**
* Created by rockyl on 2019-11-05.
*/
import {Stage} from "../../2d/display/index";
import {Node} from "./nodes/Node";
import {instantiate} from "./view-interpreter";
import {injectProperties} from "../utils/utils";
/**
* 编辑器舞台
*/
export class EditorStage extends Node {
private _view: Node;
constructor(stage: Stage) {
super();
this.name = 'editor-stage';
this.addEventListener('modify-props', this.onModifyProps, this);
}
launch(onStart) {
onStart();
}
showView(viewConfig) {
if (this._view) {
this.removeChild(this._view);
}
let view = this._view = instantiate(viewConfig);
this.addChild(view);
}
getNodeProps(nodePath) {
return this._view.getChildByIndexPath(nodePath);
}
private onModifyProps(e) {
console.log(e.data);
const {nodePath, props} = e.data;
let node = this._view.getChildByIndexPath(nodePath);
if (node) {
injectProperties(node, props);
} else {
console.warn('node not found:', nodePath);
}
}
}
...@@ -100,6 +100,7 @@ export class GameStage extends Node { ...@@ -100,6 +100,7 @@ export class GameStage extends Node {
* @param config * @param config
* @param onAssetsProgress * @param onAssetsProgress
* @param onAssetsComplete * @param onAssetsComplete
* @param onStart
*/ */
async launch(config, onAssetsProgress?, onAssetsComplete?, onStart?) { async launch(config, onAssetsProgress?, onAssetsComplete?, onStart?) {
this._config = config; this._config = config;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-08. * Created by rockyl on 2019-11-08.
*/ */
import {Stage} from "../2d/display"; import {Stage} from "../2d/display/index";
import {registerCustomModuleFromConfig, registerScripts, RENDERER_TYPE, setProcessMetaLibs, StageScaleMode} from ".."; import {registerCustomModuleFromConfig, registerScripts, RENDERER_TYPE, setProcessMetaLibs, StageScaleMode} from "..";
import {GameStage} from "./game-warpper/index"; import {GameStage} from "./game-warpper/index";
import {setGlobalContext} from "./behavior-runtime"; import {setGlobalContext} from "./behavior-runtime";
...@@ -11,8 +11,12 @@ import {Event} from "../2d/events/Event"; ...@@ -11,8 +11,12 @@ import {Event} from "../2d/events/Event";
import builtinLoadingView from "./game-warpper/LoadingView"; import builtinLoadingView from "./game-warpper/LoadingView";
import {queryParams} from "./web"; import {queryParams} from "./web";
import {initAutoLayout} from "./game-warpper/auto-layout"; import {initAutoLayout} from "./game-warpper/auto-layout";
import {EditorStage} from "./game-warpper/EditorStage";
export let gameStage: GameStage; export let gameStage: GameStage;
export let editorStage: EditorStage;
export let editorMode = false;
export function launch(url, loadingDelegate?, onStart?) { export function launch(url, loadingDelegate?, onStart?) {
if (queryParams.__proxy_mode__) { if (queryParams.__proxy_mode__) {
...@@ -51,7 +55,9 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) { ...@@ -51,7 +55,9 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
setTimeout(resolve, 300); setTimeout(resolve, 300);
}); });
return await new Promise(resolve => { return await new Promise(resolve => {
const {containerId, designWidth, designHeight, frameRate, scaleMode, rendererType,} = config.options; const {containerId, designWidth, designHeight, frameRate, scaleMode, rendererType, editorMode: _editorMode,} = config.options;
editorMode = _editorMode;
let stage = window['stage'] = new Stage( let stage = window['stage'] = new Stage(
containerId || "game-container", containerId || "game-container",
designWidth || 750, designWidth || 750,
...@@ -64,6 +70,11 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) { ...@@ -64,6 +70,11 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
Stage.flushAll(); Stage.flushAll();
stage.addEventListener(Event.ON_INIT_STAGE, () => { stage.addEventListener(Event.ON_INIT_STAGE, () => {
if (editorMode) {
editorStage = new EditorStage(stage);
stage.addChild(editorStage);
editorStage.launch(onStart)
} else {
gameStage = new GameStage(stage); gameStage = new GameStage(stage);
setGlobalContext({ setGlobalContext({
gameStage gameStage
...@@ -77,8 +88,9 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) { ...@@ -77,8 +88,9 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
}, function () { }, function () {
delegate.onComplete && delegate.onComplete(); delegate.onComplete && delegate.onComplete();
}, onStart); }, onStart);
}
}); });
resolve(gameStage); resolve();
}) })
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment