Commit 67994e39 authored by liujiangnan's avatar liujiangnan
parents 3e70bfcb 5b5438f1
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -87,6 +87,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
async initView() {
const canvas = cc.find('Canvas');
const touchboard = cc.find('Canvas/touchboard');
const contant = cc.find('Canvas/touchboard/contant');
const scale = touchboard.height / contant.height;
......@@ -95,6 +96,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
contant.scale = scale;
contant.x = contant.width / 2 - touchboard.width / 2;
if((canvas.width / canvas.height) >= 1) {
// 横屏
} else {
// 竖屏
const bg = cc.find('Canvas/touchboard/contant/bg');
bg.x = -1800;
bg.y = -150;
bg.scale = 0.3;
}
const bg = cc.find('Canvas/touchboard/contant/bg');
for (let i = 0; i < 36; i++) {
const btn = seekChildByName(bg, `btn_${i}`);
......
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