Commit 4db2fcb4 authored by 范雪寒's avatar 范雪寒

feat: 标题适配

parent a40a509c
...@@ -223,6 +223,7 @@ export class Stage extends Item { ...@@ -223,6 +223,7 @@ export class Stage extends Item {
this.titleBg.removeChild(this.curTitleLabel); this.titleBg.removeChild(this.curTitleLabel);
} }
console.log('this._scaleX = ' + this._scaleX);
const title = new RichText(); const title = new RichText();
title.scaleX = this._scaleX; title.scaleX = this._scaleX;
title.scaleY = this._scaleY; title.scaleY = this._scaleY;
...@@ -238,8 +239,8 @@ export class Stage extends Item { ...@@ -238,8 +239,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, 210 / title.height); // title.scaleX = Math.min(this.scaleX, 500 / title.width);
title.scaleX = Math.min(1, 210 / title.height); // title.scaleY = Math.min(this.scaleY, 150 / title.height);
this.curTitleLabel = title; this.curTitleLabel = title;
} }
...@@ -286,14 +287,14 @@ export class Mission extends Item { ...@@ -286,14 +287,14 @@ export class Mission extends Item {
const missionPic = new MySprite(); const missionPic = new MySprite();
missionPic.init(this.images.get(theme + "e-mission")); missionPic.init(this.images.get(theme + "e-mission"));
missionPic.x = missionPic.width / 2; missionPic.x = missionPic.width / 2 - 20;
missionPic.y = this.height / 2; missionPic.y = this.height / 2;
bg.addChild(missionPic, 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.alpha = 0; stageBgPic.alpha = 0;
stageBgPic.x = missionPic.width + stageBgPic.width / 2 - 50; stageBgPic.x = missionPic.width + stageBgPic.width / 2 - 70;
stageBgPic.y = this.height / 2; stageBgPic.y = this.height / 2;
this.stageBgPic = stageBgPic; this.stageBgPic = stageBgPic;
bg.addChild(stageBgPic, 1); bg.addChild(stageBgPic, 1);
......
...@@ -175,6 +175,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -175,6 +175,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.winResizeEventStream this.winResizeEventStream
.pipe(debounceTime(500)) .pipe(debounceTime(500))
.subscribe(data => { .subscribe(data => {
console.log('汪汪汪')
this.renderAfterResize(); this.renderAfterResize();
}); });
...@@ -481,6 +482,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -481,6 +482,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const s = Math.min(sx, sy); const s = Math.min(sx, sy);
this.mapScale = s; this.mapScale = s;
console.log('this.mapScale = ' + this.mapScale);
this.renderArr = []; this.renderArr = [];
......
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