Commit 631f7f50 authored by Chen Jiping's avatar Chen Jiping

完善

parent a4761847
......@@ -100,7 +100,7 @@ export class Exercises {
playAudio(type, callback = null){
if(type == 'T'){
playAudio(this.audio);
playAudio(this.audio, true);
return this.audio;
}
else if(type == 'I'){
......
......@@ -42,7 +42,7 @@ export class Skin {
this.scaleX = this.scaleY = sacle;
if (this.skinType == 'B') {
this.intervalHeight = 56 * this.scaleY;
this.intervalHeight = 117 * this.scaleY;
this.intervalWidth = 28 * this.scaleX;
......@@ -125,14 +125,22 @@ export class Skin {
textLabel.y = bg.height / 2;
bg.addChild(textLabel);
const indexBg = new MySprite();
indexBg.init(this.images.get('skin_2_index_bg'));
indexBg.scaleX = this.scaleX;
indexBg.scaleY = this.scaleY;
indexBg.x = bg.width / 2;
indexBg.y = - indexBg.getBoundingBox().height / 2 + 14 * this.scaleY;
const indexPic = new MySprite();
indexPic.init(this.images.get('skin_2_index_bg'));
indexPic.scaleX = this.scaleX;
indexPic.scaleY = this.scaleY;
indexPic.x = indexPic.getBoundingBox().width / 2;
indexPic.y = indexPic.getBoundingBox().height / 2;
const indexBg = new ShapeRect();
indexBg.setSize(indexPic.getBoundingBox().width, indexPic.getBoundingBox().height);
indexBg.x = (bg.width - indexBg.width) / 2;
indexBg.y = - (indexBg.height - 14 * this.scaleY);
indexBg.alpha = 0;
exercises.indexBg = indexBg;
bg.addChild(indexBg);
indexBg.addChild(indexPic);
const indexLabel = new Label();
exercises.indexLabel = indexLabel;
......@@ -143,8 +151,8 @@ export class Skin {
indexLabel.fontColor = "#000000";
indexLabel.setMaxSize(indexBg.getBoundingBox().width);
indexLabel.refreshSize();
indexLabel.x = - indexLabel.width / 2 + 6 * this.scaleX;
indexLabel.y = - 6 * this.scaleY;
indexLabel.x = (indexBg.width - indexLabel.getBoundingBox().width) / 2 + 2 * this.scaleX;
indexLabel.y = indexBg.height / 2 - 4 * this.scaleY;
indexLabel.alpha = 0;
indexBg.addChild(indexLabel);
}
......@@ -243,7 +251,7 @@ export class Skin {
let textWidth = textLabel.getBoundingBox().width;
textLabel.x = textMargin.marginLeft + (textMargin.maxWidth - textWidth) / 2;
textLabel.y = textMargin.marginTop + textLabel.height * this.scaleY / 2;
textLabel.y = textMargin.marginTop + textLabel.height * this.scaleY / 2;
bg.addChild(textLabel);
indexBg.x = indexMargin.marginLeft;
......
......@@ -515,6 +515,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.curAnswerIndex = 1;
if (this.curAudio) {
this.curAudio.pause();
}
}
......@@ -674,7 +678,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
//起始y坐标
let startY = (this.canvasHeight - totalHeight) / 2;
let startY = (this.canvasHeight - totalHeight) / 2 + this.title.titleBg.height;
let tempStartX = startX;
......@@ -770,6 +774,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if (exercisesObj.indexShowed) {
this.curAudio = exercisesObj.playAudio('I');
}
else{
this.curAudio = exercisesObj.playAudio('T');
}
}
return;
......
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