Commit 39a1173e authored by rockyl's avatar rockyl

修改了好多东西啊

parent 364ff526
......@@ -4,12 +4,12 @@
"props": {
"left": {
"alias": "左值",
"type": "data",
"type": "dynamic",
"default": ""
},
"right": {
"alias": "右值",
"type": "data",
"type": "dynamic",
"default": ""
},
"operator": {
......
......@@ -5,7 +5,7 @@
"success"
],
"id": "env-judge",
"script": "var ua = navigator.userAgent.toLowerCase();\nvar env;\nif (ua.indexOf('eversunshine') >= 0) {\n env = 'eversunshine';\n}\nelse if (ua.indexOf('micromessenger') >= 0) {\n env = 'weixin';\n}\nvar payload = args || {};\npayload.env = env;\nnext('success', payload);\n",
"script": "var ua = navigator.userAgent.toLowerCase();\nvar env;\nif (ua.indexOf('eversunshine') >= 0) {\n env = 'eversunshine';\n}\nelse if (ua.indexOf('micromessenger') >= 0) {\n env = 'weixin';\n}\nconsole.log('env:', env);\nvar payload = args || {};\npayload.env = env;\nnext('success', payload);\n",
"group": "base",
"type": "builtin"
}
......@@ -4,14 +4,14 @@
"props": {
"url": {
"alias": "地址",
"type": "data"
"type": "dynamic"
}
},
"output": [
"complete"
],
"id": "jump",
"script": "if (args && args.url) {\n location.href = args.url;\n}\nelse if (props.url) {\n location.href = props.url;\n}\nnext('complete');\n",
"script": "var url = engine.findVariable('url', args, props);\nlocation.href = url;\nnext('complete');\n",
"group": "base",
"type": "builtin"
}
......@@ -32,19 +32,6 @@
"5fc7ba4d-6afa-4eab-82d8-f25cbcb79d56": {
"uuid": "5fc7ba4d-6afa-4eab-82d8-f25cbcb79d56",
"meta": "entry",
"design": {
"x": 10,
"y": 10,
"input": {},
"output": {
"success": [
{
"x": 124.5,
"y": 31
}
]
}
},
"props": {},
"output": {
"success": [
......@@ -55,44 +42,15 @@
"69e28053-dfb3-459e-a9e5-4964c6e35193": {
"uuid": "69e28053-dfb3-459e-a9e5-4964c6e35193",
"meta": "http-request",
"design": {
"x": 67,
"y": 139,
"input": {
"default": [
{
"x": 5.5,
"y": 47.5
}
]
},
"output": {
"success": [
{
"x": 124.5,
"y": 33.5
}
],
"failed": [
{
"x": 124.5,
"y": 47.5
}
],
"exception": [
{
"x": 124.5,
"y": 61.5
}
]
}
},
"props": {
"url": {
"type": "link"
},
"method": {
"type": "link"
},
"params": {
"type": "link"
}
},
"output": {
......@@ -104,32 +62,6 @@
"39dce565-539b-44b6-901c-0344467795a8": {
"uuid": "39dce565-539b-44b6-901c-0344467795a8",
"meta": "duiba-api-transform",
"design": {
"x": 184,
"y": 275,
"input": {
"default": [
{
"x": 5.5,
"y": 30.5
}
]
},
"output": {
"success": [
{
"x": 124.5,
"y": 23.5
}
],
"failed": [
{
"x": 124.5,
"y": 37.5
}
]
}
},
"props": {},
"output": {
"success": [
......@@ -140,26 +72,6 @@
"e95e7bbc-b592-4f87-b433-77fd03a9ef51": {
"uuid": "e95e7bbc-b592-4f87-b433-77fd03a9ef51",
"meta": "put-data",
"design": {
"x": 280,
"y": 367,
"input": {
"default": [
{
"x": 5.5,
"y": 47.5
}
]
},
"output": {
"success": [
{
"x": 124.5,
"y": 47.5
}
]
}
},
"props": {
"name": {
"type": "link"
......@@ -172,7 +84,7 @@
"metas": [
{
"id": "duiba-api-transform",
"script": "if (args.success) {\n next('success', args.data);\n}\nelse {\n next('failed');\n}\n",
"script": "if (args.success) {\n next('success', args.data);\n}\nelse {\n next('failed', args);\n}\n",
"props": {},
"isInline": true,
"name": "兑吧接口转换",
......
......@@ -26,7 +26,7 @@
"exception"
],
"id": "http-request",
"script": "var url = engine.findVariable('url', args, props);\nvar params = engine.findVariable('params', args, props);\nif (!url) {\n console.log('url is empty');\n next('exception', '\\'url is empty\\'');\n}\nelse {\n engine.httpRequest(function (s, payload) {\n if (s) {\n next('success', payload);\n }\n else {\n next('failed', payload);\n }\n }, url, props.method, params, 'json');\n}\n",
"script": "var url = engine.findVariable('url', args, props);\nvar params = engine.findVariable('params', args, props);\nif (!url) {\n console.log('url is empty');\n next('exception', '\\'url is empty\\'');\n}\nelse {\n engine.httpRequest(url, props.method, params, 'json')\n .then(function (data) {\n next('success', data);\n }, function (err) {\n next('failed', err);\n });\n}\n",
"group": "net",
"type": "builtin"
}
......@@ -22,7 +22,7 @@
"alias": "参数"
}
},
"name": "api请求",
"name": "API请求",
"output": [
"success",
"failed",
......@@ -32,19 +32,6 @@
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de": {
"uuid": "e6a9f1de-40c6-445b-b5e9-5c50a904a4de",
"meta": "entry",
"design": {
"x": 10,
"y": 10,
"input": {},
"output": {
"success": [
{
"x": 124.5,
"y": 31
}
]
}
},
"props": {},
"output": {
"success": [
......@@ -55,26 +42,6 @@
"567169ba-a2c1-4c10-9025-605a2e89ef0f": {
"uuid": "567169ba-a2c1-4c10-9025-605a2e89ef0f",
"meta": "a4b27753-4cbb-47e3-9b31-51ced475e41a",
"design": {
"x": 163,
"y": 133,
"input": {
"default": [
{
"x": 5.5,
"y": 39
}
]
},
"output": {
"success": [
{
"x": 124.5,
"y": 39
}
]
}
},
"props": {
"host": {
"type": "link"
......@@ -92,32 +59,6 @@
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db": {
"uuid": "f9a32b46-aec1-4bd2-9b98-3d9a427d87db",
"meta": "duiba-api",
"design": {
"x": 350,
"y": 188,
"input": {
"default": [
{
"x": 5.5,
"y": 64.5
}
]
},
"output": {
"success": [
{
"x": 124.5,
"y": 57.5
}
],
"failed": [
{
"x": 124.5,
"y": 71.5
}
]
}
},
"props": {
"method": {
"type": "link"
......@@ -125,6 +66,9 @@
"name": {
"type": "link",
"alias": "dataName"
},
"params": {
"type": "link"
}
},
"output": {}
......@@ -134,7 +78,7 @@
"metas": [
{
"id": "a4b27753-4cbb-47e3-9b31-51ced475e41a",
"script": "//var projectX = 'projectX';\n//var projectID = engine.env.projectID;\nvar uri = engine.findVariable('uri', args, props);\nnext('success', {url: uri});//engine.joinPath(projectX, projectID, uri)});",
"script": "var uri = engine.findVariable('uri', args, props);\nvar url;\nif(uri.indexOf('//') !== 0 && uri.indexOf('://') < 0 && location.pathname === '/preview' || top.location.hash.indexOf('preview/') >= 0){\n\tvar projectX = 'projectx';\n\tvar projectID = engine.env.projectID;\n url = engine.joinPath(projectX, projectID, uri);\n}else{\n url = uri;\n}\nnext('success', {url:url});",
"props": {
"uri": {
"type": "string",
......@@ -149,6 +93,6 @@
}
],
"id": "api-request",
"group": "projextX",
"group": "projectX",
"type": "builtin"
}
......@@ -18,5 +18,5 @@
}
},
"id": "buried-point",
"code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BuriedPoint = (function (_super) {\n __extends(BuriedPoint, _super);\n function BuriedPoint() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dpm = '0.0.0.0';\n _this.dcm = '0.0.0.0';\n _this.dom = '0.0.0.0';\n return _this;\n }\n BuriedPoint.prototype.mounted = function () {\n this.dpm && (this.dpm = fill(this.dpm));\n this.dcm && (this.dcm = fill(this.dcm));\n this.dom && (this.dom = fill(this.dom));\n this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n };\n BuriedPoint.prototype.awake = function () {\n log('exposure', this);\n };\n BuriedPoint.prototype._onClick = function (e) {\n log('click', this);\n };\n BuriedPoint.id = 'buried-point';\n return BuriedPoint;\n}(engine.ScriptBase));\nexports.default = BuriedPoint;\nfunction fill(src) {\n var result = src;\n for (var key in engine.env) {\n result = result.replace(key, engine.env[key]);\n }\n return result;\n}\nfunction log(type, data) {\n var dpm = data.dpm, dcm = data.dcm, dom = data.dom;\n var params = {\n dpm: dpm, dcm: dcm, appId: engine.env.app_id\n };\n if (dom !== '0.0.0.0') {\n params.dom = dom;\n }\n var isExposure = type === 'exposure';\n engine.httpRequest(null, isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');\n}\n"
"code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BuriedPoint = (function (_super) {\n __extends(BuriedPoint, _super);\n function BuriedPoint() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.dpm = '0.0.0.0';\n _this.dcm = '0.0.0.0';\n _this.dom = '0.0.0.0';\n return _this;\n }\n BuriedPoint.prototype.mounted = function () {\n this.dpm && (this.dpm = fill(this.dpm));\n this.dcm && (this.dcm = fill(this.dcm));\n this.dom && (this.dom = fill(this.dom));\n this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);\n };\n BuriedPoint.prototype.awake = function () {\n log('exposure', this);\n };\n BuriedPoint.prototype._onClick = function (e) {\n log('click', this);\n };\n BuriedPoint.id = 'buried-point';\n return BuriedPoint;\n}(engine.ScriptBase));\nexports.default = BuriedPoint;\nfunction fill(src) {\n var result = src;\n for (var key in engine.env) {\n result = result.replace(key, engine.env[key]);\n }\n return result;\n}\nfunction log(type, data) {\n var dpm = data.dpm, dcm = data.dcm, dom = data.dom;\n var params = {\n dpm: dpm, dcm: dcm, appId: engine.env.app_id\n };\n if (dom !== '0.0.0.0') {\n params.dom = dom;\n }\n var isExposure = type === 'exposure';\n engine.httpRequest(isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');\n}\n"
}
......@@ -34,8 +34,17 @@
"alias": "自动播放",
"type": "boolean",
"default": true
},
"revert": {
"alias": "自动恢复",
"type": "boolean",
"default": false
},
"ratio": {
"alias": "时间占比",
"type": "string"
}
},
"id": "wave",
"code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Wave = (function (_super) {\n __extends(Wave, _super);\n function Wave() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.duration = 1000;\n _this.waveMethod = 'rotate';\n _this.loop = -1;\n _this.autoPlay = true;\n _this._oldProps = {};\n return _this;\n }\n Wave.prototype.mounted = function () {\n this._startTime = 0;\n engine.copyProp(this._oldProps, this.host, oldPropFields);\n if (this.autoPlay) {\n this.play();\n }\n };\n Wave.prototype.update = function (t) {\n if (this._playing) {\n if (!this._startTime) {\n this._startTime = t;\n }\n var _a = this, duration = _a.duration, waveParams = _a.waveParams, _waveAlgorithm = _a._waveAlgorithm, host = _a.host, _oldProps = _a._oldProps;\n var pass = (t - this._startTime) % duration;\n var r = pass / duration * PI2;\n var loopCounting = Math.floor((t - this._startTime) / duration);\n if (loopCounting != this._loopCounting) {\n this._loopCounting = loopCounting;\n if (this.onLoopEnd()) {\n r = PI2;\n }\n }\n var params = waveParams ? (waveParams.split(',')) : [];\n var props = _waveAlgorithm.apply(void 0, __spreadArrays(params, [r]));\n if (props.hasOwnProperty('x')) {\n host.x = (props.x || 0) + _oldProps.x;\n }\n if (props.hasOwnProperty('y')) {\n host.y = (props.y || 0) + _oldProps.y;\n }\n if (props.hasOwnProperty('sx')) {\n host.scaleX = props.sx;\n }\n if (props.hasOwnProperty('sy')) {\n host.scaleY = props.sy;\n }\n if (props.hasOwnProperty('r')) {\n host.rotation = props.r;\n }\n }\n };\n Wave.prototype.onLoopEnd = function () {\n if (this.loop < 0) {\n }\n else if (this._loopCounting < this.loop) {\n }\n else {\n this._playing = false;\n return true;\n }\n };\n Wave.prototype.play = function () {\n this._loopCounting = 0;\n this._playing = true;\n this._startTime = 0;\n };\n Wave.prototype.stop = function (revert) {\n if (revert === void 0) { revert = false; }\n this._playing = false;\n if (revert) {\n for (var key in this._oldProps) {\n var prop = this._oldProps[key];\n if (typeof prop === 'object') {\n engine.injectProp(this.host[key], prop);\n }\n else {\n this.host[key] = prop;\n }\n }\n }\n };\n Wave.prototype.onModify = function (value, key, oldValue) {\n switch (key) {\n case 'waveMethod':\n this._waveAlgorithm = waveLibs[this.waveMethod];\n break;\n }\n };\n Wave.id = 'wave';\n __decorate([\n engine.dirtyFieldTrigger\n ], Wave.prototype, \"waveMethod\", void 0);\n return Wave;\n}(engine.ScriptBase));\nexports.default = Wave;\nvar PI2 = Math.PI * 2;\nvar oldPropFields = {\n x: 'x',\n y: 'y',\n scaleX: 'scaleX',\n scaleY: 'scaleY',\n alpha: 'alpha',\n rotation: 'rotation',\n};\nvar cos = Math.cos, sin = Math.sin, PI = Math.PI;\nvar waveLibs = {\n round: function (radius, t) {\n return { x: cos(t) * radius, y: sin(t) * radius };\n },\n cosWave: function (h, t) {\n return { x: cos(t) * h, y: 0 };\n },\n sinWave: function (h, t) {\n h = h || 1;\n return { x: 0, y: sin(t) * h };\n },\n rotate: function (t) {\n return { r: 360 * t / PI / 2 };\n },\n shake: function (angle, count, t) {\n return { r: sin(t * count) * angle };\n },\n breath: function (scale, t) {\n if (scale === void 0) { scale = 0.1; }\n return { sx: sin(t) * scale + 1, sy: -sin(t + PI / 4) * scale + 1 };\n },\n zoom: function (scale, t) {\n if (scale === void 0) { scale = 0.1; }\n return { sx: sin(t) * scale + 1, sy: sin(t) * scale + 1 };\n },\n fade: function (base, t) {\n if (base === void 0) { base = 1; }\n return { alpha: (sin(t) + 1) * 0.5 + base };\n },\n};\n"
"code": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Wave = (function (_super) {\n __extends(Wave, _super);\n function Wave() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.duration = 1000;\n _this.waveMethod = 'rotate';\n _this.loop = -1;\n _this.autoPlay = true;\n _this.revert = false;\n _this._oldProps = {};\n return _this;\n }\n Wave.prototype.mounted = function () {\n this._startTime = 0;\n engine.copyProp(this._oldProps, this.host, oldPropFields);\n if (this.autoPlay) {\n this.play();\n }\n };\n Wave.prototype.sleep = function () {\n if (this.revert) {\n this.revertProps();\n }\n };\n Wave.prototype.update = function (t) {\n if (this._playing) {\n if (!this._startTime) {\n this._startTime = t;\n }\n var _a = this, duration = _a.duration, waveParams = _a.waveParams, _waveAlgorithm = _a._waveAlgorithm, host = _a.host, _oldProps = _a._oldProps;\n var pass = (t - this._startTime) % duration;\n var r = pass / duration * PI2;\n var loopCounting = Math.floor((t - this._startTime) / duration);\n if (loopCounting != this._loopCounting) {\n this._loopCounting = loopCounting;\n if (this.onLoopEnd()) {\n r = PI2;\n }\n }\n var t2 = void 0;\n if (this.ratio) {\n var ratio = this.ratio.split(',').map(function (item) { return parseFloat(item); });\n if (ratio.length === 2) {\n var begin = ratio[0], end = ratio[1];\n if (end >= begin) {\n var tr = r / PI2;\n if (tr >= begin && tr < end) {\n t2 = r / (end - begin);\n }\n else {\n t2 = 0;\n }\n }\n else {\n t2 = 0;\n }\n }\n else {\n t2 = 0;\n }\n }\n else {\n t2 = r;\n }\n var params = waveParams ? (waveParams.split(',').map(function (item) { return parseFloat(item); })) : [];\n var props = _waveAlgorithm.apply(void 0, __spreadArrays(params, [t2]));\n if (props.hasOwnProperty('x')) {\n host.x = (props.x || 0) + _oldProps.x;\n }\n if (props.hasOwnProperty('y')) {\n host.y = (props.y || 0) + _oldProps.y;\n }\n if (props.hasOwnProperty('sx')) {\n host.scaleX = props.sx;\n }\n if (props.hasOwnProperty('sy')) {\n host.scaleY = props.sy;\n }\n if (props.hasOwnProperty('r')) {\n host.rotation = props.r;\n }\n }\n };\n Wave.prototype.onLoopEnd = function () {\n if (this.loop < 0) {\n }\n else if (this._loopCounting < this.loop) {\n }\n else {\n this._playing = false;\n return true;\n }\n };\n Wave.prototype.play = function () {\n this._loopCounting = 0;\n this._playing = true;\n this._startTime = 0;\n };\n Wave.prototype.stop = function (revert) {\n if (revert === void 0) { revert = false; }\n this._playing = false;\n if (revert) {\n this.revertProps();\n }\n };\n Wave.prototype.revertProps = function () {\n for (var key in this._oldProps) {\n var prop = this._oldProps[key];\n if (typeof prop === 'object') {\n engine.injectProp(this.host[key], prop);\n }\n else {\n this.host[key] = prop;\n }\n }\n };\n Wave.prototype.onModify = function (value, key, oldValue) {\n switch (key) {\n case 'waveMethod':\n this._waveAlgorithm = waveLibs[this.waveMethod];\n break;\n }\n };\n Wave.id = 'wave';\n __decorate([\n engine.dirtyFieldTrigger\n ], Wave.prototype, \"waveMethod\", void 0);\n return Wave;\n}(engine.ScriptBase));\nexports.default = Wave;\nvar PI2 = Math.PI * 2;\nvar oldPropFields = {\n x: 'x',\n y: 'y',\n scaleX: 'scaleX',\n scaleY: 'scaleY',\n alpha: 'alpha',\n rotation: 'rotation',\n};\nvar cos = Math.cos, sin = Math.sin, PI = Math.PI;\nvar waveLibs = {\n round: function (radius, t) {\n return { x: cos(t) * radius, y: sin(t) * radius };\n },\n cosWave: function (h, t) {\n return { x: cos(t) * h, y: 0 };\n },\n sinWave: function (h, t) {\n h = h || 1;\n return { x: 0, y: sin(t) * h };\n },\n rotate: function (t) {\n return { r: 360 * t / PI / 2 };\n },\n shake: function (angle, count, t) {\n return { r: sin(t * count) * angle };\n },\n breath: function (scale, t) {\n if (scale === void 0) { scale = 0.1; }\n return { sx: sin(t) * scale + 1, sy: -sin(t + PI / 4) * scale + 1 };\n },\n zoom: function (scale, t) {\n if (scale === void 0) { scale = 0.1; }\n return { sx: sin(t) * scale + 1, sy: sin(t) * scale + 1 };\n },\n fade: function (base, t) {\n if (base === void 0) { base = 1; }\n return { alpha: (sin(t) + 1) * 0.5 + base };\n },\n};\n"
}
declare const args: any;
declare const props: any;
declare const target: engine.Container;
......@@ -6,101 +7,93 @@ declare const vm: engine.VM;
declare function next(type: string, payload?: any);
declare module engine {
export const VERSION = "1.0";
export function addCustomModule(id, container: Container, options?): Container;
export function findVariable(name, ...contexts);
export function joinPath(...segments);
declare module engine{
export const VERSION = "1.0";
export function trimChar(str, char);
export const devicePixelRatio: number;
export const devicePixelRatio: number;
export let StageScaleMode: {
export let StageScaleMode: {
EXACT_FIT: string;
NO_BORDER: string;
NO_SCALE: string;
SHOW_ALL: string;
FIXED_WIDTH: string;
FIXED_HEIGHT: string;
}
}
export const osType: string;
export const osType: string;
export function cos(angle: number): number;
export function cos(angle: number): number;
export function sin(angle: number): number;
export function sin(angle: number): number;
export const PI_2: number;
export const PI_2: number;
export const RAD_TO_DEG: number;
export const RAD_TO_DEG: number;
export const DEG_TO_RAD: number;
export const DEG_TO_RAD: number;
export enum RENDERER_TYPE {
export enum RENDERER_TYPE {
UNKNOWN = 0,
WEBGL = 1,
CANVAS = 2
}
}
export enum SHAPES {
export enum SHAPES {
POLY = 0,
RECT = 1,
CIRC = 2,
ELIP = 3,
RREC = 4
}
}
export enum PRECISION {
export enum PRECISION {
LOW = "lowp",
MEDIUM = "mediump",
HIGH = "highp"
}
}
export enum TEXT_GRADIENT {
export enum TEXT_GRADIENT {
LINEAR_VERTICAL = 0,
LINEAR_HORIZONTAL = 1
}
}
export enum TEXT_ALIGN {
export enum TEXT_ALIGN {
CENTER = "center",
LEFT = "left",
RIGHT = "right"
}
}
export enum VERTICAL_ALIGN {
export enum VERTICAL_ALIGN {
MIDDLE = "middle",
UP = "up",
DOWN = "down"
}
}
export enum TEXT_lINETYPE {
export enum TEXT_lINETYPE {
SINGLE = "single",
MULTI = "multi"
}
}
export enum LINE_ALIGNMENT {
export enum LINE_ALIGNMENT {
middle = 0.5,
outter = 1,
inner = 0
}
}
export enum LINE_CAP {
export enum LINE_CAP {
BUTT = "butt",
ROUND = "round",
SQUARE = "square"
}
}
export enum LINE_JOIN {
export enum LINE_JOIN {
MITER = "miter",
ROUND = "round",
BEVEL = "bevel"
}
}
export enum BLEND_MODES {
export enum BLEND_MODES {
NORMAL = 0,
ADD = 1,
MULTIPLY = 2,
......@@ -121,9 +114,9 @@ declare module engine {
NORMAL_NPM = 17,
ADD_NPM = 18,
SCREEN_NPM = 19
}
}
export enum DRAW_MODES {
export enum DRAW_MODES {
POINTS = 0,
LINES = 1,
LINE_LOOP = 2,
......@@ -131,89 +124,76 @@ declare module engine {
TRIANGLES = 4,
TRIANGLE_STRIP = 5,
TRIANGLE_FAN = 6
}
}
export enum SCALE_MODES {
export enum SCALE_MODES {
LINEAR = 0,
NEAREST = 1
}
}
export enum WRAP_MODES {
export enum WRAP_MODES {
CLAMP = 33071,
REPEAT = 10497,
MIRRORED_REPEAT = 33648
}
}
export enum GC_MODES {
export enum GC_MODES {
AUTO = 0,
MANUAL = 1
}
}
export const URL_FILE_EXTENSION: any;
export const URL_FILE_EXTENSION: any;
export const DATA_URI: any;
export const DATA_URI: any;
export enum SCROLL_DIRECTION {
HORIZONTAL = "horizontal",
VERTICAL = "vertical"
}
export class Container extends DisplayObject {
export class Container extends DisplayObject {
percentWidth: number;
percentHeight: number;
left: number;
top: number;
right: number;
bottom: number;
horizonCenter: number;
verticalCenter: number;
mouseChildren: boolean;
children: any[];
containerUpdateTransform: any;
constructor();
afterConstructor(): void;
onChildrenChange(index: any): void;
addChild(child: DisplayObject): DisplayObject;
addChildAt(child: DisplayObject, index: number): DisplayObject;
swapChildren(child1: DisplayObject, child2: DisplayObject): boolean;
getChildIndex(child: DisplayObject): number;
setChildIndex(child: DisplayObject, index: number): void;
getChildAt(index: number): DisplayObject;
getChildByName(name: string | RegExp, isOnlyOne?: boolean, isRecursive?: boolean): any;
removeChild(child: DisplayObject): DisplayObject;
removeChildAt(index: number): DisplayObject;
removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[];
updateTransform(): void;
calculateBounds(): void;
protected _calculateBounds(): void;
hitTestPoint(globalPoint: Point, isMouseEvent?: boolean): any;
renderWebGL(renderer: WebglRenderer): void;
private renderAdvancedWebGL;
protected _renderWebGL(renderer: WebglRenderer): void;
renderCanvas(renderer: CanvasRenderer): void;
protected _renderCanvas(renderer: CanvasRenderer): void;
update(deltaTime: number): void;
_onDispatchBubbledEvent(type: string): void;
destroy(): void;
width: number;
height: number;
private static _getElementsByName;
}
}
export class DisplayObject extends EventDispatcher {
export class DisplayObject extends EventDispatcher {
transform: Transform;
visible: boolean;
renderable: boolean;
......@@ -234,46 +214,28 @@ declare module engine {
displayObjectHitTestPoint: any;
protected _width: number;
protected _height: number;
constructor();
private readonly _tempDisplayObjectParent;
updateTransform(): void;
static _bp: Point;
static _p1: Point;
static _p2: Point;
static _p3: Point;
static _p4: Point;
static temBounds: Rectangle;
hitTestPoint(point: Point, isMouseEvent?: boolean): DisplayObject;
private _recursivePostUpdateTransform;
getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle;
getLocalBounds(rect?: Rectangle): Rectangle;
calculateBounds(): void;
globalToLocal(point: Point, bp?: Point): Point;
localToGlobal(point: Point, bp?: Point): Point;
_onDispatchBubbledEvent(type: string): void;
renderWebGL(renderer: any): void;
renderCanvas(renderer: any): void;
setParent(container: any): any;
setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, anchorX?: number, anchorY?: number): DisplayObject;
destroy(): void;
alpha: number;
x: number;
y: number;
......@@ -292,27 +254,21 @@ declare module engine {
mask: Graphics;
width: number;
height: number;
update(deltaTime: number): void;
}
}
export class FloatDisplay extends DisplayObject {
export class FloatDisplay extends DisplayObject {
htmlElement: any;
private _isAdded;
private _transformID;
constructor();
init(htmlElement: any): void;
private getStyle;
updateStyle(): void;
destroy(): void;
}
}
export class Sprite extends Container {
export class Sprite extends Container {
private _anchorTexture;
_texture: Texture;
_width: number;
......@@ -327,48 +283,31 @@ declare module engine {
uvs: Float32Array;
vertexData: Float32Array;
vertexTrimmedData: Float32Array;
constructor(texture?: Texture);
_onTextureUpdate(): void;
_onAnchorUpdate(): void;
calculateVertices(): void;
calculateTrimmedVertices(): void;
_renderWebGL(renderer: WebglRenderer): void;
_renderCanvas(renderer: CanvasRenderer): void;
_calculateBounds(): void;
getLocalBounds(rect?: Rectangle): Rectangle;
hitTestPoint(globalPoint: Point, isMouseEvent?: boolean): any;
destroy(): void;
anchorTexture: any;
texture: Texture;
static from(source: any): Sprite;
static fromFrame(frameId: string): Sprite;
static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite;
}
}
export class Stage extends Container {
export class Stage extends Container {
iosTouchendPreventDefault: boolean;
isPreventDefaultEvent: boolean;
rootDiv: any;
renderObj: SystemRenderer;
renderType: number;
static getStage(stageName?: string): Stage;
private static _stageList;
static pause: boolean;
private static _pause;
......@@ -390,49 +329,33 @@ declare module engine {
private _lastDpList;
private _rid;
private _floatDisplayList;
constructor(rootDivId?: string, desW?: number, desH?: number, frameRate?: number, scaleMode?: string, renderType?: number, transparent?: boolean, bgColor?: number);
render(): void;
private _ml;
private _mp;
private _initMouseEvent;
private _mouseDownPoint;
flush(): void;
setFrameRate(fps: number): void;
getFrameRate(): number;
getRootDivWH(div: HTMLDivElement): {
w: number;
h: number;
};
kill(): void;
private _mouseEventTypes;
private onMouseEvent;
private setAlign;
resize(): void;
getBounds(): Rectangle;
private static allUpdateObjList;
static flushAll(): void;
static addUpdateObj(target: any): void;
static removeUpdateObj(target: any): void;
destroy(): void;
}
}
export class Event extends HashObject {
export class Event extends HashObject {
static RESIZE: string;
static ON_SCROLL_TO_HEAD: string;
static ON_SCROLL_STOP: string;
......@@ -454,62 +377,42 @@ declare module engine {
type: string;
target: any;
data: any;
constructor(type: string);
stopImmediatePropagation(): void;
stopPropagation(): void;
private _bpd;
private _pd;
destroy(): void;
reset(type: string, target: any): void;
}
}
export class EventDispatcher extends HashObject {
export class EventDispatcher extends HashObject {
protected eventTypes: any;
protected eventTypes1: any;
constructor();
private static _MECO;
static _totalMEC: number;
static getMouseEventCount(type?: string): number;
addEventListener(type: string, listener: Function, context?: any, useCapture?: boolean): void;
once(type: string, listener: Function, context?: any, useCapture?: boolean): void;
private _changeMouseCount;
private _defaultEvent;
dispatchEvent(event: any, data?: any, useCapture?: boolean): boolean;
hasEventListener(type: string, useCapture?: boolean): boolean;
removeEventListener(type: string, listener: Function, context?: any, useCapture?: boolean): void;
removeAllEventListener(): void;
destroy(): void;
}
}
export class GDispatcher {
export class GDispatcher {
private static callbackPool;
private static thisObjPool;
static addEvent(name: string, callback: any, thisObj: any): void;
static removeEvent(name: string, callback: any, thisObj?: any): void;
static dispatchEvent(name: string, ...args: any[]): void;
}
}
export class MouseEvent extends Event {
export class MouseEvent extends Event {
static MOUSE_DOWN: string;
static MOUSE_UP: string;
static CLICK: string;
......@@ -524,37 +427,34 @@ declare module engine {
localY: number;
currentTarget: DisplayObject;
identifier: any;
constructor(type: string);
updateAfterEvent(): void;
destroy(): void;
}
}
export const _default: {
export const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: any, graphicsGeometry: Graphics): void;
}
}
export const _default: {
export const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void;
}
}
export const _default: {
export const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphics: Graphics): void;
}
}
export const _default: {
export const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void;
}
}
export function earcut(data: any, holeIndices: any, dim: any): any[];
export function earcut(data: any, holeIndices: any, dim: any): any[];
export class Graphics extends Container {
export class Graphics extends Container {
private _fillStyle;
private _lineStyle;
readonly fill: FillStyle;
......@@ -587,89 +487,52 @@ declare module engine {
private vertexData;
private shapeIndex;
private _transformID;
constructor();
clone(): Graphics;
lineStyle(lineWidth?: number, color?: number, alpha?: number, alignment?: number, native?: boolean): Graphics;
lineTextureStyle(width?: number, texture?: Texture, color?: number, alpha?: number, matrix?: any, alignment?: number, native?: boolean): this;
private startPoly;
private finishPoly;
moveTo(x: number, y: number): Graphics;
lineTo(x: number, y: number): Graphics;
private _initCurve;
quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): Graphics;
bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): Graphics;
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Graphics;
arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): Graphics;
beginFill(color?: number | string, alpha?: number): Graphics;
beginTextureFill(texture?: Texture, color?: number, alpha?: number, matrix?: Matrix): this;
endFill(): Graphics;
closePath(): Graphics;
beginHole(): this;
endHole(): this;
drawRect(x: number, y: number, width: number, height: number): Graphics;
drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Graphics;
drawCircle(x: number, y: number, radius: number): Graphics;
drawEllipse(x: number, y: number, width: number, height: number): Graphics;
drawPolygon(path: number[] | Point[] | Polygon): Graphics;
drawStar(x: number, y: number, points: number, radius: number, innerRadius: number, rotation?: number): Graphics;
private drawShape;
clear(): Graphics;
isFastRect(): boolean;
_renderWebGL(renderer: WebglRenderer): void;
private updateBatch;
private calculateTints;
private calculateVertices;
private transformPoints;
_renderCanvas(renderer: CanvasRenderer): void;
_calculateBounds(): void;
hitTestPoint(point: Point, isMouseEvent?: boolean): DisplayObject;
private hitTestPointAccuratly;
updateLocalBoundsSelf(): void;
private generateCanvasTexture;
destroy(): void;
private proccessHoles;
private addUvs;
private adjustUvs;
}
}
export class GraphicsData extends HashObject {
export class GraphicsData extends HashObject {
fillStyle: FillStyle;
lineStyle: LineStyle;
matrix: Matrix;
......@@ -677,230 +540,161 @@ declare module engine {
shape: any;
type: number;
points: number[];
constructor(shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle, fillStyle?: FillStyle, lineStyle?: LineStyle, matrix?: Matrix);
clone(): GraphicsData;
destroy(): void;
}
}
export class Shape extends Sprite {
export class Shape extends Sprite {
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
dirty: boolean;
offsetX: number;
offsetY: number;
constructor();
private _command;
private _isBitmapStroke;
private _isBitmapFill;
hitTestByPixel: boolean;
drawRoundRect(x: number, y: number, w: number, h: number, rTL?: number, rTR?: number, rBL?: number, rBR?: number): void;
moveTo(x: number, y: number): void;
lineTo(x: number, y: number): void;
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
quadraticCurveTo(cpX: number, cpY: number, x: number, y: number): void;
bezierCurveTo(cp1X: number, cp1Y: number, cp2X: number, cp2Y: number, x: number, y: number): void;
closePath(): void;
drawRect(x: number, y: number, w: number, h: number): void;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
drawCircle(x: number, y: number, radius: number, counterclockwise?: boolean): void;
drawEllipse(x: number, y: number, w: number, h: number): void;
clear(): void;
beginFill(color: number, alpha?: number): void;
beginLinearGradientFill(points: any, colors: any): void;
beginRadialGradientFill: (points: any, colors: any) => void;
beginBitmapFill(image: any, matrix: Array<number>): void;
private _fill;
beginStroke(color: number, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number, alpha?: number): void;
beginLinearGradientStroke(points: Array<number>, colors: any, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number): void;
beginRadialGradientStroke(points: Array<number>, colors: any, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number): void;
beginBitmapStroke(image: any, matrix: Array<number>, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number): void;
private _stroke;
endFill(): void;
endStroke(): void;
updateShape(): void;
private _drawShape;
hitTestPoint(globalPoint: Point, isMouseEvent?: boolean): DisplayObject;
changeColor(infoObj: any): void;
updateTexture(): void;
_renderCanvas(renderer: any): void;
_renderWebGL(renderer: any): void;
destroy(): void;
}
}
export class Circle {
export class Circle {
x: number;
y: number;
radius: number;
type: number;
constructor(x?: number, y?: number, radius?: number);
clone(): Circle;
isPointIn(point: Point): boolean;
getBounds(): Rectangle;
}
}
export class Ellipse {
export class Ellipse {
x: number;
y: number;
width: number;
height: number;
type: number;
constructor(x?: number, y?: number, width?: number, height?: number);
clone(): Ellipse;
isPointIn(point: Point): boolean;
getBounds(): Rectangle;
}
}
export class Polygon {
export class Polygon {
closed: boolean;
points: number[];
type: number;
constructor(...points: any[]);
clone(): Polygon;
close(): void;
isPointIn(point: Point): boolean;
}
}
export class RoundedRectangle {
export class RoundedRectangle {
x: number;
y: number;
width: number;
height: number;
radius: number;
type: number;
constructor(x?: number, y?: number, width?: number, height?: number, radius?: number);
clone(): RoundedRectangle;
isPointIn(point: Point): boolean;
}
}
export class FillStyle {
export class FillStyle {
color: number;
alpha: number;
texture: Texture;
matrix: Matrix;
visible: boolean;
alphaBlock: boolean;
constructor();
clone(): FillStyle;
reset(): void;
destroy(): void;
}
}
export class LineStyle extends FillStyle {
export class LineStyle extends FillStyle {
native: boolean;
width: number;
alignment: LINE_ALIGNMENT;
clone(): LineStyle;
reset(): void;
}
}
export function bezierCurveControlPoint(points: any): {
export function bezierCurveControlPoint(points: any): {
A: any[];
B: any[];
}
}
export const GRAPHICS_CURVES: {
export const GRAPHICS_CURVES: {
adaptive: boolean;
maxLength: number;
minSegments: number;
maxSegments: number;
segmentsCount: Function;
}
}
export abstract class HashObject {
export abstract class HashObject {
protected _instanceId: number;
protected _instanceType: string;
protected static _object_id: number;
constructor();
readonly instanceId: number;
readonly instanceType: string;
abstract destroy(): void;
}
}
export class Loader extends EventDispatcher {
export class Loader extends EventDispatcher {
caches: {};
_req: XMLHttpRequest;
crossOrigin: boolean;
constructor();
loadSheet(url: string): Promise<void>;
loadRaw(url: string, uuid?: string, type?: 'text' | 'json'): Promise<any>;
loadJson(url: string, uuid?: string): Promise<any>;
loadText(url: string, uuid?: string): Promise<any>;
loadImage(url: string, uuid?: string): Promise<{}>;
loadTexture(url: string, uuid?: string): Promise<Texture>;
cache(name: string, data: any): void;
}
loadSheet(callback: Function, url: string): void;
loadRaw(callback: Function, url: string, type: 'text' | 'json'): void;
export const globalLoader: Loader;
loadJson(callback: Function, url: string): void;
loadText(callback: Function, url: string): void;
loadTexture(callback: Function, url: string): void;
loadImage(callback: Function, url: string, crossOrigin?: boolean): HTMLImageElement;
cache(name: string, data: any): void;
}
export const globalLoader: Loader;
export const GroupD8: {
export const GroupD8: {
E: number;
SE: number;
S: number;
......@@ -922,9 +716,9 @@ declare module engine {
isVertical: (rotation: any) => boolean;
byDirection: (dx: any, dy: any) => number;
matrixAppendRotationInv: (matrix: any, rotation: any, tx?: number, ty?: number) => void;
}
}
export class Matrix extends HashObject {
export class Matrix extends HashObject {
a: number;
b: number;
c: number;
......@@ -932,93 +726,58 @@ declare module engine {
tx: number;
ty: number;
array: any;
constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
clone(): Matrix;
copy(matrix: Matrix | any): this;
transformPoint(x: number, y: number, bp?: Point): Point;
transformPointInverse(x: number, y: number, bp?: Point): Point;
setFrom(mtx: Matrix): void;
identity(): void;
invert(): Matrix;
createBox(x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, ax: number, ay: number): void;
prepend: (mtx: Matrix) => void;
append(matrix: Matrix): void;
static isEqual(m1: Matrix, m2: Matrix): boolean;
concat(mtx: Matrix): void;
rotate(angle: number): void;
scale(sx: number, sy: number): void;
translate(dx: number, dy: number): void;
set(a: any, b: any, c: any, d: any, tx: any, ty: any): this;
getRotation(): number;
toArray(transpose?: boolean, out?: any): any;
static readonly IDENTITY: Matrix;
static readonly TEMP_MATRIX: Matrix;
destroy(): void;
}
}
export class ObservablePoint extends HashObject {
export class ObservablePoint extends HashObject {
_x: number;
_y: number;
cb: any;
scope: any;
constructor(cb: Function, scope: any, x?: number, y?: number);
set(x?: number, y?: number): void;
copy(point: Point | ObservablePoint): void;
x: number;
y: number;
destroy(): void;
}
}
export class Point extends HashObject {
export class Point extends HashObject {
destroy(): void;
constructor(x?: number, y?: number);
x: number;
y: number;
static distance(...args: any[]): number;
set(x: number, y: number): void;
}
}
export class Rectangle extends HashObject {
export class Rectangle extends HashObject {
type: number;
constructor(x?: number, y?: number, width?: number, height?: number);
clear(): void;
copy(rect: Rectangle): this;
clone(): Rectangle;
x: number;
y: number;
width: number;
......@@ -1027,25 +786,17 @@ declare module engine {
readonly right: number;
readonly top: number;
readonly bottom: number;
isPointIn(point: Point): boolean;
fit(rectangle: Rectangle): void;
static createFromRects(...arg: Rectangle[]): Rectangle;
static createFromPoints(rect: Rectangle, ...arg: Point[]): Rectangle;
static createFromVertexData(rect: Rectangle, vertexData: Float32Array): Rectangle;
static createRectfrom2Point(rect: Rectangle, p1: Point, p2: Point): Rectangle;
static testRectCross(ra: Rectangle, rb: Rectangle): boolean;
destroy(): void;
}
}
export class Transform extends HashObject {
export class Transform extends HashObject {
worldMatrix: Matrix;
localMatrix: Matrix;
_worldID: number;
......@@ -1061,29 +812,22 @@ declare module engine {
_sy: number;
_localID: number;
_currentLocalID: number;
constructor();
onChange(): void;
updateSkew(): void;
updateLocalMatrix(): void;
updateWorldMatrix(parentTransform: Transform): void;
rotation: number;
destroy(): void;
}
}
export function httpRequest(callback: Function, url: string, method?: string, params?: any, type?: 'text' | 'json' | 'jsonp'): void;
export function httpRequest(url: string, method?: string, params?: any, type?: 'text' | 'json' | 'jsonp'): Promise<{}>;
export function jsonp(callback: any, url: any, params: any): void;
export function jsonp(url: any, params: any): Promise<{}>;
export function urlJoin(url: any, query: any): any;
export function urlJoin(url: any, query: any): any;
export class CanvasRenderer extends SystemRenderer {
export class CanvasRenderer extends SystemRenderer {
rootContext: CanvasRenderingContext2D;
context: CanvasRenderingContext2D;
maskManager: CanvasMaskManager;
......@@ -1093,49 +837,34 @@ declare module engine {
graphics: CanvasGraphicsRenderer;
};
renderingToScreen: boolean;
constructor(options: RendererOptions);
render(displayObject: DisplayObject, renderTexture?: any, transform?: Matrix): void;
clear(clearColor: string): void;
destroy(): void;
resize(screenWidth: number, screenHeight: number): void;
destroyPlugins(): void;
}
}
export class BatchManager {
export class BatchManager {
renderer: WebglRenderer;
emptyRenderer: ObjectRenderer;
currentRenderer: ObjectRenderer;
constructor(renderer: WebglRenderer);
setObjectRenderer(objectRenderer: ObjectRenderer): void;
flush(): void;
reset(): void;
}
}
export class CanvasMaskManager extends HashObject {
export class CanvasMaskManager extends HashObject {
renderer: any;
constructor(renderer: CanvasRenderer);
pushMask(maskData: Graphics): void;
renderGraphicsShape(graphics: Graphics): void;
popMask(renderer: CanvasRenderer): void;
destroy(): void;
}
}
export class MaskManager {
export class MaskManager {
renderer: WebglRenderer;
scissor: boolean;
scissorData: any;
......@@ -1143,61 +872,42 @@ declare module engine {
enableScissor: boolean;
alphaMaskPool: any[];
alphaMaskIndex: number;
constructor(renderer: WebglRenderer);
pushMask(target: any, maskData: any): void;
popMask(target: any, maskData: any): void;
pushStencilMask(maskData: Graphics): void;
popStencilMask(): void;
pushScissorMask(target: any, maskData: Graphics): void;
popScissorMask(): void;
destroy(): void;
}
}
export class StencilManager {
export class StencilManager {
renderer: WebglRenderer;
stencilMaskStack: Graphics[];
constructor(renderer: WebglRenderer);
setMaskStack(stencilMaskStack: Graphics[]): void;
pushStencil(graphics: Graphics): void;
popStencil(): void;
_useCurrent(): void;
_getBitwiseMask(): number;
destroy(): void;
}
}
export class TextureGarbageCollector {
export class TextureGarbageCollector {
renderer: WebglRenderer;
count: number;
checkCount: number;
maxIdle: number;
checkCountMax: number;
mode: number;
constructor(renderer: WebglRenderer);
update(): void;
run(): void;
unload(displayObject: any): void;
}
}
export class TextureManager {
export class TextureManager {
boundTextures: any;
renderer: WebglRenderer;
emptyTextures: any;
......@@ -1205,27 +915,18 @@ declare module engine {
currentLocation: number;
gl: WebGLRenderingContext;
_managedTextures: Array<any>;
constructor(renderer: WebglRenderer);
onContextChange(): void;
bindTexture(texture: any, location?: number, forceLocation?: boolean): number;
getTexture(): void;
updateTexture(texture: any, location?: number): GLTexture;
unbindTexture(texture: any): void;
destroyTexture(texture: any, skipRemove: any): void;
removeAll(): void;
destroy(): void;
}
}
export class BatchRenderer extends ObjectRenderer {
export class BatchRenderer extends ObjectRenderer {
vertSize: number;
vertByteSize: number;
size: number;
......@@ -1243,80 +944,58 @@ declare module engine {
MAX_TEXTURES: number;
vertexBuffers: GLBuffer[];
indexBuffers: GLBuffer[];
constructor(renderer: WebglRenderer);
onContextChange(): void;
onPreRender(): void;
render(element: any): void;
getIndexBuffer(size: any): any;
getAttributeBuffer(size: number): any;
flush(): void;
packGeometry(element: any, float32View: any, uint32View: any, indexBuffer: any, index: any, indexCount: any): void;
start(): void;
stop(): void;
destroy(): void;
}
}
export class CanvasGraphicsRenderer {
export class CanvasGraphicsRenderer {
renderer: CanvasRenderer;
constructor(renderer: CanvasRenderer);
render(graphics: Graphics): void;
destroy(): void;
}
}
export function holePath(graphicsData: GraphicsData, context: CanvasRenderingContext2D, ccw?: boolean): void;
export function holePath(graphicsData: GraphicsData, context: CanvasRenderingContext2D, ccw?: boolean): void;
export function judgeCcw(points: number[]): boolean;
export function judgeCcw(points: number[]): boolean;
export class CanvasSpriteRenderer {
export class CanvasSpriteRenderer {
renderer: CanvasRenderer;
constructor(renderer: CanvasRenderer);
render(sprite: any): void;
destroy(): void;
}
}
export interface RendererOptions {
export interface RendererOptions {
htmlElement?: HTMLCanvasElement;
transparent?: boolean;
antialias?: boolean;
preserveDrawingBuffer?: boolean;
backgroundColor?: number;
roundPixels?: boolean;
}
}
export class CanvasRenderTarget {
export class CanvasRenderTarget {
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
constructor(width: number, height: number);
clear(): void;
resize(width: number, height: number): void;
destroy(): void;
width: number;
height: number;
}
}
export class RenderTarget {
export class RenderTarget {
gl: WebGLRenderingContext;
frameBuffer: GLFramebuffer;
texture: GLTexture;
......@@ -1332,25 +1011,17 @@ declare module engine {
stencilMaskStack: Graphics[];
scaleMode: number;
root: boolean;
constructor(gl: WebGLRenderingContext, width?: number, height?: number, scaleMode?: number, root?: boolean);
clear(clearColor?: number[]): void;
attachStencilBuffer(): void;
setFrame(destinationFrame?: Rectangle, sourceFrame?: Rectangle): void;
activate(): void;
calculateProjection(destinationFrame: Rectangle, sourceFrame?: Rectangle): void;
resize(width: number, height: number): void;
destroy(): void;
}
}
export class SystemRenderer extends EventDispatcher {
export class SystemRenderer extends EventDispatcher {
options: RendererOptions;
type: number;
htmlElement: HTMLCanvasElement;
......@@ -1361,64 +1032,49 @@ declare module engine {
_backgroundColorString: string;
_tempDisplayObjectParent: Container;
_lastObjectRendered: DisplayObject;
constructor(options: RendererOptions);
resize(width: number, height: number): void;
render(displayObject: any, renderTexture?: any, transform?: any): void;
destroy(): void;
backgroundColor: number;
}
}
export class BatchBuffer {
export class BatchBuffer {
vertices: ArrayBuffer;
float32View: Float32Array;
uint32View: Uint32Array;
positions: any;
uvs: any;
colors: any;
constructor(size: number);
destroy(): void;
}
}
export class BatchDrawCall {
export class BatchDrawCall {
textures: BaseTexture[];
textureCount: number;
start: number;
size: number;
type: number;
constructor();
}
}
export function createIndicesForQuads(size: number): Uint16Array;
export function createIndicesForQuads(size: number): Uint16Array;
export function generateMultiTextureShader(gl: any, maxTextures: any): GLShader;
export function generateMultiTextureShader(gl: any, maxTextures: any): GLShader;
export class ObjectRenderer {
export class ObjectRenderer {
renderer: WebglRenderer;
constructor(renderer: WebglRenderer);
onContextChange(): void;
start(): void;
stop(): void;
flush(): void;
render(object: DisplayObject): void;
destroy(): void;
}
}
export class WebGLState {
export class WebGLState {
blendModes: any;
activeState: Uint8Array;
defaultState: Uint8Array;
......@@ -1429,29 +1085,19 @@ declare module engine {
attribState: any[];
};
nativeVaoExtension: any;
constructor(gl: WebGLRenderingContext);
setState(state: any): void;
setBlend(value: any): void;
setBlendMode(value: any): void;
setDepthTest(value: any): void;
setCullFace(value: any): void;
setFrontFace(value: any): void;
resetAttributes(): void;
resetToDefault(): void;
resetTo3D(): void;
}
}
export class WebglRenderer extends SystemRenderer {
export class WebglRenderer extends SystemRenderer {
plugins: {};
gl: WebGLRenderingContext;
CONTEXT_UID: number;
......@@ -1466,69 +1112,47 @@ declare module engine {
_activeVao: VertexArrayObject;
_activeRenderTarget: RenderTarget;
rootRenderTarget: RenderTarget;
constructor(options: RendererOptions);
_initContext(): void;
render(displayObject: DisplayObject, renderTexture?: any, transform?: any): void;
clear(clearColor: number[]): void;
setTransform(matrix: Matrix): void;
clearRenderTexture(renderTexture: any, clearColor: any): this;
bindShader(shader: GLShader, autoProject?: boolean): WebglRenderer;
createVao(): VertexArrayObject;
bindVao(vao: VertexArrayObject): WebglRenderer;
reset(): WebglRenderer;
bindRenderTexture(renderTexture: any, transform?: Matrix): WebglRenderer;
bindRenderTarget(renderTarget: RenderTarget): WebglRenderer;
resize(screenWidth: any, screenHeight: any): void;
destroy(): void;
handleContextRestored(): void;
handleContextLost(event: WebGLContextEvent): void;
initPlugins(staticMap: any): void;
destroyPlugins(): void;
static __plugins: any;
static registerPlugin(pluginName: string, ctor: Function): void;
}
}
export class BezierPath {
export class BezierPath {
_d: any;
_transform: any;
_styles: any;
_shape: any;
constructor(d?: any, transform?: any, styles?: any);
}
}
export class EllipsePath extends BezierPath {
export class EllipsePath extends BezierPath {
_x: any;
_y: any;
_radiusX: any;
_radiusY: any;
_transform: any;
_styles: any;
constructor(x: any, y: any, radiusX: any, radiusY: any, transform: any, styles: any);
}
}
export class FrameEntity {
export class FrameEntity {
alpha: number;
transform: {
a: number;
......@@ -1548,15 +1172,13 @@ declare module engine {
ny: number;
maskPath: any;
shapes: any[];
constructor(spec: any);
static lastShapes: any;
}
}
export const _default: (data: any, cb: any, failure: any) => void;
export const _default: (data: any, cb: any, failure: any) => void;
export class MovieClip extends Container {
export class MovieClip extends Container {
lockStep: boolean;
readonly currentFrame: number;
private _curFrame;
......@@ -1570,61 +1192,43 @@ declare module engine {
private timeInterval;
private deltaFrame;
private frameCount;
constructor(mv?: VideoEntity);
init(mv: VideoEntity): void;
private initChildren;
private resetTransform;
resetTransformAll(frameIndex: number): void;
setImage(imagekey: any, imageUrl: string): void;
stop(): void;
nextFrame(): void;
prevFrame(): void;
gotoAndStop(frameIndex: number): void;
play(isFront?: boolean): void;
private _lastFrame;
readonly isInTimeFrame: boolean;
gotoAndPlay(frameIndex: number, isFront?: boolean): void;
startAniRange(beginFrame?: number, endFrame?: number, loops?: number, callback?: Function): void;
private startTime;
private startFrame;
private lastDeltaFrame;
private _endMark;
commonDeltaTime: number;
updateFrame(): void;
private getCurFrameWhenLockStep;
update(deltaTime: number): void;
destroy(): void;
}
}
export function inflate(input: any, options: any): any;
export function inflate(input: any, options: any): any;
export const _default: {
export const _default: {
inflate: typeof inflate;
}
}
export function assign(obj: any, objO: any): any;
export function assign(obj: any, objO: any): any;
export function shrinkBuf(buf: any, size: any): any;
export function shrinkBuf(buf: any, size: any): any;
export const utils: {
export const utils: {
assign: typeof assign;
shrinkBuf: typeof shrinkBuf;
Buf8: any;
......@@ -1632,33 +1236,33 @@ declare module engine {
Buf32: any;
arraySet: any;
flattenChunks: any;
}
}
export {};
export {};
export function string2buf(str: any): any;
export function string2buf(str: any): any;
export function buf2binstring(buf: any, len?: any): any;
export function buf2binstring(buf: any, len?: any): any;
export function binstring2buf(str: any): any;
export function binstring2buf(str: any): any;
export function buf2string(buf: any, max: any): any;
export function buf2string(buf: any, max: any): any;
export function utf8border(buf: any, max: any): any;
export function utf8border(buf: any, max: any): any;
export const strings: {
export const strings: {
utf8border: typeof utf8border;
buf2string: typeof buf2string;
binstring2buf: typeof binstring2buf;
buf2binstring: typeof buf2binstring;
string2buf: typeof string2buf;
}
}
export {};
export {};
export function adler32(adler: any, buf: any, len: any, pos: any): number;
export function adler32(adler: any, buf: any, len: any, pos: any): number;
export const _default: {
export const _default: {
Z_NO_FLUSH: number;
Z_PARTIAL_FLUSH: number;
Z_SYNC_FLUSH: number;
......@@ -1686,27 +1290,27 @@ declare module engine {
Z_TEXT: number;
Z_UNKNOWN: number;
Z_DEFLATED: number;
}
}
export function crc32(crc: any, buf: any, len: any, pos: any): number;
export function crc32(crc: any, buf: any, len: any, pos: any): number;
export function deflateResetKeep(strm: any): any;
export function deflateResetKeep(strm: any): any;
export function deflateReset(strm: any): any;
export function deflateReset(strm: any): any;
export function deflateSetHeader(strm: any, head: any): number;
export function deflateSetHeader(strm: any, head: any): number;
export function deflateInit2(strm: any, level: any, method: any, windowBits: any, memLevel: any, strategy: any): any;
export function deflateInit2(strm: any, level: any, method: any, windowBits: any, memLevel: any, strategy: any): any;
export function deflateInit(strm: any, level: any): any;
export function deflateInit(strm: any, level: any): any;
export function deflate(strm: any, flush: any): any;
export function deflate(strm: any, flush: any): any;
export function deflateEnd(strm: any): any;
export function deflateEnd(strm: any): any;
export function deflateSetDictionary(strm: any, dictionary: any): number;
export function deflateSetDictionary(strm: any, dictionary: any): number;
export const _default: {
export const _default: {
deflateInit: typeof deflateInit;
deflateInit2: typeof deflateInit2;
deflateReset: typeof deflateReset;
......@@ -1716,29 +1320,29 @@ declare module engine {
deflateEnd: typeof deflateEnd;
deflateSetDictionary: typeof deflateSetDictionary;
deflateInfo: string;
}
}
export function GZheader(): void;
export function GZheader(): void;
export function inflateResetKeep(strm: any): number;
export function inflateResetKeep(strm: any): number;
export function inflateReset(strm: any): number;
export function inflateReset(strm: any): number;
export function inflateReset2(strm: any, windowBits: any): number;
export function inflateReset2(strm: any, windowBits: any): number;
export function inflateInit2(strm: any, windowBits: any): any;
export function inflateInit2(strm: any, windowBits: any): any;
export function inflateInit(strm: any): any;
export function inflateInit(strm: any): any;
export function inflate(strm: any, flush: any): any;
export function inflate(strm: any, flush: any): any;
export function inflateEnd(strm: any): number;
export function inflateEnd(strm: any): number;
export function inflateGetHeader(strm: any, head: any): number;
export function inflateGetHeader(strm: any, head: any): number;
export function inflateSetDictionary(strm: any, dictionary: any): number;
export function inflateSetDictionary(strm: any, dictionary: any): number;
export const _default: {
export const _default: {
inflateReset: typeof inflateReset;
inflateReset2: typeof inflateReset2;
inflateResetKeep: typeof inflateResetKeep;
......@@ -1749,9 +1353,9 @@ declare module engine {
inflateGetHeader: typeof inflateGetHeader;
inflateSetDictionary: typeof inflateSetDictionary;
inflateInfo: string;
}
}
export const _default: {
export const _default: {
2: string;
1: string;
0: string;
......@@ -1761,39 +1365,38 @@ declare module engine {
'-4': string;
'-5': string;
'-6': string;
}
}
export function _tr_init(s: any): void;
export function _tr_init(s: any): void;
export function _tr_stored_block(s: any, buf: any, stored_len: any, last: any): void;
export function _tr_stored_block(s: any, buf: any, stored_len: any, last: any): void;
export function _tr_align(s: any): void;
export function _tr_align(s: any): void;
export function _tr_flush_block(s: any, buf: any, stored_len: any, last: any): void;
export function _tr_flush_block(s: any, buf: any, stored_len: any, last: any): void;
export function _tr_tally(s: any, dist: any, lc: any): boolean;
export function _tr_tally(s: any, dist: any, lc: any): boolean;
export const _default: {
export const _default: {
_tr_init: typeof _tr_init;
_tr_stored_block: typeof _tr_stored_block;
_tr_flush_block: typeof _tr_flush_block;
_tr_tally: typeof _tr_tally;
_tr_align: typeof _tr_align;
}
}
export function ZStream(): void;
export function ZStream(): void;
export class Parser {
export class Parser {
load(url: any, success: any, failure: any): void;
loadViaWorker(url: any, success: any, failure: any): void;
}
}
export const proto: protobuf.Root;
export const proto: protobuf.Root;
export const ProtoMovieEntity: protobuf.Type;
export const ProtoMovieEntity: protobuf.Type;
export class RectPath extends BezierPath {
export class RectPath extends BezierPath {
_x: any;
_y: any;
_width: any;
......@@ -1801,19 +1404,17 @@ declare module engine {
_cornerRadius: any;
_transform: any;
_styles: any;
constructor(x: any, y: any, width: any, height: any, cornerRadius: any, transform: any, styles: any);
}
}
export class SpriteEntity {
export class SpriteEntity {
matteKey: any;
imageKey: any;
frames: any[];
constructor(spec: any);
}
}
export class VideoEntity extends HashObject {
export class VideoEntity extends HashObject {
version: string;
videoSize: {
width: number;
......@@ -1825,15 +1426,12 @@ declare module engine {
hasBeenCached: boolean;
sprites: SpriteEntity[];
audios: any[];
constructor(spec: any, images: any);
resetSprites(spec: any): void;
destroy(): void;
}
}
export class EditableText extends TextField {
export class EditableText extends TextField {
htmlElement: any;
private _prompt;
prompt: string;
......@@ -1841,22 +1439,17 @@ declare module engine {
promptColor: string;
private _textColor;
textColor: string;
constructor();
}
}
export class InputText extends FloatDisplay {
export class InputText extends FloatDisplay {
private _view;
inputType: number;
isAutoDownKeyBoard: boolean;
private static _inputTypeList;
constructor(inputType?: number);
init(htmlElement: any): void;
initInfo(text: string, color: string, align: string, size: number, font: string, showBorder: boolean, lineSpacing: number, textWidth: number): void;
lineSpacing: number;
bold: boolean;
italic: boolean;
......@@ -1866,19 +1459,16 @@ declare module engine {
border: boolean;
text: string;
maxCharacters: number;
convertToTextField(textField?: TextField): TextField;
}
}
export class TextField extends Sprite {
export class TextField extends Sprite {
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
dirty: boolean;
offsetX: number;
offsetY: number;
constructor();
textAlpha: number;
private _textAlpha;
textAlign: TEXT_ALIGN;
......@@ -1892,10 +1482,8 @@ declare module engine {
lineType: TEXT_lINETYPE;
private _lineType;
text: string;
protected _setText(value: any): void;
private _text;
protected _text: string;
font: string;
private _font;
size: number;
......@@ -1913,37 +1501,27 @@ declare module engine {
border: boolean;
private _border;
private _prepContext;
getTextWidth(lineIndex?: number): number;
readonly lines: number;
private _getMeasuredWidth;
private realLines;
updateText(): void;
updateTexture(): void;
_renderCanvas(renderer: any): void;
_renderWebGL(renderer: any): void;
destroy(): void;
}
}
export class BaseRenderTexture extends BaseTexture {
export class BaseRenderTexture extends BaseTexture {
_glRenderTargets: {};
_canvasRenderTarget: any;
valid: boolean;
constructor(width?: number, height?: number, scaleMode?: number);
resize(width: number, height: number): void;
destroy(): void;
}
}
export class BaseTexture extends EventDispatcher {
export class BaseTexture extends EventDispatcher {
touched: number;
width: number;
height: number;
......@@ -1961,44 +1539,30 @@ declare module engine {
_enabled: number;
_destroyed: boolean;
textureCacheIds: string[];
constructor(source?: HTMLImageElement | HTMLCanvasElement, scaleMode?: number);
update(): void;
loadSource(source: any): void;
private _updateImageType;
private _sourceLoaded;
destroy(): void;
dispose(): void;
updateSourceImage(newSrc: string): void;
static fromImage(imageUrl: string, crossorigin?: any, scaleMode?: number): BaseTexture;
static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): BaseTexture;
static from(source: any, scaleMode?: number): BaseTexture;
static addToCache(baseTexture: BaseTexture, id: string): void;
static removeFromCache(baseTexture: string | BaseTexture): BaseTexture | null;
}
}
export function getTexture(str: string): any;
export function getTexture(str: string): any;
export class RenderTexture extends Texture {
export class RenderTexture extends Texture {
constructor(baseRenderTexture: BaseRenderTexture, frame?: Rectangle);
resize(width: number, height: number, doNotResizeBaseTexture?: boolean): void;
static create(width: number, height: number, scaleMode?: number): RenderTexture;
}
}
export class Texture extends EventDispatcher {
export class Texture extends EventDispatcher {
noFrame: boolean;
baseTexture: BaseTexture;
_frame: Rectangle;
......@@ -2013,62 +1577,42 @@ declare module engine {
textureCacheIds: string[];
static EMPTY: Texture;
static WHITE: Texture;
constructor(baseTexture: BaseTexture | Texture, frame?: Rectangle, orig?: Rectangle, trim?: Rectangle, rotate?: number, anchor?: Point);
update(): void;
onBaseTextureLoaded(e: Event): void;
onBaseTextureUpdated(e: Event): void;
destroy(): void;
clone(): Texture;
_updateUvs(): void;
frame: Rectangle;
rotate: number;
readonly width: number;
readonly height: number;
static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number): Texture;
static fromFrame(frameId: string): Texture;
static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): Texture;
static from(source: any): Texture;
static addToCache(texture: Texture, id: string): void;
static removeFromCache(texture: any): Texture;
}
}
export class TextureSheet {
baseTexture: BaseTexture;
export class TextureSheet {
baseTexture: any;
textures: {};
animations: {};
data: any;
_frames: any;
_frameKeys: string[];
_callback: Function;
constructor(baseTexture: BaseTexture, data: any);
constructor(baseTexture: BaseTexture | Texture, data: any);
parse(callback: Function): void;
_processFrames(initialFrameIndex: number): void;
_processAnimations(): void;
_parseComplete(): void;
destroy(destroyBase?: boolean): void;
}
}
export class TextureUvs {
export class TextureUvs {
x0: number;
y0: number;
x1: number;
......@@ -2079,23 +1623,16 @@ declare module engine {
y3: number;
uvsUint32: Uint32Array;
uvsFloat32: Float32Array;
constructor();
set(frame: Rectangle, baseFrame: Rectangle | BaseTexture, rotate: number): void;
}
}
export class Ease {
export class Ease {
constructor();
static get(amount: number): (t: number) => number;
static getPowIn(pow: number): (t: number) => number;
static getPowOut(pow: number): (t: number) => number;
static getPowInOut(pow: number): (t: number) => number;
static quadIn: (t: number) => number;
static quadOut: (t: number) => number;
static quadInOut: (t: number) => number;
......@@ -2108,51 +1645,30 @@ declare module engine {
static quintIn: (t: number) => number;
static quintOut: (t: number) => number;
static quintInOut: (t: number) => number;
static sineIn(t: number): number;
static sineOut(t: number): number;
static sineInOut(t: number): number;
static getBackIn(amount: number): (t: number) => number;
static backIn: (t: number) => number;
static getBackOut(amount: number): (t: any) => number;
static backOut: (t: any) => number;
static getBackInOut(amount: number): (t: number) => number;
static backInOut: (t: number) => number;
static circIn(t: number): number;
static circOut(t: number): number;
static circInOut(t: number): number;
static bounceIn(t: number): number;
static bounceOut(t: number): number;
static bounceInOut(t: number): number;
static getElasticIn(amplitude: number, period: number): (t: number) => number;
static elasticIn: (t: number) => number;
static getElasticOut(amplitude: number, period: number): (t: number) => number;
static elasticOut: (t: number) => number;
static getElasticInOut(amplitude: number, period: number): (t: number) => number;
static elasticInOut: (t: number) => number;
}
}
export class Tween {
export class Tween {
private static NONE;
private static LOOP;
private static REVERSE;
......@@ -2175,103 +1691,73 @@ declare module engine {
private _prevPosition;
private _stepPosition;
private passive;
static get(target: any, props?: {
loop?: boolean;
onChange?: Function;
onChangeObj?: any;
}, pluginData?: any, override?: boolean): Tween;
static removeTweens(target: any): void;
static pauseTweens(target: any): void;
static resumeTweens(target: any): void;
private static tick;
static flush(): void;
private static _lastTime;
private static _register;
static removeAllTweens(): void;
constructor(target: any, props: any, pluginData: any);
onChange: Function;
private initialize;
setPosition(value: number, actionsMode?: number): boolean;
private _runAction;
private _updateTargetProps;
setPaused(value: boolean): Tween;
private _cloneProps;
private _addStep;
private _appendQueueProps;
private _addAction;
private _set;
wait(duration: number, passive?: boolean): Tween;
to(props: any, duration?: number, ease?: Function): Tween;
call(callback: Function, thisObj?: any, params?: any[]): Tween;
set(props: any, target?: any): Tween;
play(tween?: Tween): Tween;
pause(tween?: Tween): Tween;
$tick(delta: number): void;
}
}
export class BitmapNumber extends Sprite {
export class BitmapNumber extends Sprite {
resName: string;
private textures;
private _num;
num: number;
constructor(textures: Texture[]);
reset(textures: Texture[]): void;
}
}
export class BitmapNumbers extends Container {
export class BitmapNumbers extends Container {
textures: Texture[];
align: TEXT_ALIGN;
singleWidth: number;
private _num;
num: number;
constructor(textures: Texture[]);
adaptate(): void;
}
}
export class Button extends Sprite {
export class Button extends Sprite {
textureUp: any;
textureDown: any;
textureDisable: any;
constructor(tUp: Texture, tDown?: Texture, tDisable?: Texture);
private _mouseEvent;
initButton(): void;
clicked: boolean;
private _clicked;
textureStatusEnable: boolean;
destroy(): void;
}
}
export class FrameAni extends Sprite {
export class FrameAni extends Sprite {
texturesAll: Texture[];
currentFrame: number;
totalFrames: number;
......@@ -2281,28 +1767,50 @@ declare module engine {
callback: Function;
_frameRate: number;
frameRate: number;
constructor(texturesAll: Texture[]);
private count;
onEnterFrame(): void;
play(callback: any): void;
reset(): void;
private changeTexture;
}
}
export interface IScrollListItem extends DisplayObject {
initData(id: number, data: any): void;
export class ScrollContainer extends Container {
private _direction;
protected distance: number;
private minDis;
private maskObj;
viewPort: Container;
private lastValue;
protected speed: number;
private addSpeed;
isStop: boolean;
maxSpeed: number;
fSpeed: number;
protected paramXY: string;
protected paramSize: string;
private stopTimes;
private isMouseDownState;
private autoScroll;
isSpringBack: boolean;
constructor(maxDistance?: number, isFull?: boolean);
readonly maxDistance: any;
direction: SCROLL_DIRECTION;
protected updateDirection(): void;
updateViewRect(): void;
cancelScroll(): void;
private onMouseEvent;
scrollTo(dis: number, time?: number): void;
destroy(): void;
}
export interface IScrollListItem extends DisplayObject {
initData(id: number, data: any): void;
id: number;
data: number;
}
}
export class ScrollList extends ScrollPage {
export class ScrollList extends ScrollContainer {
private _items;
private _itemW;
private _itemH;
......@@ -2317,228 +1825,169 @@ declare module engine {
private _disParam;
private _lastFirstId;
readonly loadingView: DisplayObject;
constructor(itemClassName: any, itemWidth: number, itemHeight: number, vW: number, vH: number, isVertical?: boolean, cols?: number);
constructor(itemClassName: any, itemWidth: number, itemHeight: number, cols?: number);
updateData(data: Array<any>, isReset?: boolean): void;
private flushData;
setViewRect(w: number, h: number, isVertical: boolean): void;
updateViewRect(): void;
private _updateViewRect;
setLoading(downLoading: DisplayObject): void;
destroy(): void;
}
export class ScrollPage extends Container {
protected isVertical: boolean;
private viewWidth;
private viewHeight;
maxDistance: number;
protected distance: number;
private minDis;
private maskObj;
view: Container;
private lastValue;
protected speed: number;
private addSpeed;
isStop: boolean;
maxSpeed: number;
fSpeed: number;
protected paramXY: string;
private stopTimes;
private isMouseDownState;
private autoScroll;
isSpringBack: boolean;
constructor(vW: number, vH: number, maxDistance: number, isVertical?: boolean, isFull?: boolean);
setViewRect(w: number, h: number, isVertical: boolean): void;
private onMouseEvent;
scrollTo(dis: number, time?: number): void;
destroy(): void;
}
}
export class ShowWord extends TextField {
export class ShowWord extends TextField {
playWords(text: string, deltaTime?: number, callback?: Function): void;
}
}
export function DrawAllToCanvas(images: any, callback: any): void;
export function DrawAllToCanvas(images: any, callback: any): void;
export function uid(): number;
export function uid(): number;
export const backupCanvas: HTMLCanvasElement;
export const backupCanvas: HTMLCanvasElement;
export function getGradientColor(points: any, colors: any): any;
export function getGradientColor(points: any, colors: any): any;
export function getCanvasBitmapStyle(image: any): any;
export function getCanvasBitmapStyle(image: any): any;
export function hex2rgb(hex: number, out?: number[] | Float32Array): number[] | Float32Array;
export function hex2rgb(hex: number, out?: number[] | Float32Array): number[] | Float32Array;
export function hex2string(hex: any): string;
export function hex2string(hex: any): string;
export function string2hex(string: string): number;
export function string2hex(string: string): number;
export function rgb2hex(rgb: number[]): number;
export function rgb2hex(rgb: number[]): number;
export function getRGBA(color: string, alpha: number): string;
export function getRGBA(color: string, alpha: number): string;
export function inputFeildIosEnable(): void;
export function inputFeildIosEnable(): void;
export function decomposeDataUri(dataUri: any): {
export function decomposeDataUri(dataUri: any): {
mediaType: any;
subType: any;
charset: any;
encoding: any;
data: any;
}
}
export function getUrlFileExtension(url: any): any;
export function getUrlFileExtension(url: any): any;
export function sign(n: number): number;
export function sign(n: number): number;
export function premultiplyTint(tint: number, alpha: number): number;
export function premultiplyTint(tint: number, alpha: number): number;
export const TextureCache: any;
export const TextureCache: any;
export const BaseTextureCache: any;
export const BaseTextureCache: any;
export const TextureSheetCache: any;
export const TextureSheetCache: any;
export function destroyTextureCache(): void;
export function destroyTextureCache(): void;
export function clearTextureCache(): void;
export function clearTextureCache(): void;
export const GlobalPro: {
export const GlobalPro: {
stageRenderType: RENDERER_TYPE;
dpi: number;
padding: number;
startTime: number;
}
}
export function isWebGLSupported(): boolean;
export function isWebGLSupported(): boolean;
export function removeItems(arr: Array<any>, startIdx: number, removeCount: number): void;
export function removeItems(arr: Array<any>, startIdx: number, removeCount: number): void;
export function mapWebGLBlendModesToPixi(gl: any, array?: any[]): any[];
export function mapWebGLBlendModesToPixi(gl: any, array?: any[]): any[];
export const INT_BITS1 = 32;
export const INT_BITS1 = 32;
export const INT_MAX = 2147483647;
export const INT_MAX = 2147483647;
export const INT_MIN: number;
export const INT_MIN: number;
export function abs(v: any): number;
export function abs(v: any): number;
export function min(x: any, y: any): number;
export function min(x: any, y: any): number;
export function max(x: any, y: any): number;
export function max(x: any, y: any): number;
export function isPow2(v: any): boolean;
export function isPow2(v: any): boolean;
export function log2(v: any): number;
export function log2(v: any): number;
export function log10(v: any): 1 | 4 | 3 | 2 | 9 | 8 | 7 | 6 | 5 | 0;
export function log10(v: any): 1 | 4 | 3 | 2 | 9 | 8 | 7 | 6 | 5 | 0;
export function popCount(v: any): number;
export function popCount(v: any): number;
export function countTrailingZeros(v: any): number;
export function countTrailingZeros(v: any): number;
export function nextPow2(v: any): any;
export function nextPow2(v: any): any;
export function prevPow2(v: any): number;
export function prevPow2(v: any): number;
export function parity(v: any): number;
export function parity(v: any): number;
export function reverse(v: any): number;
export function reverse(v: any): number;
export function interleave2(x: any, y: any): number;
export function interleave2(x: any, y: any): number;
export function deinterleave2(v: any, n: any): number;
export function deinterleave2(v: any, n: any): number;
export function interleave3(x: any, y: any, z: any): number;
export function interleave3(x: any, y: any, z: any): number;
export function deinterleave3(v: any, n: any): number;
export function deinterleave3(v: any, n: any): number;
export function nextCombination(v: any): number;
export function nextCombination(v: any): number;
export function checkMaxIfStatementsInShader(maxIfs: number, gl: WebGLRenderingContext): number;
export function checkMaxIfStatementsInShader(maxIfs: number, gl: WebGLRenderingContext): number;
export function createContext(canvas: HTMLCanvasElement, options?: any): WebGLRenderingContext;
export function createContext(canvas: HTMLCanvasElement, options?: any): WebGLRenderingContext;
export class GLBuffer {
export class GLBuffer {
gl: any;
buffer: any;
type: any;
drawType: any;
data: any;
_updateID: number;
constructor(gl: any, type?: any, data?: any, drawType?: any);
upload(data: any, offset?: number, dontBind?: boolean): void;
bind(): void;
destroy: () => void;
static createVertexBuffer(gl: any, data?: any, drawType?: any): GLBuffer;
static createIndexBuffer(gl: any, data?: any, drawType?: any): GLBuffer;
static create(gl: any, type: any, data: any, drawType: any): GLBuffer;
}
}
export class GLFramebuffer {
export class GLFramebuffer {
gl: any;
framebuffer: any;
stencil: any;
texture: any;
width: any;
height: any;
constructor(gl: any, width: any, height: any);
enableTexture(texture: any): void;
enableStencil(): void;
clear(r: any, g: any, b: any, a: any): void;
bind(): void;
unbind(): void;
resize(width: any, height: any): void;
destroy(): void;
static createRGBA(gl: any, width: any, height: any, data?: any): GLFramebuffer;
static createFloat32(gl: any, width: any, height: any, data: any): GLFramebuffer;
}
}
export class GLShader {
export class GLShader {
gl: WebGLRenderingContext;
program: WebGLProgram;
attributes: any;
uniformData: any;
uniforms: any;
constructor(gl: WebGLRenderingContext, vertexSrc: string, fragmentSrc: string, precision?: string, attributeLocations?: any);
bind(): this;
destroy(): void;
}
}
export class GLTexture {
export class GLTexture {
gl: WebGLRenderingContext;
texture: WebGLTexture;
mipmap: boolean;
......@@ -2547,61 +1996,45 @@ declare module engine {
height: number;
format: any;
type: any;
constructor(gl: WebGLRenderingContext, width?: number, height?: number, format?: any, type?: any);
upload(source: any): void;
uploadData: (data: any, width: any, height: any) => void;
bind(location?: number): void;
unbind(): void;
minFilter(linear: boolean): void;
magFilter(linear: boolean): void;
enableMipmap(): void;
enableLinearScaling(): void;
enableNearestScaling(): void;
enableWrapClamp(): void;
enableWrapRepeat(): void;
enableWrapMirrorRepeat(): void;
destroy(): void;
static fromSource(gl: WebGLRenderingContext, source: HTMLImageElement | ImageData, premultiplyAlpha?: boolean): GLTexture;
static fromData(gl: any, data: any, width: any, height: any): GLTexture;
}
}
export function setVertexAttribArrays(gl: any, attribs: any, state?: any): void;
export function setVertexAttribArrays(gl: any, attribs: any, state?: any): void;
export function compileProgram(gl: WebGLRenderingContext, vertexSrc: string, fragmentSrc: string, attributeLocations?: any): WebGLProgram;
export function compileProgram(gl: WebGLRenderingContext, vertexSrc: string, fragmentSrc: string, attributeLocations?: any): WebGLProgram;
export function defaultValue(type: string, size: number): false | any[] | 0 | Float32Array;
export function defaultValue(type: string, size: number): false | any[] | 0 | Float32Array;
export function extractAttributes(gl: WebGLRenderingContext, program: WebGLProgram): {};
export function extractAttributes(gl: WebGLRenderingContext, program: WebGLProgram): {};
export function extractUniforms(gl: WebGLRenderingContext, program: WebGLProgram): {};
export function extractUniforms(gl: WebGLRenderingContext, program: WebGLProgram): {};
export function generateUniformAccessObject(gl: WebGLRenderingContext, uniformData: any): {
export function generateUniformAccessObject(gl: WebGLRenderingContext, uniformData: any): {
data: {};
}
}
export function mapSize(type: string): number;
export function mapSize(type: string): number;
export function mapType(gl: any, type: any): any;
export function mapType(gl: any, type: any): any;
export function setPrecision(src: string, precision: string): string;
export function setPrecision(src: string, precision: string): string;
export class VertexArrayObject {
export class VertexArrayObject {
nativeVaoExtension: any;
nativeState: any;
nativeVao: any;
......@@ -2609,37 +2042,28 @@ declare module engine {
attributes: any[];
indexBuffer: any;
dirty: boolean;
constructor(gl: WebGLRenderingContext, state: any);
bind(): this;
unbind(): this;
activate(): this;
addAttribute(buffer: any, attribute: any, type?: any, normalized?: any, stride?: any, start?: any): this;
addIndex(buffer: any): this;
clear(): this;
draw(type: any, size?: any, start?: any): this;
destroy(): void;
getSize(): number;
static FORCE_NATIVE: boolean;
}
}
export function setProcessMetaLibs(...metaContexts: any[]): void;
export function setProcessMetaLibs(...metaContexts: any[]): void;
export function setGlobalContext(context: any): void;
export function setGlobalContext(context: any): void;
export function executeBehavior(sequence: any, subEntry: string, target: any, args?: any): void;
export function setScriptMap(_scriptMap: any): void;
export class Process {
export function executeBehavior(sequence: any, subEntry: string, target: any, args?: any): void;
export class Process {
private _config;
private _parent;
private _vm;
......@@ -2647,166 +2071,148 @@ declare module engine {
private _meta;
private _target;
private _originProps;
constructor();
readonly processConfig: any;
readonly parent: Process;
readonly sequence: any;
init(context: any): void;
execute(args: any): Promise<any>;
_executeMetaScript(type: any, payload: any, meta: any): Promise<{
type: any;
payload: any;
}>;
_executeSubProcess(type: any, payload: any): Promise<{
type: any;
payload: any;
}>;
_executeNextProcess(type: any, payload: any): Promise<{
type: any;
payload: any;
}>;
getProcessMeta(id: any): any;
getProps(key?: any): any;
updateProps(args: any): void;
updateProps(props: any, args: any, originProps: any, propsConfig: any): void;
resolveLinkedProp(data: any, key: any): any;
}
}
export class VM {
export class VM {
_processMetaLibs: any;
_globalContext: any;
_target: any;
_id: any;
_scriptMap: any;
setup(context: any): void;
executeProcess(sequence: any, id: any, parentProcess: any, args: any): Promise<any>;
getMeta(id: any): any;
getScript(hash: any): any;
readonly globalContext: any;
readonly id: any;
}
}
export function fieldChanged(onModify: any): (target: any, key: string) => void;
export function fieldChanged(onModify: any): (target: any, key: string) => void;
export const dirtyFieldDetector: (target: any, key: string) => void;
export const dirtyFieldDetector: (target: any, key: string) => void;
export const deepDirtyFieldDetector: (target: any, key: string) => void;
export const deepDirtyFieldDetector: (target: any, key: string) => void;
export const dirtyFieldTrigger: (target: any, key: string) => void;
export const dirtyFieldTrigger: (target: any, key: string) => void;
export const deepDirtyFieldTrigger: (target: any, key: string) => void;
export const deepDirtyFieldTrigger: (target: any, key: string) => void;
export function afterConstructor(ctor: Function): void;
export function afterConstructor(ctor: Function): void;
export function applyAutoAdjust(ctor: Function): void;
export function applyAutoAdjust(ctor: Function): void;
export const globalEvent: EventDispatcher;
export const globalEvent: EventDispatcher;
export const DATA_CENTER_EVENT: string;
export const DATA_CENTER_EVENT: string;
export function applyEvents(ctor: Function): void;
export function applyEvents(ctor: Function): void;
export function applyScript(ctor: Function): void;
export function applyScript(ctor: Function): void;
export class ScriptBase {
export class ScriptBase {
private _host;
disabled: boolean;
private _disabled;
readonly host: Container;
disabled: boolean;
mounted(): void;
destroy(): void;
update(t: number): void;
awake(): void;
sleep(): void;
}
}
export function registerScriptDef(id: any, def: any): void;
export function registerScripts(scripts: any): void;
export function loadAssets(config: any, onProgress?: any, onComplete?: any): Promise<never>;
export function registerScriptDef(id: any, def: any): void;
export function getAssetByUUID(uuid: any): any;
export function registerScripts(scripts: any): void;
export function getAssetByName(name: any): any;
export function loadAssets(config: any, onProgress?: any, onComplete?: any): Promise<never>;
export function registerCustomModule(id: any, def: any): void;
export function getAssetByUUID(uuid: any): any;
export function registerCustomCodeModule(config: any): void;
export function getAssetByName(name: any): any;
export function registerCustomModuleFromConfig(config: any): void;
export class DataCenter extends EventDispatcher {
export function addCustomModule(id: any, container: Container, options?: any): any;
export class DataCenter extends EventDispatcher {
store: {};
watchers: any[];
constructor();
registerGroup(name: any, origin?: any): void;
unregisterGroup(name: any): void;
getGroup(name: any): any;
getDataByPath(path: any, throwException?: any): any;
getDataByPath(path: any, groupName?: any, throwException?: any): any;
getDataByName(name: any, throwException?: any): any;
formatString(str: any, escapes: any): any;
mutate(name: any, data?: any, path?: any, dispatch?: boolean): void;
increase(groupName: any, step?: any, path?: any, dispatch?: boolean): void;
mutate(groupName: any, data?: any, path?: any, dispatch?: boolean): void;
watch(name: any, path: any): void;
getWatcher(name: any): any;
registerDataMapping(dataMapping: any): void;
}
}
export const dataCenter: DataCenter;
export const dataCenter: DataCenter;
export let env: any;
export let env: {};
export function injectEnv(data: any): void;
export function injectEnv(data: any): void;
export class GameStage extends Container {
export class GameStage extends Container {
private _sceneContainer;
private _popupContainer;
private _toast;
private _blackLayer;
private _stage;
private _dataCenter;
private _config;
private _viewCache;
constructor(stage: Stage);
readonly sceneContainer: StackContainer;
readonly popupContainer: StackContainer;
readonly toast: Toast;
readonly dataCenter: DataCenter;
launch(config: any, onAssetsProgress: any, onAssetsComplete: any): void;
launch(config: any, onAssetsProgress?: any, onAssetsComplete?: any): Promise<void>;
start(): void;
instantiateView(name: any, cache?: boolean): any;
getViewConfigByName(name: any): any;
setBlackLayerVisible(visible: any): void;
onPopupContainerChange(e: any): void;
}
instantiateView(name, cache = true): any;
export function showLoadingView(): void;
setBlackLayerVisible(visible: any): void;
export function hideLoadingView(): void;
onPopupContainerChange(e: any): void;
}
export function setLoadingViewProgress(current: any, total: any): void;
export class Image extends Sprite {
export class Image extends Sprite {
private _originText;
private _escapes;
private _registeredEvents;
......@@ -2817,88 +2223,115 @@ declare module engine {
private _setSource;
private unregisterEvents;
private onDataMutated;
}
}
export class Label extends TextField {
export class Label extends TextField {
private _originText;
private _escapes;
private _registeredEvents;
private _htmlText;
protected _setText(value: any): void;
private dealEscape;
htmlText: any;
private unregisterEvents;
private onDataMutated;
}
private onTextMutated;
private onHtmlMutated;
}
export class ShapeBase extends Shape {
export class ScrollView extends ScrollContainer {
constructor();
}
export class ShapeBase extends Shape {
protected __fieldDirty: boolean;
fillColor: any;
strokeColor: any;
strokeWidth: number;
constructor();
private onResize;
private onEnterFrame;
protected redraw(): void;
}
}
export class Rect extends ShapeBase {
export class Rect extends ShapeBase {
borderRadius: number;
protected redraw(): void;
}
}
export class Circle extends ShapeBase {
export class Circle extends ShapeBase {
protected redraw(): void;
}
}
export {};
export {};
export class StackContainer extends Container {
export class StackContainer extends Container {
private _mutex;
private _stack;
constructor(mutex?: boolean);
push(view: DisplayObject, options?: any, dispatch?: boolean): void;
replace(view: DisplayObject, options?: any): void;
pop(dispatch?: boolean): boolean;
popAll(view?: DisplayObject, options?: any): void;
}
pop(): boolean;
export function createTextureSheet(baseTexture: BaseTexture, altaData: any): void;
export class Toast extends Container {
private _contentSample;
private _content;
private _gameStage;
constructor(gameStage: GameStage);
show(props?: any): void;
hide(animation?: boolean, hideDuration?: number): void;
private removeContentView;
private getContent;
}
popAll(view?: DisplayObject, options?: any): void;
}
export function instantiate(config: any): any;
export { instantiate };
export let gameStage: GameStage;
export function launch(url: any, onAssetsProgress: any, onAssetsComplete: any): Promise<{}>;
export function launchWithLocalStorage(id: any, onAssetsProgress: any, onAssetsComplete: any): Promise<{}>;
export function launchWithConfig(config: any, onAssetsProgress: any, onAssetsComplete: any): Promise<{}>;
export function findNodeByUUID(node: any, uuid: any): any;
export function md5(string: any): string;
export function instantiate(config: any): any;
export const ESCAPE_REG_EXP: RegExp;
export {instantiate};
export const linkedFlag = "$_linked_$";
export let gameStage: any;
export const nodeScheme = "node://";
export function launch(url: any, onAssetsProgress: any, onAssetsComplete: any): Promise<{}>;
export function arrayFind(arr: any, predicate: any): any;
export function launchWithConfig(config: any, onAssetsProgress: any, onAssetsComplete: any): Promise<{}>;
export function objClone(obj: any): any;
export function findNodeByUUID(node: any, uuid: any): any;
export function propertyParse(key: any, node: any, properties: any): void;
export const ESCAPE_REG_EXP: RegExp;
export function getDataByPath(scope: any, path: any, throwException?: any): any;
export const linkedFlag = "$_linked_$";
export function injectProp(target: any, data?: any, callback?: Function, ignoreMethod?: boolean, ignoreNull?: boolean): boolean;
export const nodeScheme = "node://";
export function copyProp(target: any, data: any, config?: any): void;
export function arrayFind(arr: any, callback: any): any;
export function obj2query(obj: any): string;
export function objClone(obj: any): any;
export function importCJSCode(code: any, node?: any): any;
export function propertyParse(key: any, node: any, properties: any): void;
export function importUMDCode(code: any): any;
export function getDataByPath(scope: any, path: any, throwException?: any): any;
export function trimChar(str: string, char: string): string;
export function injectProp(target: any, data?: any, callback?: Function, ignoreMethod?: boolean, ignoreNull?: boolean): boolean;
export function joinPath(...segments: string[]): string;
export function copyProp(target: any, data: any, config?: any): void;
export function findVariable(name: string, ...contexts: any[]): any;
export function obj2query(obj: any): string;
export function htmlToPureText(htmlText: any): any;
}
......@@ -35,8 +35,8 @@ function compileProcess(sourcePath, output) {
const outputPath = path.join(output, sourcePath);
fs.ensureDirSync(path.dirname(outputPath));
fs.writeJsonSync(outputPath + '.json', meta, {spaces: ' '});
fs.writeFileSync(outputPath + '.js', code);
/*fs.writeJsonSync(outputPath + '-req.json', {
/*fs.writeFileSync(outputPath + '.js', result.code);
fs.writeJsonSync(outputPath + '-req.json', {
data: JSON.stringify(meta)
});*/
......
......@@ -2,8 +2,8 @@
"name": "比较",
"desc": "比较两个值",
"props": {
"left": {"alias": "左值","type": "data", "default": ""},
"right": {"alias": "右值","type": "data", "default": ""},
"left": {"alias": "左值","type": "dynamic", "default": ""},
"right": {"alias": "右值","type": "dynamic", "default": ""},
"operator": {"alias": "操作符","type": "enum",
"enum": ["==","!=","===","!==",">",">=","<","<="],
"default": "=="}
......
{
"script": "if(args.name === props.dataName){\nnext('success', args);\n}else{\nnext('cancel')\n}",
"props": {
"dataName": {
"type": "string",
"alias": "数据名"
}
},
"name": "数据中心事件筛选",
"output": [
"success",
"cancel"
]
}
\ No newline at end of file
......@@ -11,6 +11,8 @@ if(ua.indexOf('eversunshine') >= 0){
env = 'weixin'
}
console.log('env:', env);
const payload = args || {};
payload.env = env;
......
......@@ -2,10 +2,8 @@
* Created by rockyl on 2019-11-16.
*/
if (args && args.url) {
location.href = args.url;
} else if (props.url) {
location.href = props.url;
}
let url = engine.findVariable('url', args, props);
location.href = url;
next('complete');
......@@ -4,7 +4,7 @@
"props": {
"url": {
"alias": "地址",
"type": "data"
"type": "dynamic"
}
},
"output": [
......
{
"props": {
"cardListNode": {
"type": "node",
"alias": "卡片列表"
},
"cardCount": {
"type": "number",
"default": 6,
"alias": "卡片数量"
}
},
"name": "初始化卡片列表",
"output": [
"success"
]
}
\ No newline at end of file
......@@ -84,7 +84,7 @@
"metas": [
{
"id": "duiba-api-transform",
"script": "if (args.success) {\n next('success', args.data);\n}\nelse {\n next('failed');\n}\n",
"script": "if (args.success) {\n next('success', args.data);\n}\nelse {\n next('failed', args);\n}\n",
"props": {},
"isInline": true,
"name": "兑吧接口转换",
......
......@@ -9,11 +9,13 @@ if (!url) {
console.log('url is empty');
next('exception', '\'url is empty\'');
} else {
engine.httpRequest((s, payload) => {
if (s) {
next('success', payload);
} else {
next('failed', payload);
engine.httpRequest(url, props.method, params, 'json')
.then(
data => {
next('success', data);
},
err => {
next('failed', err);
}
}, url, props.method, params, 'json');
);
}
......@@ -45,7 +45,7 @@ function log(type, data) {
}
let isExposure = type === 'exposure';
engine.httpRequest(null,
engine.httpRequest(
isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click',
'get',
params,
......
......@@ -11,6 +11,8 @@ export default class Wave extends engine.ScriptBase {
waveParams: string;
loop: number = -1;
autoPlay: boolean = true;
ratio: string;
revert: boolean = false;
private _playing;
private _waveAlgorithm;
......@@ -18,7 +20,7 @@ export default class Wave extends engine.ScriptBase {
private _oldProps: any = {};
private _loopCounting;
mounted(){
mounted() {
this._startTime = 0;
engine.copyProp(this._oldProps, this.host, oldPropFields);
......@@ -46,15 +48,36 @@ export default class Wave extends engine.ScriptBase {
let r = pass / duration * PI2;
let loopCounting = Math.floor((t - this._startTime) / duration);
if(loopCounting != this._loopCounting){
if (loopCounting != this._loopCounting) {
this._loopCounting = loopCounting;
if(this.onLoopEnd()){
if (this.onLoopEnd()) {
r = PI2;
}
}
let params = waveParams ? (waveParams.split(',')) : [];
let props = _waveAlgorithm(...params, r);
let t2;
if (this.ratio) {
let ratio = this.ratio.split(',').map(item => parseFloat(item));
if (ratio.length === 2) {
const [begin, end] = ratio;
if(end >= begin){
let tr = r / PI2;
if(tr >= begin && tr < end){
t2 = r / (end - begin);
}else{
t2 = 0;
}
}else{
t2 = 0;
}
}else{
t2 = 0;
}
} else {
t2 = r;
}
let params = waveParams ? (waveParams.split(',').map(item => parseFloat(item))) : [];
let props = _waveAlgorithm(...params, t2);
if (props.hasOwnProperty('x')) {
host.x = (props.x || 0) + _oldProps.x;
......@@ -74,7 +97,7 @@ export default class Wave extends engine.ScriptBase {
}
}
private onLoopEnd(){
private onLoopEnd() {
if (this.loop < 0) {
//this.onLoopComplete.invoke();
} else if (this._loopCounting < this.loop) {
......@@ -98,15 +121,8 @@ export default class Wave extends engine.ScriptBase {
*/
stop(revert = false) {
this._playing = false;
if(revert){
for(let key in this._oldProps){
let prop = this._oldProps[key];
if(typeof prop === 'object'){
engine.injectProp(this.host[key], prop);
}else{
this.host[key] = prop;
}
}
if (revert) {
this.revertProps();
}
}
......@@ -122,7 +138,7 @@ export default class Wave extends engine.ScriptBase {
}
protected onModify(value, key, oldValue) {
switch(key){
switch (key) {
case 'waveMethod':
this._waveAlgorithm = waveLibs[this.waveMethod];
break;
......
......@@ -34,6 +34,15 @@
"alias": "自动播放",
"type": "boolean",
"default": true
},
"revert": {
"alias": "自动恢复",
"type": "boolean",
"default": false
},
"ratio": {
"alias": "时间占比",
"type": "string"
}
}
}
\ No newline at end of file
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