Commit 56df4c40 authored by 邱旭's avatar 邱旭

Merge branch '1101' into dev

parents 4cfae1e0 db2d92bf
......@@ -10,7 +10,7 @@ import { getRepeatCount } from "../startScene/StartScene";
export default class MapBottomPart extends ComponentBase {
static LEVEL_NUMS = 11;
getTxt(i): eui.BitmapLabel { return this[`txt${i}`]; }
start() {
start({repeatHeight,topHeight}) {
super.start();
const repeatCount =getRepeatCount();
for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) {
......@@ -31,6 +31,7 @@ export default class MapBottomPart extends ComponentBase {
const icon = MapScene.iconHash[levelOrder] = this.getIcon(i);
this.removeChild(icon);
icon.show = ()=>{this.addChild(icon)};
icon.hide = ()=>{this.removeChild(icon)};
icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1);
icon['mappart']=this;
......@@ -39,6 +40,7 @@ export default class MapBottomPart extends ComponentBase {
star.loadSkin(); star.start();
MapScene.starHash[levelOrder] = star;
icon.addChild(star);
icon['visibleY'] = icon.y + topHeight + repeatHeight * repeatCount;
}
}
......
......@@ -12,7 +12,6 @@ export default class MapRpeatPart extends ComponentBase {
super();
this._index = i;
this._topHeight=topHeight;
// createData()
}
start() {
......@@ -21,9 +20,11 @@ export default class MapRpeatPart extends ComponentBase {
const levelOrder = MapTopPart.LEVEL_NUMS + this._index * MapRpeatPart.LEVEL_NUMS + i + 1;
this.getTxt(i).text = levelOrder + '';
const icon = MapScene.iconHash[levelOrder] = this.getIcon(i);
this.removeChild(icon);
icon.show = ()=>{this.addChild(icon)};
icon.hide = ()=>{this.removeChild(icon)};
icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1);
icon['mappart']=this;
......@@ -32,7 +33,8 @@ export default class MapRpeatPart extends ComponentBase {
star.loadSkin(); star.start();
MapScene.starHash[levelOrder] = star;
icon.addChild(star);
icon['visibleY'] = this._topHeight + this
icon['visibleY'] = this._topHeight + this.height * this._index + icon.y;
console.log(icon['visibleY'] );
}
this['animal1'].visible = this._index % 2;
......
This diff is collapsed.
import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import MapScene from "./MapScene";
import MapStarComp from "./MapStarComp";
import { createData } from "../startScene/StartScene";
export default class MapTopPart extends ComponentBase {
static LEVEL_NUMS = 7;
......@@ -18,10 +19,11 @@ export default class MapTopPart extends ComponentBase {
icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1);
this.removeChild(icon);
this.removeChild(icon);icon.hide = ()=>{this.removeChild(icon)};
icon['mappart']=this;
icon.show = ()=>{this.addChild(icon)};
icon['visibleY'] = icon.y;
console.log(icon['visibleY']);
}
}
......
......@@ -109,21 +109,32 @@ export const changeMapScene = (p?) => {
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE, data);
}
let _startSceneData;
export const createData = () => {
if(_startSceneData)return _startSceneData;
const startSceneData: any = {};
startSceneData.top = new MapTopPart();
startSceneData.top.loadSkin(); startSceneData.top.start();
startSceneData.bottom = new MapBottomPart();
startSceneData.bottom.loadSkin(); startSceneData.bottom.start();
_startSceneData = startSceneData;
const repeatCount =getRepeatCount();
const list = [];
startSceneData.list = list;
const repeatCount =getRepeatCount();
startSceneData.top = new MapTopPart();
startSceneData.top.loadSkin(); startSceneData.top.start();
for (let i = 0; i < repeatCount; i++) {
const repeat = new MapRpeatPart(i,startSceneData.top.height);
repeat.loadSkin(); repeat.start();
list.push(repeat);
}
startSceneData.bottom = new MapBottomPart();
startSceneData.bottom.loadSkin();
startSceneData.bottom.start({
repeatHeight:list[0].height,
topHeight:startSceneData.top.height
});
return startSceneData
}
......
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