Commit 68fb93cd authored by Tt's avatar Tt

基础部分完成

parent 0c5eb5b6
......@@ -81,37 +81,40 @@
"__id__": 46
},
{
"__id__": 48
"__id__": 47
},
{
"__id__": 50
"__id__": 49
},
{
"__id__": 54
"__id__": 51
},
{
"__id__": 68
"__id__": 59
},
{
"__id__": 73
"__id__": 77
},
{
"__id__": 78
"__id__": 82
},
{
"__id__": 86
"__id__": 87
},
{
"__id__": 95
}
],
"_active": true,
"_components": [
{
"__id__": 102
"__id__": 111
},
{
"__id__": 103
"__id__": 112
},
{
"__id__": 104
"__id__": 113
}
],
"_prefab": null,
......@@ -2099,6 +2102,64 @@
"_atlas": null,
"_id": "1dB9jUoQdHKJ3b1z6VMQGF"
},
{
"__type__": "cc.Node",
"_name": "layout_items",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [],
"_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": [
4.448,
12.336,
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": "e1jCjaDd9Kxan+6NOgs4Rm"
},
{
"__type__": "cc.Node",
"_name": "layout_battery_left",
......@@ -2110,7 +2171,7 @@
"_active": true,
"_components": [
{
"__id__": 47
"__id__": 48
}
],
"_prefab": null,
......@@ -2166,7 +2227,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
"__id__": 47
},
"_enabled": true,
"alignMode": 1,
......@@ -2199,7 +2260,7 @@
"_active": true,
"_components": [
{
"__id__": 49
"__id__": 50
}
],
"_prefab": null,
......@@ -2255,7 +2316,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 48
"__id__": 49
},
"_enabled": true,
"alignMode": 1,
......@@ -2286,7 +2347,10 @@
},
"_children": [
{
"__id__": 51
"__id__": 52
},
{
"__id__": 55
}
],
"_active": false,
......@@ -2314,8 +2378,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-825,
280,
808.352,
242.015,
0,
0,
0,
......@@ -2344,11 +2408,11 @@
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 51
},
"_children": [
{
"__id__": 52
"__id__": 53
}
],
"_active": true,
......@@ -2406,13 +2470,13 @@
"_name": "img_ battery001",
"_objFlags": 0,
"_parent": {
"__id__": 51
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 53
"__id__": 54
}
],
"_prefab": null,
......@@ -2468,7 +2532,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 52
"__id__": 53
},
"_enabled": true,
"_materials": [
......@@ -2497,95 +2561,22 @@
},
{
"__type__": "cc.Node",
"_name": "item_battery_text",
"_name": "item_img",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 51
},
"_children": [
{
"__id__": 55
"__id__": 56
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 290,
"height": 140
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-825,
280,
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": "abW1u6FilEDbHPOKEYHaw2"
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 54
},
"_children": [
{
"__id__": 56
},
"_active": true,
"_components": [
{
"__id__": 58
},
{
"__id__": 60
},
{
"__id__": 62
},
{
"__id__": 64
},
{
"__id__": 66
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -2597,8 +2588,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 270,
"height": 180
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2609,8 +2600,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
2.467,
-20.732,
0,
0,
0,
......@@ -2632,17 +2623,17 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "48IafkIxBMbLTmRTSwwHrn"
"_id": "60qjsocf9EyaEvREbcu+6z"
},
{
"__type__": "cc.Node",
"_name": "img_battery6",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 57
......@@ -2659,8 +2650,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 281,
"height": 140
"width": 270,
"height": 180
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2694,7 +2685,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a2uRW76TxNeIKScxe1eFBh"
"_id": "c23J4FiPhBA5SlmGzdYpPt"
},
{
"__type__": "cc.Sprite",
......@@ -2712,10 +2703,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d07aabdb-0171-4f0e-b866-86a11a2ee5f8"
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -2724,24 +2715,95 @@
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_isTrimmedMode": false,
"_atlas": null,
"_id": "20AN3Hw79C2qOJEE49hHmS"
"_id": "cdoIZfETNMSIcYK//iUNxr"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
},
"_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",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"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": "45DjO3ALdEv7jTOjqtqpcS"
},
{
"__type__": "cc.Node",
"_name": "img_battery4",
"_name": "item_battery_text",
"_objFlags": 0,
"_parent": {
"__id__": 55
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
"_children": [
{
"__id__": 59
"__id__": 60
},
{
"__id__": 73
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -2753,7 +2815,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 281,
"width": 290,
"height": 140
},
"_anchorPoint": {
......@@ -2765,8 +2827,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
-825,
280,
0,
0,
0,
......@@ -2788,14 +2850,247 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "6a2NnEhcpNMJAb3u3rrjma"
"_id": "abW1u6FilEDbHPOKEYHaw2"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 59
},
"_children": [
{
"__id__": 61
},
{
"__id__": 63
},
{
"__id__": 65
},
{
"__id__": 67
},
{
"__id__": 69
},
{
"__id__": 71
}
],
"_active": true,
"_components": [],
"_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,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "48IafkIxBMbLTmRTSwwHrn"
},
{
"__type__": "cc.Node",
"_name": "img_battery6",
"_objFlags": 0,
"_parent": {
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 62
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 281,
"height": 140
},
"_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": "a2uRW76TxNeIKScxe1eFBh"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 58
"__id__": 61
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d07aabdb-0171-4f0e-b866-86a11a2ee5f8"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "20AN3Hw79C2qOJEE49hHmS"
},
{
"__type__": "cc.Node",
"_name": "img_battery4",
"_objFlags": 0,
"_parent": {
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 64
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 281,
"height": 140
},
"_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": "6a2NnEhcpNMJAb3u3rrjma"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
},
"_enabled": true,
"_materials": [
......@@ -2827,13 +3122,107 @@
"_name": "img_battery5",
"_objFlags": 0,
"_parent": {
"__id__": 55
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 61
"__id__": 66
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 281,
"height": 140
},
"_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": "d7x5Wkr01B4bXDJqHhqFMk"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1037f84a-4788-4011-a067-9034dc7bbb2f"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "fascYDbU1Egra7urQJmSbQ"
},
{
"__type__": "cc.Node",
"_name": "img_battery3",
"_objFlags": 0,
"_parent": {
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 68
}
],
"_prefab": null,
......@@ -2882,14 +3271,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d7x5Wkr01B4bXDJqHhqFMk"
"_id": "acABGWU79NjJ6FwfGjGyQQ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
"__id__": 67
},
"_enabled": true,
"_materials": [
......@@ -2900,7 +3289,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1037f84a-4788-4011-a067-9034dc7bbb2f"
"__uuid__": "e4aacec2-9290-4e97-9804-ce17090c69fe"
},
"_type": 0,
"_sizeMode": 1,
......@@ -2914,20 +3303,20 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "fascYDbU1Egra7urQJmSbQ"
"_id": "d4wsgXLMdD+ov2U4mKNK0U"
},
{
"__type__": "cc.Node",
"_name": "img_battery3",
"_name": "img_battery2",
"_objFlags": 0,
"_parent": {
"__id__": 55
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 63
"__id__": 70
}
],
"_prefab": null,
......@@ -2976,14 +3365,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "acABGWU79NjJ6FwfGjGyQQ"
"_id": "aeJICgxppO+Zf7sYW4o0RA"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 62
"__id__": 69
},
"_enabled": true,
"_materials": [
......@@ -2994,7 +3383,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e4aacec2-9290-4e97-9804-ce17090c69fe"
"__uuid__": "d9b6fcf1-5d4c-4d01-99e5-bc40468c1008"
},
"_type": 0,
"_sizeMode": 1,
......@@ -3008,20 +3397,20 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d4wsgXLMdD+ov2U4mKNK0U"
"_id": "a8vAGRqHxBcLH6AxRVtQ8E"
},
{
"__type__": "cc.Node",
"_name": "img_battery2",
"_name": "img_battery1",
"_objFlags": 0,
"_parent": {
"__id__": 55
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 65
"__id__": 72
}
],
"_prefab": null,
......@@ -3070,14 +3459,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "aeJICgxppO+Zf7sYW4o0RA"
"_id": "e2HHus9OZHrrF5PjhVB/zp"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 64
"__id__": 71
},
"_enabled": true,
"_materials": [
......@@ -3088,7 +3477,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d9b6fcf1-5d4c-4d01-99e5-bc40468c1008"
"__uuid__": "c3ff7a71-a8d6-4a48-80d9-926c949d18b6"
},
"_type": 0,
"_sizeMode": 1,
......@@ -3102,20 +3491,86 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a8vAGRqHxBcLH6AxRVtQ8E"
"_id": "eaJ17EsIBDgLiNJzA1UNkd"
},
{
"__type__": "cc.Node",
"_name": "img_battery1",
"_name": "item_text",
"_objFlags": 0,
"_parent": {
"__id__": 55
"__id__": 59
},
"_children": [
{
"__id__": 74
}
],
"_active": true,
"_components": [
{
"__id__": 76
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 210,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-22.035,
-1.581,
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": "eeeLXJZsVFc7X5BeiFC7Aj"
},
{
"__type__": "cc.Node",
"_name": "text",
"_objFlags": 0,
"_parent": {
"__id__": 73
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 67
"__id__": 75
}
],
"_prefab": null,
......@@ -3129,8 +3584,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 281,
"height": 140
"width": 210,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3164,14 +3619,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e2HHus9OZHrrF5PjhVB/zp"
"_id": "4a7hIDDyBO7LepapZekREM"
},
{
"__type__": "cc.Sprite",
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
"__id__": 74
},
"_enabled": true,
"_materials": [
......@@ -3181,22 +3636,91 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "c3ff7a71-a8d6-4a48-80d9-926c949d18b6"
"_string": "Label",
"_N$string": "Label",
"_fontSize": 80,
"_lineHeight": 80,
"_enableWrapText": false,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": "19riTcfoFHC6rIuKU2L2Wo"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 73
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
"_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",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "eaJ17EsIBDgLiNJzA1UNkd"
"_N$pressedColor": {
"__type__": "cc.Color",
"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": "e46vsRgBRJv6d09JTXtX7u"
},
{
"__type__": "cc.Node",
......@@ -3207,10 +3731,10 @@
},
"_children": [
{
"__id__": 69
"__id__": 78
},
{
"__id__": 71
"__id__": 80
}
],
"_active": false,
......@@ -3268,13 +3792,13 @@
"_name": "img_left_1",
"_objFlags": 0,
"_parent": {
"__id__": 68
"__id__": 77
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 70
"__id__": 79
}
],
"_prefab": null,
......@@ -3330,7 +3854,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 78
},
"_enabled": true,
"_materials": [
......@@ -3362,13 +3886,13 @@
"_name": "img_left_2",
"_objFlags": 0,
"_parent": {
"__id__": 68
"__id__": 77
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 81
}
],
"_prefab": null,
......@@ -3424,7 +3948,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 71
"__id__": 80
},
"_enabled": true,
"_materials": [
......@@ -3460,10 +3984,10 @@
},
"_children": [
{
"__id__": 74
"__id__": 83
},
{
"__id__": 76
"__id__": 85
}
],
"_active": false,
......@@ -3521,13 +4045,13 @@
"_name": "img_right_1",
"_objFlags": 0,
"_parent": {
"__id__": 73
"__id__": 82
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 75
"__id__": 84
}
],
"_prefab": null,
......@@ -3583,7 +4107,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 74
"__id__": 83
},
"_enabled": true,
"_materials": [
......@@ -3615,13 +4139,13 @@
"_name": "img_right_2",
"_objFlags": 0,
"_parent": {
"__id__": 73
"__id__": 82
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 77
"__id__": 86
}
],
"_prefab": null,
......@@ -3677,7 +4201,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 76
"__id__": 85
},
"_enabled": true,
"_materials": [
......@@ -3713,16 +4237,16 @@
},
"_children": [
{
"__id__": 79
"__id__": 88
},
{
"__id__": 81
"__id__": 90
}
],
"_active": false,
"_components": [
{
"__id__": 85
"__id__": 94
}
],
"_prefab": null,
......@@ -3778,13 +4302,13 @@
"_name": "ani",
"_objFlags": 0,
"_parent": {
"__id__": 78
"__id__": 87
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 80
"__id__": 89
}
],
"_prefab": null,
......@@ -3840,7 +4364,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 79
"__id__": 88
},
"_enabled": true,
"_materials": [
......@@ -3880,17 +4404,17 @@
"_name": "btn_go",
"_objFlags": 0,
"_parent": {
"__id__": 78
"__id__": 87
},
"_children": [
{
"__id__": 82
"__id__": 91
}
],
"_active": false,
"_components": [
{
"__id__": 84
"__id__": 93
}
],
"_prefab": null,
......@@ -3946,13 +4470,13 @@
"_name": "text",
"_objFlags": 0,
"_parent": {
"__id__": 81
"__id__": 90
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 83
"__id__": 92
}
],
"_prefab": null,
......@@ -4008,7 +4532,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 82
"__id__": 91
},
"_enabled": true,
"_materials": [
......@@ -4041,7 +4565,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 81
"__id__": 90
},
"_enabled": true,
"_materials": [
......@@ -4073,11 +4597,11 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 87
},
"_enabled": true,
"aniRole": {
"__id__": 79
"__id__": 88
},
"moveX": 500,
"_id": "e4RrOXSNJGd68Mq3UTYY0p"
......@@ -4091,13 +4615,13 @@
},
"_children": [
{
"__id__": 87
"__id__": 96
},
{
"__id__": 90
"__id__": 99
},
{
"__id__": 91
"__id__": 100
}
],
"_active": true,
......@@ -4155,11 +4679,11 @@
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 86
"__id__": 95
},
"_children": [
{
"__id__": 88
"__id__": 97
}
],
"_active": true,
......@@ -4217,13 +4741,13 @@
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 87
"__id__": 96
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 89
"__id__": 98
}
],
"_prefab": null,
......@@ -4279,7 +4803,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 88
"__id__": 97
},
"_enabled": true,
"_materials": [
......@@ -4314,7 +4838,7 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 86
"__id__": 95
},
"_children": [],
"_active": true,
......@@ -4372,23 +4896,23 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 86
"__id__": 95
},
"_children": [
{
"__id__": 92
"__id__": 101
},
{
"__id__": 94
"__id__": 103
},
{
"__id__": 96
"__id__": 105
},
{
"__id__": 98
"__id__": 107
},
{
"__id__": 100
"__id__": 109
}
],
"_active": true,
......@@ -4446,13 +4970,13 @@
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 91
"__id__": 100
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 93
"__id__": 102
}
],
"_prefab": null,
......@@ -4508,7 +5032,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 92
"__id__": 101
},
"_enabled": true,
"_clip": {
......@@ -4527,13 +5051,13 @@
"_name": "dragdown",
"_objFlags": 0,
"_parent": {
"__id__": 91
"__id__": 100
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 95
"__id__": 104
}
],
"_prefab": null,
......@@ -4589,7 +5113,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 94
"__id__": 103
},
"_enabled": true,
"_clip": null,
......@@ -4606,13 +5130,13 @@
"_name": "nextgame",
"_objFlags": 0,
"_parent": {
"__id__": 91
"__id__": 100
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 97
"__id__": 106
}
],
"_prefab": null,
......@@ -4668,7 +5192,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 96
"__id__": 105
},
"_enabled": true,
"_clip": null,
......@@ -4685,13 +5209,13 @@
"_name": "boom",
"_objFlags": 0,
"_parent": {
"__id__": 91
"__id__": 100
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 99
"__id__": 108
}
],
"_prefab": null,
......@@ -4747,7 +5271,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 98
"__id__": 107
},
"_enabled": true,
"_clip": null,
......@@ -4764,13 +5288,13 @@
"_name": "pie_drop",
"_objFlags": 0,
"_parent": {
"__id__": 91
"__id__": 100
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 101
"__id__": 110
}
],
"_prefab": null,
......@@ -4826,7 +5350,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 100
"__id__": 109
},
"_enabled": true,
"_clip": null,
......@@ -4893,17 +5417,20 @@
"layout_canvas": {
"__id__": 32
},
"layout_battery_left": {
"layout_items": {
"__id__": 46
},
"layout_battery_left": {
"__id__": 47
},
"layout_battery_right": {
"__id__": 48
"__id__": 49
},
"item_battery_text": {
"__id__": 54
"__id__": 59
},
"item_battery_img": {
"__id__": 50
"__id__": 51
},
"_id": "5b78aJTZFGI79ubV+y7E/s"
}
......
......@@ -69,13 +69,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
@property(cc.Node) layout_canvas: cc.Node = null;
@property(cc.Node) layout_items: cc.Node = null;
@property(cc.Node) layout_battery_left: cc.Node = null;
@property(cc.Node) layout_battery_right: cc.Node = null;
@property(cc.Node) item_battery_text: cc.Node = null;
@property(cc.Node) item_battery_img: cc.Node = null;
updateCanvas() {
let img = pg.view.find(this.layout_canvas, 'img');
pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 })
pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 }, false)
}
initLayoutBattery() {
let color = 1;
......@@ -95,6 +96,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
if (data.itemType == 'text') {
let item = pg.view.clone(this.item_battery_text)
let item_text = pg.view.find(item, 'item_text');
pg.view.setString(pg.view.find(item_text, 'text'), data.text)
if (isleft) {
// 左侧
pg.view.visible(pg.view.find(item, 'bg/img_battery' + 1), i == 0)
......@@ -105,6 +108,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 右侧
pg.view.visible(pg.view.find(item, 'bg/img_battery' + 5), i == 4 || i == 6)
pg.view.visible(pg.view.find(item, 'bg/img_battery' + 6), i == 5 || i == 7)
item_text.x = 20
}
item.active = true;
item.x = 0;
......@@ -112,23 +116,111 @@ export default class SceneComponent extends MyCocosSceneComponent {
item.y = lastY -= spaceTextY;
layout.addChild(item);
lastY = item.y;
item_text.data = data;
color++;
if (color > 6) color = 1;
item_text.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
item_text.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
item_text.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
item_text.on(cc.Node.EventType.TOUCH_CANCEL, this.onTouchEnd, this);
} else if (data.itemType == 'pic') {
let item = pg.view.clone(this.item_battery_img)
let item_img = pg.view.find(item, 'item_img');
pg.view.setNetImg(pg.view.find(item_img, 'img'), data.pic_url, { w: 270, h: 180 }, true)
item.active = true;
item.x = 0;
if (!lastY && lastY != 0) lastY = orgPosY;
item.y = lastY -= spaceImgY;
layout.addChild(item);
lastY = item.y;
item_img.data = data;
item_img.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
item_img.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
item_img.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
item_img.on(cc.Node.EventType.TOUCH_CANCEL, this.onTouchEnd, this);
}
console.log(data);
})
}
currentTouchNode: cc.Node;
onTouchStart(event) {
let node = event.target;
this.currentTouchNode = node;
node.cPos = cc.v2(node);
}
onTouchMove(event) {
let node = event.target;
if (!node || !node.data) return;
if (node != this.currentTouchNode) return;
node.opacity = 255;
let delta = event.touch.getDelta();
let pos = cc.v2(delta);
node.x += pos.x;
node.y += pos.y;
}
onTouchEnd(event) {
let node = event.target;
if (!node || !node.data) return;
if (node != this.currentTouchNode) return;
let x = node.x;
let y = node.y;
let isIn = this.rectCollect(node, this.layout_canvas);
if (!isIn) {
this.onMeetFail(node);
} else {
// 未碰撞到
// 判定碰撞坐标和区域
let target = this.checkSuccess(node)
if (!target) {
this.onMeetFail(node);
} else {
this.onMeetSuccess(node);
}
}
}
// 检测碰撞成功需要重新编写
checkSuccess(node) {
let question = this.currentQuestion
let arr = this.changepoints(question)
return arr.find(ar => {
let dis = this.getDistances(cc.v2(ar.pos), node);
if (dis < 100) {
return true
} else {
return false
}
});
}
private changepoints(data) {
let scX = 1560 / data.bgItem.rect.width;
let scY = 720 / data.bgItem.rect.height;
let px = data.bgItem.rect.x;
let py = data.bgItem.rect.y;
return data.hotZoneItemArr.map((item, idx) => {
let rect = item.rect;
item.pos = {
x: (rect.x + (rect.width / 2)) * scX,
y: -((rect.y + (rect.height / 2)) * scY)
}
item.width = rect.width * scX;
item.height = rect.height * scY;
return item;
})
}
onMeetSuccess(node) {
node.off(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
node.off(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
node.off(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
node.off(cc.Node.EventType.TOUCH_CANCEL, this.onTouchEnd, this);
}
onMeetFail(node) {
node.x = node.cPos.x;
node.y = node.cPos.y;
}
private waitTime: number;
update(dt) {
if (!this.waitTime) this.waitTime = 8;
......@@ -139,6 +231,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
private getDistances(p1, p2) {
//转换世界坐标查看距离
let temp = p1.sub(p2);
let dis = Math.abs(temp.mag());
return dis;
}
private rectCollect(A, B) {
let AP = A.convertToWorldSpaceAR(cc.v2(0, 0));
let BP = B.convertToWorldSpaceAR(cc.v2(0, 0));
if (Math.abs(AP.x - BP.x) < A.width / 2 + B.width / 2
&& Math.abs(AP.y - BP.y) < A.height / 2 + B.height / 2) return true;
return false;
}
showXiaodi() {
if (!this.data.npcAudioEnd) return;
pg.view.find(this, 'layout_xiaodi/btn_go').active = false;
......@@ -175,22 +282,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
private changepoints(data) {
let scX = 1560 / data.bgItem.rect.width;
let scY = 720 / data.bgItem.rect.height;
let px = data.bgItem.rect.x;
let py = data.bgItem.rect.y;
let pointsArr = [];
let arr = [];
data.hotZoneItemArr.forEach((item, idx) => {
let p = item.rect;
arr[idx] = {
x: (p.x + (p.width / 2)) * scX,// - px
y: -((p.y + (p.height / 2)) * scY)// - py
}
})
pointsArr = arr.concat();
}
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
......
......@@ -291,9 +291,14 @@ let pg = {
if (w && h && custom) {
let scaleX = w / nw;
let scaleY = h / nh;
let scale = scaleX <= scaleY ? scaleY : scaleX;
let scale = scaleX <= scaleY ? scaleX : scaleY;
node.width = nw * scale;
node.height = nh * scale;
} else {
let scaleX = w / nw;
let scaleY = h / nh;
node.width = nw * scaleX;
node.height = nh * scaleY;
}
node.active = nodeActive;
resolve({ w: nw, h: nh });
......
......@@ -38,11 +38,9 @@ export const defaultData =
}, {
"index": 4, "text": "part5", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 883.89, "y": 460.5, "width": 200, "height": 200 }
}, {
"index": 5, "text": "part6", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 469.89, "y": -70.5, "width": 200, "height": 200 }
"index": 5, "pic_url": "http://staging-teach.cdn.ireadabc.com/be8ec5cee7a3074440478b00a4a84f5e.png", "itemType": "pic", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 0.44287909836065575, "mapScale": 0.853125, "rect": { "x": 6.89, "y": 79.5, "width": 200, "height": 200 }
}, {
"index": 6, "pic_url": "http://staging-teach.cdn.ireadabc.com/be8ec5cee7a3074440478b00a4a84f5e.png", "itemType": "pic", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 0.44287909836065575, "mapScale": 0.853125, "rect": { "x": 6.89, "y": 79.5, "width": 200, "height": 200 }
}, {
"index": 7, "pic_url": "http://staging-teach.cdn.ireadabc.com/a5d393ae3c9759211c441f8d3fc69e04.png", "itemType": "pic", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1.1256510416666667, "mapScale": 0.853125, "rect": { "x": 870.89, "y": 294.5, "width": 200, "height": 200 }
"index": 6, "pic_url": "http://staging-teach.cdn.ireadabc.com/a5d393ae3c9759211c441f8d3fc69e04.png", "itemType": "pic", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1.1256510416666667, "mapScale": 0.853125, "rect": { "x": 870.89, "y": 294.5, "width": 200, "height": 200 }
}],
"hotZoneFontObj": {
"size": 50,
......
......@@ -4588,6 +4588,7 @@ declare namespace cc {
/** !#en Returns a normalized vector representing the forward direction (Z axis) of the node in world space.
!#zh 获取节点正前方(z 轴)面对的方向,返回值为世界坐标系下的归一化向量 */
forward: Vec3;
data: any;
/**
@param name name
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