Commit f5032c6a authored by asdf's avatar asdf

如果骨骼动画没有canvas,默认大小

parent f1d798e0
{ {
"ver": "1.2.7", "ver": "1.2.9",
"uuid": "196ced84-f877-4734-bed7-931dcdf479fc", "uuid": "196ced84-f877-4734-bed7-931dcdf479fc",
"optimizationPolicy": "AUTO", "optimizationPolicy": "AUTO",
"asyncLoadAssets": false, "asyncLoadAssets": false,
......
{ {
"ver": "1.2.7", "ver": "1.2.9",
"uuid": "d49720e9-3f1f-42ec-9b9b-dc90d989fee4", "uuid": "d49720e9-3f1f-42ec-9b9b-dc90d989fee4",
"optimizationPolicy": "AUTO", "optimizationPolicy": "AUTO",
"asyncLoadAssets": false, "asyncLoadAssets": false,
......
{ {
"ver": "1.2.7", "ver": "1.2.9",
"uuid": "57ea7c61-9b8b-498a-b024-c98ee9124beb", "uuid": "57ea7c61-9b8b-498a-b024-c98ee9124beb",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": true, "autoReleaseAssets": true,
......
...@@ -75,9 +75,9 @@ cc.Class({ ...@@ -75,9 +75,9 @@ cc.Class({
// skeUrl = 'http://127.0.0.1/walkingfish_ske.json'; // skeUrl = 'http://127.0.0.1/walkingfish_ske.json';
// atlasUrl = 'http://127.0.0.1/walkingfish_tex.json'; // atlasUrl = 'http://127.0.0.1/walkingfish_tex.json';
// imageUrl = 'http://127.0.0.1/B1U5L3_page1_ani_tex.png'; // imageUrl = 'http://127.0.0.1/1_tex.png';
// skeUrl = 'http://127.0.0.1/B1U5L3_page1_ani_ske.json'; // skeUrl = 'http://127.0.0.1/1_ske.json';
// atlasUrl = 'http://127.0.0.1/B1U5L3_page1_ani_tex.json'; // atlasUrl = 'http://127.0.0.1/1_tex.json';
cc.assetManager.loadAny([{ url: atlasUrl, ext: '.txt' }, { url: skeUrl, ext: '.txt' }], (error, assets) => { cc.assetManager.loadAny([{ url: atlasUrl, ext: '.txt' }, { url: skeUrl, ext: '.txt' }], (error, assets) => {
if (error) { if (error) {
console.log(error) console.log(error)
...@@ -105,7 +105,7 @@ cc.Class({ ...@@ -105,7 +105,7 @@ cc.Class({
} }
this.dragonBone.armatureName = data.name; this.dragonBone.armatureName = data.name;
this.animationName = data.animation[0].name; this.animationName = data.animation[0].name;
this.dragonBone.animationName = this.animationName;
this.setSpineScale(data.canvas); this.setSpineScale(data.canvas);
} }
}); });
...@@ -132,6 +132,16 @@ cc.Class({ ...@@ -132,6 +132,16 @@ cc.Class({
} }
}, },
setSpineScale(size) { setSpineScale(size) {
let mask = this.dragonBone.node.parent;
if (!size) {
mask.width = 1000;
mask.height = 500;
if (!this.data.text) {
bgHeight = 546;
}
this.dragonBone.node.scale = 1;
return;
}
let bgWidth = 1000; let bgWidth = 1000;
let bgHeight = 500; let bgHeight = 500;
if (!this.data.text) { if (!this.data.text) {
...@@ -147,7 +157,6 @@ cc.Class({ ...@@ -147,7 +157,6 @@ cc.Class({
} }
} }
let mask = this.dragonBone.node.parent;
mask.width = this.dragonBone.node.scale * size.width; mask.width = this.dragonBone.node.scale * size.width;
mask.height = this.dragonBone.node.scale * size.height; mask.height = this.dragonBone.node.scale * size.height;
}, },
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"packages": "packages", "packages": "packages",
"name": "play", "name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231", "id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.0", "version": "2.4.3",
"isNew": false "isNew": false
} }
\ No newline at end of file
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