Commit 6caf42c1 authored by zjz1994's avatar zjz1994

调整map显示

parent ddd908f6
...@@ -316,8 +316,10 @@ export default class MapScene extends Scene { ...@@ -316,8 +316,10 @@ export default class MapScene extends Scene {
} }
this.scrollMapy.push(smaph+mapbot_height); this.scrollMapy.push(smaph+mapbot_height);
// console.log(maptop_height,repeatnum,maprep_height,mapbot_height);
var scrollheight = maptop_height+repeatnum*maprep_height+mapbot_height; var scrollheight = maptop_height+repeatnum*maprep_height+mapbot_height;
// console.log("scroll--------height",scrollheight,this.scrollMapy); // console.log("scroll--------height",scrollheight,this.scrollMapy);
this.scroll.height = this.stage.stageHeight;
this.scrollGroup.height = scrollheight; this.scrollGroup.height = scrollheight;
var nowlevel = getHomeData().levels.length; var nowlevel = getHomeData().levels.length;
// console.log("玩家level",nowlevel); // console.log("玩家level",nowlevel);
...@@ -345,6 +347,7 @@ export default class MapScene extends Scene { ...@@ -345,6 +347,7 @@ export default class MapScene extends Scene {
if (homeData.levels.length >= window['total_level']) if (homeData.levels.length >= window['total_level'])
lastOrder = window['total_level']; lastOrder = window['total_level'];
this.scroll.viewport.scrollV = this.getScrollV(lastOrder, this.stage.stageHeight); this.scroll.viewport.scrollV = this.getScrollV(lastOrder, this.stage.stageHeight);
// console.log("滚动设置",this.scroll.viewport.scrollV,this.scrollGroup.height,this.scroll.height,this.stage.stageHeight);
// console.log("滚动设置",lastOrder,this.scroll.viewport.scrollV); // console.log("滚动设置",lastOrder,this.scroll.viewport.scrollV);
this.setScrollVShow(); this.setScrollVShow();
// console.log('地图数据-----',this._data); // console.log('地图数据-----',this._data);
...@@ -822,13 +825,48 @@ export default class MapScene extends Scene { ...@@ -822,13 +825,48 @@ export default class MapScene extends Scene {
}else{ }else{
var joidx = i3%2; var joidx = i3%2;
//1对应onemapr,0对应twomapr //1对应onemapr,0对应twomapr
let onemapy:number;
let twomapy:number;
let cmap:number;
let onemapidx = this.scrollGroup.getChildIndex(this.onemapreppart);
let twomapidx = this.scrollGroup.getChildIndex(this.twomapreppart);
let maxidx = Math.max(onemapidx,twomapidx);
let minidx = Math.min(onemapidx,twomapidx);
if(joidx==1){ if(joidx==1){
i3map = this.onemapreppart; i3map = this.onemapreppart;
cmap = 1;
onemapy = this.onemapreppart.y;
twomapy = this.twomapreppart.y;
}else{ }else{
i3map = this.twomapreppart; i3map = this.twomapreppart;
cmap = 2;
onemapy = this.onemapreppart.y;
twomapy = this.twomapreppart.y;
} }
if(i3map.y!=i3mapy){ if(i3map.y!=i3mapy){
i3map.y = i3mapy; i3map.y = i3mapy;
if(cmap==1){
if(i3mapy>twomapy){
this.scrollGroup.setChildIndex(this.onemapreppart,maxidx);
this.scrollGroup.setChildIndex(this.twomapreppart,minidx);
}else{
this.scrollGroup.setChildIndex(this.onemapreppart,minidx);
this.scrollGroup.setChildIndex(this.twomapreppart,maxidx);
}
}else{
if(i3mapy>onemapy){
this.scrollGroup.setChildIndex(this.onemapreppart,minidx);
this.scrollGroup.setChildIndex(this.twomapreppart,maxidx);
}else{
this.scrollGroup.setChildIndex(this.onemapreppart,maxidx);
this.scrollGroup.setChildIndex(this.twomapreppart,minidx);
}
}
var i3startlevel = MapTopPart.LEVEL_NUMS+(i3-1)*MapRpeatPart.LEVEL_NUMS; var i3startlevel = MapTopPart.LEVEL_NUMS+(i3-1)*MapRpeatPart.LEVEL_NUMS;
// console.log("局部显示",i3,i3mapy,i3startlevel,lidx,nidx); // console.log("局部显示",i3,i3mapy,i3startlevel,lidx,nidx);
......
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