Commit 63324a0b authored by asdf's avatar asdf

骨骼动画缩放

parent 33fdf405
......@@ -9,60 +9,34 @@
"wrapMode": 1,
"curveData": {
"paths": {
"dragonBone": {
"lettters": {
"props": {
"position": [
"scaleX": [
{
"frame": 0,
"value": [
250,
218
],
"motionPath": [
[
-38,
266,
69,
256,
-158,
277
]
]
"frame": 0.5,
"value": 0,
"curve": "quintOut"
},
{
"frame": 0.2,
"value": [
-216.2,
260.2
],
"motionPath": [
[
-248.8,
215.5,
-261.2,
238.8,
-240.2,
199.3
"frame": 0.6666666666666666,
"value": 1
}
],
[
-167.7,
160.7,
-232.5,
188.4,
-73.7,
127.3
]
]
"angle": [
{
"frame": 0.5,
"value": -45
},
{
"frame": 0.4166666666666667,
"value": [
-2,
110.8
],
"motionPath": []
"frame": 0.6666666666666666,
"value": 0
}
],
]
}
},
"dragonParent/dragonBone": {
"comps": {},
"props": {
"scale": [
{
"frame": 0,
......@@ -83,27 +57,58 @@
]
}
},
"lettters": {
"dragonParent": {
"props": {
"scaleX": [
"position": [
{
"frame": 0.5,
"value": 0,
"curve": "quintOut"
"frame": 0,
"value": [
250,
218
],
"motionPath": [
[
0,
301,
107,
293,
-114,
303
],
[
-136,
296,
-107,
299,
-192,
289
]
]
},
{
"frame": 0.6666666666666666,
"value": 1
}
"frame": 0.2,
"value": [
-216,
260
],
"angle": [
{
"frame": 0.5,
"value": -45
"motionPath": [
[
-184,
170,
-234,
205,
-128,
131
]
]
},
{
"frame": 0.6666666666666666,
"value": 0
"frame": 0.4166666666666667,
"value": [
-2,
111
],
"motionPath": []
}
]
}
......
......@@ -24,29 +24,29 @@
"__id__": 6
},
{
"__id__": 9
"__id__": 11
},
{
"__id__": 12
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 25
},
{
"__id__": 24
"__id__": 26
},
{
"__id__": 25
"__id__": 27
},
{
"__id__": 26
"__id__": 28
}
],
"_prefab": {
"__id__": 27
"__id__": 29
},
"_opacity": 255,
"_color": {
......@@ -234,20 +234,84 @@
},
{
"__type__": "cc.Node",
"_name": "dragonBone",
"_name": "dragonParent",
"_objFlags": 0,
"_parent": {
"__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": [],
"_active": true,
"_components": [
{
"__id__": 7
"__id__": 8
}
],
"_prefab": {
"__id__": 8
"__id__": 9
},
"_opacity": 255,
"_color": {
......@@ -259,8 +323,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1100,
"height": 646
"width": 3296.0067973175956,
"height": 1330.842029371438
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -272,7 +336,7 @@
"ctor": "Float64Array",
"array": [
0,
117.753,
0,
0,
0,
0,
......@@ -301,7 +365,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
"__id__": 7
},
"_enabled": true,
"_materials": [
......@@ -315,7 +379,7 @@
"_cacheMode": 0,
"playTimes": -1,
"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,
"_playCount": 0,
"_frameCache": null,
......@@ -340,7 +404,18 @@
"asset": {
"__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
},
{
......@@ -354,11 +429,11 @@
"_active": true,
"_components": [
{
"__id__": 10
"__id__": 12
}
],
"_prefab": {
"__id__": 11
"__id__": 13
},
"_opacity": 255,
"_color": {
......@@ -412,7 +487,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
"__id__": 11
},
"_enabled": true,
"_layoutSize": {
......@@ -459,16 +534,16 @@
},
"_children": [
{
"__id__": 13
"__id__": 15
},
{
"__id__": 16
"__id__": 18
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 22
"__id__": 24
},
"_opacity": 255,
"_color": {
......@@ -522,17 +597,17 @@
"_name": "combined-shape",
"_objFlags": 0,
"_parent": {
"__id__": 12
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
"__id__": 16
}
],
"_prefab": {
"__id__": 15
"__id__": 17
},
"_opacity": 255,
"_color": {
......@@ -586,7 +661,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
"__id__": 15
},
"_enabled": true,
"_materials": [
......@@ -629,21 +704,21 @@
"_name": "rightLetters",
"_objFlags": 0,
"_parent": {
"__id__": 12
"__id__": 14
},
"_children": [
{
"__id__": 17
"__id__": 19
}
],
"_active": true,
"_components": [
{
"__id__": 20
"__id__": 22
}
],
"_prefab": {
"__id__": 21
"__id__": 23
},
"_opacity": 255,
"_color": {
......@@ -697,17 +772,17 @@
"_name": "layout",
"_objFlags": 0,
"_parent": {
"__id__": 16
"__id__": 18
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 18
"__id__": 20
}
],
"_prefab": {
"__id__": 19
"__id__": 21
},
"_opacity": 255,
"_color": {
......@@ -761,7 +836,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
"__id__": 19
},
"_enabled": true,
"_layoutSize": {
......@@ -804,7 +879,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
"__id__": 18
},
"_enabled": true,
"_materials": [
......@@ -865,7 +940,7 @@
"__uuid__": "b4cceb6a-30d5-400a-ac0f-9fb6961a728b"
},
"dragonBone": {
"__id__": 7
"__id__": 8
},
"audMove": {
"__uuid__": "ccc98fd8-785a-4bc1-ac6e-1854b10ffb08"
......
......@@ -36,6 +36,10 @@ cc.Class({
// imageUrl = 'http://127.0.0.1/walkingfish_tex.png';
// skeUrl = 'http://127.0.0.1/walkingfish_ske.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) => {
if (error) {
console.log(error)
......@@ -79,9 +83,9 @@ cc.Class({
let designScale = bgWidth / bgHeight;
let scale = size.width / size.height;
if (scale > designScale) {
this.dragonBone.node.scale = bgWidth / size.width;
this.dragonBone.node.parent.scale = bgWidth / size.width;
} 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