Commit ea7d06da authored by Li Mingzhe's avatar Li Mingzhe

feat: 手机版优化适配

parent b60ce741
......@@ -825,13 +825,13 @@ export class PlayComponent implements OnInit, OnDestroy {
let prompt_val = new Label();
prompt_val.text = "";
prompt_val.textAlign='middle';
prompt_val.textAlign='center';
prompt_val.fontSize = 100;
prompt_val.fontName = "BRLNSDB_1";
prompt_val.fontColor = "#FFFFFF";
prompt_val.refreshSize();
prompt_val.x = -prompt_val.width/2;
prompt_val.x = 0; -prompt_val.width/2;
prompt_val.y = 0;
prompt.addChild(prompt_val);
this.prompt_val = prompt_val;
......@@ -885,7 +885,13 @@ export class PlayComponent implements OnInit, OnDestroy {
bg_pic.init(this.images.get('bg'));
bg_pic.x = this.canvasWidth / 2;
bg_pic.y = this.canvasHeight / 2;
bg_pic.setScaleXY(maxW/bg_pic.width);
const sx = this.canvasWidth / bg_pic.width;
const sy = this.canvasHeight / bg_pic.height;
const s = Math.max(sx, sy);
bg_pic.setScaleXY(s);
// bg_pic.setScaleXY(maxW/bg_pic.width);
this.renderArr.push(bg_pic);
this.bg_pic = bg_pic;
......@@ -899,9 +905,9 @@ export class PlayComponent implements OnInit, OnDestroy {
const start_pic = new MySprite();
start_pic.init(this.images.get('start'));
start_pic.x = this.canvasWidth / 2;
start_pic.y = this.canvasHeight - start_pic.height / 2;;
start_pic.setScaleXY(this.mapScale);
start_pic.x = this.canvasWidth / 2;
start_pic.y = this.canvasHeight - (start_pic.height / 2 - 30) * start_pic.scaleY;
this.renderArr.push(start_pic);
this.startPic = start_pic;
......@@ -1478,16 +1484,16 @@ export class PlayComponent implements OnInit, OnDestroy {
setTimeout(() => {
tweenChange(cover, {alpha: 0}, 6, ()=>{
tweenChange(cover, {alpha: 0}, 2, ()=>{
this.prompt.x = -(this.prompt.width + 100);
this.prompt.y = -this.prompt.height - 100;
this.initPracticePic();
});
}, 6000);
}, 1500);
setTimeout(() => {
this.showPrompt();
}, 4000);
}, 1000);
}
}
......@@ -1504,7 +1510,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.prompt_val.text = (this.nextPracticeIndex + 1) + " / " + this.data.practices.length;
this.prompt_val.refreshSize();
this.prompt_val.x = -this.prompt_val.getBoundingBox().width/2;
// this.prompt_val.x = -this.prompt_val.getBoundingBox().width/2;
}
/**
......@@ -1811,7 +1817,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.weapon_pic.alpha=0;
let out = this.canvasHeight - this.restartPic.height/2;
let out = this.canvasHeight - (this.restartPic.height/2 - 40) * this.restartPic.scaleY;
tweenChange(this.restartPic, {y: out}, 1, ()=>{
......
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