Commit da6983b2 authored by wildfirecode's avatar wildfirecode

1

parent 6775f6d8
File added
{"map":"{\"version\":3,\"file\":\"TextRenderer.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/TextRenderer.ts\"],\"names\":[],\"mappings\":\";AAIA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,UAAU,EAAoB,MAAM,QAAQ,CAAC;AAEvE,IAAA,kDAAkB,EAAE,gDAAiB,CAAe;AAE3D,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IAIpB,0BAAa,CAAA;IAIb,8BAAiB,CAAA;IAIjB,4BAAe,CAAA;AAChB,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB;AAED,MAAM,CAAN,IAAY,aAaX;AAbD,WAAY,aAAa;IAIxB,4BAAW,CAAA;IAIX,kCAAiB,CAAA;IAIjB,kCAAiB,CAAA;AAClB,CAAC,EAbW,aAAa,KAAb,aAAa,QAaxB;AAKD;IAA0C,wCAAe;IAAzD;QAAA,qEAubC;QAlbA,UAAI,GAAW,EAAE,CAAC;QAMlB,cAAQ,GAAQ,IAAI,CAAC;QAMrB,eAAS,GAAc,SAAS,CAAC,MAAM,CAAC;QAMxC,mBAAa,GAAkB,aAAa,CAAC,MAAM,CAAC;QAMpD,iBAAW,GAAW,CAAC,CAAC;QAMxB,mBAAa,GAAW,CAAC,CAAC;QAQhB,iBAAW,GAAW,GAAG,CAAC;QAC1B,oBAAc,GAAW,CAAC,CAAC;QAQrC,eAAS,GAAc,IAAI,SAAS,EAAE,CAAC;QAGvC,kBAAY,GAAY,IAAI,CAAC;QAMnB,kBAAY,GAAQ,EAAE,CAAC;;IA0XlC,CAAC;IAxXU,+BAAQ,GAAlB,UAAmB,KAAK,EAAE,GAAG,EAAE,QAAQ;QACtC,iBAAM,QAAQ,YAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAErC,QAAQ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,CAAC,cAAc,EAAE,CAAC;SACtB;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;QAEjB,iBAAM,aAAa,WAAE,CAAC;IACvB,CAAC;IAjbD;QADC,kBAAkB;8CACD;IAMlB;QADC,iBAAiB;kDACG;IAMrB;QADC,kBAAkB;mDACqB;IAMxC;QADC,kBAAkB;uDACiC;IAMpD;QADC,kBAAkB;qDACK;IAMxB;QADC,kBAAkB;uDACO;IAM1B;QADC,kBAAkB;iDACD;IAWlB;QADC,kBAAkB;mDACoB;IAGvC;QADC,kBAAkB;sDACU;IAgY9B,mBAAC;CAAA,AAvbD,CAA0C,eAAe,GAubxD;eAvboB,YAAY\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport GraphicRenderer from \"./GraphicRenderer\";\r\nimport { TextStyle, EngineConfig, decorators } from \"scilla\";\r\nvar dirtyFieldDetector = decorators.dirtyFieldDetector, dirtyFieldTrigger = decorators.dirtyFieldTrigger;\r\nexport var TextAlign;\r\n(function (TextAlign) {\r\n TextAlign[\"LEFT\"] = \"left\";\r\n TextAlign[\"CENTER\"] = \"center\";\r\n TextAlign[\"RIGHT\"] = \"right\";\r\n})(TextAlign || (TextAlign = {}));\r\nexport var VerticalAlign;\r\n(function (VerticalAlign) {\r\n VerticalAlign[\"TOP\"] = \"top\";\r\n VerticalAlign[\"MIDDLE\"] = \"middle\";\r\n VerticalAlign[\"BOTTOM\"] = \"bottom\";\r\n})(VerticalAlign || (VerticalAlign = {}));\r\nvar TextRenderer = (function (_super) {\r\n tslib_1.__extends(TextRenderer, _super);\r\n function TextRenderer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.text = '';\r\n _this.textFlow = null;\r\n _this.textAlign = TextAlign.CENTER;\r\n _this.verticalAlign = VerticalAlign.MIDDLE;\r\n _this.lineSpacing = 0;\r\n _this.letterSpacing = 0;\r\n _this._lineHeight = NaN;\r\n _this._bmpLineHeight = 0;\r\n _this.textStyle = new TextStyle();\r\n _this.useCacheMode = true;\r\n _this.measureCache = {};\r\n return _this;\r\n }\r\n TextRenderer.prototype.onModify = function (value, key, oldValue) {\r\n _super.prototype.onModify.call(this, value, key, oldValue);\r\n switch (key) {\r\n case 'textFlow':\r\n if (value) {\r\n this.updateTextFlow();\r\n }\r\n break;\r\n case 'textStyle':\r\n value.onChange = this.makeDirty.bind(this);\r\n this.makeDirty();\r\n break;\r\n }\r\n };\r\n TextRenderer.prototype.updateTextFlow = function () {\r\n var e_1, _a;\r\n var text = '';\r\n if (this.textFlow) {\r\n try {\r\n for (var _b = tslib_1.__values(this.textFlow), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var item = _c.value;\r\n text += item.text;\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n this._pureText = text;\r\n this.makeDirty();\r\n };\r\n Object.defineProperty(TextRenderer.prototype, \"lineHeight\", {\r\n get: function () {\r\n return isNaN(this._lineHeight) ? (this.isBmpMode ? this._bmpLineHeight : this.textStyle.fontSize * EngineConfig.lineHeightRatio) : this._lineHeight;\r\n },\r\n set: function (value) {\r\n if (this._lineHeight != value) {\r\n this._lineHeight = value;\r\n this.dirty = true;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextRenderer.prototype, \"pureText\", {\r\n get: function () {\r\n return this.textFlow ? this._pureText : this.text;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n TextRenderer.prototype.getRenderSize = function () {\r\n return {\r\n width: this._textWidth,\r\n height: this._textHeight,\r\n };\r\n };\r\n TextRenderer.prototype.beforeDraw = function () {\r\n _super.prototype.beforeDraw.call(this);\r\n if (!this.isBmpMode) {\r\n this.applyTextStyle();\r\n }\r\n };\r\n TextRenderer.prototype.applyTextStyle = function () {\r\n var _a = this, context = _a.context, textStyle = _a.textStyle;\r\n var fontStyle = textStyle.fontStyle, fontVariant = textStyle.fontVariant, fontWeight = textStyle.fontWeight, fontSize = textStyle.fontSize, fontFamily = textStyle.fontFamily;\r\n context.font = fontStyle + \" \" + fontVariant + \" \" + fontWeight + \" \" + fontSize + \"px \" + fontFamily;\r\n };\r\n TextRenderer.prototype.fillAndStoke = function () {\r\n if (!this.pureText || this.pureText.length == 0) {\r\n return;\r\n }\r\n var _a = this, context = _a.context, measureCache = _a.measureCache, lineHeight = _a.lineHeight, lineSpacing = _a.lineSpacing, letterSpacing = _a.letterSpacing, rows = _a.rows, textAlign = _a.textAlign, verticalAlign = _a.verticalAlign, isBmpMode = _a.isBmpMode, _b = _a.transform, width = _b.width, height = _b.height;\r\n var rowCount = rows.length;\r\n var x = 0;\r\n switch (textAlign) {\r\n case \"left\":\r\n x = 0;\r\n break;\r\n case \"right\":\r\n x = width;\r\n break;\r\n case \"center\":\r\n default:\r\n x = width / 2;\r\n break;\r\n }\r\n var y = 0;\r\n var drawHeight = rowCount * lineHeight + lineSpacing * (rowCount - 1);\r\n switch (verticalAlign) {\r\n case \"top\":\r\n y = 0;\r\n break;\r\n case \"bottom\":\r\n y = height - drawHeight;\r\n break;\r\n case \"middle\":\r\n default:\r\n y = (height - drawHeight) / 2;\r\n break;\r\n }\r\n y += lineHeight;\r\n context.textAlign = letterSpacing == 0 && !this.textFlow ? textAlign : 'left';\r\n context.textBaseline = 'bottom';\r\n var offY = 0;\r\n for (var i = 0; i < rowCount; i++) {\r\n var _c = rows[i], text = _c.text, lineWidth = _c.lineWidth;\r\n if (letterSpacing == 0 && !isBmpMode && !this.textFlow) {\r\n this.drawText(i, text, x, y + offY);\r\n }\r\n else {\r\n var offX = 0;\r\n switch (textAlign) {\r\n case \"left\":\r\n offX = 0;\r\n break;\r\n case \"right\":\r\n offX = -lineWidth;\r\n break;\r\n case \"center\":\r\n default:\r\n offX = -lineWidth / 2;\r\n break;\r\n }\r\n for (var j = 0, lj = text.length; j < lj; j++) {\r\n var char = text[j];\r\n this.drawText(j, char, x + offX, y + offY);\r\n if (measureCache[char].width > 0) {\r\n offX += measureCache[char].width + letterSpacing;\r\n }\r\n }\r\n }\r\n offY += lineHeight + lineSpacing;\r\n }\r\n };\r\n TextRenderer.prototype.getStyle = function (index) {\r\n var e_2, _a;\r\n if (!this.textFlow) {\r\n return null;\r\n }\r\n var targetItem;\r\n var count = 0;\r\n try {\r\n for (var _b = tslib_1.__values(this.textFlow), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var item = _c.value;\r\n count += item.text.length;\r\n if (index < count) {\r\n targetItem = item;\r\n break;\r\n }\r\n }\r\n }\r\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n }\r\n return targetItem.style;\r\n };\r\n TextRenderer.prototype.drawText = function (index, text, x, y) {\r\n var _a = this, context = _a.context, borderWidth = _a.borderWidth, isBmpMode = _a.isBmpMode, fontRes = _a.fontRes;\r\n if (isBmpMode) {\r\n var texture = fontRes.getTexture(text);\r\n if (!texture) {\r\n return;\r\n }\r\n var _b = texture.bounds, textureX = _b.x, textureY = _b.y, textureWidth = _b.width, textureHeight = _b.height;\r\n context.drawImage(texture.img, textureX, textureY, textureWidth, textureHeight, x, y, textureWidth, textureHeight);\r\n }\r\n else {\r\n var style = this.getStyle(index);\r\n if (style) {\r\n if (style.hasOwnProperty('textColor')) {\r\n context.fillStyle = style.textColor;\r\n }\r\n }\r\n else {\r\n context.fillStyle = this.fillColor;\r\n }\r\n context.fillText(text, x, y + 1);\r\n if (borderWidth > 0) {\r\n context.strokeText(text, x, y + 1);\r\n }\r\n }\r\n };\r\n Object.defineProperty(TextRenderer.prototype, \"isBmpMode\", {\r\n get: function () {\r\n return !!this.fontRes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n TextRenderer.prototype.measureText = function (text) {\r\n var e_3, _a, e_4, _b;\r\n var result;\r\n if (this.measureCache.hasOwnProperty(text)) {\r\n result = this.measureCache[text];\r\n }\r\n else {\r\n var _c = this, context = _c.context, letterSpacing = _c.letterSpacing, isBmpMode = _c.isBmpMode, fontRes = _c.fontRes, lineHeight = _c.lineHeight;\r\n if (isBmpMode) {\r\n if (text.length == 1) {\r\n var texture = fontRes.getTexture(text);\r\n result = {\r\n width: texture ? texture.width : 0,\r\n height: texture ? texture.height : 0,\r\n };\r\n }\r\n else {\r\n var totalWidth = 0, totalHeight = 0;\r\n try {\r\n for (var text_1 = tslib_1.__values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {\r\n var char = text_1_1.value;\r\n var measureResult = this.measureText(char);\r\n totalWidth += measureResult.width;\r\n if (measureResult.height > totalHeight) {\r\n totalHeight = measureResult.height;\r\n }\r\n }\r\n }\r\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\r\n finally {\r\n try {\r\n if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);\r\n }\r\n finally { if (e_3) throw e_3.error; }\r\n }\r\n result = {\r\n width: totalWidth,\r\n height: totalHeight,\r\n };\r\n }\r\n }\r\n else {\r\n result = {\r\n width: context.measureText(text).width,\r\n height: lineHeight,\r\n };\r\n }\r\n result.width += letterSpacing * (text.length - 1);\r\n if (text.length == 1) {\r\n this.measureCache[text] = result;\r\n }\r\n if (letterSpacing != 0 && text.length > 1 || this.textFlow) {\r\n try {\r\n for (var text_2 = tslib_1.__values(text), text_2_1 = text_2.next(); !text_2_1.done; text_2_1 = text_2.next()) {\r\n var char = text_2_1.value;\r\n this.measureCache[char] = this.measureText(char);\r\n }\r\n }\r\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\r\n finally {\r\n try {\r\n if (text_2_1 && !text_2_1.done && (_b = text_2.return)) _b.call(text_2);\r\n }\r\n finally { if (e_4) throw e_4.error; }\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n TextRenderer.prototype.splitText = function () {\r\n var e_5, _a;\r\n var _b = this, text = _b.pureText, letterSpacing = _b.letterSpacing, lineSpacing = _b.lineSpacing, lineHeight = _b.lineHeight, isBmpMode = _b.isBmpMode, _c = _b.transform, explicitWidth = _c.explicitWidth, explicitHeight = _c.explicitHeight;\r\n this.measureCache = {};\r\n var textWidth = 0, textHeight = 0, maxHeight = 0;\r\n var rows = [], measureResult;\r\n if (text && text.length > 0) {\r\n if (isNaN(explicitWidth)) {\r\n var lines = text.split('\\n');\r\n try {\r\n for (var lines_1 = tslib_1.__values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {\r\n var line = lines_1_1.value;\r\n measureResult = this.measureText(line);\r\n var mw = measureResult.width;\r\n if (mw > textWidth) {\r\n textWidth = mw;\r\n }\r\n if (isBmpMode) {\r\n var mh = measureResult.height;\r\n if (mh > maxHeight) {\r\n maxHeight = mh;\r\n }\r\n }\r\n rows.push({\r\n text: line,\r\n lineWidth: mw,\r\n });\r\n }\r\n }\r\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\r\n finally {\r\n try {\r\n if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);\r\n }\r\n finally { if (e_5) throw e_5.error; }\r\n }\r\n if (!isBmpMode) {\r\n maxHeight = lineHeight;\r\n }\r\n this._bmpLineHeight = maxHeight;\r\n }\r\n else {\r\n var chars = text.split('');\r\n var lineWidth = 0, charWidth = 0, index = 0;\r\n var line = '';\r\n for (var i = 0, li = chars.length; i < li; i++) {\r\n var char = chars[i];\r\n if (char == '\\n') {\r\n rows.push({\r\n text: line,\r\n lineWidth: lineWidth,\r\n });\r\n line = '';\r\n lineWidth = 0;\r\n index = 0;\r\n }\r\n else {\r\n measureResult = this.measureText(char);\r\n if (measureResult.width == 0) {\r\n continue;\r\n }\r\n charWidth = measureResult.width;\r\n var mh = measureResult.height;\r\n if (mh > maxHeight) {\r\n maxHeight = mh;\r\n }\r\n if (index > 0 && lineWidth + charWidth + (index == 0 ? 0 : letterSpacing) > explicitWidth) {\r\n rows.push({\r\n text: line,\r\n lineWidth: lineWidth,\r\n });\r\n line = '';\r\n lineWidth = 0;\r\n index = 0;\r\n }\r\n line += char;\r\n lineWidth += charWidth + (index == 0 ? 0 : letterSpacing);\r\n index++;\r\n }\r\n }\r\n this._bmpLineHeight = maxHeight;\r\n rows.push({\r\n text: line,\r\n lineWidth: lineWidth,\r\n });\r\n textWidth = explicitWidth;\r\n }\r\n textHeight = isNaN(explicitHeight) ? (maxHeight * rows.length + lineSpacing * (rows.length - 1)) : explicitHeight;\r\n }\r\n else {\r\n textWidth = isNaN(explicitWidth) ? 0 : explicitWidth;\r\n textHeight = isNaN(explicitHeight) ? 0 : explicitHeight;\r\n }\r\n this.rows = rows;\r\n this._textWidth = textWidth;\r\n this._textHeight = textHeight;\r\n return {\r\n rows: rows,\r\n textWidth: textWidth,\r\n textHeight: textHeight,\r\n };\r\n };\r\n TextRenderer.prototype.measureBounds = function () {\r\n if (!this.dirty) {\r\n return;\r\n }\r\n if (!this.isBmpMode) {\r\n this.applyTextStyle();\r\n }\r\n this.splitText();\r\n _super.prototype.measureBounds.call(this);\r\n };\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"text\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldTrigger\r\n ], TextRenderer.prototype, \"textFlow\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"textAlign\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"verticalAlign\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"lineSpacing\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"letterSpacing\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"fontRes\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"textStyle\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextRenderer.prototype, \"useCacheMode\", void 0);\r\n return TextRenderer;\r\n}(GraphicRenderer));\r\nexport default TextRenderer;\r\n//# sourceMappingURL=TextRenderer.js.map"}
{"map":"{\"version\":3,\"file\":\"FrameAnimationRenderer.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/FrameAnimationRenderer.ts\"],\"names\":[],\"mappings\":\";AAQA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAiB,WAAW,EAAC,MAAM,QAAQ,CAAC;AAKnD;IAAoD,kDAAQ;IAA5D;QAAA,qEAyJC;QAjJO,cAAQ,GAAY,KAAK,CAAC;QAK1B,SAAG,GAAW,GAAG,CAAC;QAElB,gBAAU,GAAgB,IAAI,WAAW,EAAE,CAAC;QAC5C,oBAAc,GAAgB,IAAI,WAAW,EAAE,CAAC;;IAyIxD,CAAC;IAxHA,wCAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;QAEhB,IAAG,IAAI,CAAC,QAAQ,EAAC;YAChB,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SACjB;IACF,CAAC;IAKD,yCAAQ,GAAR,UAAS,CAAC;QACT,IAAI,IAAI,CAAC,QAAQ,EAAE;YACZ,IAAA,SAAoD,EAAnD,kCAAc,EAAE,4BAAW,EAAE,wBAAS,EAAE,YAAW,CAAC;YAE3D,IAAI,IAAI,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;gBACxB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;gBACpB,IAAI,CAAC,aAAa,EAAG,CAAC;aACtB;YAED,IAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,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,YAAY,EAAE,aAAa,CAAC,CAAC;YAE1D,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,GAAC,EAAE,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;SACvG;IACF,CAAC;IACF,6BAAC;AAAD,CAAC,AAzJD,CAAoD,QAAQ,GAyJ3D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport Renderer from \"./Renderer\";\r\nimport { ScillaEvent } from \"scilla\";\r\nvar FrameAnimationRenderer = (function (_super) {\r\n tslib_1.__extends(FrameAnimationRenderer, _super);\r\n function FrameAnimationRenderer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.autoPlay = false;\r\n _this.fps = NaN;\r\n _this.onComplete = new ScillaEvent();\r\n _this.onLoopComplete = new ScillaEvent();\r\n return _this;\r\n }\r\n FrameAnimationRenderer.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n if (this.autoPlay) {\r\n this.play(0, -1);\r\n }\r\n };\r\n FrameAnimationRenderer.prototype.onUpdate = function (t) {\r\n if (this._playing) {\r\n var _a = this, frameAnimation = _a.frameAnimation, _startFrame = _a._startFrame, _endFrame = _a._endFrame, fps = _a.fps;\r\n if (this._startFlag) {\r\n this._startFlag = false;\r\n this._startTime = t;\r\n this._loopCounting++;\r\n }\r\n var mFPS = isNaN(fps) ? frameAnimation.fps : fps;\r\n var passTime = t - this._startTime;\r\n var passFrameCount = Math.floor(passTime / (1000 / mFPS));\r\n var passFrameInRegion = passFrameCount % (_endFrame - _startFrame + 1);\r\n this._currentFrameIndex = _startFrame + passFrameInRegion;\r\n if (passFrameInRegion == 0 && passFrameCount > 0) {\r\n this._currentFrameIndex = _endFrame;\r\n this.onLoopEnd();\r\n }\r\n }\r\n _super.prototype.onUpdate.call(this, t);\r\n };\r\n FrameAnimationRenderer.prototype.onSleep = function () {\r\n _super.prototype.onSleep.call(this);\r\n };\r\n FrameAnimationRenderer.prototype.onLoopEnd = function () {\r\n if (this._loop < 0) {\r\n this._startFlag = true;\r\n this.onLoopComplete.invoke();\r\n }\r\n else if (this._loopCounting < this._loop) {\r\n this._startFlag = true;\r\n this.onLoopComplete.invoke();\r\n }\r\n else {\r\n this._playing = false;\r\n this.onComplete.invoke();\r\n }\r\n };\r\n FrameAnimationRenderer.prototype.play = function (frame, loop, force) {\r\n if (frame === void 0) { frame = 0; }\r\n if (loop === void 0) { loop = 0; }\r\n if (force === void 0) { force = true; }\r\n this._loop = loop;\r\n this._loopCounting = 0;\r\n if (!this.frameAnimation) {\r\n return;\r\n }\r\n var startFrame = 0, endFrame = this.frameAnimation.frameCount - 1;\r\n if (typeof frame == 'string') {\r\n var label = this.frameAnimation.getLabel(frame);\r\n if (label) {\r\n startFrame = label.frame - 1;\r\n endFrame = label.end;\r\n }\r\n }\r\n else {\r\n startFrame = frame;\r\n }\r\n this._startFrame = startFrame;\r\n this._endFrame = endFrame;\r\n this._currentFrameIndex = this._startFrame;\r\n this._startFlag = true;\r\n this._playing = true;\r\n };\r\n FrameAnimationRenderer.prototype.stop = function () {\r\n this._playing = false;\r\n };\r\n FrameAnimationRenderer.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (!this.frameAnimation) {\r\n return;\r\n }\r\n var _a = this, context = _a.context, frameAnimation = _a.frameAnimation, _currentFrameIndex = _a._currentFrameIndex, bounds = _a.bounds;\r\n var _b = frameAnimation.getFrame(_currentFrameIndex), texture = _b.texture, data = _b.data;\r\n if (texture) {\r\n var img = texture.img, _c = texture.bounds, x_1 = _c.x, y = _c.y, textureWidth = _c.width, textureHeight = _c.height;\r\n bounds.setTo(data.x, data.y, textureWidth, textureHeight);\r\n context.drawImage(img, x_1, y, textureWidth, textureHeight, data.x, data.y, textureWidth, textureHeight);\r\n }\r\n };\r\n return FrameAnimationRenderer;\r\n}(Renderer));\r\nexport default FrameAnimationRenderer;\r\n//# sourceMappingURL=FrameAnimationRenderer.js.map"}
{"map":"{\"version\":3,\"file\":\"InteractComponent.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/base/InteractComponent.ts\"],\"names\":[],\"mappings\":\";AAIA,OAAO,EAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAC,MAAM,QAAQ,CAAC;AAC3D,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAErC,IAAA,gDAAiB,CAAe;AAKvC;IAA+C,6CAAe;IAkB7D;QAAA,YACC,iBAAO,SAEP;QAhBD,kBAAY,GAAG,IAAI,CAAC;QAKpB,oBAAc,GAAY,KAAK,CAAC;QAEtB,kBAAY,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC/B,cAAQ,GAAQ,EAAE,CAAC;QACnB,WAAK,GAAG,IAAI,CAAC;;IAOvB,CAAC;IAED,iDAAqB,GAArB,UAAsB,CAAC;QACtB,IAAI,SAAS,GAAG,iBAAM,qBAAqB,YAAC,CAAC,CAAC,CAAC;QAE/C,IAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,KAAK,EAAE;YACV,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACrB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;SACvB;QAED,OAAO,KAAK,IAAI,SAAS,CAAC;IAC3B,CAAC;IAED,gDAAoB,GAApB,UAAqB,CAAC;QACrB,IAAI,SAAS,GAAG,iBAAM,oBAAoB,YAAC,CAAC,CAAC,CAAC;QAE9C,IAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,KAAK,EAAE;YACV,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YACvB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;SACpB;aAAM;YACN,IAAI,CAAC,aAA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AC,SAAS,EAAE,CAAC;QAC1C,IAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACvC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9B,YAAY,CAAC,MAAM,EAAE,CAAC;QACtB,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAErD,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;;YACtD,KAAqB,IAAA,cAAA,iBAAA,SAAS,CAAA,oCAAA,2DAAE;gBAA3B,IAAI,QAAQ,sBAAA;gBAChB,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;oBACvD,IAAI,QAAQ,CAAC,YAAY,EAAE;wBAC1B,SAAQ;qBACR;yBAAM;wBACN,MAAM,GAAG,IAAI,CAAC;wBACd,MAAK;qBACL;iBACD;qBAAM,IAAI,QAAQ,CAAC,YAAY,EAAE;oBACjC,OAAO,KAAK,CAAA;iBACZ;aACD;;;;;;;;;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IA/HD;QADC,iBAAiB;2DACE;IAgIrB,wBAAC;CAAA,AArID,CAA+C,eAAe,GAqI7D;eArIoB,iBAAiB\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { Matrix, ScillaComponent, decorators } from \"scilla\";\r\nimport Renderer from \"../renderer/Renderer\";\r\nvar dirtyFieldTrigger = decorators.dirtyFieldTrigger;\r\nvar InteractComponent = (function (_super) {\r\n tslib_1.__extends(InteractComponent, _super);\r\n function InteractComponent() {\r\n var _this = _super.call(this) || this;\r\n _this.interactable = true;\r\n _this.touchInterrupt = false;\r\n _this.invertMatrix = Matrix.create();\r\n _this.localPos = {};\r\n _this.isOut = true;\r\n return _this;\r\n }\r\n InteractComponent.prototype._dealGlobalTouchBegin = function (e) {\r\n var interrupt = _super.prototype._dealGlobalTouchBegin.call(this, e);\r\n var hitOn = this.hitTest(e);\r\n if (hitOn) {\r\n this._touchBeginFlag = true;\r\n this.onTouchBegin(e);\r\n this._dealTouchOver(e);\r\n }\r\n return hitOn && interrupt;\r\n };\r\n InteractComponent.prototype._dealGlobalTouchMove = function (e) {\r\n var interrupt = _super.prototype._dealGlobalTouchMove.call(this, e);\r\n var hitOn = this.hitTest(e);\r\n if (hitOn) {\r\n this._dealTouchOver(e);\r\n this.onTouchMove(e);\r\n }\r\n else {\r\n this._dealTouchOut(e);\r\n }\r\n return hitOn && interrupt;\r\n };\r\n InteractComponent.prototype._dealGlobalTouchEnd = function (e) {\r\n var interrupt = _super.prototype._dealGlobalTouchEnd.call(this, e);\r\n var hitOn = this.hitTest(e);\r\n if (hitOn) {\r\n this.onTouchEnd(e);\r\n if (this._touchBeginFlag) {\r\n this.onTouchTap(e);\r\n this._touchBeginFlag = false;\r\n }\r\n }\r\n this.isOut = true;\r\n return hitOn && interrupt;\r\n };\r\n InteractComponent.prototype._dealTouchOver = function (e) {\r\n if (this.isOut) {\r\n this.isOut = false;\r\n this.onTouchOver(e);\r\n }\r\n };\r\n InteractComponent.prototype._dealTouchOut = function (e) {\r\n if (!this.isOut) {\r\n this.isOut = true;\r\n this.onTouchOut(e);\r\n }\r\n };\r\n InteractComponent.prototype.onTouchBegin = function (e) {\r\n };\r\n InteractComponent.prototype.onTouchMove = function (e) {\r\n };\r\n InteractComponent.prototype.onTouchOver = function (e) {\r\n };\r\n InteractComponent.prototype.onTouchOut = function (e) {\r\n };\r\n InteractComponent.prototype.onTouchEnd = function (e) {\r\n };\r\n InteractComponent.prototype.onTouchTap = function (e) {\r\n };\r\n InteractComponent.prototype.hitTest = function (e) {\r\n var e_1, _a;\r\n var matrix = this.transform.getMatrix();\r\n var invertMatrix = this.invertMatrix;\r\n invertMatrix.copyFrom(matrix);\r\n invertMatrix.invert();\r\n invertMatrix.transformPoint(e.x, e.y, this.localPos);\r\n var result = false;\r\n var renderers = this.entity.getComponents(Renderer);\r\n try {\r\n for (var renderers_1 = tslib_1.__values(renderers), renderers_1_1 = renderers_1.next(); !renderers_1_1.done; renderers_1_1 = renderers_1.next()) {\r\n var renderer = renderers_1_1.value;\r\n if (renderer.hitTest(this.localPos.x, this.localPos.y)) {\r\n if (renderer.isUsedToMask) {\r\n continue;\r\n }\r\n else {\r\n result = true;\r\n break;\r\n }\r\n }\r\n else if (renderer.isUsedToMask) {\r\n return false;\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (renderers_1_1 && !renderers_1_1.done && (_a = renderers_1.return)) _a.call(renderers_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return result;\r\n };\r\n tslib_1.__decorate([\r\n dirtyFieldTrigger\r\n ], InteractComponent.prototype, \"interactable\", void 0);\r\n return InteractComponent;\r\n}(ScillaComponent));\r\nexport default InteractComponent;\r\n//# sourceMappingURL=InteractComponent.js.map"}
{"map":"{\"version\":3,\"file\":\"TextureRenderer.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/TextureRenderer.ts\"],\"names\":[],\"mappings\":\";AAIA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAU,UAAU,EAAC,MAAM,QAAQ,CAAC;AAEpC,IAAA,kDAAkB,CAAe;AAExC,MAAM,CAAN,IAAY,QAaX;AAbD,WAAY,QAAQ;IAInB,2CAAM,CAAA;IAIN,2CAAM,CAAA;IAIN,yCAAK,CAAA;AACN,CAAC,EAbW,QAAQ,KAAR,QAAQ,QAanB;AAKD;IAA6C,2CAAQ;IAArD;QAAA,qEAqIC;QA1HA,cAAQ,GAAa,QAAQ,CAAC,MAAM,CAAC;QAMrC,aAAO,GAAG,EAAE,CAAC;;IAoHd,CAAC;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Q,GAqIpD;eArIoB,eAAe\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport Renderer from \"./Renderer\";\r\nimport { decorators } from \"scilla\";\r\nvar dirtyFieldDetector = decorators.dirtyFieldDetector;\r\nexport var FillMode;\r\n(function (FillMode) {\r\n FillMode[FillMode[\"NORMAL\"] = 0] = \"NORMAL\";\r\n FillMode[FillMode[\"SLICED\"] = 1] = \"SLICED\";\r\n FillMode[FillMode[\"TILED\"] = 2] = \"TILED\";\r\n})(FillMode || (FillMode = {}));\r\nvar TextureRenderer = (function (_super) {\r\n tslib_1.__extends(TextureRenderer, _super);\r\n function TextureRenderer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.fillMode = FillMode.NORMAL;\r\n _this.filters = [];\r\n return _this;\r\n }\r\n Object.defineProperty(TextureRenderer.prototype, \"hasFilters\", {\r\n get: function () {\r\n return this.filters && this.filters.length > 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n TextureRenderer.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.drawImage();\r\n this.applyFilters();\r\n };\r\n TextureRenderer.prototype.applyFilters = function () {\r\n var e_1, _a;\r\n if (!this.hasFilters)\r\n return;\r\n var _b = this, texture = _b.texture, filters = _b.filters, context = _b.context;\r\n var _c = texture.bounds, textureWidth = _c.width, textureHeight = _c.height;\r\n var imageData = context.getImageData(0, 0, textureWidth, textureHeight);\r\n try {\r\n for (var filters_1 = tslib_1.__values(filters), filters_1_1 = filters_1.next(); !filters_1_1.done; filters_1_1 = filters_1.next()) {\r\n var filter = filters_1_1.value;\r\n filter.drawFilter(imageData);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (filters_1_1 && !filters_1_1.done && (_a = filters_1.return)) _a.call(filters_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n context.putImageData(imageData, 0, 0);\r\n };\r\n TextureRenderer.prototype.drawImage = function () {\r\n if (!this.texture) {\r\n return;\r\n }\r\n var _a = this, texture = _a.texture, fillMode = _a.fillMode, context = _a.context, _b = _a.bounds, width = _b.width, height = _b.height;\r\n var _c = texture.bounds, x = _c.x, y = _c.y, textureWidth = _c.width, textureHeight = _c.height;\r\n switch (fillMode) {\r\n case FillMode.NORMAL:\r\n texture.drawToCanvas(context);\r\n break;\r\n case FillMode.SLICED:\r\n break;\r\n case FillMode.TILED:\r\n var textureCanvas = texture.getCacheCanvas();\r\n var pattern = context.createPattern(textureCanvas, 'repeat');\r\n context.rect(0, 0, width, height);\r\n context.fillStyle = pattern;\r\n context.fill();\r\n break;\r\n }\r\n };\r\n TextureRenderer.prototype.measureBounds = function () {\r\n if (!this.dirty) {\r\n return;\r\n }\r\n var _a = this, bounds = _a.bounds, _b = _a.transform, tWidth = _b.explicitWidth, tHeight = _b.explicitHeight;\r\n if (this.texture) {\r\n var _c = this.texture, textureWidth = _c.width, textureHeight = _c.height;\r\n bounds.width = isNaN(tWidth) ? textureWidth : tWidth;\r\n bounds.height = isNaN(tHeight) ? textureHeight : tHeight;\r\n }\r\n else {\r\n bounds.width = isNaN(tWidth) ? 0 : tWidth;\r\n bounds.height = isNaN(tHeight) ? 0 : tHeight;\r\n }\r\n _super.prototype.measureBounds.call(this);\r\n };\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextureRenderer.prototype, \"texture\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextureRenderer.prototype, \"fillMode\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], TextureRenderer.prototype, \"filters\", void 0);\r\n return TextureRenderer;\r\n}(Renderer));\r\nexport default TextureRenderer;\r\n//# sourceMappingURL=TextureRenderer.js.map"}
{"map":"{\"version\":3,\"file\":\"LineRenderer.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/LineRenderer.ts\"],\"names\":[],\"mappings\":\";AAIA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAKhD;IAA0C,wCAAe;IAAzD;QAAA,qEA4BC;QA3BA,QAAE,GAAW,CAAC,CAAC;QACf,QAAE,GAAW,CAAC,CAAC;QACf,QAAE,GAAW,CAAC,CAAC;QACf,QAAE,GAAW,CAAC,CAAC;;IAwBhB,CAAC;IAnBA,2BAAI,GAAJ;QACC,iBAAM,IAAI,WAAE,CAAC;QAEP,IAAA,SAAgC,EAA/B,oBAAO,EAAE,UAAE,EAAE,UAAE,EAAE,UAAE,EAAE,UAAU,CAAC;QAEvC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACvB,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACxB,CAAC;IAKD,oCAAa,GAAb;QACQ,IAAA,oBAAM,CAAS;QACtB,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;QACjB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAElB,iBAAM,aAAa,WAAE,CAAC;IACvB,CAAC;IACF,mBAAC;AAAD,CAAC,AA5BD,CAA0C,eAAe,GA4BxD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport GraphicRenderer from \"./GraphicRenderer\";\r\nvar LineRenderer = (function (_super) {\r\n tslib_1.__extends(LineRenderer, _super);\r\n function LineRenderer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.x0 = 0;\r\n _this.y0 = 0;\r\n _this.x1 = 0;\r\n _this.y1 = 0;\r\n return _this;\r\n }\r\n LineRenderer.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var _a = this, context = _a.context, x0 = _a.x0, y0 = _a.y0, x1 = _a.x1, y1 = _a.y1;\r\n context.moveTo(x0, y0);\r\n context.lineTo(x1, y1);\r\n };\r\n LineRenderer.prototype.measureBounds = function () {\r\n var bounds = this.bounds;\r\n bounds.width = 0;\r\n bounds.height = 0;\r\n _super.prototype.measureBounds.call(this);\r\n };\r\n return LineRenderer;\r\n}(GraphicRenderer));\r\nexport default LineRenderer;\r\n//# sourceMappingURL=LineRenderer.js.map"}
{"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/index.ts\"],\"names\":[],\"mappings\":\"AAIA,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mBAAmB,CAAA\"}","code":"export { default as CircleRenderer } from './CircleRenderer';\r\nexport { default as FrameAnimationRenderer } from './FrameAnimationRenderer';\r\nexport { default as GraphicRenderer } from './GraphicRenderer';\r\nexport { default as LineRenderer } from './LineRenderer';\r\nexport { default as RectRenderer } from './RectRenderer';\r\nexport { default as Renderer } from './Renderer';\r\nexport { default as TextRenderer } from './TextRenderer';\r\nexport { default as TextureRenderer } from './TextureRenderer';\r\n//# sourceMappingURL=index.js.map"}
{"map":"{\"version\":3,\"file\":\"MustCompile.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/generated/MustCompile.ts\"],\"names\":[],\"mappings\":\"AAKA,OAAO,EAAC,WAAW,EAAC,MAAM,QAAQ,CAAA;AAElC,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,WAAW,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;AAErD,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,WAAW,CAAC,mCAAmC,EAAE,UAAU,CAAC,CAAC;AAE7D,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAC7D,WAAW,CAAC,qCAAqC,EAAE,UAAU,CAAC,CAAC;AAE/D,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,WAAW,CAAC,kCAAkC,EAAE,UAAU,CAAC,CAAC;AAE5D,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,WAAW,CAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;AAE1D,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,WAAW,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;AAEhD,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,WAAW,CAAC,kCAAkC,EAAE,UAAU,CAAC,CAAC\"}","code":"import { registerDef } from 'scilla';\r\nimport component0 from 'components/base/Transform';\r\nregisterDef('components/base/Transform', component0);\r\nimport component1 from 'components/other/CameraController';\r\nregisterDef('components/other/CameraController', component1);\r\nimport component2 from 'components/renderer/TextureRenderer';\r\nregisterDef('components/renderer/TextureRenderer', component2);\r\nimport component3 from 'components/renderer/RectRenderer';\r\nregisterDef('components/renderer/RectRenderer', component3);\r\nimport component4 from 'components/animation/TouchZoom';\r\nregisterDef('components/animation/TouchZoom', component4);\r\nimport component5 from 'components/ui/Button';\r\nregisterDef('components/ui/Button', component5);\r\nimport component6 from 'components/renderer/TextRenderer';\r\nregisterDef('components/renderer/TextRenderer', component6);\r\n//# sourceMappingURL=MustCompile.js.map"}
{"map":"{\"version\":3,\"file\":\"CircleRenderer.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/CircleRenderer.ts\"],\"names\":[],\"mappings\":\";AAIA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAE3B,IAAA,kDAAkB,CAAe;AAKxC;IAA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GAAG,EAAE,GAAG,CAAC,CAAC;aACzB;SACD;QAED,iBAAM,IAAI,WAAE,CAAC;IACd,CAAC;IAhDD;QADC,kBAAkB;kDACP;IAMZ;QADC,kBAAkB;sDACI;IAMvB;QADC,kBAAkB;oDACI;IAMvB;QADC,kBAAkB;wDACU;IA+B9B,qBAAC;CAAA,AAtDD,CAA4C,eAAe,GAsD1D;eAtDoB,cAAc\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport GraphicRenderer from \"./GraphicRenderer\";\r\nimport { decorators } from \"scilla\";\r\nvar dirtyFieldDetector = decorators.dirtyFieldDetector;\r\nvar CircleRenderer = (function (_super) {\r\n tslib_1.__extends(CircleRenderer, _super);\r\n function CircleRenderer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.radius = 50;\r\n _this.startAngle = 0;\r\n _this.endAngle = 360;\r\n _this.backToCenter = true;\r\n return _this;\r\n }\r\n CircleRenderer.prototype.getRenderSize = function () {\r\n var radius = this.radius;\r\n return { width: radius * 2, height: radius * 2 };\r\n };\r\n CircleRenderer.prototype.draw = function () {\r\n var _a = this, context = _a.context, _b = _a.bounds, width = _b.width, height = _b.height, startAngle = _a.startAngle, endAngle = _a.endAngle, backToCenter = _a.backToCenter, _margin = _a._margin, _useCacheMode = _a._useCacheMode;\r\n var offset = _useCacheMode ? _margin : 0;\r\n var radius = Math.min(width, height) / 2;\r\n var pos = offset + radius;\r\n if (startAngle == 0 && endAngle == 360) {\r\n context.arc(pos, pos, radius, 0, 2 * Math.PI);\r\n }\r\n else {\r\n if (backToCenter) {\r\n context.moveTo(pos, pos);\r\n }\r\n context.arc(pos, pos, radius, startAngle * Math.PI / 180, endAngle * Math.PI / 180);\r\n if (backToCenter) {\r\n context.lineTo(pos, pos);\r\n }\r\n }\r\n _super.prototype.draw.call(this);\r\n };\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], CircleRenderer.prototype, \"radius\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], CircleRenderer.prototype, \"startAngle\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], CircleRenderer.prototype, \"endAngle\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], CircleRenderer.prototype, \"backToCenter\", void 0);\r\n return CircleRenderer;\r\n}(GraphicRenderer));\r\nexport default CircleRenderer;\r\n//# sourceMappingURL=CircleRenderer.js.map"}
{"map":"{\"version\":3,\"file\":\"TouchZoom.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/animation/TouchZoom.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAS,QAAQ,GAAE,MAAM,QAAQ,CAAC;AACjF,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAE1C;IAAuC,qCAAiB;IAAxD;QAAA,qEA+CC;QA9CA,iBAAW,GAAa,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACjD,cAAQ,GAAW,GAAG,CAAC;QACvB,cAAQ,GAAS,IAAI,CAAC,OAAO,CAAC;;IA4C/B,CAAC;IAtCA,2BAAO,GAAP;QACC,iBAAM,OAAO,WAAE,CAAC;QAEhB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACZ,IAAA,SAAyC,EAAxC,4BAAW,EAAE,sBAAQ,EAAE,wBAAiB,CAAC;YAEhD,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAErC,IAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAC1C,IAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YAEzD,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,SAAS,EAAE,KAAK,EAAE,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAC,CAAC;iBAClG,EAAE,CAAC,EAAC,KAAK,EAAE,OAAO,EAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAE3C,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,SAAS,EAAE,KAAK,EAAE,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAC,CAAC;iBACnG,EAAE,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;SAC7C;IACF,CAAC;IAED,gCAAY,GAAZ,UAAa,CAAC;QACb,iBAAM,WAAW,YAAC,CAAC,CAAC,CAAC;QAErB,IAAI,IAAI,CAAC,YAAY,EAAE;YACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACxB;IACF,CAAC;IAED,oCAAgB,GAAhB,UAAiB,CAAC;QACjB,iBAAM,gBAAgB,YAAC,CAAC,CAAC,CAAC;QAE1B,IAAI,IAAI,CAAC,WAAW,EAAE;YACrB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IACF,gBAAC;AAAD,CAAC,AA/CD,CAAuC,iBAAiB,GA+CvD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { createTween, createVector2D, ease, Ease, Vector2D, } from \"scilla\";\r\nimport { InteractComponent } from \"../base\";\r\nvar TouchZoom = (function (_super) {\r\n tslib_1.__extends(TouchZoom, _super);\r\n function TouchZoom() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.scaleOffset = createVector2D(0.1, 0.1);\r\n _this.duration = 200;\r\n _this.easeName = Ease.backOut;\r\n return _this;\r\n }\r\n TouchZoom.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n if (!this._zoomIn) {\r\n var _a = this, scaleOffset = _a.scaleOffset, duration = _a.duration, transform = _a.transform;\r\n var easeFunc = ease[this.easeName];\r\n var scaleFrom = transform.scale.clone();\r\n var scaleTo = transform.scale.clone().add(scaleOffset);\r\n this._zoomIn = createTween(transform, false, { autoPlay: false, clazz: Vector2D, fields: ['x', 'y'] })\r\n .to({ scale: scaleTo }, duration, easeFunc);\r\n this._zoomOut = createTween(transform, false, { autoPlay: false, clazz: Vector2D, fields: ['x', 'y'] })\r\n .to({ scale: scaleFrom }, duration, easeFunc);\r\n }\r\n };\r\n TouchZoom.prototype.onTouchBegin = function (e) {\r\n _super.prototype.onTouchOver.call(this, e);\r\n if (this.interactable) {\r\n this._touchBegin = true;\r\n this._zoomIn.play(true);\r\n }\r\n };\r\n TouchZoom.prototype.onGlobalTouchEnd = function (e) {\r\n _super.prototype.onGlobalTouchEnd.call(this, e);\r\n if (this._touchBegin) {\r\n this._touchBegin = false;\r\n this._zoomOut.play(true);\r\n }\r\n return false;\r\n };\r\n return TouchZoom;\r\n}(InteractComponent));\r\nexport default TouchZoom;\r\n//# sourceMappingURL=TouchZoom.js.map"}
{"map":"{\"version\":3,\"file\":\"TouchInterrupt.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/base/TouchInterrupt.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD;IAA4C,0CAAiB;IAA7D;QAAA,qEAEC;QADA,oBAAc,GAAY,IAAI,CAAC;;IAChC,CAAC;IAAD,qBAAC;AAAD,CAAC,AAFD,CAA4C,iBAAiB,GAE5D\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport InteractComponent from \"./InteractComponent\";\r\nvar TouchInterrupt = (function (_super) {\r\n tslib_1.__extends(TouchInterrupt, _super);\r\n function TouchInterrupt() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.touchInterrupt = true;\r\n return _this;\r\n }\r\n return TouchInterrupt;\r\n}(InteractComponent));\r\nexport default TouchInterrupt;\r\n//# sourceMappingURL=TouchInterrupt.js.map"}
{"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-core/src/assets-manager/index.ts\"],\"names\":[],\"mappings\":\";AAOA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAiB,iBAAiB,EAAE,YAAY,EAAC,MAAM,wBAAwB,CAAA;AACtF,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAA;AAEnC,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,IAAI,QAAQ,GAAG,EAAE,CAAC;AAClB,IAAI,OAAO,GAAG,EAAE,CAAC;AAEjB,IAAM,aAAa,GAAG;IACrB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,mBAAmB;IAC5B,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,iBAAiB;IAClC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;CACjB,CAAC;AAMF,MAAM,UAAU,UAAU,CAAC,IAAI;IAC9B,OAAO,GAAG,IAAI,CAAC;AAChB,CAAC;AAQD,MAAM,UAAU,YAAY,CAAC,KAA0B,EAAE,QAAuC;IAC/F,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IACzB,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,OAAO,CAAC,GAAG,CACjB,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI;QACb,IAAI,IAAI,EAAE,GAAG,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U,CAAC;YACtB,MAAM,CAAC,CAAC,CAAC,CAAC;QACX,CAAC,CAAA;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAe,WAAW,CAAC,IAAI;;;;;wBACd,WAAM,mBAAmB,CAAC,IAAI,CAAC,EAAA;;oBAAzC,OAAO,GAAG,SAA+B;oBAE/C,WAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;4BAClC,IAAI,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;4BACtB,IAAI,YAAY,CAAC,cAAc,EAAE;gCAChC,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;6BAC7C;4BACD,GAAG,CAAC,MAAM,GAAG;gCACZ,OAAO,CAAC,GAAG,CAAC,CAAC;4BACd,CAAC,CAAC;4BACF,GAAG,CAAC,OAAO,GAAG,UAAU,CAAC;gCACxB,MAAM,CAAC,CAAC,CAAC,CAAC;4BACX,CAAC,CAAC;4BACF,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC;wBACnB,CAAC,CAAC,EAAA;;;;CACF\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { createTexture } from '../core/Texture';\r\nimport { getFrameAnimation, putFrameAnim } from '../core/FrameAnimation';\r\nimport { Sheet } from '../core/Sheet';\r\nimport { EngineConfig } from \"../engine-config\";\r\nvar resCache = {};\r\nvar resPath = '';\r\nvar resLoaderType = {\r\n '.json': loadJson,\r\n '.json5': loadJson5,\r\n '.txt': loadTxt,\r\n '.png': loadTexture,\r\n '.jpg': loadTexture,\r\n '.svg': loadTexture,\r\n '.bimg': loadTextureFromBlob,\r\n '.sht': loadSheet,\r\n '.sht-disperse': loadSheetDisperse,\r\n '.fnt': loadFont,\r\n '.anim': loadAnim,\r\n};\r\nexport function setResPath(path) {\r\n resPath = path;\r\n}\r\nexport function loadResItems(items, progress) {\r\n var total = items.length;\r\n var count = 0;\r\n return Promise.all(items.map(function (item) {\r\n var uuid, url, config, ext;\r\n if (typeof item === 'string') {\r\n url = item;\r\n }\r\n else {\r\n url = item.url;\r\n }\r\n if (!url) {\r\n return Promise.resolve();\r\n }\r\n if (typeof item === 'string') {\r\n uuid = getUUIDFromUrl(url);\r\n }\r\n else {\r\n uuid = item.uuid || getUUIDFromUrl(url);\r\n ext = item.ext;\r\n config = item.config;\r\n }\r\n var loader = getLoader(ext, url);\r\n return loader(url, uuid, true, config).then(function (res) {\r\n count++;\r\n progress && progress(count / total);\r\n return res;\r\n });\r\n }));\r\n}\r\nexport function loadAny(url, uuid, cache, config, options, type) {\r\n if (cache === void 0) { cache = true; }\r\n if (options === void 0) { options = {}; }\r\n if (type === void 0) { type = 'arraybuffer'; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var response, result;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, fetch(resolveUrl(url), options)];\r\n case 1:\r\n response = _a.sent();\r\n switch (type) {\r\n case 'json':\r\n result = response.json();\r\n break;\r\n case 'text':\r\n result = response.text();\r\n break;\r\n case 'arraybuffer':\r\n result = response.arrayBuffer();\r\n break;\r\n case 'blob':\r\n result = response.blob();\r\n break;\r\n }\r\n return [4, result];\r\n case 2: return [2, _a.sent()];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadTxt(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var p = loadAny(url, uuid, cache, config, undefined, 'text');\r\n if (cache) {\r\n p.then(function (data) {\r\n cacheRes(data, url, uuid);\r\n return data;\r\n });\r\n }\r\n return p;\r\n}\r\nexport function loadJson(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var p = loadAny(url, uuid, cache, config, undefined, 'json');\r\n if (cache) {\r\n p.then(function (data) {\r\n cacheRes(data, url, uuid);\r\n return data;\r\n });\r\n }\r\n return p;\r\n}\r\nexport function loadJson5(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var txt, jsonData;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, loadTxt(url, uuid)];\r\n case 1:\r\n txt = _a.sent();\r\n jsonData = window['eval'](\"(\" + txt + \")\");\r\n cacheRes(jsonData, url, uuid);\r\n return [2, jsonData];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadSheet(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var pngFile = url.substring(0, url.lastIndexOf('.')) + '.png';\r\n return Promise.all([\r\n loadJson(url, null, false),\r\n loadImage(pngFile, null, false),\r\n ]).then(function (result) {\r\n var e_1, _a;\r\n var data = result[0];\r\n var img = result[1];\r\n var sheet = new Sheet(img, data.frames);\r\n sheet.generateAll();\r\n if (cache) {\r\n cacheRes(sheet, url, uuid);\r\n if (config) {\r\n try {\r\n for (var _b = tslib_1.__values(config.textures), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var textureConfig = _c.value;\r\n var name_1 = textureConfig.name, uuid_1 = textureConfig.uuid;\r\n var texture = sheet.getTexture(name_1);\r\n cacheRes(texture, name_1, uuid_1);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n else {\r\n var textures = sheet.getAllTextures();\r\n for (var key in textures) {\r\n cacheRes(textures[key], key, key);\r\n }\r\n }\r\n }\r\n return sheet;\r\n });\r\n}\r\nexport function loadSheetDisperse(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var e_2, _a, _b, _c, _d, name_2, uuid_2, subUrl, e_2_1;\r\n return tslib_1.__generator(this, function (_e) {\r\n switch (_e.label) {\r\n case 0:\r\n _e.trys.push([0, 5, 6, 7]);\r\n _b = tslib_1.__values(config.textures), _c = _b.next();\r\n _e.label = 1;\r\n case 1:\r\n if (!!_c.done) return [3, 4];\r\n _d = _c.value, name_2 = _d.name, uuid_2 = _d.uuid;\r\n subUrl = url.replace('-disperse', '') + '/' + name_2 + '.png';\r\n return [4, loadTexture(subUrl, uuid_2)];\r\n case 2:\r\n _e.sent();\r\n _e.label = 3;\r\n case 3:\r\n _c = _b.next();\r\n return [3, 1];\r\n case 4: return [3, 7];\r\n case 5:\r\n e_2_1 = _e.sent();\r\n e_2 = { error: e_2_1 };\r\n return [3, 7];\r\n case 6:\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n return [7];\r\n case 7: return [2, null];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadFont(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return loadSheet(url, null, false).then(function (sheet) {\r\n if (cache) {\r\n cacheRes(sheet, url, uuid);\r\n }\r\n return sheet;\r\n });\r\n}\r\nfunction findAnimConfig(animations, name) {\r\n var result;\r\n animations.some(function (item) {\r\n if (item.name === name) {\r\n result = item;\r\n return true;\r\n }\r\n });\r\n return result;\r\n}\r\nexport function loadAnim(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var pngFile = url.substring(0, url.lastIndexOf('.')) + '.png';\r\n return Promise.all([\r\n loadJson(url, null, false),\r\n loadImage(pngFile, null, false),\r\n ]).then(function (result) {\r\n var data = result[0];\r\n var img = result[1];\r\n putFrameAnim(img, data);\r\n var animations = [];\r\n for (var name_3 in data.mc) {\r\n var animation = getFrameAnimation(name_3);\r\n if (cache) {\r\n var uuid_3 = name_3;\r\n if (config) {\r\n var cfg = findAnimConfig(config.animations, name_3);\r\n uuid_3 = cfg.uuid;\r\n }\r\n cacheRes(animation, name_3, uuid_3);\r\n }\r\n animations.push(animation);\r\n }\r\n return animations;\r\n });\r\n}\r\nexport function loadImage(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return new Promise(function (resolve, reject) {\r\n var img = new Image();\r\n if (EngineConfig.imgCrossOrigin) {\r\n img.setAttribute('crossOrigin', 'anonymous');\r\n }\r\n img.onload = function (e) {\r\n resolve(img);\r\n };\r\n img.onerror = function (e) {\r\n reject(e);\r\n };\r\n img.src = resolveUrl(url);\r\n });\r\n}\r\nexport function loadImageFromBlob(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var imgBlob, e_3;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 3, , 4]);\r\n return [4, loadAny(url, uuid, false, config, undefined, 'blob')];\r\n case 1:\r\n imgBlob = _a.sent();\r\n return [4, blobToImage(imgBlob)];\r\n case 2: return [2, _a.sent()];\r\n case 3:\r\n e_3 = _a.sent();\r\n console.log(e_3);\r\n return [3, 4];\r\n case 4: return [2];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadTexture(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var img, texture;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, loadImage(url, uuid, false)];\r\n case 1:\r\n img = _a.sent();\r\n texture = createTexture(img);\r\n if (cache) {\r\n cacheRes(texture, url, uuid);\r\n }\r\n return [2, texture];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadTextureFromBlob(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var img, texture;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, loadImageFromBlob(url, uuid, false)];\r\n case 1:\r\n img = _a.sent();\r\n texture = createTexture(img);\r\n if (cache) {\r\n cacheRes(texture, url, uuid);\r\n }\r\n return [2, texture];\r\n }\r\n });\r\n });\r\n}\r\nfunction resolveUrl(url) {\r\n if (url.indexOf('//') === 0 || url.indexOf('http:') === 0 || url.indexOf('https:') === 0) {\r\n return url;\r\n }\r\n return resPath + url;\r\n}\r\nfunction getLoader(ext, url) {\r\n ext = ext || url.substr(url.lastIndexOf('.'));\r\n return resLoaderType[ext] || loadAny;\r\n}\r\nfunction getUUIDFromUrl(url) {\r\n return url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));\r\n}\r\nexport function cacheRes(res, url, uuid) {\r\n uuid = uuid || getUUIDFromUrl(url);\r\n resCache[uuid] = res;\r\n}\r\nexport function addLoader(ext, loader) {\r\n resLoaderType[ext] = loader;\r\n}\r\nexport function getRes(uuid) {\r\n return resCache[uuid];\r\n}\r\nexport function destroyRes(uuidOrUuids) {\r\n if (Array.isArray(uuidOrUuids)) {\r\n while (uuidOrUuids.length > 0) {\r\n delete resCache[uuidOrUuids.pop()];\r\n }\r\n }\r\n else {\r\n delete resCache[uuidOrUuids];\r\n }\r\n}\r\nexport function destroyAllRes() {\r\n for (var key in resCache) {\r\n destroyRes(key);\r\n }\r\n}\r\nexport function getAllResUuids() {\r\n return Object.keys(resCache);\r\n}\r\nfunction fileOrBlobToDataURL(obj) {\r\n return new Promise(function (resolve, reject) {\r\n var a = new FileReader();\r\n a.readAsDataURL(obj);\r\n a.onload = function (e) {\r\n resolve(e.target['result']);\r\n };\r\n a.onerror = function (e) {\r\n reject(e);\r\n };\r\n });\r\n}\r\nfunction blobToImage(blob) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var dataUrl;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, fileOrBlobToDataURL(blob)];\r\n case 1:\r\n dataUrl = _a.sent();\r\n return [2, new Promise(function (resolve, reject) {\r\n var img = new Image();\r\n if (EngineConfig.imgCrossOrigin) {\r\n img.setAttribute('crossOrigin', 'anonymous');\r\n }\r\n img.onload = function () {\r\n resolve(img);\r\n };\r\n img.onerror = function (e) {\r\n reject(e);\r\n };\r\n img.src = dataUrl;\r\n })];\r\n }\r\n });\r\n });\r\n}\r\n//# sourceMappingURL=index.js.map"}
{"map":"{\"version\":3,\"file\":\"MustCompile.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/generated/MustCompile.ts\"],\"names\":[],\"mappings\":\"AAKA,OAAO,EAAC,WAAW,EAAC,MAAM,QAAQ,CAAA;AAElC,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,WAAW,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;AAErD,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,WAAW,CAAC,mCAAmC,EAAE,UAAU,CAAC,CAAC\"}","code":"import { registerDef } from 'scilla';\r\nimport component0 from 'components/base/Transform';\r\nregisterDef('components/base/Transform', component0);\r\nimport component1 from 'components/other/CameraController';\r\nregisterDef('components/other/CameraController', component1);\r\n//# sourceMappingURL=MustCompile.js.map"}
{"map":"{\"version\":3,\"file\":\"GraphicRenderer.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/GraphicRenderer.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAMlC;IAA6C,2CAAQ;IAArD;QAAA,qEAsGC;QArGA,eAAS,GAAU,SAAS,CAAC;QAC7B,iBAAW,GAAU,SAAS,CAAC;QAC/B,iBAAW,GAAG,CAAC,CAAC;QAGhB,kBAAY,GAAG,KAAK,CAAC;QAErB,iBAAW,GAAG,KAAK,CAAC;;IA8FrB,CAAC;IA5FU,yCAAe,GAAzB;QACC,OAAO,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IACjD,CAAC;IAKS,uCAAa,GAAvB;QACC,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC,CAAC;IAC9B,CAAC;IAKS,oCAAU,GAApB;QACC,iBAAM,UAAU,WAAE,CAAC;QACnB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,SA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BAAM,EAAE,iBAA2D,EAA/C,yBAAqB,EAAE,2BAAgC,CAAC;QAC7E,IAAA,yBAAuD,EAAtD,iBAAa,EAAE,mBAAuC,CAAC;QAE9D,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/C,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAEnD,iBAAM,aAAa,WAAE,CAAC;IACvB,CAAC;IACF,sBAAC;AAAD,CAAC,AAtGD,CAA6C,QAAQ,GAsGpD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport Renderer from \"./Renderer\";\r\nvar GraphicRenderer = (function (_super) {\r\n tslib_1.__extends(GraphicRenderer, _super);\r\n function GraphicRenderer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.fillColor = '#42bce4';\r\n _this.borderColor = '#0899d0';\r\n _this.borderWidth = 0;\r\n _this.isUsedToMask = false;\r\n _this.maskVisible = false;\r\n return _this;\r\n }\r\n GraphicRenderer.prototype.getUseCacheMode = function () {\r\n return this._useCacheMode && !this.isUsedToMask;\r\n };\r\n GraphicRenderer.prototype.getRenderSize = function () {\r\n return { width: 0, height: 0 };\r\n };\r\n GraphicRenderer.prototype.beforeDraw = function () {\r\n _super.prototype.beforeDraw.call(this);\r\n this.applyStyle();\r\n this.context.beginPath();\r\n };\r\n GraphicRenderer.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.isUsedToMask) {\r\n this._context.clip();\r\n this.maskVisible && this.fillAndStoke();\r\n }\r\n else {\r\n this.fillAndStoke();\r\n }\r\n };\r\n GraphicRenderer.prototype.applyStyle = function () {\r\n var _a = this, context = _a.context, fillColor = _a.fillColor, borderColor = _a.borderColor, borderWidth = _a.borderWidth;\r\n context.fillStyle = fillColor;\r\n if (borderWidth > 0) {\r\n context.strokeStyle = borderColor;\r\n context.lineWidth = borderWidth;\r\n }\r\n };\r\n GraphicRenderer.prototype.fillAndStoke = function () {\r\n var _a = this, context = _a.context, borderWidth = _a.borderWidth;\r\n context.fill();\r\n if (borderWidth > 0) {\r\n context.stroke();\r\n }\r\n };\r\n GraphicRenderer.prototype.drawClip = function () {\r\n this.isUsedToMask && this.context.save();\r\n };\r\n GraphicRenderer.prototype.afterUpdate = function () {\r\n this.isUsedToMask && this.context.restore();\r\n };\r\n GraphicRenderer.prototype.measureBounds = function () {\r\n if (this.entity.name == 'content') {\r\n console.log();\r\n }\r\n if (!this.dirty) {\r\n return;\r\n }\r\n this._margin = this.borderWidth;\r\n var _a = this, bounds = _a.bounds, _b = _a.transform, tWidth = _b.explicitWidth, tHeight = _b.explicitHeight;\r\n var _c = this.getRenderSize(), sWidth = _c.width, sHeight = _c.height;\r\n bounds.width = isNaN(tWidth) ? sWidth : tWidth;\r\n bounds.height = isNaN(tHeight) ? sHeight : tHeight;\r\n _super.prototype.measureBounds.call(this);\r\n };\r\n return GraphicRenderer;\r\n}(Renderer));\r\nexport default GraphicRenderer;\r\n//# sourceMappingURL=GraphicRenderer.js.map"}
{"map":"{\"version\":3,\"file\":\"Button.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/ui/Button.ts\"],\"names\":[],\"mappings\":\";AAMA,OAAO,EAAC,WAAW,GAAW,MAAM,QAAQ,CAAC;AAC7C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAE5C;IAAoC,kCAAiB;IAWpD;QAAA,YACC,iBAAO,SAGP;QADA,KAAI,CAAC,cAAc,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAED,sBAAI,6BAAS;aAAb;YACC,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,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,CAAC;QACX,iBAAM,UAAU,YAAC,CAAC,CAAC,CAAC;QAEpB,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC5B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC/B;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,iCAAgB,GAAhB,UAAiB,CAAC;QACjB,iBAAM,gBAAgB,YAAC,CAAC,CAAC,CAAC;QAE1B,IAAI,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;SACtB;QAED,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,8BAAa,GAAb,UAAc,GAAI;QACjB,IAAG,CAAC,IAAI,CAAC,UAAU,EAAC;YACnB,OAAO;SACP;QAED,IAAI,CAAC,UAAU,GAAG,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC;QACpC,IAAG,IAAI,CAAC,YAAY,EAAC;YACpB,IAAI,CAAC,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC;SAC1C;aAAI;YACJ,IAAI,CAAC,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;SAC3C;IACF,CAAC;IACF,aAAC;AAAD,CAAC,AAlGD,CAAoC,iBAAiB,GAkGpD\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { ScillaEvent, } from \"scilla\";\r\nimport TouchZoom from \"../animation/TouchZoom\";\r\nimport { InteractComponent } from \"../base\";\r\nimport { TextureRenderer } from \"../renderer\";\r\nvar Button = (function (_super) {\r\n tslib_1.__extends(Button, _super);\r\n function Button() {\r\n var _this = _super.call(this) || this;\r\n _this.touchInterrupt = true;\r\n return _this;\r\n }\r\n Object.defineProperty(Button.prototype, \"touchZoom\", {\r\n get: function () {\r\n return this.entity && this.entity.getComponent(TouchZoom);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Button.prototype.onModify = function (value, key, oldValue) {\r\n _super.prototype.onModify.call(this, value, key, oldValue);\r\n if (key === 'interactable') {\r\n if (this.touchZoom) {\r\n this.touchZoom.interactable = value;\r\n }\r\n try {\r\n this.changeTexture();\r\n }\r\n catch (e) { }\r\n }\r\n };\r\n Button.prototype.onCreate = function () {\r\n _super.prototype.onCreate.call(this);\r\n this.onClick = new ScillaEvent();\r\n };\r\n Button.prototype.onAwake = function () {\r\n _super.prototype.onAwake.call(this);\r\n this.bgRenderer = this.entity.getComponent(TextureRenderer);\r\n this.changeTexture(this.upRes);\r\n };\r\n Button.prototype.onTouchBegin = function (e) {\r\n _super.prototype.onTouchBegin.call(this, e);\r\n this.touchBeginWithSelf = true;\r\n this.changeTexture(this.downRes);\r\n };\r\n Button.prototype.onTouchOver = function (e) {\r\n _super.prototype.onTouchOver.call(this, e);\r\n if (this.touchBeginWithSelf) {\r\n this.touchBeginWithSelf = true;\r\n this.changeTexture(this.downRes);\r\n }\r\n this.touchOut = false;\r\n };\r\n Button.prototype.onTouchOut = function (e) {\r\n _super.prototype.onTouchOut.call(this, e);\r\n if (this.touchBeginWithSelf) {\r\n this.changeTexture(this.upRes);\r\n }\r\n this.touchOut = true;\r\n };\r\n Button.prototype.onGlobalTouchEnd = function (e) {\r\n _super.prototype.onGlobalTouchEnd.call(this, e);\r\n if (this.touchBeginWithSelf && !this.touchOut) {\r\n this.onClick.invoke();\r\n }\r\n this.touchBeginWithSelf = false;\r\n this.changeTexture(this.upRes);\r\n };\r\n Button.prototype.changeTexture = function (res) {\r\n if (!this.bgRenderer) {\r\n return;\r\n }\r\n this.currentRes = res || this.upRes;\r\n if (this.interactable) {\r\n this.bgRenderer.texture = this.currentRes;\r\n }\r\n else {\r\n this.bgRenderer.texture = this.disabledRes;\r\n }\r\n };\r\n return Button;\r\n}(InteractComponent));\r\nexport default Button;\r\n//# sourceMappingURL=Button.js.map"}
{"map":"{\"version\":3,\"file\":\"RectRenderer.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/renderer/RectRenderer.ts\"],\"names\":[],\"mappings\":\";AAIA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAA;AAE1B,IAAA,kDAAkB,CAAe;AAKxC;IAA0C,wCAAe;IAAzD;QAAA,qEAsCC;QApCA,WAAK,GAAG,GAAG,CAAC;QAEZ,YAAM,GAAG,GAAG,CAAC;QAEb,kBAAY,GAAG,CAAC,CAAC;;IAgClB,CAAC;IA9BU,oCAAa,GAAvB;QACO,IAAA,SAAsB,EAArB,gBAAK,EAAE,kBAAc,CAAC;QAC7B,OAAO,EAAC,KAAK,OAAA,EAAE,MAAM,QAAA,EAAC,CAAC;IACxB,CAAC;IAKS,2BAAI,GAAd;QACQ,IAAA,YAAE,CAAS;QACZ,IAAA,SAAkF,EAAjF,oBAAO,EAAE,mBAAe,EAAE,cAAuB,EAAd,gBAAK,EAAE,kBAAM,EAAG,oBAAO,EAAE,gCAAqB,CAAC;QAEzF,IAAI,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzC,IAAI,CAAC,EAAE;YACN,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;YACvC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;YAC/C,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YACnE,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;YACpD,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;YACnE,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5D,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;YACvC,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;SACvD;aAAM;YACN,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;SAC5C;QAED,iBAAM,IAAI,WAAE,CAAC;IACd,CAAC;IAnCD;QADC,kBAAkB;+CACP;IAEZ;QADC,kBAAkB;gDACN;IAEb;QADC,kBAAkB;sDACF;IAgClB,mBAAC;CAAA,AAtCD,CAA0C,eAAe,GAsCxD;eAtCoB,YAAY\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport GraphicRenderer from \"./GraphicRenderer\";\r\nimport { decorators } from 'scilla';\r\nvar dirtyFieldDetector = decorators.dirtyFieldDetector;\r\nvar RectRenderer = (function (_super) {\r\n tslib_1.__extends(RectRenderer, _super);\r\n function RectRenderer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.width = 100;\r\n _this.height = 100;\r\n _this.cornerRadius = 0;\r\n return _this;\r\n }\r\n RectRenderer.prototype.getRenderSize = function () {\r\n var _a = this, width = _a.width, height = _a.height;\r\n return { width: width, height: height };\r\n };\r\n RectRenderer.prototype.draw = function () {\r\n var PI = Math.PI;\r\n var _a = this, context = _a.context, r = _a.cornerRadius, _b = _a.bounds, width = _b.width, height = _b.height, _margin = _a._margin, _useCacheMode = _a._useCacheMode;\r\n var offset = _useCacheMode ? _margin : 0;\r\n if (r) {\r\n context.moveTo(offset + r, offset + 0);\r\n context.lineTo(offset + width - r, offset + 0);\r\n context.arc(offset + width - r, offset + r, r, PI * 3 / 2, PI * 2);\r\n context.lineTo(offset + width, offset + height - r);\r\n context.arc(offset + width - r, offset + height - r, r, 0, PI / 2);\r\n context.lineTo(offset + r, offset + height);\r\n context.arc(offset + r, offset + height - r, r, PI / 2, PI);\r\n context.lineTo(offset + 0, offset + r);\r\n context.arc(offset + r, offset + r, r, PI, PI * 3 / 2);\r\n }\r\n else {\r\n context.rect(offset, offset, width, height);\r\n }\r\n _super.prototype.draw.call(this);\r\n };\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], RectRenderer.prototype, \"width\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], RectRenderer.prototype, \"height\", void 0);\r\n tslib_1.__decorate([\r\n dirtyFieldDetector\r\n ], RectRenderer.prototype, \"cornerRadius\", void 0);\r\n return RectRenderer;\r\n}(GraphicRenderer));\r\nexport default RectRenderer;\r\n//# sourceMappingURL=RectRenderer.js.map"}
{"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-components/src/base/index.ts\"],\"names\":[],\"mappings\":\"AAIA,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,aAAa,CAAA\"}","code":"export { default as InteractComponent } from './InteractComponent';\r\nexport { default as TouchInterrupt } from './TouchInterrupt';\r\nexport { default as Transform } from './Transform';\r\n//# sourceMappingURL=index.js.map"}
{"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../../node_modules/scilla-core/src/assets-manager/index.ts\"],\"names\":[],\"mappings\":\";AAOA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAiB,iBAAiB,EAAE,YAAY,EAAC,MAAM,wBAAwB,CAAA;AACtF,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAA;AAEnC,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,IAAI,QAAQ,GAAG,EAAE,CAAC;AAClB,IAAI,OAAO,GAAG,EAAE,CAAC;AAEjB,IAAM,aAAa,GAAG;IACrB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,mBAAmB;IAC5B,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,iBAAiB;IAClC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;CACjB,CAAC;AAMF,MAAM,UAAU,UAAU,CAAC,IAAI;IAC9B,OAAO,GAAG,IAAI,CAAC;AAChB,CAAC;AAQD,MAAM,UAAU,YAAY,CAAC,KAA0B,EAAE,QAAuC;IAC/F,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IACzB,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,OAAO,CAAC,GAAG,CACjB,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI;QACb,IAAI,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC;QAC3B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;Y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AAC,CAAC;QACX,CAAC,CAAA;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAe,WAAW,CAAC,IAAI;;;;;wBACd,WAAM,mBAAmB,CAAC,IAAI,CAAC,EAAA;;oBAAzC,OAAO,GAAG,SAA+B;oBAE/C,WAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;4BAClC,IAAI,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;4BACtB,IAAI,YAAY,CAAC,cAAc,EAAE;gCAChC,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;6BAC7C;4BACD,GAAG,CAAC,MAAM,GAAG;gCACZ,OAAO,CAAC,GAAG,CAAC,CAAC;4BACd,CAAC,CAAC;4BACF,GAAG,CAAC,OAAO,GAAG,UAAU,CAAC;gCACxB,MAAM,CAAC,CAAC,CAAC,CAAC;4BACX,CAAC,CAAC;4BACF,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC;wBACnB,CAAC,CAAC,EAAA;;;;CACF\"}","code":"import * as tslib_1 from \"tslib\";\r\nimport { createTexture } from '../core/Texture';\r\nimport { getFrameAnimation, putFrameAnim } from '../core/FrameAnimation';\r\nimport { Sheet } from '../core/Sheet';\r\nimport { EngineConfig } from \"../engine-config\";\r\nvar resCache = {};\r\nvar resPath = '';\r\nvar resLoaderType = {\r\n '.json': loadJson,\r\n '.json5': loadJson5,\r\n '.txt': loadTxt,\r\n '.png': loadTexture,\r\n '.jpg': loadTexture,\r\n '.svg': loadTexture,\r\n '.bimg': loadTextureFromBlob,\r\n '.sht': loadSheet,\r\n '.sht-disperse': loadSheetDisperse,\r\n '.fnt': loadFont,\r\n '.anim': loadAnim,\r\n};\r\nexport function setResPath(path) {\r\n resPath = path;\r\n}\r\nexport function loadResItems(items, progress) {\r\n var total = items.length;\r\n var count = 0;\r\n return Promise.all(items.map(function (item) {\r\n var uuid, url, config, ext;\r\n if (typeof item === 'string') {\r\n url = item;\r\n }\r\n else {\r\n url = item.url;\r\n }\r\n if (!url) {\r\n return Promise.resolve();\r\n }\r\n if (typeof item === 'string') {\r\n uuid = getUUIDFromUrl(url);\r\n }\r\n else {\r\n uuid = item.uuid || getUUIDFromUrl(url);\r\n ext = item.ext;\r\n config = item.config;\r\n }\r\n var loader = getLoader(ext, url);\r\n return loader(url, uuid, true, config).then(function (res) {\r\n count++;\r\n progress && progress(count / total);\r\n return res;\r\n });\r\n }));\r\n}\r\nexport function loadAny(url, uuid, cache, config, options, type) {\r\n if (cache === void 0) { cache = true; }\r\n if (options === void 0) { options = {}; }\r\n if (type === void 0) { type = 'arraybuffer'; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var response, result;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, fetch(resolveUrl(url), options)];\r\n case 1:\r\n response = _a.sent();\r\n switch (type) {\r\n case 'json':\r\n result = response.json();\r\n break;\r\n case 'text':\r\n result = response.text();\r\n break;\r\n case 'arraybuffer':\r\n result = response.arrayBuffer();\r\n break;\r\n case 'blob':\r\n result = response.blob();\r\n break;\r\n }\r\n return [4, result];\r\n case 2: return [2, _a.sent()];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadTxt(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var p = loadAny(url, uuid, cache, config, undefined, 'text');\r\n if (cache) {\r\n p.then(function (data) {\r\n cacheRes(data, url, uuid);\r\n return data;\r\n });\r\n }\r\n return p;\r\n}\r\nexport function loadJson(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var p = loadAny(url, uuid, cache, config, undefined, 'json');\r\n if (cache) {\r\n p.then(function (data) {\r\n cacheRes(data, url, uuid);\r\n return data;\r\n });\r\n }\r\n return p;\r\n}\r\nexport function loadJson5(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var txt, jsonData;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, loadTxt(url, uuid)];\r\n case 1:\r\n txt = _a.sent();\r\n jsonData = window['eval'](\"(\" + txt + \")\");\r\n cacheRes(jsonData, url, uuid);\r\n return [2, jsonData];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadSheet(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var pngFile = url.substring(0, url.lastIndexOf('.')) + '.png';\r\n return Promise.all([\r\n loadJson(url, null, false),\r\n loadImage(pngFile, null, false),\r\n ]).then(function (result) {\r\n var e_1, _a;\r\n var data = result[0];\r\n var img = result[1];\r\n var sheet = new Sheet(img, data.frames);\r\n sheet.generateAll();\r\n if (cache) {\r\n cacheRes(sheet, url, uuid);\r\n if (config) {\r\n try {\r\n for (var _b = tslib_1.__values(config.textures), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var textureConfig = _c.value;\r\n var name_1 = textureConfig.name, uuid_1 = textureConfig.uuid;\r\n var texture = sheet.getTexture(name_1);\r\n cacheRes(texture, name_1, uuid_1);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n else {\r\n var textures = sheet.getAllTextures();\r\n for (var key in textures) {\r\n cacheRes(textures[key], key, key);\r\n }\r\n }\r\n }\r\n return sheet;\r\n });\r\n}\r\nexport function loadSheetDisperse(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var e_2, _a, _b, _c, _d, name_2, uuid_2, subUrl, e_2_1;\r\n return tslib_1.__generator(this, function (_e) {\r\n switch (_e.label) {\r\n case 0:\r\n _e.trys.push([0, 5, 6, 7]);\r\n _b = tslib_1.__values(config.textures), _c = _b.next();\r\n _e.label = 1;\r\n case 1:\r\n if (!!_c.done) return [3, 4];\r\n _d = _c.value, name_2 = _d.name, uuid_2 = _d.uuid;\r\n subUrl = url.replace('-disperse', '') + '/' + name_2.replace('_', '/') + '.png';\r\n return [4, loadTexture(subUrl, uuid_2)];\r\n case 2:\r\n _e.sent();\r\n _e.label = 3;\r\n case 3:\r\n _c = _b.next();\r\n return [3, 1];\r\n case 4: return [3, 7];\r\n case 5:\r\n e_2_1 = _e.sent();\r\n e_2 = { error: e_2_1 };\r\n return [3, 7];\r\n case 6:\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_2) throw e_2.error; }\r\n return [7];\r\n case 7: return [2, null];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadFont(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return loadSheet(url, null, false).then(function (sheet) {\r\n if (cache) {\r\n cacheRes(sheet, url, uuid);\r\n }\r\n return sheet;\r\n });\r\n}\r\nfunction findAnimConfig(animations, name) {\r\n var result;\r\n animations.some(function (item) {\r\n if (item.name === name) {\r\n result = item;\r\n return true;\r\n }\r\n });\r\n return result;\r\n}\r\nexport function loadAnim(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n var pngFile = url.substring(0, url.lastIndexOf('.')) + '.png';\r\n return Promise.all([\r\n loadJson(url, null, false),\r\n loadImage(pngFile, null, false),\r\n ]).then(function (result) {\r\n var data = result[0];\r\n var img = result[1];\r\n putFrameAnim(img, data);\r\n var animations = [];\r\n for (var name_3 in data.mc) {\r\n var animation = getFrameAnimation(name_3);\r\n if (cache) {\r\n var uuid_3 = name_3;\r\n if (config) {\r\n var cfg = findAnimConfig(config.animations, name_3);\r\n uuid_3 = cfg.uuid;\r\n }\r\n cacheRes(animation, name_3, uuid_3);\r\n }\r\n animations.push(animation);\r\n }\r\n return animations;\r\n });\r\n}\r\nexport function loadImage(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return new Promise(function (resolve, reject) {\r\n var img = new Image();\r\n if (EngineConfig.imgCrossOrigin) {\r\n img.setAttribute('crossOrigin', 'anonymous');\r\n }\r\n img.onload = function (e) {\r\n resolve(img);\r\n };\r\n img.onerror = function (e) {\r\n reject(e);\r\n };\r\n img.src = resolveUrl(url);\r\n });\r\n}\r\nexport function loadImageFromBlob(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var imgBlob, e_3;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 3, , 4]);\r\n return [4, loadAny(url, uuid, false, config, undefined, 'blob')];\r\n case 1:\r\n imgBlob = _a.sent();\r\n return [4, blobToImage(imgBlob)];\r\n case 2: return [2, _a.sent()];\r\n case 3:\r\n e_3 = _a.sent();\r\n console.log(e_3);\r\n return [3, 4];\r\n case 4: return [2];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadTexture(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var img, texture;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, loadImage(url, uuid, false)];\r\n case 1:\r\n img = _a.sent();\r\n texture = createTexture(img);\r\n if (cache) {\r\n cacheRes(texture, url, uuid);\r\n }\r\n return [2, texture];\r\n }\r\n });\r\n });\r\n}\r\nexport function loadTextureFromBlob(url, uuid, cache, config) {\r\n if (cache === void 0) { cache = true; }\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var img, texture;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, loadImageFromBlob(url, uuid, false)];\r\n case 1:\r\n img = _a.sent();\r\n texture = createTexture(img);\r\n if (cache) {\r\n cacheRes(texture, url, uuid);\r\n }\r\n return [2, texture];\r\n }\r\n });\r\n });\r\n}\r\nfunction resolveUrl(url) {\r\n if (url.indexOf('//') === 0 || url.indexOf('http:') === 0 || url.indexOf('https:') === 0) {\r\n return url;\r\n }\r\n return resPath + url;\r\n}\r\nfunction getLoader(ext, url) {\r\n ext = ext || url.substr(url.lastIndexOf('.'));\r\n return resLoaderType[ext] || loadAny;\r\n}\r\nfunction getUUIDFromUrl(url) {\r\n return url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));\r\n}\r\nexport function cacheRes(res, url, uuid) {\r\n uuid = uuid || getUUIDFromUrl(url);\r\n resCache[uuid] = res;\r\n}\r\nexport function addLoader(ext, loader) {\r\n resLoaderType[ext] = loader;\r\n}\r\nexport function getRes(uuid) {\r\n return resCache[uuid];\r\n}\r\nexport function destroyRes(uuidOrUuids) {\r\n if (Array.isArray(uuidOrUuids)) {\r\n while (uuidOrUuids.length > 0) {\r\n delete resCache[uuidOrUuids.pop()];\r\n }\r\n }\r\n else {\r\n delete resCache[uuidOrUuids];\r\n }\r\n}\r\nexport function destroyAllRes() {\r\n for (var key in resCache) {\r\n destroyRes(key);\r\n }\r\n}\r\nexport function getAllResUuids() {\r\n return Object.keys(resCache);\r\n}\r\nfunction fileOrBlobToDataURL(obj) {\r\n return new Promise(function (resolve, reject) {\r\n var a = new FileReader();\r\n a.readAsDataURL(obj);\r\n a.onload = function (e) {\r\n resolve(e.target['result']);\r\n };\r\n a.onerror = function (e) {\r\n reject(e);\r\n };\r\n });\r\n}\r\nfunction blobToImage(blob) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var dataUrl;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4, fileOrBlobToDataURL(blob)];\r\n case 1:\r\n dataUrl = _a.sent();\r\n return [2, new Promise(function (resolve, reject) {\r\n var img = new Image();\r\n if (EngineConfig.imgCrossOrigin) {\r\n img.setAttribute('crossOrigin', 'anonymous');\r\n }\r\n img.onload = function () {\r\n resolve(img);\r\n };\r\n img.onerror = function (e) {\r\n reject(e);\r\n };\r\n img.src = dataUrl;\r\n })];\r\n }\r\n });\r\n });\r\n}\r\n//# sourceMappingURL=index.js.map"}
{"ver":"1.0.1","uuid":"c7f2b35a-c2e8-4607-a3c1-16c5a2ec2993","subMetas":{},"isGroup":true}
{"ver":"1.0.1","uuid":"69227bac-6549-4561-87ba-cc9ca243882d","subMetas":{"bg":{"ver":"1.0.1","uuid":"1a215aff-a60e-4a1d-9514-0d136637e289","rawTextureUuid":"69227bac-6549-4561-87ba-cc9ca243882d","type":"texture"}},"type":"texture","imagePath":"/Users/wanghongyuan/kuwo/assets/bg/bg.jpg"}
{"ver":"1.0.1","uuid":"8bc8fb9b-8c9c-41ad-87bc-32830df0dcd3","subMetas":{},"isGroup":true}
......@@ -24,13 +24,83 @@
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|69227bac-6549-4561-87ba-cc9ca243882d"
}
}
],
"children": [
{
"name": "Button",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/RectRenderer",
"properties": {
"fillColor": "rgba(0, 192, 255, 1)",
"width": 150,
"height": 60,
"cornerRadius": 10
}
},
{
"script": "components/animation/TouchZoom",
"properties": {
"easeName": "backOut"
}
},
{
"script": "components/ui/Button",
"properties": {}
}
],
"children": [
{
"name": "label",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "button",
"fillColor": "rgba(255, 255, 255, 1)"
}
}
],
"children": []
"uuid": "b902e1d9-c1a1-4008-8d3a-5696ceee59a7"
}
],
"uuid": "f5f271ae-4af2-4e4d-9398-00f366bec620"
},
{
"name": "helloPanel",
"components": [
{
"script": "components/base/Transform",
"properties": {}
}
],
"uuid": "702054c6-f4db-4b72-9b71-d2016408e511"
}
]
}
]
},
"entity-cache": [],
"resource-groups": {
"preload": []
"preload": [
{
"uuid": "69227bac-6549-4561-87ba-cc9ca243882d",
"url": "bg/bg.jpg"
}
]
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"2efbaf44-f7d2-4b20-96fa-4e3615196502","subMetas":{},"isGroup":true}
{"ver":"1.0.1","uuid":"af65f7d6-42fa-4f5a-ac46-b3cc399e2c05","subMetas":{"withdrawBtn":{"ver":"1.0.1","uuid":"aa12612c-8589-4300-b63c-f1d75a00f2c0","rawTextureUuid":"af65f7d6-42fa-4f5a-ac46-b3cc399e2c05","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","subMetas":{"addTimesBtn":{"ver":"1.0.1","uuid":"1029947c-ac65-49c5-a2f0-0cccba73cc9f","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"addTimesBtnTips":{"ver":"1.0.1","uuid":"ee82006d-123d-4463-8cd4-4c9904aaa65c","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"bottom":{"ver":"1.0.1","uuid":"e7fb8664-3d0e-46aa-978b-08d5a53f377a","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"countTxtBg":{"ver":"1.0.1","uuid":"33e58a7f-3ce4-4307-9642-cec604c74cb8","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"eggListBtn":{"ver":"1.0.1","uuid":"19cc0f39-3a5d-4e06-a4a3-9a722b69b52c","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"glass":{"ver":"1.0.1","uuid":"c6af92fe-15a7-4d1c-b864-70bde2cfd7c5","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"main_bottom_bg":{"ver":"1.0.1","uuid":"53b2bf73-1ee6-43ba-af3f-2af10b432ffa","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"middle":{"ver":"1.0.1","uuid":"663c6d8e-a2f6-4022-a19f-00be63f9debc","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"progressbar_inner":{"ver":"1.0.1","uuid":"8534d43e-c1b0-42da-83af-027b43a88447","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"progressbar":{"ver":"1.0.1","uuid":"561d9875-a3c1-47c9-90a2-017b1f40c76b","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"recordBtn":{"ver":"1.0.1","uuid":"bec9f772-1392-4b9c-83dc-456a97885f9f","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"ruleBtn":{"ver":"1.0.1","uuid":"2257099a-016f-4fb8-9049-47ee93da4e0f","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"shadow":{"ver":"1.0.1","uuid":"b0d5515e-187b-4a5b-ad7a-97c1343bb205","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"sliderbg":{"ver":"1.0.1","uuid":"9e6302b3-cde4-4a25-96b9-6b74baab93b5","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"title":{"ver":"1.0.1","uuid":"86fe7352-2826-4219-9d52-11b5162a2a6e","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"title2":{"ver":"1.0.1","uuid":"5188c337-79fa-4b48-930e-7bdc81f4fe90","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"},"withdrawBtn":{"ver":"1.0.1","uuid":"36a7e2ae-8426-46d3-8d63-64045ad7527a","rawTextureUuid":"6fe5aa11-4868-46e0-9619-6c515ec538f7","type":"texture"}},"type":"sheet"}
......@@ -1459,7 +1459,7 @@
case 1:
if (!!_c.done) return [3, 4];
_d = _c.value, name_2 = _d.name, uuid_2 = _d.uuid;
subUrl = url.replace('-disperse', '') + '/' + name_2.replace('_', '/') + '.png';
subUrl = url.replace('-disperse', '') + '/' + name_2 + '.png';
return [4, loadTexture(subUrl, uuid_2)];
case 2:
_e.sent();
......@@ -2523,6 +2523,16 @@
STATUS[STATUS["DO_WAIT"] = 4] = "DO_WAIT";
STATUS[STATUS["DO_CALL"] = 5] = "DO_CALL";
})(STATUS || (STATUS = {}));
function createTween(target, override, options, plugins) {
if (override === void 0) { override = false; }
if (plugins === void 0) { plugins = []; }
if (override) {
killTweens(target);
}
var tween = new Tween(target, options);
addTween(target, tween);
return tween;
}
function killTweens(target) {
var e_1, _a;
var tweens = target['tweens'];
......@@ -3450,6 +3460,116 @@
Ease["elasticOut"] = "elasticOut";
Ease["elasticInOut"] = "elasticInOut";
})(Ease || (Ease = {}));
function get$1(amount) {
if (amount < -1) {
amount = -1;
}
if (amount > 1) {
amount = 1;
}
return function (t) {
if (amount == 0) {
return t;
}
if (amount < 0) {
return t * (t * -amount + 1 + amount);
}
return t * ((2 - t) * amount + (1 - amount));
};
}
function getPowIn(pow) {
return function (t) {
return Math.pow(t, pow);
};
}
function getPowOut(pow) {
return function (t) {
return 1 - Math.pow(1 - t, pow);
};
}
function getPowInOut(pow) {
return function (t) {
if ((t *= 2) < 1)
return 0.5 * Math.pow(t, pow);
return 1 - 0.5 * Math.abs(Math.pow(2 - t, pow));
};
}
var quadIn = getPowIn(2);
var quadOut = getPowOut(2);
var quadInOut = getPowInOut(2);
var cubicIn = getPowIn(3);
var cubicOut = getPowOut(3);
var cubicInOut = getPowInOut(3);
var quartIn = getPowIn(4);
var quartOut = getPowOut(4);
var quartInOut = getPowInOut(4);
var quintIn = getPowIn(5);
var quintOut = getPowOut(5);
var quintInOut = getPowInOut(5);
function sineIn(t) {
return 1 - Math.cos(t * Math.PI / 2);
}
function sineOut(t) {
return Math.sin(t * Math.PI / 2);
}
function sineInOut(t) {
return -0.5 * (Math.cos(Math.PI * t) - 1);
}
function getBackIn(amount) {
return function (t) {
return t * t * ((amount + 1) * t - amount);
};
}
var backIn = getBackIn(1.7);
function getBackOut(amount) {
return function (t) {
return (--t * t * ((amount + 1) * t + amount) + 1);
};
}
var backOut = getBackOut(1.7);
function getBackInOut(amount) {
amount *= 1.525;
return function (t) {
if ((t *= 2) < 1)
return 0.5 * (t * t * ((amount + 1) * t - amount));
return 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2);
};
}
var backInOut = getBackInOut(1.7);
function circIn(t) {
return -(Math.sqrt(1 - t * t) - 1);
}
function circOut(t) {
return Math.sqrt(1 - (--t) * t);
}
function circInOut(t) {
if ((t *= 2) < 1) {
return -0.5 * (Math.sqrt(1 - t * t) - 1);
}
return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
}
function bounceIn(t) {
return 1 - bounceOut(1 - t);
}
function bounceOut(t) {
if (t < 1 / 2.75) {
return (7.5625 * t * t);
}
else if (t < 2 / 2.75) {
return (7.5625 * (t -= 1.5 / 2.75) * t + 0.75);
}
else if (t < 2.5 / 2.75) {
return (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375);
}
else {
return (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
}
}
function bounceInOut(t) {
if (t < 0.5)
return bounceIn(t * 2) * .5;
return bounceOut(t * 2 - 1) * 0.5 + 0.5;
}
function getElasticIn(amplitude, period) {
var pi2 = Math.PI * 2;
return function (t) {
......@@ -3481,6 +3601,47 @@
}
var elasticInOut = getElasticInOut(1, 0.3 * 1.5);
var ease = /*#__PURE__*/Object.freeze({
get Ease () { return Ease; },
get: get$1,
getPowIn: getPowIn,
getPowOut: getPowOut,
getPowInOut: getPowInOut,
quadIn: quadIn,
quadOut: quadOut,
quadInOut: quadInOut,
cubicIn: cubicIn,
cubicOut: cubicOut,
cubicInOut: cubicInOut,
quartIn: quartIn,
quartOut: quartOut,
quartInOut: quartInOut,
quintIn: quintIn,
quintOut: quintOut,
quintInOut: quintInOut,
sineIn: sineIn,
sineOut: sineOut,
sineInOut: sineInOut,
getBackIn: getBackIn,
backIn: backIn,
getBackOut: getBackOut,
backOut: backOut,
getBackInOut: getBackInOut,
backInOut: backInOut,
circIn: circIn,
circOut: circOut,
circInOut: circInOut,
bounceIn: bounceIn,
bounceOut: bounceOut,
bounceInOut: bounceInOut,
getElasticIn: getElasticIn,
elasticIn: elasticIn,
getElasticOut: getElasticOut,
elasticOut: elasticOut,
getElasticInOut: getElasticInOut,
elasticInOut: elasticInOut
});
var dirtyFieldTrigger$1 = dirtyFieldTrigger;
var Renderer = (function (_super) {
__extends(Renderer, _super);
......@@ -3852,8 +4013,1078 @@
return CameraController;
}(ScillaComponent));
var dirtyFieldDetector$2 = dirtyFieldDetector;
var FillMode;
(function (FillMode) {
FillMode[FillMode["NORMAL"] = 0] = "NORMAL";
FillMode[FillMode["SLICED"] = 1] = "SLICED";
FillMode[FillMode["TILED"] = 2] = "TILED";
})(FillMode || (FillMode = {}));
var TextureRenderer = (function (_super) {
__extends(TextureRenderer, _super);
function TextureRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.fillMode = FillMode.NORMAL;
_this.filters = [];
return _this;
}
Object.defineProperty(TextureRenderer.prototype, "hasFilters", {
get: function () {
return this.filters && this.filters.length > 0;
},
enumerable: true,
configurable: true
});
TextureRenderer.prototype.draw = function () {
_super.prototype.draw.call(this);
this.drawImage();
this.applyFilters();
};
TextureRenderer.prototype.applyFilters = function () {
var e_1, _a;
if (!this.hasFilters)
return;
var _b = this, texture = _b.texture, filters = _b.filters, context = _b.context;
var _c = texture.bounds, textureWidth = _c.width, textureHeight = _c.height;
var imageData = context.getImageData(0, 0, textureWidth, textureHeight);
try {
for (var filters_1 = __values(filters), filters_1_1 = filters_1.next(); !filters_1_1.done; filters_1_1 = filters_1.next()) {
var filter = filters_1_1.value;
filter.drawFilter(imageData);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (filters_1_1 && !filters_1_1.done && (_a = filters_1.return)) _a.call(filters_1);
}
finally { if (e_1) throw e_1.error; }
}
context.putImageData(imageData, 0, 0);
};
TextureRenderer.prototype.drawImage = function () {
if (!this.texture) {
return;
}
var _a = this, texture = _a.texture, fillMode = _a.fillMode, context = _a.context, _b = _a.bounds, width = _b.width, height = _b.height;
var _c = texture.bounds, x = _c.x, y = _c.y, textureWidth = _c.width, textureHeight = _c.height;
switch (fillMode) {
case FillMode.NORMAL:
texture.drawToCanvas(context);
break;
case FillMode.SLICED:
break;
case FillMode.TILED:
var textureCanvas = texture.getCacheCanvas();
var pattern = context.createPattern(textureCanvas, 'repeat');
context.rect(0, 0, width, height);
context.fillStyle = pattern;
context.fill();
break;
}
};
TextureRenderer.prototype.measureBounds = function () {
if (!this.dirty) {
return;
}
var _a = this, bounds = _a.bounds, _b = _a.transform, tWidth = _b.explicitWidth, tHeight = _b.explicitHeight;
if (this.texture) {
var _c = this.texture, textureWidth = _c.width, textureHeight = _c.height;
bounds.width = isNaN(tWidth) ? textureWidth : tWidth;
bounds.height = isNaN(tHeight) ? textureHeight : tHeight;
}
else {
bounds.width = isNaN(tWidth) ? 0 : tWidth;
bounds.height = isNaN(tHeight) ? 0 : tHeight;
}
_super.prototype.measureBounds.call(this);
};
__decorate([
dirtyFieldDetector$2
], TextureRenderer.prototype, "texture", void 0);
__decorate([
dirtyFieldDetector$2
], TextureRenderer.prototype, "fillMode", void 0);
__decorate([
dirtyFieldDetector$2
], TextureRenderer.prototype, "filters", void 0);
return TextureRenderer;
}(Renderer));
var GraphicRenderer = (function (_super) {
__extends(GraphicRenderer, _super);
function GraphicRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.fillColor = '#42bce4';
_this.borderColor = '#0899d0';
_this.borderWidth = 0;
_this.isUsedToMask = false;
_this.maskVisible = false;
return _this;
}
GraphicRenderer.prototype.getUseCacheMode = function () {
return this._useCacheMode && !this.isUsedToMask;
};
GraphicRenderer.prototype.getRenderSize = function () {
return { width: 0, height: 0 };
};
GraphicRenderer.prototype.beforeDraw = function () {
_super.prototype.beforeDraw.call(this);
this.applyStyle();
this.context.beginPath();
};
GraphicRenderer.prototype.draw = function () {
_super.prototype.draw.call(this);
if (this.isUsedToMask) {
this._context.clip();
this.maskVisible && this.fillAndStoke();
}
else {
this.fillAndStoke();
}
};
GraphicRenderer.prototype.applyStyle = function () {
var _a = this, context = _a.context, fillColor = _a.fillColor, borderColor = _a.borderColor, borderWidth = _a.borderWidth;
context.fillStyle = fillColor;
if (borderWidth > 0) {
context.strokeStyle = borderColor;
context.lineWidth = borderWidth;
}
};
GraphicRenderer.prototype.fillAndStoke = function () {
var _a = this, context = _a.context, borderWidth = _a.borderWidth;
context.fill();
if (borderWidth > 0) {
context.stroke();
}
};
GraphicRenderer.prototype.drawClip = function () {
this.isUsedToMask && this.context.save();
};
GraphicRenderer.prototype.afterUpdate = function () {
this.isUsedToMask && this.context.restore();
};
GraphicRenderer.prototype.measureBounds = function () {
if (this.entity.name == 'content') {
console.log();
}
if (!this.dirty) {
return;
}
this._margin = this.borderWidth;
var _a = this, bounds = _a.bounds, _b = _a.transform, tWidth = _b.explicitWidth, tHeight = _b.explicitHeight;
var _c = this.getRenderSize(), sWidth = _c.width, sHeight = _c.height;
bounds.width = isNaN(tWidth) ? sWidth : tWidth;
bounds.height = isNaN(tHeight) ? sHeight : tHeight;
_super.prototype.measureBounds.call(this);
};
return GraphicRenderer;
}(Renderer));
var dirtyFieldDetector$3 = dirtyFieldDetector;
var RectRenderer = (function (_super) {
__extends(RectRenderer, _super);
function RectRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.width = 100;
_this.height = 100;
_this.cornerRadius = 0;
return _this;
}
RectRenderer.prototype.getRenderSize = function () {
var _a = this, width = _a.width, height = _a.height;
return { width: width, height: height };
};
RectRenderer.prototype.draw = function () {
var PI = Math.PI;
var _a = this, context = _a.context, r = _a.cornerRadius, _b = _a.bounds, width = _b.width, height = _b.height, _margin = _a._margin, _useCacheMode = _a._useCacheMode;
var offset = _useCacheMode ? _margin : 0;
if (r) {
context.moveTo(offset + r, offset + 0);
context.lineTo(offset + width - r, offset + 0);
context.arc(offset + width - r, offset + r, r, PI * 3 / 2, PI * 2);
context.lineTo(offset + width, offset + height - r);
context.arc(offset + width - r, offset + height - r, r, 0, PI / 2);
context.lineTo(offset + r, offset + height);
context.arc(offset + r, offset + height - r, r, PI / 2, PI);
context.lineTo(offset + 0, offset + r);
context.arc(offset + r, offset + r, r, PI, PI * 3 / 2);
}
else {
context.rect(offset, offset, width, height);
}
_super.prototype.draw.call(this);
};
__decorate([
dirtyFieldDetector$3
], RectRenderer.prototype, "width", void 0);
__decorate([
dirtyFieldDetector$3
], RectRenderer.prototype, "height", void 0);
__decorate([
dirtyFieldDetector$3
], RectRenderer.prototype, "cornerRadius", void 0);
return RectRenderer;
}(GraphicRenderer));
var dirtyFieldTrigger$3 = dirtyFieldTrigger;
var InteractComponent = (function (_super) {
__extends(InteractComponent, _super);
function InteractComponent() {
var _this = _super.call(this) || this;
_this.interactable = true;
_this.touchInterrupt = false;
_this.invertMatrix = Matrix.create();
_this.localPos = {};
_this.isOut = true;
return _this;
}
InteractComponent.prototype._dealGlobalTouchBegin = function (e) {
var interrupt = _super.prototype._dealGlobalTouchBegin.call(this, e);
var hitOn = this.hitTest(e);
if (hitOn) {
this._touchBeginFlag = true;
this.onTouchBegin(e);
this._dealTouchOver(e);
}
return hitOn && interrupt;
};
InteractComponent.prototype._dealGlobalTouchMove = function (e) {
var interrupt = _super.prototype._dealGlobalTouchMove.call(this, e);
var hitOn = this.hitTest(e);
if (hitOn) {
this._dealTouchOver(e);
this.onTouchMove(e);
}
else {
this._dealTouchOut(e);
}
return hitOn && interrupt;
};
InteractComponent.prototype._dealGlobalTouchEnd = function (e) {
var interrupt = _super.prototype._dealGlobalTouchEnd.call(this, e);
var hitOn = this.hitTest(e);
if (hitOn) {
this.onTouchEnd(e);
if (this._touchBeginFlag) {
this.onTouchTap(e);
this._touchBeginFlag = false;
}
}
this.isOut = true;
return hitOn && interrupt;
};
InteractComponent.prototype._dealTouchOver = function (e) {
if (this.isOut) {
this.isOut = false;
this.onTouchOver(e);
}
};
InteractComponent.prototype._dealTouchOut = function (e) {
if (!this.isOut) {
this.isOut = true;
this.onTouchOut(e);
}
};
InteractComponent.prototype.onTouchBegin = function (e) {
};
InteractComponent.prototype.onTouchMove = function (e) {
};
InteractComponent.prototype.onTouchOver = function (e) {
};
InteractComponent.prototype.onTouchOut = function (e) {
};
InteractComponent.prototype.onTouchEnd = function (e) {
};
InteractComponent.prototype.onTouchTap = function (e) {
};
InteractComponent.prototype.hitTest = function (e) {
var e_1, _a;
var matrix = this.transform.getMatrix();
var invertMatrix = this.invertMatrix;
invertMatrix.copyFrom(matrix);
invertMatrix.invert();
invertMatrix.transformPoint(e.x, e.y, this.localPos);
var result = false;
var renderers = this.entity.getComponents(Renderer);
try {
for (var renderers_1 = __values(renderers), renderers_1_1 = renderers_1.next(); !renderers_1_1.done; renderers_1_1 = renderers_1.next()) {
var renderer = renderers_1_1.value;
if (renderer.hitTest(this.localPos.x, this.localPos.y)) {
if (renderer.isUsedToMask) {
continue;
}
else {
result = true;
break;
}
}
else if (renderer.isUsedToMask) {
return false;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (renderers_1_1 && !renderers_1_1.done && (_a = renderers_1.return)) _a.call(renderers_1);
}
finally { if (e_1) throw e_1.error; }
}
return result;
};
__decorate([
dirtyFieldTrigger$3
], InteractComponent.prototype, "interactable", void 0);
return InteractComponent;
}(ScillaComponent));
var TouchInterrupt = (function (_super) {
__extends(TouchInterrupt, _super);
function TouchInterrupt() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.touchInterrupt = true;
return _this;
}
return TouchInterrupt;
}(InteractComponent));
var TouchZoom = (function (_super) {
__extends(TouchZoom, _super);
function TouchZoom() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.scaleOffset = createVector2D(0.1, 0.1);
_this.duration = 200;
_this.easeName = Ease.backOut;
return _this;
}
TouchZoom.prototype.onAwake = function () {
_super.prototype.onAwake.call(this);
if (!this._zoomIn) {
var _a = this, scaleOffset = _a.scaleOffset, duration = _a.duration, transform = _a.transform;
var easeFunc = ease[this.easeName];
var scaleFrom = transform.scale.clone();
var scaleTo = transform.scale.clone().add(scaleOffset);
this._zoomIn = createTween(transform, false, { autoPlay: false, clazz: Vector2D, fields: ['x', 'y'] })
.to({ scale: scaleTo }, duration, easeFunc);
this._zoomOut = createTween(transform, false, { autoPlay: false, clazz: Vector2D, fields: ['x', 'y'] })
.to({ scale: scaleFrom }, duration, easeFunc);
}
};
TouchZoom.prototype.onTouchBegin = function (e) {
_super.prototype.onTouchOver.call(this, e);
if (this.interactable) {
this._touchBegin = true;
this._zoomIn.play(true);
}
};
TouchZoom.prototype.onGlobalTouchEnd = function (e) {
_super.prototype.onGlobalTouchEnd.call(this, e);
if (this._touchBegin) {
this._touchBegin = false;
this._zoomOut.play(true);
}
return false;
};
return TouchZoom;
}(InteractComponent));
var dirtyFieldDetector$4 = dirtyFieldDetector;
var CircleRenderer = (function (_super) {
__extends(CircleRenderer, _super);
function CircleRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.radius = 50;
_this.startAngle = 0;
_this.endAngle = 360;
_this.backToCenter = true;
return _this;
}
CircleRenderer.prototype.getRenderSize = function () {
var radius = this.radius;
return { width: radius * 2, height: radius * 2 };
};
CircleRenderer.prototype.draw = function () {
var _a = this, context = _a.context, _b = _a.bounds, width = _b.width, height = _b.height, startAngle = _a.startAngle, endAngle = _a.endAngle, backToCenter = _a.backToCenter, _margin = _a._margin, _useCacheMode = _a._useCacheMode;
var offset = _useCacheMode ? _margin : 0;
var radius = Math.min(width, height) / 2;
var pos = offset + radius;
if (startAngle == 0 && endAngle == 360) {
context.arc(pos, pos, radius, 0, 2 * Math.PI);
}
else {
if (backToCenter) {
context.moveTo(pos, pos);
}
context.arc(pos, pos, radius, startAngle * Math.PI / 180, endAngle * Math.PI / 180);
if (backToCenter) {
context.lineTo(pos, pos);
}
}
_super.prototype.draw.call(this);
};
__decorate([
dirtyFieldDetector$4
], CircleRenderer.prototype, "radius", void 0);
__decorate([
dirtyFieldDetector$4
], CircleRenderer.prototype, "startAngle", void 0);
__decorate([
dirtyFieldDetector$4
], CircleRenderer.prototype, "endAngle", void 0);
__decorate([
dirtyFieldDetector$4
], CircleRenderer.prototype, "backToCenter", void 0);
return CircleRenderer;
}(GraphicRenderer));
var FrameAnimationRenderer = (function (_super) {
__extends(FrameAnimationRenderer, _super);
function FrameAnimationRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.autoPlay = false;
_this.fps = NaN;
_this.onComplete = new ScillaEvent();
_this.onLoopComplete = new ScillaEvent();
return _this;
}
FrameAnimationRenderer.prototype.onAwake = function () {
_super.prototype.onAwake.call(this);
if (this.autoPlay) {
this.play(0, -1);
}
};
FrameAnimationRenderer.prototype.onUpdate = function (t) {
if (this._playing) {
var _a = this, frameAnimation = _a.frameAnimation, _startFrame = _a._startFrame, _endFrame = _a._endFrame, fps = _a.fps;
if (this._startFlag) {
this._startFlag = false;
this._startTime = t;
this._loopCounting++;
}
var mFPS = isNaN(fps) ? frameAnimation.fps : fps;
var passTime = t - this._startTime;
var passFrameCount = Math.floor(passTime / (1000 / mFPS));
var passFrameInRegion = passFrameCount % (_endFrame - _startFrame + 1);
this._currentFrameIndex = _startFrame + passFrameInRegion;
if (passFrameInRegion == 0 && passFrameCount > 0) {
this._currentFrameIndex = _endFrame;
this.onLoopEnd();
}
}
_super.prototype.onUpdate.call(this, t);
};
FrameAnimationRenderer.prototype.onSleep = function () {
_super.prototype.onSleep.call(this);
};
FrameAnimationRenderer.prototype.onLoopEnd = function () {
if (this._loop < 0) {
this._startFlag = true;
this.onLoopComplete.invoke();
}
else if (this._loopCounting < this._loop) {
this._startFlag = true;
this.onLoopComplete.invoke();
}
else {
this._playing = false;
this.onComplete.invoke();
}
};
FrameAnimationRenderer.prototype.play = function (frame, loop, force) {
if (frame === void 0) { frame = 0; }
if (loop === void 0) { loop = 0; }
if (force === void 0) { force = true; }
this._loop = loop;
this._loopCounting = 0;
if (!this.frameAnimation) {
return;
}
var startFrame = 0, endFrame = this.frameAnimation.frameCount - 1;
if (typeof frame == 'string') {
var label = this.frameAnimation.getLabel(frame);
if (label) {
startFrame = label.frame - 1;
endFrame = label.end;
}
}
else {
startFrame = frame;
}
this._startFrame = startFrame;
this._endFrame = endFrame;
this._currentFrameIndex = this._startFrame;
this._startFlag = true;
this._playing = true;
};
FrameAnimationRenderer.prototype.stop = function () {
this._playing = false;
};
FrameAnimationRenderer.prototype.draw = function () {
_super.prototype.draw.call(this);
if (!this.frameAnimation) {
return;
}
var _a = this, context = _a.context, frameAnimation = _a.frameAnimation, _currentFrameIndex = _a._currentFrameIndex, bounds = _a.bounds;
var _b = frameAnimation.getFrame(_currentFrameIndex), texture = _b.texture, data = _b.data;
if (texture) {
var img = texture.img, _c = texture.bounds, x_1 = _c.x, y = _c.y, textureWidth = _c.width, textureHeight = _c.height;
bounds.setTo(data.x, data.y, textureWidth, textureHeight);
context.drawImage(img, x_1, y, textureWidth, textureHeight, data.x, data.y, textureWidth, textureHeight);
}
};
return FrameAnimationRenderer;
}(Renderer));
var LineRenderer = (function (_super) {
__extends(LineRenderer, _super);
function LineRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.x0 = 0;
_this.y0 = 0;
_this.x1 = 0;
_this.y1 = 0;
return _this;
}
LineRenderer.prototype.draw = function () {
_super.prototype.draw.call(this);
var _a = this, context = _a.context, x0 = _a.x0, y0 = _a.y0, x1 = _a.x1, y1 = _a.y1;
context.moveTo(x0, y0);
context.lineTo(x1, y1);
};
LineRenderer.prototype.measureBounds = function () {
var bounds = this.bounds;
bounds.width = 0;
bounds.height = 0;
_super.prototype.measureBounds.call(this);
};
return LineRenderer;
}(GraphicRenderer));
var dirtyFieldDetector$5 = dirtyFieldDetector, dirtyFieldTrigger$4 = dirtyFieldTrigger;
var TextAlign;
(function (TextAlign) {
TextAlign["LEFT"] = "left";
TextAlign["CENTER"] = "center";
TextAlign["RIGHT"] = "right";
})(TextAlign || (TextAlign = {}));
var VerticalAlign;
(function (VerticalAlign) {
VerticalAlign["TOP"] = "top";
VerticalAlign["MIDDLE"] = "middle";
VerticalAlign["BOTTOM"] = "bottom";
})(VerticalAlign || (VerticalAlign = {}));
var TextRenderer = (function (_super) {
__extends(TextRenderer, _super);
function TextRenderer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.text = '';
_this.textFlow = null;
_this.textAlign = TextAlign.CENTER;
_this.verticalAlign = VerticalAlign.MIDDLE;
_this.lineSpacing = 0;
_this.letterSpacing = 0;
_this._lineHeight = NaN;
_this._bmpLineHeight = 0;
_this.textStyle = new TextStyle();
_this.useCacheMode = true;
_this.measureCache = {};
return _this;
}
TextRenderer.prototype.onModify = function (value, key, oldValue) {
_super.prototype.onModify.call(this, value, key, oldValue);
switch (key) {
case 'textFlow':
if (value) {
this.updateTextFlow();
}
break;
case 'textStyle':
value.onChange = this.makeDirty.bind(this);
this.makeDirty();
break;
}
};
TextRenderer.prototype.updateTextFlow = function () {
var e_1, _a;
var text = '';
if (this.textFlow) {
try {
for (var _b = __values(this.textFlow), _c = _b.next(); !_c.done; _c = _b.next()) {
var item = _c.value;
text += item.text;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
}
this._pureText = text;
this.makeDirty();
};
Object.defineProperty(TextRenderer.prototype, "lineHeight", {
get: function () {
return isNaN(this._lineHeight) ? (this.isBmpMode ? this._bmpLineHeight : this.textStyle.fontSize * EngineConfig.lineHeightRatio) : this._lineHeight;
},
set: function (value) {
if (this._lineHeight != value) {
this._lineHeight = value;
this.dirty = true;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(TextRenderer.prototype, "pureText", {
get: function () {
return this.textFlow ? this._pureText : this.text;
},
enumerable: true,
configurable: true
});
TextRenderer.prototype.getRenderSize = function () {
return {
width: this._textWidth,
height: this._textHeight,
};
};
TextRenderer.prototype.beforeDraw = function () {
_super.prototype.beforeDraw.call(this);
if (!this.isBmpMode) {
this.applyTextStyle();
}
};
TextRenderer.prototype.applyTextStyle = function () {
var _a = this, context = _a.context, textStyle = _a.textStyle;
var fontStyle = textStyle.fontStyle, fontVariant = textStyle.fontVariant, fontWeight = textStyle.fontWeight, fontSize = textStyle.fontSize, fontFamily = textStyle.fontFamily;
context.font = fontStyle + " " + fontVariant + " " + fontWeight + " " + fontSize + "px " + fontFamily;
};
TextRenderer.prototype.fillAndStoke = function () {
if (!this.pureText || this.pureText.length == 0) {
return;
}
var _a = this, context = _a.context, measureCache = _a.measureCache, lineHeight = _a.lineHeight, lineSpacing = _a.lineSpacing, letterSpacing = _a.letterSpacing, rows = _a.rows, textAlign = _a.textAlign, verticalAlign = _a.verticalAlign, isBmpMode = _a.isBmpMode, _b = _a.transform, width = _b.width, height = _b.height;
var rowCount = rows.length;
var x = 0;
switch (textAlign) {
case "left":
x = 0;
break;
case "right":
x = width;
break;
case "center":
default:
x = width / 2;
break;
}
var y = 0;
var drawHeight = rowCount * lineHeight + lineSpacing * (rowCount - 1);
switch (verticalAlign) {
case "top":
y = 0;
break;
case "bottom":
y = height - drawHeight;
break;
case "middle":
default:
y = (height - drawHeight) / 2;
break;
}
y += lineHeight;
context.textAlign = letterSpacing == 0 && !this.textFlow ? textAlign : 'left';
context.textBaseline = 'bottom';
var offY = 0;
for (var i = 0; i < rowCount; i++) {
var _c = rows[i], text = _c.text, lineWidth = _c.lineWidth;
if (letterSpacing == 0 && !isBmpMode && !this.textFlow) {
this.drawText(i, text, x, y + offY);
}
else {
var offX = 0;
switch (textAlign) {
case "left":
offX = 0;
break;
case "right":
offX = -lineWidth;
break;
case "center":
default:
offX = -lineWidth / 2;
break;
}
for (var j = 0, lj = text.length; j < lj; j++) {
var char = text[j];
this.drawText(j, char, x + offX, y + offY);
if (measureCache[char].width > 0) {
offX += measureCache[char].width + letterSpacing;
}
}
}
offY += lineHeight + lineSpacing;
}
};
TextRenderer.prototype.getStyle = function (index) {
var e_2, _a;
if (!this.textFlow) {
return null;
}
var targetItem;
var count = 0;
try {
for (var _b = __values(this.textFlow), _c = _b.next(); !_c.done; _c = _b.next()) {
var item = _c.value;
count += item.text.length;
if (index < count) {
targetItem = item;
break;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
return targetItem.style;
};
TextRenderer.prototype.drawText = function (index, text, x, y) {
var _a = this, context = _a.context, borderWidth = _a.borderWidth, isBmpMode = _a.isBmpMode, fontRes = _a.fontRes;
if (isBmpMode) {
var texture = fontRes.getTexture(text);
if (!texture) {
return;
}
var _b = texture.bounds, textureX = _b.x, textureY = _b.y, textureWidth = _b.width, textureHeight = _b.height;
context.drawImage(texture.img, textureX, textureY, textureWidth, textureHeight, x, y, textureWidth, textureHeight);
}
else {
var style = this.getStyle(index);
if (style) {
if (style.hasOwnProperty('textColor')) {
context.fillStyle = style.textColor;
}
}
else {
context.fillStyle = this.fillColor;
}
context.fillText(text, x, y + 1);
if (borderWidth > 0) {
context.strokeText(text, x, y + 1);
}
}
};
Object.defineProperty(TextRenderer.prototype, "isBmpMode", {
get: function () {
return !!this.fontRes;
},
enumerable: true,
configurable: true
});
TextRenderer.prototype.measureText = function (text) {
var e_3, _a, e_4, _b;
var result;
if (this.measureCache.hasOwnProperty(text)) {
result = this.measureCache[text];
}
else {
var _c = this, context = _c.context, letterSpacing = _c.letterSpacing, isBmpMode = _c.isBmpMode, fontRes = _c.fontRes, lineHeight = _c.lineHeight;
if (isBmpMode) {
if (text.length == 1) {
var texture = fontRes.getTexture(text);
result = {
width: texture ? texture.width : 0,
height: texture ? texture.height : 0,
};
}
else {
var totalWidth = 0, totalHeight = 0;
try {
for (var text_1 = __values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {
var char = text_1_1.value;
var measureResult = this.measureText(char);
totalWidth += measureResult.width;
if (measureResult.height > totalHeight) {
totalHeight = measureResult.height;
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);
}
finally { if (e_3) throw e_3.error; }
}
result = {
width: totalWidth,
height: totalHeight,
};
}
}
else {
result = {
width: context.measureText(text).width,
height: lineHeight,
};
}
result.width += letterSpacing * (text.length - 1);
if (text.length == 1) {
this.measureCache[text] = result;
}
if (letterSpacing != 0 && text.length > 1 || this.textFlow) {
try {
for (var text_2 = __values(text), text_2_1 = text_2.next(); !text_2_1.done; text_2_1 = text_2.next()) {
var char = text_2_1.value;
this.measureCache[char] = this.measureText(char);
}
}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {
try {
if (text_2_1 && !text_2_1.done && (_b = text_2.return)) _b.call(text_2);
}
finally { if (e_4) throw e_4.error; }
}
}
}
return result;
};
TextRenderer.prototype.splitText = function () {
var e_5, _a;
var _b = this, text = _b.pureText, letterSpacing = _b.letterSpacing, lineSpacing = _b.lineSpacing, lineHeight = _b.lineHeight, isBmpMode = _b.isBmpMode, _c = _b.transform, explicitWidth = _c.explicitWidth, explicitHeight = _c.explicitHeight;
this.measureCache = {};
var textWidth = 0, textHeight = 0, maxHeight = 0;
var rows = [], measureResult;
if (text && text.length > 0) {
if (isNaN(explicitWidth)) {
var lines = text.split('\n');
try {
for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
var line = lines_1_1.value;
measureResult = this.measureText(line);
var mw = measureResult.width;
if (mw > textWidth) {
textWidth = mw;
}
if (isBmpMode) {
var mh = measureResult.height;
if (mh > maxHeight) {
maxHeight = mh;
}
}
rows.push({
text: line,
lineWidth: mw,
});
}
}
catch (e_5_1) { e_5 = { error: e_5_1 }; }
finally {
try {
if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
}
finally { if (e_5) throw e_5.error; }
}
if (!isBmpMode) {
maxHeight = lineHeight;
}
this._bmpLineHeight = maxHeight;
}
else {
var chars = text.split('');
var lineWidth = 0, charWidth = 0, index = 0;
var line = '';
for (var i = 0, li = chars.length; i < li; i++) {
var char = chars[i];
if (char == '\n') {
rows.push({
text: line,
lineWidth: lineWidth,
});
line = '';
lineWidth = 0;
index = 0;
}
else {
measureResult = this.measureText(char);
if (measureResult.width == 0) {
continue;
}
charWidth = measureResult.width;
var mh = measureResult.height;
if (mh > maxHeight) {
maxHeight = mh;
}
if (index > 0 && lineWidth + charWidth + (index == 0 ? 0 : letterSpacing) > explicitWidth) {
rows.push({
text: line,
lineWidth: lineWidth,
});
line = '';
lineWidth = 0;
index = 0;
}
line += char;
lineWidth += charWidth + (index == 0 ? 0 : letterSpacing);
index++;
}
}
this._bmpLineHeight = maxHeight;
rows.push({
text: line,
lineWidth: lineWidth,
});
textWidth = explicitWidth;
}
textHeight = isNaN(explicitHeight) ? (maxHeight * rows.length + lineSpacing * (rows.length - 1)) : explicitHeight;
}
else {
textWidth = isNaN(explicitWidth) ? 0 : explicitWidth;
textHeight = isNaN(explicitHeight) ? 0 : explicitHeight;
}
this.rows = rows;
this._textWidth = textWidth;
this._textHeight = textHeight;
return {
rows: rows,
textWidth: textWidth,
textHeight: textHeight,
};
};
TextRenderer.prototype.measureBounds = function () {
if (!this.dirty) {
return;
}
if (!this.isBmpMode) {
this.applyTextStyle();
}
this.splitText();
_super.prototype.measureBounds.call(this);
};
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "text", void 0);
__decorate([
dirtyFieldTrigger$4
], TextRenderer.prototype, "textFlow", void 0);
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "textAlign", void 0);
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "verticalAlign", void 0);
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "lineSpacing", void 0);
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "letterSpacing", void 0);
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "fontRes", void 0);
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "textStyle", void 0);
__decorate([
dirtyFieldDetector$5
], TextRenderer.prototype, "useCacheMode", void 0);
return TextRenderer;
}(GraphicRenderer));
var Button = (function (_super) {
__extends(Button, _super);
function Button() {
var _this = _super.call(this) || this;
_this.touchInterrupt = true;
return _this;
}
Object.defineProperty(Button.prototype, "touchZoom", {
get: function () {
return this.entity && this.entity.getComponent(TouchZoom);
},
enumerable: true,
configurable: true
});
Button.prototype.onModify = function (value, key, oldValue) {
_super.prototype.onModify.call(this, value, key, oldValue);
if (key === 'interactable') {
if (this.touchZoom) {
this.touchZoom.interactable = value;
}
try {
this.changeTexture();
}
catch (e) { }
}
};
Button.prototype.onCreate = function () {
_super.prototype.onCreate.call(this);
this.onClick = new ScillaEvent();
};
Button.prototype.onAwake = function () {
_super.prototype.onAwake.call(this);
this.bgRenderer = this.entity.getComponent(TextureRenderer);
this.changeTexture(this.upRes);
};
Button.prototype.onTouchBegin = function (e) {
_super.prototype.onTouchBegin.call(this, e);
this.touchBeginWithSelf = true;
this.changeTexture(this.downRes);
};
Button.prototype.onTouchOver = function (e) {
_super.prototype.onTouchOver.call(this, e);
if (this.touchBeginWithSelf) {
this.touchBeginWithSelf = true;
this.changeTexture(this.downRes);
}
this.touchOut = false;
};
Button.prototype.onTouchOut = function (e) {
_super.prototype.onTouchOut.call(this, e);
if (this.touchBeginWithSelf) {
this.changeTexture(this.upRes);
}
this.touchOut = true;
};
Button.prototype.onGlobalTouchEnd = function (e) {
_super.prototype.onGlobalTouchEnd.call(this, e);
if (this.touchBeginWithSelf && !this.touchOut) {
this.onClick.invoke();
}
this.touchBeginWithSelf = false;
this.changeTexture(this.upRes);
};
Button.prototype.changeTexture = function (res) {
if (!this.bgRenderer) {
return;
}
this.currentRes = res || this.upRes;
if (this.interactable) {
this.bgRenderer.texture = this.currentRes;
}
else {
this.bgRenderer.texture = this.disabledRes;
}
};
return Button;
}(InteractComponent));
registerDef('components/base/Transform', Transform);
registerDef('components/other/CameraController', CameraController);
registerDef('components/renderer/TextureRenderer', TextureRenderer);
registerDef('components/renderer/RectRenderer', RectRenderer);
registerDef('components/animation/TouchZoom', TouchZoom);
registerDef('components/ui/Button', Button);
registerDef('components/renderer/TextRenderer', TextRenderer);
var options$1 = {};
function inject(data) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,8 +11,8 @@
"tslib@^1.9.3"
],
"lockfileEntries": {
"scilla-components@git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git": "git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git#810156761cf22a7933b5b6066f3633a7c2bdaa9d",
"scilla-core@git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git": "git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git#cd8752837a5d56bd4336d9247cc5844b673e6a5f",
"scilla-components@git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git": "git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git#79e4440c153d1df5561610a694bdc8396f463e8c",
"scilla-core@git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git": "git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git#2b2457de9fc06bfebbf720bed47b4e12fb5c8db0",
"tslib@^1.9.3": "http://npm.dui88.com:80/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
},
"files": [],
......
......@@ -45,7 +45,7 @@ export default class TextRenderer extends GraphicRenderer {
* 文本
*/
@dirtyFieldDetector
text: string = 'text';
text: string = '';
/**
* 文本流
......
......@@ -213,7 +213,7 @@ export function loadSheet(url, uuid?, cache = true, config?): Promise<Sheet> {
*/
export async function loadSheetDisperse(url, uuid?, cache = true, config?): Promise<Sheet> {
for(let {name, uuid} of config.textures){
let subUrl = url.replace('-disperse', '') + '/' + name.replace('_', '/') + '.png';
let subUrl = url.replace('-disperse', '') + '/' + name + '.png';
await loadTexture(subUrl, uuid);
}
......
......@@ -17,8 +17,8 @@
"version": "12345"
},
"dependencies": {
"scilla-core": "git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git",
"scilla-components": "git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git",
"scilla-core": "git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git",
"tslib": "^1.9.3"
},
"devDependencies": {}
......
......@@ -10,3 +10,18 @@ registerDef('components/base/Transform', component0);
import component1 from 'components/other/CameraController';
registerDef('components/other/CameraController', component1);
import component2 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component2);
import component3 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component3);
import component4 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component4);
import component5 from 'components/ui/Button';
registerDef('components/ui/Button', component5);
import component6 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component6);
......@@ -4,13 +4,13 @@
"scilla-components@git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git":
version "1.0.0"
resolved "git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git#810156761cf22a7933b5b6066f3633a7c2bdaa9d"
resolved "git+http://gitlab2.dui88.com/laoqifeng/scilla-components.git#79e4440c153d1df5561610a694bdc8396f463e8c"
dependencies:
tslib "^1.9.3"
"scilla-core@git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git":
version "1.0.0"
resolved "git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git#cd8752837a5d56bd4336d9247cc5844b673e6a5f"
resolved "git+http://gitlab2.dui88.com/laoqifeng/scilla-core.git#2b2457de9fc06bfebbf720bed47b4e12fb5c8db0"
dependencies:
tslib "^1.9.3"
......
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