
//动态适配屏幕
cc.Class({
    extends: cc.Component,

    onLoad() {
        // cc.view.setDesignResolutionSize(720, 1280, cc.ResolutionPolicy.EXACT_FIT);
        var canvasSize = cc.view.getCanvasSize();
        var proportion = canvasSize.width / canvasSize.height;
        if (proportion >= 0.5) {
            cc.view.setDesignResolutionSize(720, 1280, cc.ResolutionPolicy.FIXED_HEIGHT);
        } else {
            cc.view.setDesignResolutionSize(720, 1280, cc.ResolutionPolicy.FIXED_WIDTH);
            // cc.log('齐刘海手机：');
            cc.find('Canvas/UICamera/BelowTheMask/TopLabel').getComponent(cc.Widget).top -=100;
            cc.find('Canvas/UICamera/BelowTheMask/TopButton').getComponent(cc.Widget).top -=100;
            cc.find('Canvas/UICamera/BelowTheMask/BottomButton').getComponent(cc.Widget).bottom -= 100;
        }

        cc.log("canvasSize:", canvasSize);
    },

});
