Commit 898ae6fc authored by XieChuanJin's avatar XieChuanJin

Merge branch 'dev' of http://gitlab2.dui88.com/laoqifeng/zeroing-libs into dev

parents 2848e78e adb9fcd2
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script src="engine.js"></script>
<script src="test1.js"></script>
</body>
</html>
\ No newline at end of file
'use strict';
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var Test1 = (function (_super) {
__extends(Test1, _super);
function Test1() {
var _this = _super.call(this) || this;
var rect = new engine.Rect();
rect.width = 100;
rect.height = 100;
_this.addChild(rect);
return _this;
}
return Test1;
}(engine.Container));
function index (options) {
var instance = new Test1();
return instance;
}
module.exports = index;
This diff is collapsed.
{
"name": "播放音频",
"desc": "播放音频",
"props": {
"asset": {
"alias": "素材ID",
"type": "string"
},
"name": {
"alias": "实例名",
"type": "string"
},
"volume": {
"alias": "音量",
"type": "number"
},
"loop": {
"alias": "循环播放",
"type": "boolean"
}
},
"output": [
"complete"
],
"id": "play-sound",
"script": "var asset = engine.findVariable('asset', args, props);\nvar name = engine.findVariable('name', args, props);\nvar volume = engine.findVariable('volume', args, props);\nvar loop = engine.findVariable('loop', args, props);\nengine.playSound(asset, {\n volume: volume,\n loop: loop,\n}, name);\nnext('complete');\n",
"group": "base",
"type": "builtin"
}
{
"name": "停止音频",
"desc": "停止音频",
"props": {
"name": {
"alias": "实例名",
"type": "string"
}
},
"output": [
"complete"
],
"id": "stop-sound",
"script": "var name = engine.findVariable('name', args, props);\nengine.stopSound(name);\nnext('complete');\n",
"group": "base",
"type": "builtin"
}
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"complete" "complete"
], ],
"id": "wait", "id": "wait",
"script": "setTimeout(function () {\n next('complete');\n}, args ? args.duration : props.duration);\n", "script": "var duration = engine.findVariable('duration', args, props);\nsetTimeout(function () {\n next('complete');\n}, duration);\n",
"group": "base", "group": "base",
"type": "builtin" "type": "builtin"
} }
...@@ -12,6 +12,9 @@ export const VERSION = "1.0"; ...@@ -12,6 +12,9 @@ export const VERSION = "1.0";
export const devicePixelRatio: number; export const devicePixelRatio: number;
export function playSound(uuid, options = {}, name?);
export function stopSound(name);
export let StageScaleMode: { export let StageScaleMode: {
EXACT_FIT: string; EXACT_FIT: string;
NO_BORDER: string; NO_BORDER: string;
......
/**
* Created by rockyl on 2019-11-16.
*/
const asset = engine.findVariable('asset', args, props);
const name = engine.findVariable('name', args, props);
const volume = engine.findVariable('volume', args, props);
const loop = engine.findVariable('loop', args, props);
engine.playSound(asset, {
volume,
loop,
}, name);
next('complete');
{
"name": "播放音频",
"desc": "播放音频",
"props": {
"asset": {
"alias": "素材ID",
"type": "string"
},
"name": {
"alias": "实例名",
"type": "string"
},
"volume": {
"alias": "音量",
"type": "number"
},
"loop": {
"alias": "循环播放",
"type": "boolean"
}
},
"output": [
"complete"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
const name = engine.findVariable('name', args, props);
engine.stopSound(name);
next('complete');
{
"name": "停止音频",
"desc": "停止音频",
"props": {
"name": {
"alias": "实例名",
"type": "string"
}
},
"output": [
"complete"
]
}
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
const duration = engine.findVariable('duration', args, props);
setTimeout(function(){ setTimeout(function(){
next('complete') next('complete')
}, args ? args.duration : props.duration); }, duration);
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