Commit be81945b authored by yu's avatar yu

默认图片,字体

parent 5b3d11a5
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "d547b437-ed95-4e0a-ad03-9e8813578dad",
"subMetas": {}
}
\ No newline at end of file
......@@ -1520,8 +1520,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1208,
"height": 322
"width": 2056,
"height": 537
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1533,14 +1533,14 @@
"ctor": "Float64Array",
"array": [
0,
-555.649,
-531.5,
0,
0,
0,
0,
1,
2,
2,
1,
1,
1
]
},
......@@ -2760,7 +2760,7 @@
"_N$horizontalAlign": 0,
"_N$fontSize": 100,
"_N$font": {
"__uuid__": "04c2b808-1c8a-499b-9152-128a1abe340a"
"__uuid__": "d547b437-ed95-4e0a-ad03-9e8813578dad"
},
"_N$cacheMode": 0,
"_N$maxWidth": 0,
......@@ -2970,8 +2970,10 @@
"_fontSize": 100,
"_lineHeight": 100,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_N$file": {
"__uuid__": "d547b437-ed95-4e0a-ad03-9e8813578dad"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
......
......@@ -287,8 +287,8 @@ cc.Class({
//更换书的样子
pg.view.visible(btn_next, true);//显示的内容用true
pg.view.visible(btn_return, true);
let bg_book_img = this._stageData.img;//从数组中调取img数据
pg.view.setNetImg(bg_book, bg_book_img);//与界面的节点绑定
// let bg_book_img = this._stageData.img;//从数组中调取img数据
// pg.view.setNetImg(bg_book, bg_book_img);//与界面的节点绑定
//拓展加载动画的内容
this.animationName = "";
this._tryagainCount = 0;
......@@ -336,6 +336,8 @@ cc.Class({
this.playWordAni().then(() => {
this.playRecordAudio();
})
let bg_book2 = pg.view.find(this, "bg_book2");
pg.view.setNetImg(bg_book2, this._stageData.img, { w: 2056, h: 537 });
// this._timeoutIds.push(setTimeout(() => {
// pg.view.visible(icon_hand, true);
// let action = cc.tween(icon_hand);
......
......@@ -61,7 +61,7 @@ pg.view = {
})
})
},
setNetImg(item, res) {
setNetImg(item, res, { w, h }) {
return new Promise((resolve, reject) => {
if (!item) return log.w("图片更换失败,传入了错误的item");
let node = item.node ? item.node : item;
......@@ -71,8 +71,8 @@ pg.view = {
}
if (!node) return log.w("图片更换失败,传入了错误的item");
if (node.net_url == res) return;
let w = node.width;
let h = node.height;
// let w = node.width;
// let h = node.height;
// node.active = false;//
pg.load.loadNetImg(res).then((texture) => {
if (!cc.isValid(node)) return log.i("节点已销毁");
......@@ -82,18 +82,30 @@ pg.view = {
let spriteFrame = new cc.SpriteFrame(texture);
component.spriteFrame = spriteFrame;
node.net_url = res;
let a = w / nw;//100 2000 0.05
let b = h / nh;//100 1000 0.1
if (a < b) {
node.width = a * nw;
node.height = a * nh;
// node.active = true;
if (!cc.isValid(node)) return pg.logger.i("节点已销毁");
if (!node) return pg.logger.w("节点已销毁");
if (w && h) {
let scaleX = w / nw;
let scaleY = h / nh;
let scale = scaleX <= scaleY ? scaleX : scaleY;
node.width = w;//nw * scale;
node.height = h;//nh * scale;
} else {
node.width = b * nw;
node.height = b * nh;
let a = w / nw;//100 2000 0.05
let b = h / nh;//100 1000 0.1
if (a < b) {
node.width = a * nw;
node.height = a * nh;
} else {
node.width = b * nw;
node.height = b * nh;
}
node.scaleX = node.parent.scaleX;
node.scaleY = node.parent.scaleY;
}
node.scaleX = node.parent.scaleX;
node.scaleY = node.parent.scaleY;
// node.active = true;
node.active = true;
resolve({ w: nw, h: nh });
})
})
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1208,
"height": 322,
"width": 2056,
"height": 537,
"platformSettings": {},
"subMetas": {
"bg_book": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1208,
"height": 322,
"rawWidth": 1208,
"rawHeight": 322,
"width": 2056,
"height": 537,
"rawWidth": 2056,
"rawHeight": 537,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
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