Commit 4fc0860e authored by limingzhe's avatar limingzhe

feat: 滚动条 提交按钮出现

parent cb63e0a9
......@@ -2224,15 +2224,15 @@ export class ScrollView extends MySprite {
const boxEdgeY = curChild.y + (1 - curChild.anchorY) * curChild.height * curChild.scaleY;
if (!children[i].colorRect) {
const rect = new ShapeRectNew();
rect.fillColor = '#ff0000';
rect.setSize(curChild.width * curChild.scaleX, curChild.height * curChild.scaleY, 0);
rect.alpha = 0.3;
rect.x = boxEdgeX - curChild.width * curChild.scaleX;
rect.y = boxEdgeY - curChild.height * curChild.scaleY;
this.content.addChild(rect);
children[i].colorRect = rect;
// const rect = new ShapeRectNew();
// rect.fillColor = '#ff0000';
// rect.setSize(curChild.width * curChild.scaleX, curChild.height * curChild.scaleY, 0);
// rect.alpha = 0.3;
// rect.x = boxEdgeX - curChild.width * curChild.scaleX;
// rect.y = boxEdgeY - curChild.height * curChild.scaleY;
// this.content.addChild(rect);
// children[i].colorRect = rect;
}
// console.log('boxEdgeY: ', boxEdgeY);
......
......@@ -667,8 +667,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initMaskPic();
this.relink();
this.checkShowSubmit();
// this.gameStart();
this.gameStart();
// this.initBtn();
......@@ -689,6 +690,19 @@ export class PlayComponent implements OnInit, OnDestroy {
// // this.testInput()
}
showSubmit() {
this.submitBtn.visible = true;
this.submitBtn.shadowSpr.visible = true;
}
hideSubmit() {
this.submitBtn.visible = false;
this.submitBtn.shadowSpr.visible = false;
}
testInput() {
const tmpRect = this.sentenceEmptyArr[0].getBoundingBox();
......@@ -1633,8 +1647,6 @@ export class PlayComponent implements OnInit, OnDestroy {
if (!this.canTouch) {
return;
}
......@@ -1770,6 +1782,8 @@ export class PlayComponent implements OnInit, OnDestroy {
mapUp(event) {
this.checkShowSubmit();
if (this.resultPanel) {
this.resultSv.onTouchEnd(this.mx, this.my);
return;
......@@ -2281,15 +2295,28 @@ export class PlayComponent implements OnInit, OnDestroy {
checkShowSubmit() {
for (let i=0; i<this.btnArr.length; i++) {
if (this.btnArr[i].visible) {
return;
const arr = this.hotZoneArr;
console.log('arr: ', arr);
for (let i=0; i<arr.length; i++) {
console.log('i: ', i);
console.log('arr[i]: ', arr[i]);
if (arr[i].data.gIdx == '0') {
if (!arr[i].label || !arr[i].label.text) {
this.hideSubmit();
return;
}
}
}
this.submitBtn.visible = true;
this.submitBtn.shadowSpr.visible = true;
this.submitBtn.offBtn.visible = false;
}
this.showSubmit();
}
......
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