Commit 0f046670 authored by 范雪寒's avatar 范雪寒

fix: 分辨率适配问题

parent 9ce7f7ea
......@@ -1675,7 +1675,7 @@
"array": [
0,
0,
702.373665763048,
805.7013217520789,
0,
0,
0,
......
......@@ -134,6 +134,18 @@ cc.Class({
},
initListeners() {
this.node.on('scale-changed', () => {
console.log('scale-changed');
this.showQuestion();
this.updateButtons();
});
this.node.on('size-changed', () => {
console.log('size-changed');
this.showQuestion();
this.updateButtons();
});
addButtonListener(cc.find('Canvas/BtnNode/BtnBefore'), () => {
if (this.status.currentQuestionIdx <= 0) {
return false;
......@@ -173,6 +185,7 @@ cc.Class({
},
async showQuestion(isFirstIncome = false) {
this.resetQuestionBoard();
this.showOptions();
this.questionBoardDown();
if (isFirstIncome) {
......@@ -210,11 +223,11 @@ cc.Class({
});
const optionPosListBase = cc.find('Canvas/OptionPosListBase');
optionNode.scaleX = Math.min(optionPosListBase.scaleX, optionPosListBase.scaleY, 1);
optionNode.scaleY = Math.min(optionPosListBase.scaleX, optionPosListBase.scaleY, 1);
optionNode.scaleX = Math.min(1, optionPosListBase.scaleX, optionPosListBase.scaleY) / optionPosListBase.scaleX;
optionNode.scaleY = Math.min(1, optionPosListBase.scaleX, optionPosListBase.scaleY) / optionPosListBase.scaleY;
const posNode = cc.find(`Canvas/OptionPosListBase/Option_${optionList.length}_${idx}`)
optionNode.x = posNode.x * optionPosListBase.scaleX;
optionNode.x = posNode.x;
optionNode.y = posNode.y;
const btnFlower = cc.find('OptionSpeakerBtn/BtnFlower', optionNode);
......@@ -304,6 +317,11 @@ cc.Class({
});
},
resetQuestionBoard() {
const labelBgNode = cc.find('Canvas/QuestionLabelBg');
labelBgNode.y = 463;
},
async questionBoardDown() {
const questionStr = this.data.questionList[this.status.currentQuestionIdx].questionTxt;
const questionLabel = cc.find('Canvas/QuestionLabelBg/QuestionLabelNode');
......
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