Commit 68fb93cd authored by Tt's avatar Tt

基础部分完成

parent 0c5eb5b6
...@@ -81,37 +81,40 @@ ...@@ -81,37 +81,40 @@
"__id__": 46 "__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, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 102 "__id__": 111
}, },
{ {
"__id__": 103 "__id__": 112
}, },
{ {
"__id__": 104 "__id__": 113
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2099,6 +2102,64 @@ ...@@ -2099,6 +2102,64 @@
"_atlas": null, "_atlas": null,
"_id": "1dB9jUoQdHKJ3b1z6VMQGF" "_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", "__type__": "cc.Node",
"_name": "layout_battery_left", "_name": "layout_battery_left",
...@@ -2110,7 +2171,7 @@ ...@@ -2110,7 +2171,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 47 "__id__": 48
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2166,7 +2227,7 @@ ...@@ -2166,7 +2227,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 46 "__id__": 47
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -2199,7 +2260,7 @@ ...@@ -2199,7 +2260,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 49 "__id__": 50
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2255,7 +2316,7 @@ ...@@ -2255,7 +2316,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 48 "__id__": 49
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -2286,7 +2347,10 @@ ...@@ -2286,7 +2347,10 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 51 "__id__": 52
},
{
"__id__": 55
} }
], ],
"_active": false, "_active": false,
...@@ -2314,8 +2378,8 @@ ...@@ -2314,8 +2378,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-825, 808.352,
280, 242.015,
0, 0,
0, 0,
0, 0,
...@@ -2344,11 +2408,11 @@ ...@@ -2344,11 +2408,11 @@
"_name": "bg", "_name": "bg",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 50 "__id__": 51
}, },
"_children": [ "_children": [
{ {
"__id__": 52 "__id__": 53
} }
], ],
"_active": true, "_active": true,
...@@ -2406,13 +2470,13 @@ ...@@ -2406,13 +2470,13 @@
"_name": "img_ battery001", "_name": "img_ battery001",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 51 "__id__": 52
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 53 "__id__": 54
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2468,7 +2532,7 @@ ...@@ -2468,7 +2532,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 52 "__id__": 53
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2497,95 +2561,22 @@ ...@@ -2497,95 +2561,22 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "item_battery_text", "_name": "item_img",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 51
}, },
"_children": [ "_children": [
{ {
"__id__": 55 "__id__": 56
} }
], ],
"_active": false, "_active": true,
"_components": [], "_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
},
{ {
"__id__": 58 "__id__": 58
},
{
"__id__": 60
},
{
"__id__": 62
},
{
"__id__": 64
},
{
"__id__": 66
} }
], ],
"_active": true,
"_components": [],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -2597,8 +2588,8 @@ ...@@ -2597,8 +2588,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 270,
"height": 0 "height": 180
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -2609,8 +2600,8 @@ ...@@ -2609,8 +2600,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 2.467,
0, -20.732,
0, 0,
0, 0,
0, 0,
...@@ -2632,17 +2623,17 @@ ...@@ -2632,17 +2623,17 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "48IafkIxBMbLTmRTSwwHrn" "_id": "60qjsocf9EyaEvREbcu+6z"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "img_battery6", "_name": "img",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 55 "__id__": 55
}, },
"_children": [], "_children": [],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 57 "__id__": 57
...@@ -2659,8 +2650,8 @@ ...@@ -2659,8 +2650,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 281, "width": 270,
"height": 140 "height": 180
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -2694,7 +2685,7 @@ ...@@ -2694,7 +2685,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "a2uRW76TxNeIKScxe1eFBh" "_id": "c23J4FiPhBA5SlmGzdYpPt"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -2712,10 +2703,10 @@ ...@@ -2712,10 +2703,10 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "d07aabdb-0171-4f0e-b866-86a11a2ee5f8" "__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",
...@@ -2724,24 +2715,95 @@ ...@@ -2724,24 +2715,95 @@
}, },
"_fillStart": 0, "_fillStart": 0,
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": false,
"_atlas": null, "_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", "__type__": "cc.Node",
"_name": "img_battery4", "_name": "item_battery_text",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 55 "__id__": 2
}, },
"_children": [], "_children": [
"_active": false,
"_components": [
{ {
"__id__": 59 "__id__": 60
},
{
"__id__": 73
} }
], ],
"_active": false,
"_components": [],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -2753,7 +2815,7 @@ ...@@ -2753,7 +2815,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 281, "width": 290,
"height": 140 "height": 140
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -2765,12 +2827,245 @@ ...@@ -2765,12 +2827,245 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "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__": 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__": 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, 0,
0, 0,
0, 0,
0,
1, 1,
1, 1,
1, 1,
...@@ -2795,7 +3090,7 @@ ...@@ -2795,7 +3090,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 58 "__id__": 63
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2827,13 +3122,13 @@ ...@@ -2827,13 +3122,13 @@
"_name": "img_battery5", "_name": "img_battery5",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 55 "__id__": 60
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 61 "__id__": 66
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2889,7 +3184,7 @@ ...@@ -2889,7 +3184,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 60 "__id__": 65
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2921,13 +3216,201 @@ ...@@ -2921,13 +3216,201 @@
"_name": "img_battery3", "_name": "img_battery3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 55 "__id__": 60
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 63 "__id__": 68
}
],
"_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": "acABGWU79NjJ6FwfGjGyQQ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e4aacec2-9290-4e97-9804-ce17090c69fe"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d4wsgXLMdD+ov2U4mKNK0U"
},
{
"__type__": "cc.Node",
"_name": "img_battery2",
"_objFlags": 0,
"_parent": {
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 70
}
],
"_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": "aeJICgxppO+Zf7sYW4o0RA"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d9b6fcf1-5d4c-4d01-99e5-bc40468c1008"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a8vAGRqHxBcLH6AxRVtQ8E"
},
{
"__type__": "cc.Node",
"_name": "img_battery1",
"_objFlags": 0,
"_parent": {
"__id__": 60
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 72
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2976,14 +3459,14 @@ ...@@ -2976,14 +3459,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "acABGWU79NjJ6FwfGjGyQQ" "_id": "e2HHus9OZHrrF5PjhVB/zp"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 62 "__id__": 71
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2994,7 +3477,7 @@ ...@@ -2994,7 +3477,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "e4aacec2-9290-4e97-9804-ce17090c69fe" "__uuid__": "c3ff7a71-a8d6-4a48-80d9-926c949d18b6"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -3008,20 +3491,24 @@ ...@@ -3008,20 +3491,24 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "d4wsgXLMdD+ov2U4mKNK0U" "_id": "eaJ17EsIBDgLiNJzA1UNkd"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "img_battery2", "_name": "item_text",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 55 "__id__": 59
}, },
"_children": [], "_children": [
"_active": false, {
"__id__": 74
}
],
"_active": true,
"_components": [ "_components": [
{ {
"__id__": 65 "__id__": 76
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3035,8 +3522,8 @@ ...@@ -3035,8 +3522,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 281, "width": 210,
"height": 140 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -3047,8 +3534,8 @@ ...@@ -3047,8 +3534,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, -22.035,
0, -1.581,
0, 0,
0, 0,
0, 0,
...@@ -3070,52 +3557,20 @@ ...@@ -3070,52 +3557,20 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "aeJICgxppO+Zf7sYW4o0RA" "_id": "eeeLXJZsVFc7X5BeiFC7Aj"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 64
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d9b6fcf1-5d4c-4d01-99e5-bc40468c1008"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a8vAGRqHxBcLH6AxRVtQ8E"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "img_battery1", "_name": "text",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 55 "__id__": 73
}, },
"_children": [], "_children": [],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 67 "__id__": 75
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3129,8 +3584,8 @@ ...@@ -3129,8 +3584,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 281, "width": 210,
"height": 140 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -3164,14 +3619,14 @@ ...@@ -3164,14 +3619,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "e2HHus9OZHrrF5PjhVB/zp" "_id": "4a7hIDDyBO7LepapZekREM"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Label",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 66 "__id__": 74
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3181,22 +3636,91 @@ ...@@ -3181,22 +3636,91 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_string": "Label",
"__uuid__": "c3ff7a71-a8d6-4a48-80d9-926c949d18b6" "_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": 0, {
"_sizeMode": 1, "__type__": "cc.Button",
"_fillType": 0, "_name": "",
"_fillCenter": { "_objFlags": 0,
"__type__": "cc.Vec2", "node": {
"x": 0, "__id__": 73
"y": 0
}, },
"_fillStart": 0, "_enabled": true,
"_fillRange": 0, "_normalMaterial": null,
"_isTrimmedMode": true, "_grayMaterial": null,
"_atlas": null, "duration": 0.1,
"_id": "eaJ17EsIBDgLiNJzA1UNkd" "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": "e46vsRgBRJv6d09JTXtX7u"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -3207,10 +3731,10 @@ ...@@ -3207,10 +3731,10 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 69 "__id__": 78
}, },
{ {
"__id__": 71 "__id__": 80
} }
], ],
"_active": false, "_active": false,
...@@ -3268,13 +3792,13 @@ ...@@ -3268,13 +3792,13 @@
"_name": "img_left_1", "_name": "img_left_1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 68 "__id__": 77
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 70 "__id__": 79
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3330,7 +3854,7 @@ ...@@ -3330,7 +3854,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 69 "__id__": 78
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3362,13 +3886,13 @@ ...@@ -3362,13 +3886,13 @@
"_name": "img_left_2", "_name": "img_left_2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 68 "__id__": 77
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 72 "__id__": 81
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3424,7 +3948,7 @@ ...@@ -3424,7 +3948,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 71 "__id__": 80
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3460,10 +3984,10 @@ ...@@ -3460,10 +3984,10 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 74 "__id__": 83
}, },
{ {
"__id__": 76 "__id__": 85
} }
], ],
"_active": false, "_active": false,
...@@ -3521,13 +4045,13 @@ ...@@ -3521,13 +4045,13 @@
"_name": "img_right_1", "_name": "img_right_1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 73 "__id__": 82
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 75 "__id__": 84
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3583,7 +4107,7 @@ ...@@ -3583,7 +4107,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 74 "__id__": 83
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3615,13 +4139,13 @@ ...@@ -3615,13 +4139,13 @@
"_name": "img_right_2", "_name": "img_right_2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 73 "__id__": 82
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 77 "__id__": 86
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3677,7 +4201,7 @@ ...@@ -3677,7 +4201,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 76 "__id__": 85
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3713,16 +4237,16 @@ ...@@ -3713,16 +4237,16 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 79 "__id__": 88
}, },
{ {
"__id__": 81 "__id__": 90
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 85 "__id__": 94
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3778,13 +4302,13 @@ ...@@ -3778,13 +4302,13 @@
"_name": "ani", "_name": "ani",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 78 "__id__": 87
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 80 "__id__": 89
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3840,7 +4364,7 @@ ...@@ -3840,7 +4364,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 79 "__id__": 88
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3880,17 +4404,17 @@ ...@@ -3880,17 +4404,17 @@
"_name": "btn_go", "_name": "btn_go",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 78 "__id__": 87
}, },
"_children": [ "_children": [
{ {
"__id__": 82 "__id__": 91
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 84 "__id__": 93
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3946,13 +4470,13 @@ ...@@ -3946,13 +4470,13 @@
"_name": "text", "_name": "text",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 81 "__id__": 90
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 83 "__id__": 92
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4008,7 +4532,7 @@ ...@@ -4008,7 +4532,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 82 "__id__": 91
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4041,7 +4565,7 @@ ...@@ -4041,7 +4565,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 81 "__id__": 90
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4073,11 +4597,11 @@ ...@@ -4073,11 +4597,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 78 "__id__": 87
}, },
"_enabled": true, "_enabled": true,
"aniRole": { "aniRole": {
"__id__": 79 "__id__": 88
}, },
"moveX": 500, "moveX": 500,
"_id": "e4RrOXSNJGd68Mq3UTYY0p" "_id": "e4RrOXSNJGd68Mq3UTYY0p"
...@@ -4091,13 +4615,13 @@ ...@@ -4091,13 +4615,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 87 "__id__": 96
}, },
{ {
"__id__": 90 "__id__": 99
}, },
{ {
"__id__": 91 "__id__": 100
} }
], ],
"_active": true, "_active": true,
...@@ -4155,11 +4679,11 @@ ...@@ -4155,11 +4679,11 @@
"_name": "font", "_name": "font",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 86 "__id__": 95
}, },
"_children": [ "_children": [
{ {
"__id__": 88 "__id__": 97
} }
], ],
"_active": true, "_active": true,
...@@ -4217,13 +4741,13 @@ ...@@ -4217,13 +4741,13 @@
"_name": "BRLNSDB", "_name": "BRLNSDB",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 87 "__id__": 96
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 89 "__id__": 98
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4279,7 +4803,7 @@ ...@@ -4279,7 +4803,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 88 "__id__": 97
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4314,7 +4838,7 @@ ...@@ -4314,7 +4838,7 @@
"_name": "img", "_name": "img",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 86 "__id__": 95
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
...@@ -4372,23 +4896,23 @@ ...@@ -4372,23 +4896,23 @@
"_name": "audio", "_name": "audio",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 86 "__id__": 95
}, },
"_children": [ "_children": [
{ {
"__id__": 92 "__id__": 101
}, },
{ {
"__id__": 94 "__id__": 103
}, },
{ {
"__id__": 96 "__id__": 105
}, },
{ {
"__id__": 98 "__id__": 107
}, },
{ {
"__id__": 100 "__id__": 109
} }
], ],
"_active": true, "_active": true,
...@@ -4446,13 +4970,13 @@ ...@@ -4446,13 +4970,13 @@
"_name": "btn", "_name": "btn",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 91 "__id__": 100
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 93 "__id__": 102
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4508,7 +5032,7 @@ ...@@ -4508,7 +5032,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 92 "__id__": 101
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -4527,13 +5051,13 @@ ...@@ -4527,13 +5051,13 @@
"_name": "dragdown", "_name": "dragdown",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 91 "__id__": 100
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 95 "__id__": 104
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4589,7 +5113,7 @@ ...@@ -4589,7 +5113,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 94 "__id__": 103
}, },
"_enabled": true, "_enabled": true,
"_clip": null, "_clip": null,
...@@ -4606,13 +5130,13 @@ ...@@ -4606,13 +5130,13 @@
"_name": "nextgame", "_name": "nextgame",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 91 "__id__": 100
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 97 "__id__": 106
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4668,7 +5192,7 @@ ...@@ -4668,7 +5192,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 96 "__id__": 105
}, },
"_enabled": true, "_enabled": true,
"_clip": null, "_clip": null,
...@@ -4685,13 +5209,13 @@ ...@@ -4685,13 +5209,13 @@
"_name": "boom", "_name": "boom",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 91 "__id__": 100
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 99 "__id__": 108
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4747,7 +5271,7 @@ ...@@ -4747,7 +5271,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 98 "__id__": 107
}, },
"_enabled": true, "_enabled": true,
"_clip": null, "_clip": null,
...@@ -4764,13 +5288,13 @@ ...@@ -4764,13 +5288,13 @@
"_name": "pie_drop", "_name": "pie_drop",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 91 "__id__": 100
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 101 "__id__": 110
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4826,7 +5350,7 @@ ...@@ -4826,7 +5350,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 100 "__id__": 109
}, },
"_enabled": true, "_enabled": true,
"_clip": null, "_clip": null,
...@@ -4893,17 +5417,20 @@ ...@@ -4893,17 +5417,20 @@
"layout_canvas": { "layout_canvas": {
"__id__": 32 "__id__": 32
}, },
"layout_battery_left": { "layout_items": {
"__id__": 46 "__id__": 46
}, },
"layout_battery_left": {
"__id__": 47
},
"layout_battery_right": { "layout_battery_right": {
"__id__": 48 "__id__": 49
}, },
"item_battery_text": { "item_battery_text": {
"__id__": 54 "__id__": 59
}, },
"item_battery_img": { "item_battery_img": {
"__id__": 50 "__id__": 51
}, },
"_id": "5b78aJTZFGI79ubV+y7E/s" "_id": "5b78aJTZFGI79ubV+y7E/s"
} }
......
...@@ -69,13 +69,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -69,13 +69,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
@property(cc.Node) layout_canvas: cc.Node = null; @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_left: cc.Node = null;
@property(cc.Node) layout_battery_right: 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_text: cc.Node = null;
@property(cc.Node) item_battery_img: cc.Node = null; @property(cc.Node) item_battery_img: cc.Node = null;
updateCanvas() { updateCanvas() {
let img = pg.view.find(this.layout_canvas, 'img'); 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() { initLayoutBattery() {
let color = 1; let color = 1;
...@@ -95,6 +96,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -95,6 +96,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
if (data.itemType == 'text') { if (data.itemType == 'text') {
let item = pg.view.clone(this.item_battery_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) { if (isleft) {
// 左侧 // 左侧
pg.view.visible(pg.view.find(item, 'bg/img_battery' + 1), i == 0) pg.view.visible(pg.view.find(item, 'bg/img_battery' + 1), i == 0)
...@@ -105,6 +108,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -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' + 5), i == 4 || i == 6)
pg.view.visible(pg.view.find(item, 'bg/img_battery' + 6), i == 5 || i == 7) pg.view.visible(pg.view.find(item, 'bg/img_battery' + 6), i == 5 || i == 7)
item_text.x = 20
} }
item.active = true; item.active = true;
item.x = 0; item.x = 0;
...@@ -112,23 +116,111 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -112,23 +116,111 @@ export default class SceneComponent extends MyCocosSceneComponent {
item.y = lastY -= spaceTextY; item.y = lastY -= spaceTextY;
layout.addChild(item); layout.addChild(item);
lastY = item.y; lastY = item.y;
item_text.data = data;
color++; color++;
if (color > 6) color = 1; 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') { } else if (data.itemType == 'pic') {
let item = pg.view.clone(this.item_battery_img) 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.active = true;
item.x = 0; item.x = 0;
if (!lastY && lastY != 0) lastY = orgPosY; if (!lastY && lastY != 0) lastY = orgPosY;
item.y = lastY -= spaceImgY; item.y = lastY -= spaceImgY;
layout.addChild(item); layout.addChild(item);
lastY = item.y; 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); 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; private waitTime: number;
update(dt) { update(dt) {
if (!this.waitTime) this.waitTime = 8; if (!this.waitTime) this.waitTime = 8;
...@@ -139,6 +231,21 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -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() { showXiaodi() {
if (!this.data.npcAudioEnd) return; if (!this.data.npcAudioEnd) return;
pg.view.find(this, 'layout_xiaodi/btn_go').active = false; pg.view.find(this, 'layout_xiaodi/btn_go').active = false;
...@@ -175,22 +282,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -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) { playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource); const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
...@@ -291,9 +291,14 @@ let pg = { ...@@ -291,9 +291,14 @@ let pg = {
if (w && h && custom) { if (w && h && custom) {
let scaleX = w / nw; let scaleX = w / nw;
let scaleY = h / nh; let scaleY = h / nh;
let scale = scaleX <= scaleY ? scaleY : scaleX; let scale = scaleX <= scaleY ? scaleX : scaleY;
node.width = nw * scale; node.width = nw * scale;
node.height = nh * 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; node.active = nodeActive;
resolve({ w: nw, h: nh }); resolve({ w: nw, h: nh });
......
...@@ -38,11 +38,9 @@ export const defaultData = ...@@ -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": 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": 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 }
}, {
"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 }
}], }],
"hotZoneFontObj": { "hotZoneFontObj": {
"size": 50, "size": 50,
......
...@@ -4588,6 +4588,7 @@ declare namespace cc { ...@@ -4588,6 +4588,7 @@ declare namespace cc {
/** !#en Returns a normalized vector representing the forward direction (Z axis) of the node in world space. /** !#en Returns a normalized vector representing the forward direction (Z axis) of the node in world space.
!#zh 获取节点正前方(z 轴)面对的方向,返回值为世界坐标系下的归一化向量 */ !#zh 获取节点正前方(z 轴)面对的方向,返回值为世界坐标系下的归一化向量 */
forward: Vec3; forward: Vec3;
data: any;
/** /**
@param name name @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