Commit 95864405 authored by zjz1994's avatar zjz1994

引导遮罩调整

parent 2f0c1925
...@@ -525,8 +525,8 @@ export default class MainScene extends Scene { ...@@ -525,8 +525,8 @@ export default class MainScene extends Scene {
//重置基础元素类型及特效 //重置基础元素类型及特效
this.initBaseElement(); this.initBaseElement();
//设置栏置顶 //设置栏置顶
this.addChild(this["settingAll"]) // this.addChild(this["settingAll"])
this.addChild(this['redrainbg']); // this.addChild(this['redrainbg']);
this['redrainbg'].visible = false; this['redrainbg'].visible = false;
this.settingGroup.visible = false; this.settingGroup.visible = false;
this.addLoading(); this.addLoading();
...@@ -893,6 +893,7 @@ export default class MainScene extends Scene { ...@@ -893,6 +893,7 @@ export default class MainScene extends Scene {
//分数进度条,托管 //分数进度条,托管
this.scoreProgress = new ScoreProgress(this.starProgress, this.curScoreNum, this.chapterData.starScores); this.scoreProgress = new ScoreProgress(this.starProgress, this.curScoreNum, this.chapterData.starScores);
//分数置0 //分数置0
this.score = 0; this.score = 0;
//地图生成 //地图生成
...@@ -5406,6 +5407,9 @@ export default class MainScene extends Scene { ...@@ -5406,6 +5407,9 @@ export default class MainScene extends Scene {
Pool.recover(RecoverName.LATTICE,ilattice); Pool.recover(RecoverName.LATTICE,ilattice);
} }
} }
if(this.scoreProgress){
this.scoreProgress.removeStarProgress();
}
} }
recoverMapast(lat:Lattice){ recoverMapast(lat:Lattice){
if(lat.ice&&lat.ice.parent){ if(lat.ice&&lat.ice.parent){
......
...@@ -11,6 +11,7 @@ export class ScoreProgress { ...@@ -11,6 +11,7 @@ export class ScoreProgress {
*/ */
starScores: number[]; starScores: number[];
mask:egret.Shape;
star1: eui.Image; star1: eui.Image;
star2: eui.Image; star2: eui.Image;
star3: eui.Image; star3: eui.Image;
...@@ -97,29 +98,46 @@ export class ScoreProgress { ...@@ -97,29 +98,46 @@ export class ScoreProgress {
this.allScore = 640 / 563 * this.starScores[2]; this.allScore = 640 / 563 * this.starScores[2];
//加遮罩,加到starProgress的父级中 //加遮罩,加到starProgress的父级中
var p = starProgress.parent; var p = starProgress.parent;
var mask = new egret.Shape(); var pchildidx = p.getChildIndex(starProgress);
this.mask = new egret.Shape();
// window['aaa'] = mask; // window['aaa'] = mask;
mask.graphics.beginFill(0xff0000, 1); this.mask.graphics.beginFill(0xff0000, 1);
mask.graphics.drawRoundRect(138, 151.5, 0, 41, 50); this.mask.graphics.drawRoundRect(138, 151.5, 0, 41, 50);
mask.graphics.endFill(); this.mask.graphics.endFill();
this.starProgress.mask = mask; this.starProgress.mask = this.mask;
p.addChild(mask); p.addChildAt(this.mask,pchildidx+1);
//星星1 lightedStar_png //星星1 lightedStar_png
var textureStar = RES.getRes("unlightedStar_png"); var textureStar = RES.getRes("unlightedStar_png");
this.star1 = new eui.Image(textureStar); // width (27 * 2) this.star1 = new eui.Image(textureStar); // width (27 * 2)
this.star1.x = 383; // 410 this.star1.x = 383; // 410
this.star1.y = 153.5; // 201 this.star1.y = 153.5; // 201
p.addChild(this.star1); p.addChildAt(this.star1,pchildidx+2);
this.star2 = new eui.Image(textureStar); this.star2 = new eui.Image(textureStar);
this.star2.x = 469; // 496 this.star2.x = 469; // 496
this.star2.y = 153.5; this.star2.y = 153.5;
p.addChild(this.star2); p.addChildAt(this.star2,pchildidx+3);
this.star3 = new eui.Image(textureStar); this.star3 = new eui.Image(textureStar);
this.star3.x = 556; // 583 this.star3.x = 556; // 583
this.star3.y = 153.5; this.star3.y = 153.5;
p.addChild(this.star3); p.addChildAt(this.star3,pchildidx+4);
}
removeStarProgress(){
var p = this.starProgress.parent;
if(this.mask.parent){
this.mask.parent.removeChild(this.mask);
this.starProgress.mask = null;
}
if(this.star1.parent){
this.star1.parent.removeChild(this.star1);
}
if(this.star2.parent){
this.star2.parent.removeChild(this.star2);
}
if(this.star3.parent){
this.star3.parent.removeChild(this.star3);
}
} }
} }
\ 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