Commit 35f79513 authored by 汪欢's avatar 汪欢

aaa

parent 2dfa4ce5
......@@ -17,7 +17,10 @@ function launchWithCustomModule(customModule) {
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const { props: propsOption, assets } = customModule;
const {
props: propsOption,
assets
} = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
......@@ -49,11 +52,14 @@ function launchWithCustomModule(customModule) {
engine.globalEvent.dispatchEvent('pictures-start', {
picUrl: "http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png",
blockUrl: "888",
row: 3,
column: 3,
gameTime: 50
});
const d = engine.gameStage.sceneContainer.getChildAt(0);
engine.gameStage.sceneContainer.getChildAt(0).x = (d.stage.width-props.W)/2;
engine.gameStage.sceneContainer.getChildAt(0).y = (d.stage.height-props.H)/2;
engine.gameStage.sceneContainer.getChildAt(0).x = (d.stage.width - props.W) / 2;
engine.gameStage.sceneContainer.getChildAt(0).y = (d.stage.height - props.H) / 2;
}, 1000);
// setTimeout(() => {
......@@ -82,4 +88,4 @@ function getAssetByUUID(uuid) {
function getProps() {
return engine.getProps(customId);
}
}
\ No newline at end of file
......@@ -95,6 +95,10 @@
}
GameView.prototype.start = function () {
var _this = this;
MAX_COL = props.column || props.MAX_COL;
MAX_ROW = props.row || props.MAX_ROW;
GAME_TIME = props.gameTime || props.GAME_TIME;
console.log('start', props.column, props.row, props.gameTime);
if (!this.guideHole) {
this.guideHole = new engine.Image();
this.guideHole.source = 'asset://' + props.blockUrl;
......
This diff is collapsed.
......@@ -42,24 +42,25 @@
"type": "number",
"default": 100
}
},
"assets": [
{
"name": "遮罩",
"url": "//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png",
"uuid": "888",
"ext": ".png"
}
],
"assets": [{
"name": "遮罩",
"url": "//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png",
"uuid": "888",
"ext": ".png"
}],
"events": {
"in": {
"pictures-start": {
"alias": "开始",
"data": {
"picUrl":"图片路径",
"blockUrl":"blockUrl"
"picUrl": "图片路径",
"blockUrl": "blockUrl",
"row": "行",
"column": "列",
"gameTime": "游戏时间"
}
},
"pictures-stop": {
......@@ -70,7 +71,7 @@
"pictures-time-update": {
"alias": "倒计时更新",
"data": {
"time":"剩余时间"
"time": "剩余时间"
}
},
"pictures-game-fail": {
......
......@@ -27,6 +27,10 @@ export default class GameView extends engine.Container {
private date
start() {
MAX_COL = props.column || props.MAX_COL;
MAX_ROW = props.row || props.MAX_ROW;
GAME_TIME = props.gameTime || props.GAME_TIME;
console.log('start',props.column,props.row,props.gameTime)
if (!this.guideHole) {
this.guideHole = new engine.Image();
......
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