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

test:

parent 17316161
...@@ -53,19 +53,15 @@ cc.Class({ ...@@ -53,19 +53,15 @@ cc.Class({
var h = canvaSize.height / 1280; var h = canvaSize.height / 1280;
this.MaxSize = w / h > 1 ? w / h : h / w; this.MaxSize = w / h > 1 ? w / h : h / w;
// this.setUIMax(this.MaxSize); this.setUIMax(this.MaxSize);
// this.settopUI(this.MaxSize); this.settopUI(this.MaxSize);
// this.setBgScale(); this.setBgScale();
// this.setUiPositon(); this.setUiPositon();
var scene = cc.director.getScene(); var scene = cc.director.getScene();
var list = scene.getComponentsInChildren(cc.Widget); var list = scene.getComponentsInChildren(cc.Widget);
for (var i in list) { for (var i in list) {
if (!list[i].node.name.includes("middle")) {
list[i].updateAlignment(); list[i].updateAlignment();
} else {
console.log('middlelayer汪汪汪')
}
} }
} }
}, 0); }, 0);
...@@ -77,7 +73,6 @@ cc.Class({ ...@@ -77,7 +73,6 @@ cc.Class({
this.MaxSize = 1; this.MaxSize = 1;
}, },
init: function () { init: function () {
console.log('view init ');
var canvaSize = this.findCanvas(); var canvaSize = this.findCanvas();
cc.director._scene.width = canvaSize.width; cc.director._scene.width = canvaSize.width;
cc.director._scene.height = canvaSize.height; cc.director._scene.height = canvaSize.height;
...@@ -163,10 +158,10 @@ cc.Class({ ...@@ -163,10 +158,10 @@ cc.Class({
let realHeight = 720 * srcScaleForShowAll; let realHeight = 720 * srcScaleForShowAll;
// 2. 基于第一步的数据,再做节点宽高重置 // 2. 基于第一步的数据,再做节点宽高重置
this.nodeUIOffset[i].width = // this.nodeUIOffset[i].width =
1280 * (cc.view.getCanvasSize().width / realWidth); // 1280 * (cc.view.getCanvasSize().width / realWidth);
this.nodeUIOffset[i].height = // this.nodeUIOffset[i].height =
720 * (cc.view.getCanvasSize().height / realHeight); // 720 * (cc.view.getCanvasSize().height / realHeight);
} }
}, },
......
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