完善demo

This commit is contained in:
caizhitao 2020-01-16 23:27:09 +08:00
parent bfe61e6494
commit f58540ead2
8 changed files with 308 additions and 702 deletions

View File

@ -20,7 +20,7 @@ CCEffect %{
alphaThreshold: { value: 0.5 } alphaThreshold: { value: 0.5 }
# 圆角半径 # 圆角半径
radius: { radius: {
value: 0.1, value: 0.4,
inspector: { inspector: {
tooltip: "圆角半径", tooltip: "圆角半径",
range: [0.0, 0.5] range: [0.0, 0.5]

View File

@ -23,7 +23,7 @@ CCEffect %{
# 圆角x轴半径长度相对于纹理宽度 # 圆角x轴半径长度相对于纹理宽度
xRadius: { xRadius: {
value: 0.1026, value: 0.4,
inspector: { inspector: {
tooltip: "圆角x轴半径长度相对于纹理宽度", tooltip: "圆角x轴半径长度相对于纹理宽度",
range: [0.0, 0.5] range: [0.0, 0.5]
@ -32,9 +32,9 @@ CCEffect %{
# 圆角y轴半径长度相对于纹理高度 # 圆角y轴半径长度相对于纹理高度
yRadius: { yRadius: {
value: 0.0741, value: 0.4,
inspector: { inspector: {
tooltip: "圆角x轴半径长度(相对于纹理高度)", tooltip: "圆角y轴半径长度(相对于纹理高度)",
range: [0.0, 0.5] range: [0.0, 0.5]
} }
} }

View File

@ -78,10 +78,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 41 "__id__": 39
}, },
{ {
"__id__": 42 "__id__": 40
} }
], ],
"_prefab": null, "_prefab": null,
@ -251,7 +251,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 40 "__id__": 38
} }
], ],
"_prefab": null, "_prefab": null,
@ -1332,18 +1332,15 @@
}, },
{ {
"__id__": 34 "__id__": 34
},
{
"__id__": 36
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 38 "__id__": 36
}, },
{ {
"__id__": 39 "__id__": 37
} }
], ],
"_prefab": null, "_prefab": null,
@ -1358,7 +1355,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 384, "width": 384,
"height": 629.73 "height": 564
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1490,7 +1487,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "cocos_logo", "_name": "Rectangle1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 29 "__id__": 29
@ -1507,14 +1504,14 @@
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
"g": 255, "g": 0,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 195, "width": 200,
"height": 270 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1526,7 +1523,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-387, -302,
0, 0,
0, 0,
0, 0,
@ -1548,7 +1545,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "25JHa6EcNEBZ1hoesQM1Q4" "_id": "2eSZfgubZMxpkxf6Wv6VoZ"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
@ -1566,10 +1563,10 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "31bc895a-c003-4566-a9f3-2e54ae1c17dc" "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1580,11 +1577,11 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "74+WCqN01NIbcSpr5gcxmE" "_id": "2enlbFjsJLJqVy8iYfWwca"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "SystemFont", "_name": "Rectangle2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 29 "__id__": 29
@ -1602,13 +1599,13 @@
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 224.51, "width": 100,
"height": 50.4 "height": 200
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1620,7 +1617,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-559.2, -464,
0, 0,
0, 0,
0, 0,
@ -1642,10 +1639,10 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "5dfIaYLgJPQKk50HqrgyHI" "_id": "eeRQw29nZJXYOderYE6uKz"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
@ -1657,116 +1654,24 @@
"__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310" "__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310"
} }
], ],
"_useOriginalSize": false, "_srcBlendFactor": 770,
"_string": "System Font", "_dstBlendFactor": 771,
"_N$string": "System Font", "_spriteFrame": {
"_fontSize": 40, "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "d1whc7H8RHdrROcYj+2Qh1"
}, },
{ "_type": 0,
"__type__": "cc.Node", "_sizeMode": 0,
"_name": "BmFont", "_fillType": 0,
"_objFlags": 0, "_fillCenter": {
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 37
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 167.5,
"height": 33.33
},
"_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-613.065,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0
"z": 0
}, },
"_skewX": 0, "_fillStart": 0,
"_skewY": 0, "_fillRange": 0,
"_is3DNode": false, "_isTrimmedMode": true,
"_groupIndex": 0, "_atlas": null,
"groupIndex": 0, "_id": "0c/FhoiupJMaG6rjicnytU"
"_id": "e4XmdmRoVPxKoDxfbOgm42"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
},
"_enabled": true,
"_materials": [
{
"__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310"
}
],
"_useOriginalSize": false,
"_string": "BM Font",
"_N$string": "BM Font",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "4c95de7e-8cca-47bf-a446-47b7594e0992"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "7cXLgoUJhDP7BPjr4yx+Ep"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
@ -1806,7 +1711,7 @@
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 384, "width": 384,
"height": 629.73 "height": 564
}, },
"_resize": 1, "_resize": 1,
"_N$layoutType": 2, "_N$layoutType": 2,

View File

@ -58,7 +58,7 @@
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"autoReleaseAssets": false, "autoReleaseAssets": false,
"_id": "6c351889-b6c8-409f-b36c-4263b06d0b23" "_id": "c2dec4ed-8129-40a2-9a1e-2440da772015"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
@ -78,10 +78,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 47 "__id__": 39
}, },
{ {
"__id__": 48 "__id__": 40
} }
], ],
"_prefab": null, "_prefab": null,
@ -251,7 +251,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 46 "__id__": 38
} }
], ],
"_prefab": null, "_prefab": null,
@ -428,7 +428,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Sliders", "_name": "Controller",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 5 "__id__": 5
@ -497,7 +497,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "RoundCornerRadiusSlider", "_name": "RadiusSlider",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 9 "__id__": 9
@ -632,6 +632,33 @@
"groupIndex": 0, "groupIndex": 0,
"_id": "d9MLgZpaFCEZu70E0LAUbn" "_id": "d9MLgZpaFCEZu70E0LAUbn"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0.75,
"_top": 10,
"_bottom": 10,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": false,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 113.38,
"_originalHeight": 50.4,
"_id": "bep2S1v8FL15W8eBH2S6xE"
},
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
"_name": "SliderDescLabel<Label>", "_name": "SliderDescLabel<Label>",
@ -662,33 +689,6 @@
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "f4Hg8I+RhEqbWOBkEEOcYc" "_id": "f4Hg8I+RhEqbWOBkEEOcYc"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0.75,
"_top": 10,
"_bottom": 10,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": false,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 113.38,
"_originalHeight": 50.4,
"_id": "bep2S1v8FL15W8eBH2S6xE"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Slider", "_name": "Slider",
@ -826,6 +826,33 @@
"groupIndex": 0, "groupIndex": 0,
"_id": "02yVtZR3lIzoNcrUCehx6Z" "_id": "02yVtZR3lIzoNcrUCehx6Z"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 20,
"_bottom": 20,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 300,
"_originalHeight": 20,
"_id": "a8XR8fvBlFoJGwBW/efzNI"
},
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "Background<Sprite>", "_name": "Background<Sprite>",
@ -858,33 +885,6 @@
"_atlas": null, "_atlas": null,
"_id": "e3nPQVLp1EHbdxQFE+WpWs" "_id": "e3nPQVLp1EHbdxQFE+WpWs"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 20,
"_bottom": 20,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 300,
"_originalHeight": 20,
"_id": "a8XR8fvBlFoJGwBW/efzNI"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Handle", "_name": "Handle",
@ -1213,8 +1213,8 @@
} }
], ],
"_useOriginalSize": false, "_useOriginalSize": false,
"_string": "0.10", "_string": "40 px",
"_N$string": "0.10", "_N$string": "40 px",
"_fontSize": 40, "_fontSize": 40,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": true, "_enableWrapText": true,
@ -1332,27 +1332,15 @@
}, },
{ {
"__id__": 34 "__id__": 34
},
{
"__id__": 36
},
{
"__id__": 38
},
{
"__id__": 40
},
{
"__id__": 42
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 44 "__id__": 36
}, },
{ {
"__id__": 45 "__id__": 37
} }
], ],
"_prefab": null, "_prefab": null,
@ -1367,7 +1355,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 384, "width": 384,
"height": 629.73 "height": 564
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1403,100 +1391,6 @@
"groupIndex": 0, "groupIndex": 0,
"_id": "feymBChPxA1pr6+/rlPqey" "_id": "feymBChPxA1pr6+/rlPqey"
}, },
{
"__type__": "cc.Node",
"_name": "ball_0",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 31
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-30,
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": "49czqIEPBHr6kLJbb+kN8/"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"_materials": [
{
"__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d0b78623-4e79-4de1-b1d2-ea211bf4652c"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "94vIBMHVlAN4EGbkr2wRvX"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "freedom", "_name": "freedom",
@ -1508,7 +1402,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 33 "__id__": 31
} }
], ],
"_prefab": null, "_prefab": null,
@ -1564,12 +1458,12 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 32 "__id__": 30
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
{ {
"__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310" "__uuid__": "a86e8864-5390-443f-b41b-b38e9d584c43"
} }
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
@ -1593,7 +1487,101 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "cocos_logo", "_name": "Rectangle1",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 33
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-302,
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": "a0HbL8/C1NmJbvH7DR0kSR"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
},
"_enabled": true,
"_materials": [
{
"__uuid__": "a86e8864-5390-443f-b41b-b38e9d584c43"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "891NupVCtA5KuUmMhTWTFR"
},
{
"__type__": "cc.Node",
"_name": "Rectangle2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 29 "__id__": 29
@ -1611,13 +1599,13 @@
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 195, "width": 100,
"height": 270 "height": 200
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1629,7 +1617,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-387, -464,
0, 0,
0, 0,
0, 0,
@ -1651,7 +1639,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "25JHa6EcNEBZ1hoesQM1Q4" "_id": "b2dxodxDhKIKI1B+xcyctT"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
@ -1663,16 +1651,16 @@
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
{ {
"__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310" "__uuid__": "a86e8864-5390-443f-b41b-b38e9d584c43"
} }
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "31bc895a-c003-4566-a9f3-2e54ae1c17dc" "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1683,381 +1671,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "74+WCqN01NIbcSpr5gcxmE" "_id": "f6RC9ehGJIPpjJ7MpS4om/"
},
{
"__type__": "cc.Node",
"_name": "ball_1",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 37
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-564,
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": "08wsP0gQdCnrq+UzPWkn0+"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
},
"_enabled": true,
"_materials": [
{
"__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "969fa66a-ae10-4157-b16e-4c1a4665920c"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "4bH5hzKe9LsLQeXjLynIHQ"
},
{
"__type__": "cc.Node",
"_name": "SystemFont",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 39
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 224.51,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-559.2,
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": "5dfIaYLgJPQKk50HqrgyHI"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 38
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "System Font",
"_N$string": "System Font",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "d1whc7H8RHdrROcYj+2Qh1"
},
{
"__type__": "cc.Node",
"_name": "video_btn",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 41
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 50,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-631,
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": "c73V7fMuVE0aD5fGtmyzmF"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 40
},
"_enabled": true,
"_materials": [
{
"__uuid__": "642c2d0e-7eb6-4d65-96f2-d6e0d0305310"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "54142b08-a163-426e-a75e-4c7b21046413"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f43fJCjNdOS5VHAEhp0yDU"
},
{
"__type__": "cc.Node",
"_name": "BmFont",
"_objFlags": 0,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 43
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 167.5,
"height": 33.33
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-613.065,
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": "e4XmdmRoVPxKoDxfbOgm42"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 42
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "BM Font",
"_N$string": "BM Font",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "4c95de7e-8cca-47bf-a446-47b7594e0992"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "7cXLgoUJhDP7BPjr4yx+Ep"
}, },
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
@ -2097,7 +1711,7 @@
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 384, "width": 384,
"height": 629.73 "height": 564
}, },
"_resize": 1, "_resize": 1,
"_N$layoutType": 2, "_N$layoutType": 2,
@ -2147,13 +1761,13 @@
"_id": "4bz2+ak99DBYVlSVIMFGN0" "_id": "4bz2+ak99DBYVlSVIMFGN0"
}, },
{ {
"__type__": "d3d2b7nIXNDbKEclKMbIFTC", "__type__": "24bbee6XR5C2bLd8hn++QNn",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 2 "__id__": 2
}, },
"_enabled": true, "_enabled": true,
"_id": "9ayfD37bZP1IEjPxGKO6+/" "_id": "4dVJgUbN1DNLxYDQbGjRhE"
} }
] ]

View File

@ -1,6 +1,6 @@
{ {
"ver": "1.2.5", "ver": "1.2.5",
"uuid": "a2b4bb7d-94e6-4c58-a455-1d0f28d54666", "uuid": "c2dec4ed-8129-40a2-9a1e-2440da772015",
"asyncLoadAssets": false, "asyncLoadAssets": false,
"autoReleaseAssets": false, "autoReleaseAssets": false,
"subMetas": {} "subMetas": {}

View File

@ -34,7 +34,7 @@ export default class RoundCornerCropV1EffectScene extends cc.Component {
// 更新材质 // 更新材质
this._updateRenderComponentMaterial({ this._updateRenderComponentMaterial({
roundCornerRadius: this._radiuSlider.progress radius: this._radiuSlider.progress
}); });
} }
@ -49,12 +49,12 @@ export default class RoundCornerCropV1EffectScene extends cc.Component {
/** /**
* [0.0, 0.5] 0.5 * [0.0, 0.5] 0.5
*/ */
roundCornerRadius: number; radius: number;
}) { }) {
this._examplesParentNode.children.forEach(childNode => { this._examplesParentNode.children.forEach(childNode => {
childNode.getComponents(cc.RenderComponent).forEach(renderComponent => { childNode.getComponents(cc.RenderComponent).forEach(renderComponent => {
let material: cc.Material = renderComponent.getMaterial(0); let material: cc.Material = renderComponent.getMaterial(0);
material.setProperty("radius", param.roundCornerRadius); material.setProperty("radius", param.radius);
renderComponent.setMaterial(0, material); renderComponent.setMaterial(0, material);
}); });
}); });

View File

@ -0,0 +1,78 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class RoundCornerCropV2EffectScene extends cc.Component {
private _radiuSlider: cc.Slider = null;
private _radiuLabel: cc.Label = null;
private _examplesParentNode: cc.Node = null;
onLoad() {
// 关闭动态合图
cc.dynamicAtlasManager.enabled = false;
this._radiuSlider = cc.find("Canvas/Content/Controller/RadiusSlider/Slider").getComponent(cc.Slider);
this._radiuLabel = cc.find("Canvas/Content/Controller/RadiusSlider/ValueLabel").getComponent(cc.Label);
this._examplesParentNode = cc.find("Canvas/Content/Examples");
}
onEnable() {
this._radiuSlider.node.on("slide", this._onSliderChanged, this);
}
onDisable() {
this._radiuSlider.node.off("slide", this._onSliderChanged, this);
}
start() {
this._onSliderChanged();
}
private _onSliderChanged() {
// 计算半径px
let radiusInPx = Math.floor(100 * this._radiuSlider.progress);
this._radiuLabel.string = radiusInPx + "";
// 更新材质
this._updateRenderComponentMaterial({
radiusInPx: radiusInPx
});
}
/**
*
*
* 1.
* 2. unitform
* 3.
*/
private _updateRenderComponentMaterial(param: {
/**
* px
*/
radiusInPx: number;
}) {
this._examplesParentNode.children.forEach(childNode => {
childNode.getComponents(cc.RenderComponent).forEach(renderComponent => {
// 计算半径px分别相对于纹理宽高的比例也叫归一化
let xRadiux = param.radiusInPx / renderComponent.node.width;
// 约束范围在区间 [0.0, 0.5]
xRadiux = xRadiux >= 0.5 ? 0.5 : xRadiux;
let yRadius = param.radiusInPx / renderComponent.node.height;
yRadius = yRadius >= 0.5 ? 0.5 : yRadius;
// 更新材质
let material: cc.Material = renderComponent.getMaterial(0);
// 圆角x轴半径长度相对于纹理宽度[0.0, 0.5]
material.setProperty("xRadius", xRadiux);
// 圆角y轴半径长度相对于纹理高度[0.0, 0.5]
material.setProperty("yRadius", yRadius);
renderComponent.setMaterial(0, material);
});
});
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "24bbe7ba-5d1e-42d9-b2dd-f219fef90367",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}