Commit 569cbdd4 authored by Chen Jiping's avatar Chen Jiping

fix:调整提示显示

parent 0eaa6ef6
...@@ -55,6 +55,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -55,6 +55,9 @@ export class PlayComponent implements OnInit, OnDestroy {
audioObj = {}; audioObj = {};
renderArr; renderArr;
magnifierArr = [];
mapScale = 1; mapScale = 1;
canvasLeft; canvasLeft;
...@@ -375,7 +378,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -375,7 +378,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
checkClickHotZoneTarget(target){ checkClickHotZoneTarget(target) {
const rect = target.getBoundingBox(); const rect = target.getBoundingBox();
rect.width += 60 * this.mapScale; rect.width += 60 * this.mapScale;
...@@ -584,6 +587,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -584,6 +587,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.renderArr = []; this.renderArr = [];
this.magnifierArr = [];
this.isMagnifierTouched = false; this.isMagnifierTouched = false;
this.photoAnima = null; this.photoAnima = null;
this.textLabelArr = []; this.textLabelArr = [];
...@@ -812,7 +817,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -812,7 +817,7 @@ export class PlayComponent implements OnInit, OnDestroy {
magnifier.setScaleXY(this.mapScale); magnifier.setScaleXY(this.mapScale);
magnifier.x = this.canvasWidth / 2; magnifier.x = this.canvasWidth / 2;
magnifier.y = this.canvasHeight / 2; magnifier.y = this.canvasHeight / 2;
this.renderArr.push(magnifier); this.magnifierArr.push(magnifier);
console.log('rate: ', this.hotZoneRate); console.log('rate: ', this.hotZoneRate);
...@@ -862,6 +867,21 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -862,6 +867,21 @@ export class PlayComponent implements OnInit, OnDestroy {
this.curHotZoneItem = hotZoneItem; this.curHotZoneItem = hotZoneItem;
if (this.curHotZoneItem.alpha === 0) {
this.magnifier['light'].visible = true;
setTimeout(() => {
this.magnifier['light'].visible = false;
setTimeout(() => {
this.magnifier['light'].visible = true;
}, 100);
}, 100);
}
} else { } else {
if (this.curHotZoneItem) { if (this.curHotZoneItem) {
this.curHotZoneItem.alpha = 0; this.curHotZoneItem.alpha = 0;
...@@ -915,7 +935,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -915,7 +935,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let answered = true; let answered = true;
this.hotZoneArr.forEach((item) => { this.hotZoneArr.forEach((item) => {
if (!item.answered) { if (!item.answered) {
answered = false; answered = false;
...@@ -1009,17 +1029,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1009,17 +1029,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if (this.curHotZoneItem.alpha === 0) { if (this.curHotZoneItem.alpha === 0) {
this.magnifier['light'].visible = true; this.magnifier['light'].visible = true;
this.magnifier.x = this.curHotZoneItem.x;
setTimeout(() => { this.magnifier.y = this.curHotZoneItem.y + 50 * this.mapScale;
this.magnifier['light'].visible = false; this.showPhotoAnima();
setTimeout(() => {
this.magnifier['light'].visible = true;
this.magnifier.x = this.curHotZoneItem.x;
this.magnifier.y = this.curHotZoneItem.y + 50 * this.mapScale;
this.showPhotoAnima();
}, 100);
}, 100);
} }
} }
...@@ -1058,6 +1070,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1058,6 +1070,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.updateArr(this.renderArr); this.updateArr(this.renderArr);
this.updateArr(this.magnifierArr);
this.updateArr(this.textLabelArr); this.updateArr(this.textLabelArr);
this.updateArr(this.endRenderArr); this.updateArr(this.endRenderArr);
......
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