Commit 63324a0b authored by asdf's avatar asdf

骨骼动画缩放

parent 33fdf405
...@@ -9,60 +9,34 @@ ...@@ -9,60 +9,34 @@
"wrapMode": 1, "wrapMode": 1,
"curveData": { "curveData": {
"paths": { "paths": {
"dragonBone": { "lettters": {
"props": { "props": {
"position": [ "scaleX": [
{ {
"frame": 0, "frame": 0.5,
"value": [ "value": 0,
250, "curve": "quintOut"
218
],
"motionPath": [
[
-38,
266,
69,
256,
-158,
277
]
]
}, },
{ {
"frame": 0.2, "frame": 0.6666666666666666,
"value": [ "value": 1
-216.2, }
260.2 ],
], "angle": [
"motionPath": [ {
[ "frame": 0.5,
-248.8, "value": -45
215.5,
-261.2,
238.8,
-240.2,
199.3
],
[
-167.7,
160.7,
-232.5,
188.4,
-73.7,
127.3
]
]
}, },
{ {
"frame": 0.4166666666666667, "frame": 0.6666666666666666,
"value": [ "value": 0
-2,
110.8
],
"motionPath": []
} }
], ]
}
},
"dragonParent/dragonBone": {
"comps": {},
"props": {
"scale": [ "scale": [
{ {
"frame": 0, "frame": 0,
...@@ -83,27 +57,58 @@ ...@@ -83,27 +57,58 @@
] ]
} }
}, },
"lettters": { "dragonParent": {
"props": { "props": {
"scaleX": [ "position": [
{ {
"frame": 0.5, "frame": 0,
"value": 0, "value": [
"curve": "quintOut" 250,
218
],
"motionPath": [
[
0,
301,
107,
293,
-114,
303
],
[
-136,
296,
-107,
299,
-192,
289
]
]
}, },
{ {
"frame": 0.6666666666666666, "frame": 0.2,
"value": 1 "value": [
} -216,
], 260
"angle": [ ],
{ "motionPath": [
"frame": 0.5, [
"value": -45 -184,
170,
-234,
205,
-128,
131
]
]
}, },
{ {
"frame": 0.6666666666666666, "frame": 0.4166666666666667,
"value": 0 "value": [
-2,
111
],
"motionPath": []
} }
] ]
} }
......
...@@ -24,29 +24,29 @@ ...@@ -24,29 +24,29 @@
"__id__": 6 "__id__": 6
}, },
{ {
"__id__": 9 "__id__": 11
}, },
{ {
"__id__": 12 "__id__": 14
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 25
}, },
{ {
"__id__": 24 "__id__": 26
}, },
{ {
"__id__": 25 "__id__": 27
}, },
{ {
"__id__": 26 "__id__": 28
} }
], ],
"_prefab": { "_prefab": {
"__id__": 27 "__id__": 29
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -234,20 +234,84 @@ ...@@ -234,20 +234,84 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "dragonBone", "_name": "dragonParent",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1 "__id__": 1
}, },
"_children": [
{
"__id__": 7
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 10
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
117.753,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "dragonBone",
"_objFlags": 0,
"_parent": {
"__id__": 6
},
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 7 "__id__": 8
} }
], ],
"_prefab": { "_prefab": {
"__id__": 8 "__id__": 9
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -259,8 +323,8 @@ ...@@ -259,8 +323,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1100, "width": 3296.0067973175956,
"height": 646 "height": 1330.842029371438
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -272,7 +336,7 @@ ...@@ -272,7 +336,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
117.753, 0,
0, 0,
0, 0,
0, 0,
...@@ -301,7 +365,7 @@ ...@@ -301,7 +365,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 6 "__id__": 7
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -315,7 +379,7 @@ ...@@ -315,7 +379,7 @@
"_cacheMode": 0, "_cacheMode": 0,
"playTimes": -1, "playTimes": -1,
"premultipliedAlpha": false, "premultipliedAlpha": false,
"_armatureKey": "179808f9-d84c-4a2b-a3c1-5d3c5d002992#e3095326-81fc-4cbf-8810-a4ee76c30843", "_armatureKey": "483aebc5-f723-4adc-9d2e-018a2f5880e0#87d0a573-0bfd-4b78-9f8c-a0b5cd455678",
"_accTime": 0, "_accTime": 0,
"_playCount": 0, "_playCount": 0,
"_frameCache": null, "_frameCache": null,
...@@ -340,7 +404,18 @@ ...@@ -340,7 +404,18 @@
"asset": { "asset": {
"__uuid__": "08949af0-f133-4990-8a03-95403eb67c2d" "__uuid__": "08949af0-f133-4990-8a03-95403eb67c2d"
}, },
"fileId": "e1c/JLshlN0LFqVX1GxhfZ", "fileId": "61GjdADw9GbonRJj6gVw+k",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "08949af0-f133-4990-8a03-95403eb67c2d"
},
"fileId": "99flsOaQhBUq/2Jk5k76um",
"sync": false "sync": false
}, },
{ {
...@@ -354,11 +429,11 @@ ...@@ -354,11 +429,11 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 10 "__id__": 12
} }
], ],
"_prefab": { "_prefab": {
"__id__": 11 "__id__": 13
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -412,7 +487,7 @@ ...@@ -412,7 +487,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 9 "__id__": 11
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
...@@ -459,16 +534,16 @@ ...@@ -459,16 +534,16 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 13 "__id__": 15
}, },
{ {
"__id__": 16 "__id__": 18
} }
], ],
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 22 "__id__": 24
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -522,17 +597,17 @@ ...@@ -522,17 +597,17 @@
"_name": "combined-shape", "_name": "combined-shape",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 12 "__id__": 14
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 14 "__id__": 16
} }
], ],
"_prefab": { "_prefab": {
"__id__": 15 "__id__": 17
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -586,7 +661,7 @@ ...@@ -586,7 +661,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 13 "__id__": 15
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -629,21 +704,21 @@ ...@@ -629,21 +704,21 @@
"_name": "rightLetters", "_name": "rightLetters",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 12 "__id__": 14
}, },
"_children": [ "_children": [
{ {
"__id__": 17 "__id__": 19
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 20 "__id__": 22
} }
], ],
"_prefab": { "_prefab": {
"__id__": 21 "__id__": 23
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -697,17 +772,17 @@ ...@@ -697,17 +772,17 @@
"_name": "layout", "_name": "layout",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 16 "__id__": 18
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 18 "__id__": 20
} }
], ],
"_prefab": { "_prefab": {
"__id__": 19 "__id__": 21
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -761,7 +836,7 @@ ...@@ -761,7 +836,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 17 "__id__": 19
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
...@@ -804,7 +879,7 @@ ...@@ -804,7 +879,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 16 "__id__": 18
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -865,7 +940,7 @@ ...@@ -865,7 +940,7 @@
"__uuid__": "b4cceb6a-30d5-400a-ac0f-9fb6961a728b" "__uuid__": "b4cceb6a-30d5-400a-ac0f-9fb6961a728b"
}, },
"dragonBone": { "dragonBone": {
"__id__": 7 "__id__": 8
}, },
"audMove": { "audMove": {
"__uuid__": "ccc98fd8-785a-4bc1-ac6e-1854b10ffb08" "__uuid__": "ccc98fd8-785a-4bc1-ac6e-1854b10ffb08"
......
...@@ -36,6 +36,10 @@ cc.Class({ ...@@ -36,6 +36,10 @@ cc.Class({
// imageUrl = 'http://127.0.0.1/walkingfish_tex.png'; // imageUrl = 'http://127.0.0.1/walkingfish_tex.png';
// 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';
// skeUrl = 'http://127.0.0.1/B1U5L3_page1_ani_ske.json';
// atlasUrl = 'http://127.0.0.1/B1U5L3_page1_ani_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)
...@@ -79,9 +83,9 @@ cc.Class({ ...@@ -79,9 +83,9 @@ cc.Class({
let designScale = bgWidth / bgHeight; let designScale = bgWidth / bgHeight;
let scale = size.width / size.height; let scale = size.width / size.height;
if (scale > designScale) { if (scale > designScale) {
this.dragonBone.node.scale = bgWidth / size.width; this.dragonBone.node.parent.scale = bgWidth / size.width;
} else { } else {
this.dragonBone.node.scale = bgHeight / size.height; this.dragonBone.node.parent.scale = bgHeight / size.height;
} }
} }
}, },
......
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