Commit f2ab8408 authored by liujiangnan's avatar liujiangnan

feat: play

parent 015dcb32
...@@ -73,24 +73,18 @@ ...@@ -73,24 +73,18 @@
}, },
{ {
"__id__": 5 "__id__": 5
},
{
"__id__": 7
},
{
"__id__": 14
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 29
}, },
{ {
"__id__": 25 "__id__": 30
}, },
{ {
"__id__": 26 "__id__": 31
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -246,11 +240,21 @@ ...@@ -246,11 +240,21 @@
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [
{
"__id__": 6
},
{
"__id__": 25
}
],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 6 "__id__": 27
},
{
"__id__": 28
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -302,54 +306,101 @@ ...@@ -302,54 +306,101 @@
"_id": "32MJMZ2HRGF4BOf533Avyi" "_id": "32MJMZ2HRGF4BOf533Avyi"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Node",
"_name": "", "_name": "L1",
"_objFlags": 0, "_objFlags": 0,
"node": { "_parent": {
"__id__": 5 "__id__": 5
}, },
"_enabled": true, "_children": [
"_materials": [
{ {
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" "__id__": 7
},
{
"__id__": 12
},
{
"__id__": 16
},
{
"__id__": 20
} }
], ],
"_srcBlendFactor": 770, "_active": true,
"_dstBlendFactor": 771, "_components": [
"_spriteFrame": { {
"__uuid__": "8288e3d4-4c75-4b27-8f01-f7014417f4dd" "__id__": 24
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}, },
"_type": 0, "_contentSize": {
"_sizeMode": 1, "__type__": "cc.Size",
"_fillType": 0, "width": 1280,
"_fillCenter": { "height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2", "__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, "x": 0,
"y": 0 "y": 0,
"z": 0
}, },
"_fillStart": 0, "_skewX": 0,
"_fillRange": 0, "_skewY": 0,
"_isTrimmedMode": true, "_is3DNode": false,
"_atlas": null, "_groupIndex": 0,
"_id": "97/S6HDq9MeqgmV1Zwnhbb" "groupIndex": 0,
"_id": "56mj9gSZpIvJcxqdP03fpc"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bottomPart", "_name": "box",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 6
}, },
"_children": [ "_children": [
{ {
"__id__": 8 "__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 10
}, },
{ {
"__id__": 11 "__id__": 11
} }
], ],
"_active": true,
"_components": [],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -361,8 +412,8 @@ ...@@ -361,8 +412,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 714,
"height": 0 "height": 386
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -373,8 +424,8 @@ ...@@ -373,8 +424,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
635.132, 216.56500000000005,
-356.326, 132.526,
0, 0,
0, 0,
0, 0,
...@@ -396,11 +447,11 @@ ...@@ -396,11 +447,11 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "8c7k8ep/ZFNpO263+1QHz9" "_id": "3eWBKuieFPtYom+iNzqcGf"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_left", "_name": "title",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 7
...@@ -410,9 +461,6 @@ ...@@ -410,9 +461,6 @@
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 9
},
{
"__id__": 10
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -426,20 +474,20 @@ ...@@ -426,20 +474,20 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 61, "width": 350,
"height": 67 "height": 180.8
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": 0,
"y": 0.5 "y": 1
}, },
"_trs": { "_trs": {
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-148.464, -281.01,
34, 68.082,
0, 0,
0, 0,
0, 0,
...@@ -461,10 +509,10 @@ ...@@ -461,10 +509,10 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "5ad2wLQLxIN5Eg7OHecSH6" "_id": "18zT8SA6VNKoOcgj+02wzq"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Label",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
...@@ -478,8 +526,41 @@ ...@@ -478,8 +526,41 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "猩猩有个苹果。\n他想要什么?",
"_N$string": "猩猩有个苹果。\n他想要什么?",
"_fontSize": 50,
"_lineHeight": 80,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "4cqBtwIylAT7Qlu3fC5h8/"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5" "__uuid__": "81e601a7-2eaf-4de6-8590-d5646880abea"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -493,91 +574,53 @@ ...@@ -493,91 +574,53 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "84mqOgJ3JNqZrYVTEU8CjE" "_id": "59i1zYHJ5B+I9F/+oIWWnR"
}, },
{ {
"__type__": "cc.Button", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 7
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "alignMode": 1,
"_grayMaterial": null, "_target": null,
"duration": 0.1, "_alignFlags": 32,
"zoomScale": 1.2, "_left": 0,
"clickEvents": [], "_right": 66.43499999999995,
"_N$interactable": true, "_top": 34.47399999999999,
"_N$enableAutoGrayEffect": false, "_bottom": 0,
"_N$transition": 0, "_verticalCenter": 0,
"transition": 0, "_horizontalCenter": 0,
"_N$normalColor": { "_isAbsLeft": true,
"__type__": "cc.Color", "_isAbsRight": true,
"r": 255, "_isAbsTop": true,
"g": 255, "_isAbsBottom": true,
"b": 255, "_isAbsHorizontalCenter": true,
"a": 255 "_isAbsVerticalCenter": true,
}, "_originalWidth": 0,
"_N$pressedColor": { "_originalHeight": 0,
"__type__": "cc.Color", "_id": "85UeamOldJ3LdQv6cbs3Hu"
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "bcYN/4EKBJhbIAfovo9Ah1"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_right", "_name": "kdh",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 6
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 12 "__id__": 13
}, },
{ {
"__id__": 13 "__id__": 14
},
{
"__id__": 15
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -591,8 +634,8 @@ ...@@ -591,8 +634,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 60, "width": 191,
"height": 66 "height": 224
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -603,8 +646,8 @@ ...@@ -603,8 +646,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-47.164, -17,
34, -237,
0, 0,
0, 0,
0, 0,
...@@ -626,14 +669,14 @@ ...@@ -626,14 +669,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "46i3stdzpHX6zQHTGnRsNE" "_id": "c2fj4Gem1LN6+rsjCRiJQJ"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -644,7 +687,7 @@ ...@@ -644,7 +687,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59" "__uuid__": "49443929-b04e-402e-ae5f-0cdcfb302204"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -658,14 +701,41 @@ ...@@ -658,14 +701,41 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "42Sh8QS/BHn4WiGyPQPKPt" "_id": "e0/ExHd0RG9JaZ5ItH036y"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 4,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 11,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "71+ldUI+NMD7/XpgYxYK6L"
}, },
{ {
"__type__": "cc.Button", "__type__": "cc.Button",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -725,29 +795,31 @@ ...@@ -725,29 +795,31 @@
"_N$hoverSprite": null, "_N$hoverSprite": null,
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": null, "_N$target": {
"_id": "1aj32fYY1IxLesa77E70Qu" "__id__": 12
},
"_id": "3cl54y78pGh7GzyRwC6XUa"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "res", "_name": "dgs",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 6
}, },
"_children": [ "_children": [],
{ "_active": true,
"__id__": 15 "_components": [
{
"__id__": 17
}, },
{ {
"__id__": 18 "__id__": 18
}, },
{ {
"__id__": 21 "__id__": 19
} }
], ],
"_active": false,
"_components": [],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -759,8 +831,8 @@ ...@@ -759,8 +831,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 184,
"height": 0 "height": 202
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -771,8 +843,8 @@ ...@@ -771,8 +843,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 223,
0, -248,
0, 0,
0, 0,
0, 0,
...@@ -794,237 +866,155 @@ ...@@ -794,237 +866,155 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "0aAzbH6R1E+6AmGRrkKa5O" "_id": "77jL+nv75FDKGow3wQJSQI"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Sprite",
"_name": "font", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "node": {
"__id__": 14 "__id__": 16
}, },
"_children": [ "_enabled": true,
"_materials": [
{ {
"__id__": 16 "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
} }
], ],
"_active": true, "_srcBlendFactor": 770,
"_components": [], "_dstBlendFactor": 771,
"_prefab": null, "_spriteFrame": {
"_opacity": 255, "__uuid__": "5cbd958b-cbff-4604-809a-aed9cf037764"
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
}, },
"_anchorPoint": { "_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2", "__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, "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": "1fS7ZpS3tIbIPhwysyrqcT"
"_id": "9bLfcYeeNKrr524vzWchiM"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Widget",
"_name": "BRLNSDB", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "node": {
"__id__": 15 "__id__": 16
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
}
],
"_prefab": null,
"_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, "_enabled": true,
"_skewY": 0, "alignMode": 1,
"_is3DNode": false, "_target": null,
"_groupIndex": 0, "_alignFlags": 4,
"groupIndex": 0, "_left": 0,
"_id": "cfMLGsq0BMhJARv+ySMAxS" "_right": 0,
"_top": 0,
"_bottom": 11,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "1cPe1yDxlDeLSQbMcUOC2c"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Button",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 16 "__id__": 16
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_normalMaterial": null,
"_srcBlendFactor": 770, "_grayMaterial": null,
"_dstBlendFactor": 771, "duration": 0.1,
"_string": "", "zoomScale": 1.2,
"_N$string": "", "clickEvents": [],
"_fontSize": 40, "_N$interactable": true,
"_lineHeight": 40, "_N$enableAutoGrayEffect": false,
"_enableWrapText": true, "_N$transition": 0,
"_N$file": { "transition": 0,
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1" "_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}, },
"_isSystemFontUsed": false, "_N$pressedColor": {
"_spacingX": 0, "__type__": "cc.Color",
"_batchAsBitmap": false, "r": 211,
"_styleFlags": 0, "g": 211,
"_underlineHeight": 0, "b": 211,
"_N$horizontalAlign": 0, "a": 255
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY"
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 14
}, },
"_children": [ "pressedColor": {
{ "__type__": "cc.Color",
"__id__": 19 "r": 211,
} "g": 211,
], "b": 211,
"_active": true, "a": 255
"_components": [], },
"_prefab": null, "_N$hoverColor": {
"_opacity": 255,
"_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 255 "a": 255
}, },
"_contentSize": { "hoverColor": {
"__type__": "cc.Size", "__type__": "cc.Color",
"width": 0, "r": 255,
"height": 0 "g": 255,
}, "b": 255,
"_anchorPoint": { "a": 255
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
}, },
"_trs": { "_N$disabledColor": {
"__type__": "TypedArray", "__type__": "cc.Color",
"ctor": "Float64Array", "r": 124,
"array": [ "g": 124,
0, "b": 124,
0, "a": 255
0,
0,
0,
0,
1,
1,
1,
1
]
}, },
"_eulerAngles": { "_N$normalSprite": null,
"__type__": "cc.Vec3", "_N$pressedSprite": null,
"x": 0, "pressedSprite": null,
"y": 0, "_N$hoverSprite": null,
"z": 0 "hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 16
}, },
"_skewX": 0, "_id": "6acK64wVhOAbLiZEmUtwWJ"
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "53LUHHG2pEr79fyrvazXJs"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "icon", "_name": "qpy",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 18 "__id__": 6
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 20 "__id__": 21
},
{
"__id__": 22
},
{
"__id__": 23
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1038,8 +1028,8 @@ ...@@ -1038,8 +1028,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 138, "width": 186,
"height": 141 "height": 219
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1050,8 +1040,8 @@ ...@@ -1050,8 +1040,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 463,
0, -240,
0, 0,
0, 0,
0, 0,
...@@ -1073,21 +1063,25 @@ ...@@ -1073,21 +1063,25 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "1blU2OArJIfoC9XfupGxJG" "_id": "b2ZaAJAqtJrLxZSgHStFL+"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 19 "__id__": 20
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a" "__uuid__": "da19d2ee-1811-4cbf-bc02-b433946f3292"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -1101,82 +1095,144 @@ ...@@ -1101,82 +1095,144 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM" "_id": "fbAQkAkwVJ84nEdrf9WK8U"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Widget",
"_name": "audio", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "node": {
"__id__": 14 "__id__": 20
}, },
"_children": [ "_enabled": true,
{ "alignMode": 1,
"__id__": 22 "_target": null,
} "_alignFlags": 4,
], "_left": 0,
"_active": true, "_right": 0,
"_components": [], "_top": 0,
"_prefab": null, "_bottom": 10.5,
"_opacity": 255, "_verticalCenter": 0,
"_color": { "_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "922ATDm3RJ36pB0Zprzfa+"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 255 "a": 255
}, },
"_contentSize": { "_N$pressedColor": {
"__type__": "cc.Size", "__type__": "cc.Color",
"width": 0, "r": 211,
"height": 0 "g": 211,
"b": 211,
"a": 255
}, },
"_anchorPoint": { "pressedColor": {
"__type__": "cc.Vec2", "__type__": "cc.Color",
"x": 0.5, "r": 211,
"y": 0.5 "g": 211,
"b": 211,
"a": 255
}, },
"_trs": { "_N$hoverColor": {
"__type__": "TypedArray", "__type__": "cc.Color",
"ctor": "Float64Array", "r": 255,
"array": [ "g": 255,
0, "b": 255,
0, "a": 255
0,
0,
0,
0,
1,
1,
1,
1
]
}, },
"_eulerAngles": { "hoverColor": {
"__type__": "cc.Vec3", "__type__": "cc.Color",
"x": 0, "r": 255,
"y": 0, "g": 255,
"z": 0 "b": 255,
"a": 255
}, },
"_skewX": 0, "_N$disabledColor": {
"_skewY": 0, "__type__": "cc.Color",
"_is3DNode": false, "r": 124,
"_groupIndex": 0, "g": 124,
"groupIndex": 0, "b": 124,
"_id": "d9f+b0lmZGSJJae6zrADhp" "a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 20
},
"_id": "29RvRx27JGjoTI88DWu+TZ"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "adtip2P31MxKgLmCFT8tgT"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn", "_name": "bookImg",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 21 "__id__": 5
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 26
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1190,8 +1246,8 @@ ...@@ -1190,8 +1246,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 450,
"height": 0 "height": 600
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1202,7 +1258,7 @@ ...@@ -1202,7 +1258,7 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, -352.121,
0, 0,
0, 0,
0, 0,
...@@ -1225,26 +1281,93 @@ ...@@ -1225,26 +1281,93 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "e87DSaFCVJfb2PAUkf4/o7" "_id": "fcQ83I201BUYpiHw346tT3"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 13,
"_left": 62.87900000000002,
"_right": 0,
"_top": 60,
"_bottom": 60,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 600,
"_id": "f95qipqS9MPYtPkUAMbgiy"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "364e35df-3e01-4bdc-991a-38c8c9b0bfbd"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "97/S6HDq9MeqgmV1Zwnhbb"
}, },
{ {
"__type__": "cc.AudioSource", "__type__": "cc.Widget",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_clip": { "alignMode": 1,
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b" "_target": null,
}, "_alignFlags": 45,
"_volume": 1, "_left": 0,
"_mute": false, "_right": 0,
"_loop": false, "_top": 0,
"_firstlyEnabled": true, "_bottom": 0,
"playOnLoad": false, "_verticalCenter": 0,
"preload": false, "_horizontalCenter": 0,
"_id": "dey05oKrBIspvsDa6pOIQz" "_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "d00dRF8phOsKfN6OVXilS0"
}, },
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
......
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
// this._imageResList.push({ url: this.data.pic_url });
// this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
// this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
}
async onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initListener();
}
initListener() {
}
}
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b", "uuid": "e41edb16-84b7-4115-b7e3-3bb968da4f19",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"subMetas": { "subMetas": {
"bg": { "bg": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "364e35df-3e01-4bdc-991a-38c8c9b0bfbd",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "e41edb16-84b7-4115-b7e3-3bb968da4f19",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "uuid": "b0c127b5-bf06-4ae7-bb49-fe26c4a030f8",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 714,
"height": 67, "height": 386,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "box_1": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "81e601a7-2eaf-4de6-8590-d5646880abea",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "b0c127b5-bf06-4ae7-bb49-fe26c4a030f8",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 61, "width": 714,
"height": 67, "height": 386,
"rawWidth": 61, "rawWidth": 714,
"rawHeight": 67, "rawHeight": 386,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "1ce81038-f15b-4b11-b3ff-c8ec127f9ead",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 366, "width": 714,
"height": 336, "height": 386,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "box_2": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "abb708b3-bf09-4129-8c52-4e0c2667d52f",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "1ce81038-f15b-4b11-b3ff-c8ec127f9ead",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": -0.5, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 1, "trimY": 0,
"width": 366, "width": 714,
"height": 335, "height": 386,
"rawWidth": 366, "rawWidth": 714,
"rawHeight": 336, "rawHeight": 386,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "uuid": "b67d6811-83d4-4042-ac62-185575fcf8d8",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 714,
"height": 67, "height": 386,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_right": { "box_3": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59", "uuid": "9a6b35fb-f805-48ac-9e66-65c38ea8e71d",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "rawTextureUuid": "b67d6811-83d4-4042-ac62-185575fcf8d8",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": -0.5, "offsetX": 0,
"offsetY": 0.5, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 60, "width": 714,
"height": 66, "height": 386,
"rawWidth": 61, "rawWidth": 714,
"rawHeight": 67, "rawHeight": 386,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "2aeb0b3a-7734-41d2-8ec8-5347e658f900",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 714,
"height": 386,
"platformSettings": {},
"subMetas": {
"box_4": {
"ver": "1.0.4",
"uuid": "f2dffd48-fc23-4341-a2de-30b6d45aa14e",
"rawTextureUuid": "2aeb0b3a-7734-41d2-8ec8-5347e658f900",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 714,
"height": 386,
"rawWidth": 714,
"rawHeight": 386,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "fe980f05-bcb7-4174-bf12-8cc88874005b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 714,
"height": 386,
"platformSettings": {},
"subMetas": {
"box_5": {
"ver": "1.0.4",
"uuid": "177759b9-f847-47f2-aa0c-f81c639e4504",
"rawTextureUuid": "fe980f05-bcb7-4174-bf12-8cc88874005b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 714,
"height": 386,
"rawWidth": 714,
"rawHeight": 386,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "68a4f747-cd68-474a-a94d-8b1b14fbe578",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 184,
"height": 202,
"platformSettings": {},
"subMetas": {
"dgs_1": {
"ver": "1.0.4",
"uuid": "5cbd958b-cbff-4604-809a-aed9cf037764",
"rawTextureUuid": "68a4f747-cd68-474a-a94d-8b1b14fbe578",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 184,
"height": 202,
"rawWidth": 184,
"rawHeight": 202,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a8e52f0e-846a-48bd-85ef-cf65fe14231a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 191,
"height": 224,
"platformSettings": {},
"subMetas": {
"kdh_1": {
"ver": "1.0.4",
"uuid": "49443929-b04e-402e-ae5f-0cdcfb302204",
"rawTextureUuid": "a8e52f0e-846a-48bd-85ef-cf65fe14231a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 191,
"height": 224,
"rawWidth": 191,
"rawHeight": 224,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d4999af2-0b7c-4d8c-b0d0-6d8f17d6bc45",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 186,
"height": 219,
"platformSettings": {},
"subMetas": {
"qpy_1": {
"ver": "1.0.4",
"uuid": "da19d2ee-1811-4cbf-bc02-b433946f3292",
"rawTextureUuid": "d4999af2-0b7c-4d8c-b0d0-6d8f17d6bc45",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 186,
"height": 219,
"rawWidth": 186,
"rawHeight": 219,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
}
onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
this.initBg();
this.initPic();
this.initBtn();
this.initIcon();
}
initBg() {
const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax;
}
pic1 = null;
pic2 = null;
initPic() {
const canvas = cc.find('Canvas');
const maxW = canvas.width * 0.7;
this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
const picNode1 = sprNode;
picNode1.scale = maxW / picNode1.width;
picNode1.baseX = picNode1.x;
canvas.addChild(picNode1);
this.pic1 = picNode1;
const labelNode = new cc.Node();
labelNode.color = cc.Color.YELLOW;
const label = labelNode.addComponent(cc.Label);
label.string = this.data.text;
label.fontSize = 60;
label.lineHeight = 60;
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
picNode1.addChild(labelNode);
});
this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
const picNode2 = sprNode;
picNode2.scale = maxW / picNode2.width;
canvas.addChild(picNode2);
picNode2.x = canvas.width;
picNode2.baseX = picNode2.x;
this.pic2 = picNode2;
const labelNode = new cc.Node();
const label = labelNode.addComponent(cc.RichText);
const size = 60
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font;
label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>`
label.lineHeight = size;
picNode2.addChild(labelNode);
});
}
initIcon() {
const iconNode = this.getSprNode('icon');
iconNode.zIndex = 5;
iconNode.anchorX = 1;
iconNode.anchorY = 1;
iconNode.parent = cc.find('Canvas');
iconNode.x = iconNode.parent.width / 2 - 10;
iconNode.y = iconNode.parent.height / 2 - 10;
iconNode.on(cc.Node.EventType.TOUCH_START, () => {
this.playAudioByUrl(this.data.audio_url);
})
}
curPage = null;
initBtn() {
this.curPage = 0;
const bottomPart = cc.find('Canvas/bottomPart');
bottomPart.zIndex = 5; // 提高层级
bottomPart.x = bottomPart.parent.width / 2;
bottomPart.y = -bottomPart.parent.height / 2;
const leftBtnNode = bottomPart.getChildByName('btn_left');
//节点中添加了button组件 则可以添加click事件监听
leftBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 0) {
return;
}
this.curPage = 0
this.leftMove();
this.playLocalAudio('btn');
})
const rightBtnNode = bottomPart.getChildByName('btn_right');
//节点中添加了button组件 则可以添加click事件监听
rightBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 1) {
return;
}
this.curPage = 1
this.rightMove();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish();
this.playLocalAudio('btn');
})
}
leftMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
}
rightMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
}
// update (dt) {},
initListener() {
}
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
}
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"platformSettings": {},
"subMetas": {
"icon": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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