Commit 86adc8ef authored by xytk's avatar xytk

提交代码

parent f8d0ae18
This diff is collapsed.
...@@ -177,9 +177,9 @@ cc.Class({ ...@@ -177,9 +177,9 @@ cc.Class({
initView() { initView() {
this.initBg(); this.initBg();
this.initPic(); this.initPic();
this.initTile();
//this.initBtn(); //this.initBtn();
this.initIcon(); this.initIcon();
this.loadDragonBones(); this.loadDragonBones();
...@@ -216,10 +216,28 @@ cc.Class({ ...@@ -216,10 +216,28 @@ cc.Class({
}); });
},
initTile(){
this.tittleJs.setTittleText(this.data.bt_text);
let dy = this._frameSize.y/2-104;
this.tittleJs.node.y = dy;
}, },
initBg() { initBg() {
//等比缩放,底部对齐
const bgNode = cc.find('Canvas/bg'); const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMin; let screen_size = this._frameSize.width / this._frameSize.height
let design_size = this._designSize.width / this._designSize.height
if(screen_size<design_size){
bgNode.height = this._frameSize.height;
bgNode.width = this._frameSize.height * design_size;
}else{
bgNode.width = this._frameSize.width;
bgNode.height = this._frameSize.width / design_size;
let dy = (bgNode.height - this._frameSize.height)/2
bgNode.y = bgNode.y + dy;
}
// bgNode.scale = this._mapScaleMin;
}, },
pic1: null, pic1: null,
......
...@@ -14,7 +14,7 @@ export default class NewClass extends cc.Component { ...@@ -14,7 +14,7 @@ export default class NewClass extends cc.Component {
start () { start () {
this.audioSource.node.on(cc.Node.EventType.TOUCH_START,this.playSe,this); this.audioSource.node.on(cc.Node.EventType.TOUCH_START,this.playSe,this);
// cc.view.getFrameSize // cc.view.getFrameSize()
} }
/** /**
* 设置标题文本 * 设置标题文本
......
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