Commit b941090d authored by Tt's avatar Tt

fix

parent 489b8b25
......@@ -210,9 +210,6 @@ cc.Class({
this.loadingLayer.onLoadFinished(() => {
this.refreshCoolCatPosition();
//TODO:copy
this.hideFlower();
this.coolCatSpeakStart(() => {
this.startCountTime();
this.jumpToQuestion(this.status.currentQuestionIdx);
......@@ -245,8 +242,9 @@ cc.Class({
const canvasHeight = cc.find("Canvas").height;
const optionNum = this.data.question_arr[questionIdx].option_arr.length;
//TODO:copy---start
this.hideFlower();
const maxOptionHeight = 400;
const maxOptionWidth = (canvasWidth * 0.8) / optionNum > 300 ? 300 : (canvasWidth * 0.8) / optionNum;
const maxOptionWidth = (canvasWidth * 0.8) / optionNum;
const box_mid = cc.find('Canvas/bg/box_mid');
box_mid.removeAllChildren();
//TODO:copy---end
......@@ -259,14 +257,10 @@ cc.Class({
optionNode.y = canvasHeight / 2 - box.y - 300;
optionNode.scale = 0;
optionNode.parent = box;
optionNode.targetScale = Math.min((maxOptionWidth * 0.80) / optionNode.width, maxOptionHeight / optionNode.height)
cc.tween(optionNode)
.to(0.1, {
scale: Math.min(
(maxOptionWidth * 0.8) / optionNode.width,
maxOptionHeight / optionNode.height
),
})
.to(0.1, { scale: optionNode.targetScale })
.start();
});
},
......@@ -335,7 +329,7 @@ cc.Class({
const box_mid = cc.find('Canvas/bg/box_mid');
cc.tween(optionNode).to(0.2, { x: 0, y: 420 }, cc.easing.quadOut).call(() => {
optionNode.parent = box_mid;
}).to(0.2, { x: 0, y: 100 }, cc.easing.quadOut).start();
}).to(0.2, { x: 0, y: 100, scale: 0.6 }, cc.easing.quadOut).start();
//copy-end
......@@ -495,6 +489,8 @@ cc.Class({
//TODO:copy---start
showFlower() {
const flower = cc.find('Canvas/bg/烟花_ske');
const db = flower.getComponent(dragonBones.ArmatureDisplay)
db.playAnimation("normal", 1)
flower.active = true;
},
hideFlower() {
......@@ -505,6 +501,8 @@ cc.Class({
onAnswerRight() {
//TODO:copy---放烟花时机修改
this.showFlower();
this.coolCatSpeakRight(() => {
//TODO:copy
......@@ -521,7 +519,7 @@ cc.Class({
.forEach((child) => {
child.optionData.selected = false;
cc.tween(child)
.to(0.2, { x: child.startPos.x, y: child.startPos.y })
.to(0.2, { x: child.startPos.x, y: child.startPos.y, scale: child.targetScale })
.start();
});
......@@ -532,7 +530,7 @@ cc.Class({
.forEach(child => {
child.optionData.selected = false;
cc.tween(child)
.to(0.2, { x: child.startPos.x, y: child.startPos.y })
.to(0.2, { x: child.startPos.x, y: child.startPos.y, scale: child.targetScale })
.call(() => {
child.parent = box;
})
......@@ -563,9 +561,6 @@ cc.Class({
}, 0.1 * 1000)
);
} else {
//TODO:copy
this.showFlower();
this.coolCatSpeakEnd(() => {
this.submitBtnMoveOut();
this.showNextBtn();
......
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