Commit 5eabc7e7 authored by Tt's avatar Tt

fix

parent 454cbced
......@@ -167,9 +167,6 @@ cc.Class({
initView() {
this.refreshCoolCatPosition();
//TODO:copy
this.hideFlower();
this.coolCatSpeakStart(() => {
this.showSubmitBtn();
this.jumpToQuestion(this.status.currentQuestionIdx);
......@@ -191,8 +188,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
......@@ -205,9 +203,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.80) / optionNode.width, maxOptionHeight / optionNode.height) })
.to(0.1, { scale: optionNode.targetScale })
.start();
});
},
......@@ -268,7 +267,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
this.boxJump();
......@@ -350,6 +349,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() {
......@@ -360,6 +361,8 @@ cc.Class({
onAnswerRight() {
//TODO:copy---放烟花时机修改
this.showFlower();
this.coolCatSpeakRight(() => {
//TODO:copy
......@@ -376,7 +379,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();
});
......@@ -388,7 +391,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;
})
......@@ -421,9 +424,6 @@ cc.Class({
this.jumpToQuestion(this.status.currentQuestionIdx);
}, 0.1 * 1000);
} else {
//TODO:copy---放烟花时机修改
this.showFlower();
this.hideSubmitBtn();
this.coolCatSpeakEnd(() => {
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