Commit f0c7c95c authored by Chen Jiping's avatar Chen Jiping

fix:修复标题显示问题,修复弹出大框没有灰色背景的问题,修复各个字体的问题

parent c76ad82f
......@@ -82,9 +82,10 @@ export class Exercises {
this.initB(scaleX, scaleY, type);
}
let width = 1101 * scaleX;
let height = 479 * scaleY;
let width = 1101 * scaleX - 20 * scaleX;
let height = 479 * scaleY - 20 * scaleY;
const cardBg = new MySprite();
cardBg.init(this.images.get('box'));
cardBg.scaleX = scaleX;
......@@ -496,8 +497,8 @@ export class Exercises {
let textHeight = addText(contentBg, skin, 72);
//图片最大高度和宽度
let maxWidth = width - 40 * this.scaleY;
let maxHeight = height - 80 * this.scaleX - textHeight.height;
let maxWidth = width - 40 * this.scaleX;
let maxHeight = height - 80 * this.scaleY - textHeight.height;
const contentPic = new MySprite();
contentPic.init(this.images.get(this.exercisesData.pic_url));
......@@ -507,9 +508,9 @@ export class Exercises {
if (scale < 1) {
contentPic.setScaleXY(scale);
}
contentPic.x = width / 2;
contentPic.y = height - textHeight.sHeight - 17 * this.scaleY - contentPic.getBoundingBox().height / 2 - 22 * this.scaleY;
contentPic.y = 60 * this.scaleY + maxHeight / 2;
contentBg.addChild(contentPic);
}
......@@ -519,9 +520,9 @@ export class Exercises {
closePic.scaleX = parent.scaleX;
closePic.scaleY = parent.scaleY;
closePic.x = parent.width;
closePic.x = parent.width - 5 * this.scaleX;
closePic.y = 0;
closePic.y = 0 + 5 * this.scaleY;
parent.addChild(closePic);
return closePic;
......@@ -533,9 +534,9 @@ export class Exercises {
overturnPic.scaleX = parent.scaleX;
overturnPic.scaleY = parent.scaleY;
overturnPic.x = parent.width - 10 * parent.scaleX - overturnPic.getBoundingBox().width / 2;
overturnPic.x = parent.width - 28 * parent.scaleX - overturnPic.getBoundingBox().width / 2;
overturnPic.y = parent.height - 10 * parent.scaleY - overturnPic.getBoundingBox().height / 2;
overturnPic.y = parent.height - 15 * parent.scaleY - overturnPic.getBoundingBox().height / 2;
parent.addChild(overturnPic);
return overturnPic;
......@@ -554,7 +555,7 @@ export class Exercises {
this.cardBg.y = this.bg.y;
tweenChange(this.cardBg, { scaleX: 1, scaleY: 1, x: toX, y: toY }, 0.5, () => {
tweenChange(this.cardBg, { scaleX: 1, scaleY: 1, x: toX, y: toY }, 0.5, () => {console.log(this.bigCard.width);
this.canClickCard = true;
this.showed = true;
if (callback) {
......
......@@ -30,13 +30,19 @@ export class Title {
}
init(mapScaleX = 1, mapScaleY = 1) {
let titleBg = new ShapeRect();
//初始化标题1背景
const titePart1Bg = new MySprite();
titePart1Bg.init(this.images.get('titlePart1Bg'));
titePart1Bg.scaleX = mapScaleX;
titePart1Bg.scaleY = mapScaleY;
titePart1Bg.x = titePart1Bg.getBoundingBox().width / 2;
const titePart1Bg = new ShapeRect();
titePart1Bg.fillColor="#567790";
let pWidth = 121 * mapScaleX;
let pHeight = 69 * mapScaleY;
titePart1Bg.setSize(pWidth, pHeight);
titePart1Bg.setShadow(4,4,0, 'rgba(0, 0, 0, 0.2)');
titePart1Bg.x = 0;
titleBg.addChild(titePart1Bg);
//标题1内容
const part1 = new Label();
......@@ -46,14 +52,14 @@ export class Title {
part1.fontName = "BRLNSDB";
part1.fontColor = "#ffffff";
part1.refreshSize();
part1.x = titePart1Bg.getBoundingBox().width / 2 - part1.getBoundingBox().width - 13 * mapScaleX;
titePart1Bg.addChild(part1);
part1.x = pWidth - part1.getBoundingBox().width - 13 * mapScaleX;
titleBg.addChild(part1);
//标题2内容
const part2 = new Label();
part2.text = this.titleData.part2;
part2.fontSize = 36;
part2.fontName = "FuturaStd";
part2.fontName = "FUTURA";
part2.fontColor = "#000000";
part2.refreshSize();
part2.x = titePart1Bg.getBoundingBox().width + 11 * mapScaleX;
......@@ -62,14 +68,14 @@ export class Title {
let height = Math.max(titePart1Bg.getBoundingBox().height, part2.getBoundingBox().height);
let width = titePart1Bg.getBoundingBox().width + part2.getBoundingBox().width + 11 * mapScaleX;
titePart1Bg.y = (height - pHeight)/2;
let titleBg = new ShapeRect();
part1.y = height / 2;
titleBg.setSize(width, height);
titleBg.alpha = 0;
titePart1Bg.y = height / 2;
titleBg.addChild(titePart1Bg);
part2.y = height / 2;
titleBg.addChild(part2);
......
......@@ -4,7 +4,8 @@ import {
Label,
MySprite, tweenChange,
Line,
ShapeRectNew
ShapeRectNew,
ShapeRect
} from './Unit';
import { res, resAudio } from './resources';
......@@ -87,6 +88,8 @@ export class PlayComponent implements OnInit, OnDestroy {
curAudio;
mask : ShapeRect;
@HostListener('window:resize', ['$event'])
onResize(event) {
this.winResizeEventStream.next();
......@@ -808,10 +811,10 @@ export class PlayComponent implements OnInit, OnDestroy {
}
else {
if (this.data.skin === 'A') {
startY = startY + exercises.bg.height + 78 * this.mapScaleY;
startY = startY + exercises.bg.height + 65 * this.mapScaleY;
}
else {
startY = startY + exercises.bg.height + 65 * this.mapScaleY;
startY = startY + exercises.bg.height + 78 * this.mapScaleY;
}
hight = exercises.bg.height;
startYArr.push(startY);
......@@ -852,6 +855,13 @@ export class PlayComponent implements OnInit, OnDestroy {
this.exercisesArr[i].resetText(minScale, this.data.skin);
}
const mask = new ShapeRect();
mask.setSize(this.canvasWidth, this.canvasHeight);
mask.visible = false;
mask.alpha = 0.3
mask.fillColor = "#000000";
this.renderArr.push(mask);
this.mask = mask;
}
mapDown(event) {
......@@ -901,6 +911,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if (!exer.showed) {
this.playAudio('waves', true);
this.mask.visible = true;
exer.showBigCard(this.canvasWidth / 2, this.canvasHeight / 2, () => {
//将其它词组设置为不可点击
......@@ -931,6 +942,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.playAudio('turn', true);
this.mask.visible = false;
exer.close(() => {
//将词组设置为可点击
for (let j = 0; j < this.exercisesArr.length; ++j) {
......
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