Commit ba03f80e authored by 范雪寒's avatar 范雪寒

fix: 语音评测时切换下一页

parent ab9ea14c
...@@ -80,6 +80,7 @@ cc.Class({ ...@@ -80,6 +80,7 @@ cc.Class({
start() { start() {
initAir(this); initAir(this);
this.reWriteAir(); this.reWriteAir();
this.updateWidgets();
window.courseware.getEngineInfo((dataStr) => { window.courseware.getEngineInfo((dataStr) => {
const engineInfo = JSON.parse(dataStr); const engineInfo = JSON.parse(dataStr);
...@@ -397,7 +398,11 @@ cc.Class({ ...@@ -397,7 +398,11 @@ cc.Class({
console.log("sceneName = " + conf.sceneName); console.log("sceneName = " + conf.sceneName);
const canvas = cc.find("Canvas"); const canvas = cc.find("Canvas");
const middleLayer = cc.find("middleLayer"); const middleLayer = cc.find("middleLayer");
window.courseware.freeAllOcMethod();
this.hideWaitingLetters(); this.hideWaitingLetters();
this.updateWidgets();
callback && callback(); callback && callback();
}); });
}); });
...@@ -415,11 +420,40 @@ cc.Class({ ...@@ -415,11 +420,40 @@ cc.Class({
console.error("非源生环境"); console.error("非源生环境");
} }
}, },
reloadBundle() { reloadBundle() {
this.loadBundleByConf(this.bundleInfoList[this.currentBundleIndex]); this.loadBundleByConf(this.bundleInfoList[this.currentBundleIndex]);
}, },
updateWidgets() {
this.updateScale();
this.node.getComponentsInChildren(cc.Widget).forEach((widget) => {
widget.updateAlignment();
});
},
updateScale() {
// const canvas = cc.find("Canvas");
// const canvasSize = cc.view.getCanvasSize();
// const designSize = cc.view.getDesignResolutionSize();
// const scale =
// canvas.width / canvasSize.width / (canvas.height / canvasSize.height);
// console.log("canvasSize:", canvasSize);
// console.log("designSize:", designSize);
// console.log({ x: canvas.x, y: canvas.y });
// console.log({ width: canvas.width, height: canvas.height });
// console.log('scale = ' + scale);
// this.node.width = canvas.width;
// this.node.height = canvas.height * scale;
// this.node.x = this.node.width / 2;
// this.node.y = this.node.height / 2 - 120;
},
exit() { exit() {
cc.game.removePersistRootNode(this.node); cc.game.removePersistRootNode(this.node);
......
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