Commit 5f5484c6 authored by 范雪寒's avatar 范雪寒

feat: 标题坐标修正

parent 80dd0ae1
...@@ -240,8 +240,8 @@ export class Stage extends Item { ...@@ -240,8 +240,8 @@ export class Stage extends Item {
title.y = this.titleBg.height / 2; title.y = this.titleBg.height / 2;
this.titleBg.addChild(title); this.titleBg.addChild(title);
title.scaleY = Math.min(1, 230 / title.height); title.scaleY = Math.min(1, 210 / title.height);
title.scaleX = Math.min(1, 230 / title.height); title.scaleX = Math.min(1, 210 / title.height);
this.curTitleLabel = title; this.curTitleLabel = title;
} }
...@@ -281,26 +281,24 @@ export class Mission extends Item { ...@@ -281,26 +281,24 @@ export class Mission extends Item {
const bg = new ShapeRect(); const bg = new ShapeRect();
bg.setSize(this.width, this.height); bg.setSize(this.width, this.height);
bg.scaleX = this.scaleX;
bg.scaleY = this.scaleY;
bg.alpha = 0; bg.alpha = 0;
this.bg = bg; this.bg = bg;
const missionPic = new MySprite();
missionPic.init(this.images.get(theme + "e-mission"));
missionPic.x = missionPic.width / 2;
missionPic.y = this.height / 2;
bg.addChild(missionPic, 2);
const stageBgPic = new MySprite(); const stageBgPic = new MySprite();
stageBgPic.init(this.images.get(theme + "stage_bg")); stageBgPic.init(this.images.get(theme + "stage_bg"));
stageBgPic.scaleX = this.scaleX * 2;
stageBgPic.scaleY = this.scaleY;
stageBgPic.alpha = 0; stageBgPic.alpha = 0;
stageBgPic.x = this.width - stageBgPic.getBoundingBox().width / 2 + 5 * this.scaleX; stageBgPic.x = missionPic.width + stageBgPic.width / 2 - 50;
stageBgPic.y = this.height - stageBgPic.getBoundingBox().height / 2 + 2 * this.scaleY; stageBgPic.y = this.height / 2;
this.stageBgPic = stageBgPic; this.stageBgPic = stageBgPic;
bg.addChild(stageBgPic); bg.addChild(stageBgPic, 1);
const missionPic = new MySprite();
missionPic.init(this.images.get(theme + "e-mission"));
missionPic.scaleX = this.scaleX;
missionPic.scaleY = this.scaleY;
missionPic.x = missionPic.getBoundingBox().width / 2 - 3 * this.scaleX;
missionPic.y = this.height / 2;
bg.addChild(missionPic);
const stageVal = new Label(); const stageVal = new Label();
stageVal.text = ""; stageVal.text = "";
...@@ -308,14 +306,12 @@ export class Mission extends Item { ...@@ -308,14 +306,12 @@ export class Mission extends Item {
stageVal.fontColor = "#ffffff" stageVal.fontColor = "#ffffff"
stageVal.fontSize = 34; stageVal.fontSize = 34;
stageVal.textAlign = 'middle'; stageVal.textAlign = 'middle';
stageVal.scaleX = this.scaleX;
stageVal.scaleY = this.scaleY;
stageVal.refreshSize(); stageVal.refreshSize();
stageVal.x = missionPic.getBoundingBox().width - 12 * this.scaleX; stageVal.x = -stageBgPic.width / 4;
stageVal.y = 20 * this.scaleY + stageVal.getBoundingBox().height / 2; stageVal.y = -5;
stageVal.alpha = 0; stageVal.alpha = 0;
bg.addChild(stageVal); stageBgPic.addChild(stageVal);
this.stageValLabel = stageVal; this.stageValLabel = stageVal;
} }
......
...@@ -593,7 +593,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -593,7 +593,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const mission = new Mission(this.images, this.audioObj, this.mapScale, this.mapScale); const mission = new Mission(this.images, this.audioObj, this.mapScale, this.mapScale);
mission.init(this.theme); mission.init(this.theme);
mission.bg.x = -50 * this.mapScale; mission.bg.x = 0;
mission.bg.y = 67 * this.mapScale; mission.bg.y = 67 * this.mapScale;
this.renderArr.push(mission.bg); this.renderArr.push(mission.bg);
this.stage.mission = mission; this.stage.mission = mission;
......
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