Commit 988e7741 authored by asdf's avatar asdf

添加骨骼动画遮罩

parent 1cc8f2b4
......@@ -27,23 +27,23 @@
"__id__": 8
},
{
"__id__": 11
"__id__": 14
},
{
"__id__": 17
"__id__": 20
}
],
"_active": true,
"_components": [
{
"__id__": 20
"__id__": 23
},
{
"__id__": 21
"__id__": 24
}
],
"_prefab": {
"__id__": 22
"__id__": 25
},
"_opacity": 255,
"_color": {
......@@ -306,20 +306,88 @@
},
{
"__type__": "cc.Node",
"_name": "dragonBone",
"_name": "dragonMask",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_children": [
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 9
"__id__": 12
}
],
"_prefab": {
"__id__": 13
},
"_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,
0,
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__": 8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
}
],
"_prefab": {
"__id__": 11
},
"_opacity": 255,
"_color": {
......@@ -373,7 +441,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"__id__": 9
},
"_enabled": true,
"_materials": [
......@@ -412,7 +480,38 @@
"asset": {
"__uuid__": "d49720e9-3f1f-42ec-9b9b-dc90d989fee4"
},
"fileId": "07RHoj0MNAJZpDMbCSOJY0",
"fileId": "7e/PU22fZISqCMwNCrnDhJ",
"sync": false
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_spriteFrame": null,
"_type": 0,
"_segments": 64,
"_N$alphaThreshold": 0.1,
"_N$inverted": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "d49720e9-3f1f-42ec-9b9b-dc90d989fee4"
},
"fileId": "4eO6Y5ba5MXpoxUAGauH/A",
"sync": false
},
{
......@@ -424,17 +523,17 @@
},
"_children": [
{
"__id__": 12
"__id__": 15
}
],
"_active": false,
"_components": [
{
"__id__": 15
"__id__": 18
}
],
"_prefab": {
"__id__": 16
"__id__": 19
},
"_opacity": 255,
"_color": {
......@@ -488,17 +587,17 @@
"_name": "labWord",
"_objFlags": 0,
"_parent": {
"__id__": 11
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 16
}
],
"_prefab": {
"__id__": 14
"__id__": 17
},
"_opacity": 255,
"_color": {
......@@ -552,7 +651,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 15
},
"_enabled": true,
"_materials": [
......@@ -599,7 +698,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
"__id__": 14
},
"_enabled": true,
"_layoutSize": {
......@@ -648,11 +747,11 @@
"_active": true,
"_components": [
{
"__id__": 18
"__id__": 21
}
],
"_prefab": {
"__id__": 19
"__id__": 22
},
"_opacity": 0,
"_color": {
......@@ -706,7 +805,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
"__id__": 20
},
"_enabled": true,
"_materials": [
......@@ -753,19 +852,19 @@
},
"_enabled": true,
"dragonBone": {
"__id__": 9
"__id__": 10
},
"sprBg": {
"__id__": 6
},
"nodMask": {
"__id__": 17
"__id__": 20
},
"layoutText": {
"__id__": 11
"__id__": 14
},
"labWord": {
"__id__": 13
"__id__": 16
},
"_id": ""
},
......
......@@ -146,6 +146,10 @@ cc.Class({
this.dragonBone.node.scale = bgHeight / size.height;
}
}
let mask = this.dragonBone.node.parent;
mask.width = this.dragonBone.node.scale * size.width;
mask.height = this.dragonBone.node.scale * 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