Commit 80eba6ad authored by Chen Jiping's avatar Chen Jiping

完善

parent 2637e618
...@@ -17,6 +17,8 @@ export class Exercises { ...@@ -17,6 +17,8 @@ export class Exercises {
/**答案顺序标签 */ /**答案顺序标签 */
answerIndexLabel: Label = null; answerIndexLabel: Label = null;
answerBg : MySprite = null;
answerShowed = false; answerShowed = false;
/**单词图片 */ /**单词图片 */
......
...@@ -667,10 +667,11 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -667,10 +667,11 @@ export class PlayComponent implements OnInit, OnDestroy {
const btnPlay = new MySprite(); const btnPlay = new MySprite();
btnPlay.init(this.images.get('play')); btnPlay.init(this.images.get('play'));
btnPlay.x = this.canvasWidth - 100 * this.mapScale;
btnPlay.y = this.canvasHeight - 100 * this.mapScale;
btnPlay.setScaleXY(this.mapScale); btnPlay.setScaleXY(this.mapScale);
btnPlay.x = this.canvasWidth - btnPlay.getBoundingBox().width/2- 8 * this.mapScale;
btnPlay.y = this.canvasHeight - btnPlay.getBoundingBox().height/2 - 8 * this.mapScale;
this.renderArr.push(btnPlay); this.renderArr.push(btnPlay);
...@@ -695,7 +696,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -695,7 +696,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//初始化标题 //初始化标题
const titePart1Bg = new MySprite(); const titePart1Bg = new MySprite();
titePart1Bg.init(this.images.get('titlePart1Bg')); titePart1Bg.init(this.images.get('titlePart1Bg'));
titePart1Bg.x = titePart1Bg.width / 2; titePart1Bg.x = 60 * this.mapScale + titePart1Bg.width / 2;
titePart1Bg.y = titePart1Bg.height / 2; titePart1Bg.y = titePart1Bg.height / 2;
//标题1内容 //标题1内容
...@@ -716,7 +717,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -716,7 +717,7 @@ export class PlayComponent implements OnInit, OnDestroy {
part2.fontName = "FUTURAB"; part2.fontName = "FUTURAB";
part2.fontColor = "#000000"; part2.fontColor = "#000000";
part2.refreshSize(); part2.refreshSize();
part2.x = titePart1Bg.width + 10 * this.mapScale; part2.x = titePart1Bg.width + 70 * this.mapScale;
part2.y = titePart1Bg.height / 2; part2.y = titePart1Bg.height / 2;
let bgWidth = titePart1Bg.width + part2.getBoundingBox().width + 10 * this.mapScale; let bgWidth = titePart1Bg.width + part2.getBoundingBox().width + 10 * this.mapScale;
...@@ -860,6 +861,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -860,6 +861,15 @@ export class PlayComponent implements OnInit, OnDestroy {
letterBg.addChild(letter); letterBg.addChild(letter);
} }
const answerBg = new MySprite();
answerBg.init(this.images.get('answer'));
answerBg.setScaleXY(this.mapScale);
answerBg.x = -wordBg.width / 2 + answerBg.width / 2 + 13 ;
answerBg.y = - 5 * this.mapScale;
answerBg.alpha = 0;
exercisesObj.answerBg = answerBg;
wordBg.addChild(answerBg);
//答案顺序 //答案顺序
const answerIndex = new Label(); const answerIndex = new Label();
answerIndex.text = exercises.answerIndex; answerIndex.text = exercises.answerIndex;
...@@ -869,9 +879,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -869,9 +879,9 @@ export class PlayComponent implements OnInit, OnDestroy {
answerIndex.refreshSize(); answerIndex.refreshSize();
answerIndex.alpha = 0; answerIndex.alpha = 0;
answerIndex.setMaxSize(80 * this.mapScale); answerIndex.setMaxSize(80 * this.mapScale);
answerIndex.y = - 5 * this.mapScale; answerIndex.y = 0;
answerIndex.x = - wordBg.getBoundingBox().width / 2 + 13 * this.mapScale + 80 * this.mapScale / 2; answerIndex.x = - answerIndex.getBoundingBox().width/2 + 13;
wordBg.addChild(answerIndex); answerBg.addChild(answerIndex);
exercisesObj.answerIndexLabel = answerIndex; exercisesObj.answerIndexLabel = answerIndex;
} }
...@@ -1077,7 +1087,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1077,7 +1087,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
//点击灰色部分,判断是否显示答案 //点击灰色部分,判断是否显示答案
if(this.checkClickTarget(exercises.answerIndexLabel)){ if(this.checkClickTarget(exercises.answerBg)){
if(exercises.answerIndexLabel.text){ if(exercises.answerIndexLabel.text){
if(this.nextShowAnser == exercises.answerIndexLabel.text){ if(this.nextShowAnser == exercises.answerIndexLabel.text){
......
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