Commit e505e742 authored by limingzhe's avatar limingzhe

style: player适配大小和位置

parent 92c31301
...@@ -510,11 +510,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -510,11 +510,12 @@ export class PlayComponent implements OnInit, OnDestroy {
const pic = new MySprite(); const pic = new MySprite();
pic.init(this.images.get(this.data.pic_url)); pic.init(this.images.get(this.data.pic_url));
const scaleX = 565 / pic.width; const scaleX = 564 / pic.width;
const scaleY = 373 / pic.height; const scaleY = 373 / pic.height;
const scale = Math.min(scaleX, scaleY); const scale = Math.min(scaleX, scaleY);
pic.setScaleXY(scale); pic.setScaleXY(scale);
pic.x = -0.7;
pic.y = -138; pic.y = -138;
board.addChild(pic); board.addChild(pic);
...@@ -710,13 +711,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -710,13 +711,15 @@ export class PlayComponent implements OnInit, OnDestroy {
private initAudioPlayer() { private initAudioPlayer() {
const audioPlayer = this.createAudioPlayer(); const audioPlayer = this.createAudioPlayer();
audioPlayer.x = 1200; audioPlayer.setScaleXY(this.mapScale);
audioPlayer.y = 100; audioPlayer.x = this.canvasWidth - 450 * this.mapScale;
audioPlayer.y = this.canvasHeight - 600 * this.mapScale;
this.renderArr.push(audioPlayer); this.renderArr.push(audioPlayer);
} }
private createAudioPlayer() { private createAudioPlayer() {
const audioPlayer = new MySprite(); const audioPlayer = new MySprite();
audioPlayer.addChild(this.createPlayPauseButton()); audioPlayer.addChild(this.createPlayPauseButton());
const progressBar = this.createProgressBar(); const progressBar = this.createProgressBar();
progressBar.x = 80; progressBar.x = 80;
......
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