Commit 6dae2e0f 6dae2e0f163187accda208ec3ce1a3618167eba0 by jinwawa

complete SceneRecommend

0 parents
Showing 112 changed files with 9111 additions and 0 deletions
#/////////////////////////////////////////////////////////////////////////////
# Fireball Projects
#/////////////////////////////////////////////////////////////////////////////
/library/
/temp/
/local/
/build/
#/////////////////////////////////////////////////////////////////////////////
# npm files
#/////////////////////////////////////////////////////////////////////////////
npm-debug.log
node_modules/
#/////////////////////////////////////////////////////////////////////////////
# Logs and databases
#/////////////////////////////////////////////////////////////////////////////
*.log
*.sql
*.sqlite
#/////////////////////////////////////////////////////////////////////////////
# files for debugger
#/////////////////////////////////////////////////////////////////////////////
*.sln
*.csproj
*.pidb
*.unityproj
*.suo
#/////////////////////////////////////////////////////////////////////////////
# OS generated files
#/////////////////////////////////////////////////////////////////////////////
.DS_Store
ehthumbs.db
Thumbs.db
#/////////////////////////////////////////////////////////////////////////////
# WebStorm files
#/////////////////////////////////////////////////////////////////////////////
.idea/
#//////////////////////////
# VS Code files
#//////////////////////////
.vscode/
# hello-world
Hello world new project template.
{
"ver": "1.0.1",
"uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7",
"isGroup": false,
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_level": 0,
"_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,
"y": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_is3DNode": true,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "2d2f792f-a40c-49bb-a189-ed176a246e49"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 17
},
{
"__id__": 30
}
],
"_active": true,
"_level": 0,
"_components": [
{
"__id__": 34
},
{
"__id__": 35
},
{
"__id__": 39
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 252,
"g": 252,
"b": 252,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 640,
"y": 360,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "a286bbGknJLZpRpxROV6M94"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 4
}
],
"_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
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "bajsC4KotFLZ6XLFLKnycL"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_id": "c7r5+B15dD56dUBiNj+0KH"
},
{
"__type__": "cc.Node",
"_name": "ScrollContent",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 6
},
{
"__id__": 9
},
{
"__id__": 13
}
],
"_active": true,
"_level": 1,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 360,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_id": "d5YgFh8GFGSYo+TkcU3i8/"
},
{
"__type__": "cc.Node",
"_name": "background",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_level": 2,
"_components": [
{
"__id__": 7
},
{
"__id__": 8
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 2885
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": -1442.5,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "e2e0crkOLxGrpMxpbC4iQg1"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 0,
"_right": 507.8855000000003,
"_top": 0,
"_bottom": -290.2645000000001,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 200,
"_originalHeight": 150,
"_id": "86+yud7pFDSrM+lsxByQvE"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "eab92123-65ec-44fd-b9af-7b80346d5e64"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "6eJ8mvvn9A6o5pdFTP+tE3"
},
{
"__type__": "cc.Node",
"_name": "RightRecommendLayout",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_level": 2,
"_components": [
{
"__id__": 10
},
{
"__id__": 11
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": -720,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "51WwK6fT5MhIC+kSgz1URv"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f1MeZlDVRD2KNNosLBuU/N"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 200,
"height": 150
},
"_resize": 0,
"_N$layoutType": 0,
"_N$padding": 0,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": "b3BQZMZyBBxJl5pXvEm5lx"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 540,
"_right": 0,
"_top": 645,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "57pm3qSI5K0LQU8JHl25iQ"
},
{
"__type__": "cc.Node",
"_name": "RightTopLayout",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_level": 2,
"_components": [
{
"__id__": 14
},
{
"__id__": 15
},
{
"__id__": 16
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 48
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 19.88,
"y": -4.06
},
"_position": {
"__type__": "cc.Vec3",
"x": 24806.399999999998,
"y": -242.88,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "35Jp4SXkxGI43N2Ggf1UCc"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "3eSf6yzglJmJ+mX2/JDKVE"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": false,
"_layoutSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 48
},
"_resize": 1,
"_N$layoutType": 0,
"_N$padding": 0,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": "56DFhkMhtPSYuyBBgvO6rZ"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 9,
"_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": 0,
"_originalHeight": 0,
"_id": "22pn9r5DZCzY8gDnbvqZki"
},
{
"__type__": "cc.Node",
"_name": "TopTitle",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 18
},
{
"__id__": 21
},
{
"__id__": 24
},
{
"__id__": 27
}
],
"_active": true,
"_level": 1,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_id": "cdi5cODkZFr5VmgKy1vTNk"
},
{
"__type__": "cc.Node",
"_name": "logo",
"_objFlags": 0,
"_parent": {
"__id__": 17
},
"_children": [],
"_active": true,
"_level": 2,
"_components": [
{
"__id__": 19
},
{
"__id__": 20
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 649,
"height": 466
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": -509.073,
"y": 311.974,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 0.2,
"y": 0.2,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_id": "beZ17y2HxMJLrQRbuVHIo3"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1af31773-8501-40fe-96e5-ec700c03162c"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "534Ob4DUBNoYl4CjIl8U1/"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 66.02700000000004,
"_right": 0,
"_top": 1.4259999999999877,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "00CarZ9TlCQb53TyqcYV2a"
},
{
"__type__": "cc.Node",
"_name": "my",
"_objFlags": 0,
"_parent": {
"__id__": 17
},
"_children": [],
"_active": false,
"_level": 2,
"_components": [
{
"__id__": 22
},
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 127,
"height": 48
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 299.5,
"y": 310,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_id": "f9kqgyMlpC3ozF7o6pqj+s"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e74a5b86-b958-43cf-a583-6ebdeb00e071"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "350BsuLatCF7YLMe9Kd4P5"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 876,
"_right": 0,
"_top": 26,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "30wK+HB5dN+K4M5Bv7RBpz"
},
{
"__type__": "cc.Node",
"_name": "history",
"_objFlags": 0,
"_parent": {
"__id__": 17
},
"_children": [],
"_active": false,
"_level": 2,
"_components": [
{
"__id__": 25
},
{
"__id__": 26
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 108,
"height": 48
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 427,
"y": 310,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_id": "5a8qPirfxKcJr1VsOOYd7K"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8c0c790b-4b85-43a1-8b6c-a8686b700df6"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "73kwIf2EhLvbMiSYrTU8fZ"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 1013,
"_right": 0,
"_top": 26,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "91sa5VKrFDvIloUk0T/ZQm"
},
{
"__type__": "cc.Node",
"_name": "search",
"_objFlags": 0,
"_parent": {
"__id__": 17
},
"_children": [],
"_active": false,
"_level": 2,
"_components": [
{
"__id__": 28
},
{
"__id__": 29
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 108,
"height": 48
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 545,
"y": 310,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_id": "f6RVR5r6xKSJwKkWfuZoVo"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "2724fd4d-8592-497d-9ab1-4e33968c0e89"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "17hQ03BA9Ca4ThWJsVAe5t"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 1131,
"_right": 0,
"_top": 26,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "a2/o9snvpNqJT40s1JTdzI"
},
{
"__type__": "cc.Node",
"_name": "LeftNaviLayout",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 31
},
{
"__id__": 32
},
{
"__id__": 33
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": -46.952999999999975,
"y": -57.77800000000002,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": "69iub5QUFKlJZbOYd98Moy"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "26Ql9OXmxGI7lB2aDBhZAP"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_resize": 2,
"_N$layoutType": 3,
"_N$padding": 0,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 1,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": "02q0yVtilE4osvaqeyHIMc"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 543.047,
"_right": 0,
"_top": 367.778,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "d6M9RdbjVCuY+Yq7AAexFK"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "6f5cteKmlPh6NGUsUqxlFR"
},
{
"__type__": "280c3rsZJJKnZ9RqbALVwtK",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_cLog": null,
"_cApplication": null,
"_cFocus": null,
"_aFocusTargets": [],
"_fiCurrentFocus": null,
"_iSceneStatus": 0,
"_fFocusScaleFactor": 1.06,
"_bIsFocusInit": false,
"_oSceneContext": null,
"_oNextSceneParameter": null,
"_compPlayer": null,
"_aTouchContext": [],
"_defaultBackScene": null,
"_oFocusScaleFactorInfo": null,
"holdClick": false,
"_bShowExitBox": false,
"_iRightRecommendHeight": 0,
"_aBgHeight": [],
"PFB_LEFT_RECOMMEND": {
"__uuid__": "0a9ac85b-6d8a-498b-92ce-d1b35b092920"
},
"PFB_RECOMMEND_RIGHT": {
"__uuid__": "9058dd42-455f-43f3-93b4-ed587f2159bd"
},
"targetAry": [
{
"__id__": 36
},
{
"__id__": 37
},
{
"__id__": 38
}
],
"_id": "dcGJ+cSA5D7qNtScKfLjJJ"
},
{
"__type__": "info",
"target": {
"__id__": 30
},
"num": 0
},
{
"__type__": "info",
"target": {
"__id__": 13
},
"num": 0
},
{
"__type__": "info",
"target": {
"__id__": 9
},
"num": 0
},
{
"__type__": "cc.ScrollView",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"horizontal": false,
"vertical": true,
"inertia": true,
"brake": 1,
"elastic": true,
"bounceDuration": 1,
"scrollEvents": [],
"cancelInnerEvents": true,
"_N$content": {
"__id__": 5
},
"content": {
"__id__": 5
},
"_id": "d87WXBbQpNp76VZw/tO/Tu"
}
]
\ No newline at end of file
{
"ver": "1.2.0",
"uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934",
"isGroup": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Layout,
properties: {
},
_doLayoutDirty: function () {
this._layoutDirty = true;
//-----------------------------------------------
var children = this.node.children;
for (var i = 0; i < children.length; ++i) {
var child = children[i];
child.zIndex=10;
}
//-----------------------------------------------
},
});
\ No newline at end of file
{
"ver": "1.0.5",
"uuid": "e24450be-ee0f-4078-8526-2d1821a7bc96",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
/**
* 扩展TVFocus,新增字段_bChangeZIndex,Layout模式下禁止改动zIndex,扰乱Layout排序
*/
var Common = require('Common');
var TVFocus = require('TVFocus');
//var AbstractTVFocus=require('AbstractTVFocus');
cc.Class({
//name:"TVFocus",
extends: TVFocus,
//extends: cc.Node, 引擎团队的人不推荐这么做
properties: {
_bChangeZIndex: false,
},
init: function (strName, oScene, fiCurrentFocus,//Left,fTop,fObjectWidth,fObjectHeight,
fScreenWidth, fScreenHeight, fCornerOuterRadius, fCornerInnerRadius, fScaleFactor, bChangeZIndex) {
this._bChangeZIndex = bChangeZIndex;
//TODO:这个函数里面是否要做onbeforeFocus和onAfterFocus的操作 --question from eva
//cc.log(this instanceof Sprite); // true
if (strName) {
this.name = strName;
} else {
cc.log('No Focus Name Specified');
return;
}
if (oScene) {
this._oScene = oScene;
} else {
cc.log('No Scene Specified for Focus');
}
fScaleFactor = fScaleFactor || fiCurrentFocus.getScaleFactor();
//this.width=fObjectWidth;
//this.height=fObjectHeight;
var fLeft = fiCurrentFocus.getLeft();
var fTop = fiCurrentFocus.getTop();
var fObjectWidth = fiCurrentFocus.getWidth();
var fObjectHeight = fiCurrentFocus.getHeight();
if (fScreenWidth) {
this._screenWidth = fScreenWidth;
}
if (fScreenHeight) {
this._screenHeight = fScreenHeight;
}
if (fCornerOuterRadius) {
this._cornerOuterRadius = fCornerOuterRadius;
}
if (fCornerInnerRadius) {
this._cornerInnerRadius = fCornerInnerRadius;
}
var oTransformedPosition = this.transformCoordinatesWeb2Cocos(fLeft, fTop, fObjectWidth, fObjectHeight);
this.node.x = oTransformedPosition.x;
this.node.y = oTransformedPosition.y;
var urlFocus = null;
var textureFocus = null;
//1 2 3
//4 6
//7 8 9
for (var i = 1; i <= 9; i++) {
//this.node.children[i-1] = new cc.Node('focus_'+i);
this.node.addChild(new cc.Node('focus_' + i), 10);
if (5 == i) {
continue;
}
// urlFocus = cc.url.raw('resources/Texture/Focus/'+i+'.png');
// textureFocus = cc.textureCache.addImage(urlFocus);
var spriteTemp = this.node.getChildByName('focus_' + i).addComponent(cc.Sprite);
// spriteTemp.spriteFrame = new cc.SpriteFrame(textureFocus);
var ftaScaleTo = null
if (2 == i || 8 == i) {
//spriteTemp.sizeMode = cc.Sprite.SizeMode.CUSTOM;
//spriteTemp.type= cc.Sprite.Type.FILLED;
//spriteTemp.fillType = cc.Sprite.FillType.HORIZONTAL;
//spriteTemp.width=fObjectWidth-2*fCornerInnerRadius;
//this.node.children[i-1].width=fObjectWidth-2*fCornerInnerRadius;
//this.node.children[i-1].height=fCornerOuterRadius;
ftaScaleTo = cc.scaleTo(0, fScaleFactor * (fObjectWidth - 2 * fCornerInnerRadius), fScaleFactor * 1.0);
} else if (4 == i || 6 == i) {
//spriteTemp.sizeMode = cc.Sprite.SizeMode.CUSTOM;
//spriteTemp.type= cc.Sprite.Type.FILLED;
//spriteTemp.fillType = cc.Sprite.FillType.VERTICAL;
//spriteTemp.height=fObjectHeight-2*fCornerInnerRadius;
//this.node.children[i-1].setContentSize();
//this.node.children[i-1].width=fCornerOuterRadius;
//this.node.children[i-1].height=fObjectHeight-2*fCornerInnerRadius;
ftaScaleTo = cc.scaleTo(0, fScaleFactor * 1.0, fScaleFactor * (fObjectHeight - 2 * fCornerInnerRadius));
} else {
ftaScaleTo = cc.scaleTo(0, fScaleFactor, fScaleFactor);
}
ftaScaleTo.setTag(Common.FOCUS_CELL_TRANSFER);
this.node.children[i - 1].stopAllActions();
this.node.children[i - 1].runAction(ftaScaleTo);
}
//TODO:2.0版本采用异步加载本地图片,在焦点初始完成后在批量处理图片
//TODO:循环中焦点框不是连续的,而批量加载的图地址是连续的需特殊处理下
var self = this;
cc.loader.loadResDir("focus", cc.Texture2D, function (err, textures) {
for (let i = 1; i < 10; i++) {
if (i == 2 || i == 4 || i == 6 || i == 8) continue; //暂时将焦点框一部分隐藏
if (i >= 5) {
if (i == 5) continue;
self.node.getChildByName('focus_' + i).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(textures[i - 2]);
} else {
self.node.getChildByName('focus_' + i).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(textures[i - 1]);
}
}
});
this.node.children[0].x = fScaleFactor * (-fObjectWidth / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[0].y = fScaleFactor * (fObjectHeight / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[1].x = 0;
this.node.children[1].y = fScaleFactor * (fObjectHeight / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[2].x = fScaleFactor * (fObjectWidth / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[2].y = fScaleFactor * (fObjectHeight / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[3].x = fScaleFactor * (-fObjectWidth / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[3].y = 0;
//this.node.children[4].x=0;
//this.node.children[4].y=0;
this.node.children[5].x = fScaleFactor * (fObjectWidth / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[5].y = 0;
this.node.children[6].x = fScaleFactor * (-fObjectWidth / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[6].y = fScaleFactor * (-fObjectHeight / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[7].x = 0;
this.node.children[7].y = fScaleFactor * (-fObjectHeight / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[8].x = fScaleFactor * (fObjectWidth / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[8].y = fScaleFactor * (-fObjectHeight / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
//放大 当前选中的Node
var ftaScaleCurrentFocus = cc.scaleTo(0, fScaleFactor, fScaleFactor);
ftaScaleCurrentFocus.setTag(Common.FEATURE_NODE_TRANSFER);
if (bChangeZIndex) {
} else {
fiCurrentFocus.node.zIndex = 40;
}
fiCurrentFocus.node.stopAllActions();
fiCurrentFocus.node.runAction(ftaScaleCurrentFocus);
//开始呼吸动画
var aiFocusBreath = cc.repeatForever(cc.sequence(cc.fadeTo(1, 100), cc.fadeTo(1, 255), cc.fadeTo(2, 255)));
aiFocusBreath.setTag(Common.FOCUS_CONTAINER_BREATH);
this.node.stopAllActions();
this.node.runAction(aiFocusBreath);
this._oScene.setCurrentFocus(fiCurrentFocus);
},
flyFocus: function (fiCurrentFocus, fiFocusTarget, iDirection, fScaleFactor, oScrollParameter, iDuration) {
if (null == fiFocusTarget) {//todo:先判断这个是否更划得来
//找不到目标的动画小交互
//var blink1=cc.blink(0.6,20);
//this.node.runAction(blink1);
let aiJoggle = cc.repeat(
cc.sequence(
cc.rotateTo(0.02, -2),
cc.rotateTo(0.02, 0),
cc.rotateTo(0.02, 2),
cc.rotateTo(0.02, 0)
),
4
);
aiJoggle.setTag(Common.FOCUS_CONTAINER_JOGGLE);
//if (null!=this.node.getActionByTag(Common.FOCUS_CONTAINER_JOGGLE)){
// this.node.stopAction(Common.FOCUS_CONTAINER_JOGGLE);
//}
this.node.stopAction(this.node.getActionByTag(Common.FOCUS_CONTAINER_JOGGLE));
this.node.runAction(aiJoggle);
return 0;
}
if (null == fiCurrentFocus) {
fiCurrentFocus = this._oScene.getCurrentFocusInfo();
}
fScaleFactor = fScaleFactor || fiFocusTarget.getScaleFactor();
if (null == fScaleFactor) {
fScaleFactor = 1.0;
}
if (null == iDuration) {
iDuration = Common.FOCUS_FLY_DURATION;
}
//是否是有效方向
if (Common.MOVE_DIRECTION_UP <= iDirection && iDirection <= Common.MOVE_DIRECTION_LEFT) {
//滚屏相关参数 elScroll,iScrollStep 如果都有效开始处理滚屏
//oScrollParameter.element 需要滚动的元素 Object[Element]
//oScrollParameter.step 滚动的距离 Integer
//oScrollParameter.relation 滚动是否和焦点元素有关? Integer [0|1]
//oScrollParameter.direction 滚动方向 ['left'|'right'|'up'|'down']
//旧的时间通知
//this.node.dispachEvent('before_focus_change', { from: fiCurrentFocus, to: fiFocusTarget});
let eventBeforeFocus = new cc.Event.EventCustom('before_focus_change', true);
eventBeforeFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventBeforeFocus);
let eventOnBlur = new cc.Event.EventCustom('blur', true);
eventOnBlur.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventOnBlur);
//let eventOnFocus=new cc.Event.
let nodeCurrent = fiCurrentFocus.node;//node;
let nodeTarget = fiFocusTarget.node;//node;
//if (fiCurrentFocus && fiCurrentFocus.onBlur && typeof fiCurrentFocus.onBlur =='function' ){
// fiCurrentFocus.onBlur();
//}
//处理因焦点移动导致的部分界面滑动
let fXScrollStep = 0;
let fYScrollStep = 0;
let fXScrollTarget = 0; //新方法
let fYScrollTarget = 0; //新方法
if (null != oScrollParameter && null != oScrollParameter.node
&& null != oScrollParameter.getStep() && null != oScrollParameter.getHasRelation()) { //满足此条件才考虑界面滚动
//MOVE_DIRECTION_UP:0,
//MOVE_DIRECTION_RIGHT:1,
//MOVE_DIRECTION_DOWN:2,
//MOVE_DIRECTION_LEFT:3,
//默认反向
if (null == oScrollParameter.getDirection()) {
switch (iDirection) {
case Common.MOVE_DIRECTION_UP: oScrollParameter.setDirection(Common.MOVE_DIRECTION_DOWN); break;
case Common.MOVE_DIRECTION_RIGHT: oScrollParameter.setDirection(Common.MOVE_DIRECTION_LEFT); break;
case Common.MOVE_DIRECTION_DOWN: oScrollParameter.setDirection(Common.MOVE_DIRECTION_UP); break;
case Common.MOVE_DIRECTION_LEFT: oScrollParameter.setDirection(Common.MOVE_DIRECTION_RIGHT); break;
}
}
//Deprecated Start
switch (oScrollParameter.getDirection()) {
case Common.MOVE_DIRECTION_UP:
fYScrollStep = oScrollParameter.getStep();
break;
case Common.MOVE_DIRECTION_DOWN:
fYScrollStep = -oScrollParameter.getStep();
break;
case Common.MOVE_DIRECTION_LEFT:
fXScrollStep = -oScrollParameter.getStep();
break;
case Common.MOVE_DIRECTION_RIGHT:
fXScrollStep = oScrollParameter.getStep();
break;
}
//let ftaMoveToScrollParameter = cc.moveTo(iDuration,
// oScrollParameter.node.x+fXScrollStep,
// oScrollParameter.node.y-fYScrollStep
// );
//Deprecated End
switch (oScrollParameter.getDirection()) { //正负在外面算好了
case Common.MOVE_DIRECTION_UP:
fYScrollTarget = oScrollParameter.getTargetPosition();
break;
case Common.MOVE_DIRECTION_DOWN:
fYScrollTarget = oScrollParameter.getTargetPosition();
break;
case Common.MOVE_DIRECTION_LEFT:
fXScrollTarget = oScrollParameter.getTargetPosition();
break;
case Common.MOVE_DIRECTION_RIGHT:
fXScrollTarget = oScrollParameter.getTargetPosition();
break;
}
let finished = cc.callFunc((oScrollParameter.callback ? oScrollParameter.callback : function () {
cc.log("do something");
}), this, oScrollParameter.scope);//todo:这里是否考虑要个回调
let ftaMoveToScrollParameter = cc.sequence(cc.moveTo(iDuration, fXScrollTarget, fYScrollTarget), finished);
ftaMoveToScrollParameter.setTag(Common.SCROLL_BY_FOCUS_CHANGE);
oScrollParameter.node.stopAction(oScrollParameter.node.getActionByTag(Common.SCROLL_BY_FOCUS_CHANGE));
//oScrollParameter.node.stopAllActions();
oScrollParameter.node.runAction(ftaMoveToScrollParameter);
oScrollParameter.setDirection(null);
//oScrollParameter.node.x+=fXScrollStep;
//oScrollParameter.node.y-=fYScrollStep;
}
//由于浮点数变成坐标必须取整所以不可避免会形成误差,其中的+1 -1为了保证边框不留空隙
//Target会比边框稍大
//let fDestFocusLeft = iScaledTargetLeft - g_iFocusFrameWidth + iXScrollStep + "px";
//let fDestFocusTop = iScaledTargetTop - g_iFocusFrameHeight + iYScrollStep + "px";
//let fDestFocusWidth = iScaledTargetWidth + 2 * g_iFocusFrameWidth + "px";
//let fDestFocusHeight = iScaledTargetHeight + 2 * g_iFocusFrameHeight + "px";
//只要改掉相对Left Top 就可
//此处需很小心处理和上下代码的关系
/*
if (null != oScrollParameter && null != oScrollParameter.node
&& null != oScrollParameter.getStep() && null != oScrollParameter.getHasRelation()) { //满足此条件才考虑界面滚动
let sizeVisible = cc.Director.getVisibleSize();
let fDestScrollElementLeft = oScrollParameter.node.x + fXScrollStep;
let fDestScrollElementTop = sizeVisible.height - oScrollParameter.node.y + fYScrollStep;
//这里还缺少动画 必须一起开始动
oScrollParameter.node.x=fDestScrollElementLeft;
oScrollParameter.node.y=oScrollParameter.node.y - fYScrollStep;
}*/
//准备好了所有数据 这里开始一起行动
//if (g_fnOnBeforeFocusChange) {
// g_fnOnBeforeFocusChange(elFocusNow, elFocusTarget, strDirection);
//}
//按比例将焦点目标的区域进行缩放 得注意浮点数的问题
let ftaScaleCurrentFocus = cc.scaleTo(iDuration, 1.0, 1.0);
let ftaScaleFocusTarget = cc.scaleTo(iDuration, fScaleFactor, fScaleFactor);
/*
log("ArchorPoint:%f,%f,%f,%f", pfiCurrentFocus->node->getAnchorPoint().x,
pfiCurrentFocus->node->getAnchorPoint().y,
pfiCurrentFocus->node->getAnchorPointInPoints().x,
pfiCurrentFocus->node->getAnchorPointInPoints().y );
*/
/*
//红点测试
auto sprite1 = cocos2d::Sprite::create("image/red_point.png");
sprite1->setPosition(0,0
// pfiCurrentFocus->node->getAnchorPointInPoints().x
//, pfiCurrentFocus->node->getAnchorPointInPoints().y);
pfiCurrentFocus->node->addChild(sprite1, 20, "PointFlag");
*/
// nodeCurrent.setLocalZOrder(10);
// nodeTarget.setLocalZOrder(40);
if (this._bChangeZIndex) {
} else {
nodeCurrent.zIndex = 10;
nodeTarget.zIndex = 40;
}
ftaScaleCurrentFocus.setTag(Common.FEATURE_NODE_TRANSFER);
ftaScaleFocusTarget.setTag(Common.FEATURE_NODE_TRANSFER);
//if (null!=nodeCurrent.getActionByTag(Common.FEATURE_NODE_TRANSFER)){
// nodeCurrent.stopAction(Common.FEATURE_NODE_TRANSFER);
//}
//if (null!=nodeTarget.getActionByTag(Common.FEATURE_NODE_TRANSFER)){
// nodeTarget.stopAction(Common.FEATURE_NODE_TRANSFER);
//}
nodeCurrent.stopAction(nodeCurrent.getActionByTag(Common.FEATURE_NODE_TRANSFER));
nodeTarget.stopAction(nodeTarget.getActionByTag(Common.FEATURE_NODE_TRANSFER));
nodeCurrent.runAction(ftaScaleCurrentFocus);
nodeTarget.runAction(ftaScaleFocusTarget);
cc.log(fiFocusTarget.getLeft());
cc.log(fiFocusTarget.getTop());
this.fly(fiFocusTarget.getLeft() + fXScrollStep, fiFocusTarget.getTop() + fYScrollStep,
fiFocusTarget.getWidth(), fiFocusTarget.getHeight(),
iDuration, fScaleFactor);
//if (fiTarget.onFocus && typeof fiTarget.onFocus =='function' ){
// fiTarget.onFocus();
//}
let eventOnFocus = new cc.Event.EventCustom('focus', true);
eventOnFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventOnFocus);
//旧的事件通知
//this.node.emit('after_focus_change', { from: fiCurrentFocus, to: fiFocusTarget});
let eventAfterFocus = new cc.Event.EventCustom('after_focus_change', true);
eventAfterFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventAfterFocus);
//新的事件通知方式 是否科学有待检验
//let eventFocusLeave=new cc.Event.EventCustom('focus_leave',true);
//eventFocusLeave.setUserData({from:fiCurrentFocus,to:fiFocusTarget});
//nodeCurrent.dispatchEvent(eventFocusLeave);
//let eventFocusHover=new cc.Event.EventCustom('focus_hover',true);
//eventFocusHover.setUserData({from:fiCurrentFocus,to:fiFocusTarget});
//nodeTarget.dispatchEvent(eventFocusHover);
this._oScene.setCurrentFocus(fiFocusTarget);
//计算完成以下开始完成所有动作
//elFocusNow.style.zIndex = 0;
//elFocusTarget.style.zIndex = 20;
/*
var elFocusContainer = document.getElementById("focus_container");
//document.getElementById('view_port').style.left = destViewPortLeft;
elFocusContainer.style.left = destFocusLeft;
elFocusContainer.style.top = destFocusTop;
//document.getElementById("focus5").style.width = destFocusWidth;
//document.getElementById("focus5").style.height = destFocusHeight;
elFocusContainer.style.width = destFocusWidth;
elFocusContainer.style.height = destFocusHeight;
*/
//if (g_fnOnAfterFocusChange) {
// g_fnOnAfterFocusChange(elFocusNow, elFocusTarget, strDirection);
//}
//总要先将前面那个复原
//scaleElement(g_strFocusElementId, 1, 1);
//g_strFocusElementId = elFocusTarget.id;
return 1;
} else {
cc.log("No Target Found to Fly: Unavailable Direction");
return 0;
}
},
});
{
"ver": "1.0.5",
"uuid": "bb57216f-4ed7-4f39-ac79-58d24574a43b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
var Common = require('Common');
var Network = require('Network');
var TVFocus = require('TVFocus');
var CCTVFocus = require('CCTVFocus');
var FocusInfo = require('FocusInfo');
var TVCanvas = require('TVCanvas');
var TestLayout = require('TestLayout');
var waterfall_recommend = require('waterfall_recommend');
var waterfall_course = require('waterfall_course');
var waterfall_parent = require('waterfall_parent');
var waterfall_primarySchool = require('waterfall_primarySchool');
var waterfall_three2six = require('waterfall_three2six');
/**
* ScrollView有问题,
* 多个scrollView切换时,高度短的ScrollView无法向上/向下滚动,且初始化后的scrollView位置会错乱
* 目前暂且将所有scrollView设置为固定高度
*/
var info = cc.Class({
name: 'info',
properties: {
target: cc.Node,
num: 0
}
});
cc.Class({
extends: TVCanvas,
properties: {
_iRightRecommendHeight: 0, //右侧瀑布流宽度
_aBgHeight: [], //右侧瀑布流楼层高度
PFB_LEFT_RECOMMEND: { //左侧导航栏
default: null,
type: cc.Prefab
},
PFB_RECOMMEND_RIGHT: {
default: null,
type: cc.Prefab
},
targetAry: {
default: [],
type: [info],
},
},
onLoad: function () {
this._super();
this._scrollview = this.node.getComponent(cc.ScrollView);
this._oSceneContext.focusPath = "LeftNaviLayout/NaviCell0";
this._oSceneContext._iPageIndex = 1;
this._oSceneContext._iCurrentLeftIndex = 0;
this._oInit = {};
this.getLeftBgRequest(); //渲染左侧导航
this.getTopBgRequest(); //渲染顶部导航
this.getRightBgRequest(); //渲染右侧导航
this.getRightRecommendRequest(waterfall_recommend); //渲染右侧推荐框架
},
//请求左侧导航
getLeftBgRequest: function () {
var arrModules = TestLayout.layout4Page.children; //拿到模拟数据
let aLeftRecommend = arrModules[0].data.resultSet; //左侧导航栏数据
let count = aLeftRecommend.length;
var leftNavLayout = this.targetAry[0].target;
this._oInit.aLeftImg = [];
for (let i = 0; i < aLeftRecommend.length; i++) {
let nodeLeftRecommend = cc.instantiate(this.PFB_LEFT_RECOMMEND);
this._oInit.aLeftImg.push(Common.TOPDRAW_IMAGE_SERVER_EDU + aLeftRecommend[i].imageURL);
nodeLeftRecommend.getComponent('pfbRecommendCell').init(aLeftRecommend[i], function () { //让细胞自己渲染
count--;
if (!count) { //初始化完成了
leftNavLayout.getComponent(cc.Layout).updateLayout();
}
});
leftNavLayout.addChild(nodeLeftRecommend, 10, "NaviCell" + i);
//准备焦点坐标
let fiNodeBlock = nodeLeftRecommend.addComponent(FocusInfo);
fiNodeBlock.init(
aLeftRecommend[i].tvlink, true, null, null, 1.0 //最后一个参数决定要不要放大显示
);
this._aFocusTargets[0]["NaviCell" + i] = nodeLeftRecommend;
}
if (arrModules[0].childrenSize[0] && arrModules[0].childrenSize[1]) { //子元素大小
leftNavLayout.getComponent(cc.Layout).cellSize = new cc.size(arrModules[0].childrenSize[0], arrModules[0].childrenSize[1]);
leftNavLayout.Width = arrModules[0].childrenSize[0]; //计算Layout宽高
leftNavLayout.height = arrModules[0].childrenSize[1] * 5 + arrModules[0].childrenMargin[2] * 4;
}
leftNavLayout.getComponent(cc.Layout).spacingY = arrModules[0].childrenMargin[2]; //子元素间距
if (arrModules[0].position[0] && arrModules[0].position[1]) { //确定位置
leftNavLayout.getComponent(cc.Widget).top = arrModules[0].position[1];
leftNavLayout.getComponent(cc.Widget).left = arrModules[0].position[0];
}
this.checkDataReadyAndInitFocus();
},
//请求顶部导航
getTopBgRequest: function () {
var arrModules = TestLayout.layout4Page.children; //拿到模拟数据
let aLeftRecommend = arrModules[1].data.resultSet; //顶部导航栏数据
let count = aLeftRecommend.length;
var topNavLayout = this.targetAry[1].target;
topNavLayout.getComponent(cc.Widget).top = 0;
topNavLayout.getComponent(cc.Widget).left = 0;
this._oInit.aTopImg = [];
for (let i = 0; i < aLeftRecommend.length; i++) {
let nodeLeftRecommend = cc.instantiate(this.PFB_LEFT_RECOMMEND);
nodeLeftRecommend.width = aLeftRecommend[i].width;
nodeLeftRecommend.height = aLeftRecommend[i].height;
this._oInit.aTopImg.push(Common.TOPDRAW_IMAGE_SERVER_EDU + aLeftRecommend[i].imageURL);
nodeLeftRecommend.getComponent('pfbRecommendCell').init(aLeftRecommend[i], function () { //让细胞自己渲染
count--;
if (!count) { //初始化完成了
}
});
// cc.log("------------------->"+aLeftRecommend[i].left);
nodeLeftRecommend.getComponent(cc.Widget).top = aLeftRecommend[i].top;
nodeLeftRecommend.getComponent(cc.Widget).left = aLeftRecommend[i].left;
topNavLayout.addChild(nodeLeftRecommend, 10, "TopCell" + i);
//准备焦点坐标
let fiNodeBlock = nodeLeftRecommend.addComponent(FocusInfo);
fiNodeBlock.init(
aLeftRecommend[i].tvlink, true, null, null, 1.0 //最后一个参数决定要不要放大显示
);
this._aFocusTargets[0]["TopCell" + i] = nodeLeftRecommend;
}
},
//请求右侧导航
getRightBgRequest: function () {
var arrModules = TestLayout.layout4Page.children; //拿到模拟数据
let aLeftRecommend = arrModules[2].data.resultSet; //顶部导航栏数据
let count = aLeftRecommend.length;
var rightNavLayout = this.targetAry[2].target;
rightNavLayout.width = arrModules[2].width;
rightNavLayout.height = arrModules[2].height;
this._iRightRecommendHeight = arrModules[2].width;
if (arrModules[2].position[0] && arrModules[2].position[1]) { //确定位置
rightNavLayout.getComponent(cc.Widget).top = arrModules[2].position[1] + 20; //加20是内边距
rightNavLayout.getComponent(cc.Widget).left = arrModules[2].position[0] + 20;
}
},
//渲染推荐框架
getRightRecommendRequest: function (waterfall_model) {
var rightNodeLayout = this.targetAry[2].target;
var arrModules = waterfall_model.waterfall; //拿到模拟数据
var bgHeight = 0;
this._aBgHeight = [];
this._aBgHeight.push(0);
for (let i = 0; i < arrModules.resultSet.length; i++) {
let nodeLayout = new cc.Node(arrModules.resultSet[i].name); //创建瀑布流的每一层layout
nodeLayout.width = this._iRightRecommendHeight;
nodeLayout.height = arrModules.resultSet[i].height;
var widgetLayout = nodeLayout.addComponent(cc.Widget);
widgetLayout.isAlignTop = true;
widgetLayout.top = bgHeight;
bgHeight += arrModules.resultSet[i].height; //逐层增加高度
// cc.log("高度"+bgHeight);
if (i == arrModules.resultSet.length - 1) { //最后一个条目不够高,手动加高
bgHeight += 300;
}
this._aBgHeight.push(bgHeight);
if (arrModules.resultSet[i].hasChildFrame) { //还有子列表
for (let j = 0; j < arrModules.resultSet[i].data.resultSet.length; j++) {
let oModule = arrModules.resultSet[i].data.resultSet[j];
if (oModule.hasChildFrame) {
let autoNode = new cc.Node(); //创建特殊层的第二层自动填充的布局
let autoNodeLayout = autoNode.addComponent(cc.Layout);
autoNodeLayout.type = cc.Layout.Type.GRID; //网格
autoNodeLayout.resizeMode = cc.Layout.ResizeMode.CHILDREN; //对子节点大小进行缩放
autoNodeLayout.startAxis = cc.Layout.AxisDirection.HORIZONTAL; //排版起始轴
autoNodeLayout.horizontalDirection = cc.Layout.HorizontalDirection.LEFT_TO_RIGHT; //布局方向
let widgetAutoNode = autoNode.addComponent(cc.Widget);
widgetAutoNode.isAlignLeft = true;
widgetAutoNode.isAlignTop = true;
autoNode.width = oModule.width; //获取自动布局宽高
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
autoNode.height = oModule.childrenSize[1]; //拿子节点的高
autoNodeLayout.cellSize = new cc.size(oModule.childrenSize[0], oModule.childrenSize[1]);
}
if (oModule.childrenMargin[1]) { //细胞间隔小些
autoNodeLayout.spacingX = oModule.childrenMargin[1] / 2;
}
if (oModule.position[0] != "undefined" && oModule.position[1] != "undefined") { //确定位置
widgetAutoNode.top = oModule.position[1];
widgetAutoNode.left = oModule.position[0];
}
for (let k = 0; k < oModule.data.resultSet.length; k++) { //渲染子细胞
let node = cc.instantiate(this.PFB_RECOMMEND_RIGHT);
if (oModule.childrenSize[0] && oModule.childrenSize[1]) {
node.height = oModule.childrenSize[1]; //拿子节点的高
node.width = oModule.childrenSize[0];
node.getChildByName('Pic').height = oModule.childrenSize[1]; //拿子节点的高
node.getChildByName('Pic').width = oModule.childrenSize[0];
}
autoNode.addChild(node, 10, oModule.data.resultSet[k].code);
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
// fiNodeBlock.init(
// oParameter.promotion_items[i].tvlink, true, null, null, 1.0 //最后一个参数决定要不要放大显示
// );
this._aFocusTargets[0][oModule.data.resultSet[k].code] = node;
}
// autoNode.parent=nodeLayout;
// cc.log("添加循环子节点"+autoNode.childrenCount);
nodeLayout.addChild(autoNode, 10, "hasChildFrame");
} else {
let node = cc.instantiate(this.PFB_RECOMMEND_RIGHT);
node.width = oModule.width;
node.height = oModule.height;
node.getChildByName('Pic').width = oModule.width;
node.getChildByName('Pic').height = oModule.height;
node.getComponent(cc.Widget).top = oModule.top;
node.getComponent(cc.Widget).left = oModule.left;
nodeLayout.addChild(node, 10, oModule.code);
if (!oModule.disable) { //标题不给他焦点
//准备焦点坐标
let fiNodeBlock = node.addComponent(FocusInfo);
// fiNodeBlock.init(
// oParameter.promotion_items[i].tvlink, true, null, null, 1.0 //最后一个参数决定要不要放大显示
// );
this._aFocusTargets[0][oModule.code] = node;
}
}
}
}
nodeLayout.parent = rightNodeLayout;
// cc.log("子节点:"+nodeLayout.childrenCount);
}
this.node.getChildByName("ScrollContent").height = 2539; //这里暂且写死,scrollView有bug
cc.log("ScrollView高度: " + bgHeight); 2239
this._scrollview.scrollToTop();
// cc.log("ScrollView相对的偏移量 "+this._scrollview.getMaxScrollOffset());
// cc.log("子节点个数: "+rightNodeLayout.childrenCount);
this.getNaviPromotion("page_d14e8acf-db3d-4f74-b535-c98458596eb8");
},
//请求各导航推荐位图片
getNaviPromotion: function (pageCode) {
var self = this;
var oGetPromotionPara = {
"view": "json",
"pageCode": pageCode,
token: Common.TEST_API_TOKEN_EDU,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER_EDU + "Promotion/ListItemByPage", null, oGetPromotionPara,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
var rightNodeLayout = this.targetAry[2].target;
let bolockCount = rightNodeLayout.childrenCount; //组个数
for (let i = 0; i < oJSONResult.resultSet.length; i++) { //先循环对比最外层
for (let j = 0; j < bolockCount; j++) {
if (oJSONResult.resultSet[i].name == rightNodeLayout.children[j].name) {
for (let m = 0; m < oJSONResult.resultSet[i].promotions[0].promotion_items.length; m++) { //对比内层
for (let n = 0; n < rightNodeLayout.children[j].childrenCount; n++) {
let currentRemote = oJSONResult.resultSet[i].promotions[0].promotion_items[m];//匹配的远程条目
let currentNode = rightNodeLayout.children[j].children[n]; //匹配的已经渲染过的节点
if (currentRemote.code == currentNode.name) {
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER_EDU_RIGHT + currentRemote.image[0].fileUrl,
function (texture) {
currentNode.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, null, this
);
} else if (currentNode.name == "hasChildFrame" && currentNode.childrenCount > 0) { //渲染自动布局的节点
for (let k = 0; k < currentNode.childrenCount; k++) {
let sonCurrentNode = currentNode.children[k];
if (currentRemote.code == sonCurrentNode.name) {
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER_EDU_RIGHT + currentRemote.image[0].fileUrl,
function (texture) {
sonCurrentNode.getChildByName('Pic').getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
}, null, this
);
}
}
}
}
}
}
}
}
} catch (error) {
cc.log("Exception When FloorPromotion..." + error);
}
},
function (strResponse) {
cc.log("Error When FloorPromotion..." + strResponse);
}, this, "uuid");
},
checkDataReadyAndInitFocus: function () {
if (!this._bIsFocusInit) {
this.scheduleOnce(() => { //指定0让回调函数在下一帧立即执行
this.initFocus();
}, 0);
this._bIsFocusInit = true;
}
},
//初始化焦点框
initFocus: function () {
var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node);
// cc.log("初始化 "+nodeInitFocus.name);
var nodeFocus = new cc.Node('nodeFocus');
this.node.addChild(nodeFocus, 10);
this._cFocus = this.node.getChildByName('nodeFocus').addComponent(CCTVFocus);
this._cFocus.init('focusContainer', this,
nodeInitFocus.getComponent(FocusInfo),
Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 2, 6, 1.0, true);
if (0 == nodeInitFocus.name.indexOf('NaviCell')) {
// nodeInitFocus.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, nodeInitFocus.height, nodeInitFocus.width, nodeInitFocus.height));
Network.loadImageInNativeRuntime(
this._oInit.aLeftImg[0],
function (texture) {
nodeInitFocus.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, nodeInitFocus.height, nodeInitFocus.width, nodeInitFocus.height));
}, null, this
);
}
},
onBeforeFocusChange: function (event) {
this._super(event);
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
if (0 == this._fiCurrentFocus.node.getName().indexOf('NaviCell') && 0 == fiTo.node.getName().indexOf('NaviCell')) {
// fiFrom.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
let iIndex = fiFrom.node.name.replace("NaviCell", '');
if (this._oInit.aLeftImg[iIndex]) {
Network.loadImageInNativeRuntime(
this._oInit.aLeftImg[iIndex],
function (texture) {
fiFrom.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
}, null, this
);
}
}
if (0 == this._fiCurrentFocus.node.getName().indexOf('TopCell')) {
// fiFrom.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
let iIndex = fiFrom.node.name.replace("TopCell", '');
if (this._oInit.aTopImg[iIndex]) {
Network.loadImageInNativeRuntime(
this._oInit.aTopImg[iIndex],
function (texture) {
fiFrom.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
}, null, this
);
}
}
},
onAfterFocusChange: function (event) {
this._super(event);
let fiTo = event.detail.to;
let fiFrom = event.detail.from;
if (0 == fiTo.node.getName().indexOf('NaviCell')) {
let iIndex = fiTo.node.name.replace("NaviCell", '');
// fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
if (this._oInit.aLeftImg[iIndex]) {
Network.loadImageInNativeRuntime(
this._oInit.aLeftImg[iIndex],
function (texture) {
fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
}, null, this
);
}
this._oSceneContext._iCurrentLeftIndex = iIndex;
}
if (0 == fiTo.node.getName().indexOf('TopCell')) {
let iIndex = fiTo.node.name.replace("TopCell", '');
// fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
if (this._oInit.aTopImg[iIndex]) {
Network.loadImageInNativeRuntime(
this._oInit.aTopImg[iIndex],
function (texture) {
fiTo.node.getChildByName("Pic").getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
}, null, this
);
}
}
},
keyDownDirection: function (Direct) {
var fiFocusTarget = null;
var fiCurrentFocus = this._fiCurrentFocus;
var oScrollParameter = null;
let aCheckResult;
fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, 0, Direct);
if (!fiFocusTarget) { return; }
aCheckResult = this.checkFocusTarget(fiFocusTarget);
fiFocusTarget = aCheckResult[0];
oScrollParameter = aCheckResult[1];
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Direct, null, oScrollParameter);
},
checkFocusTarget: function (fiFocusTarget, oScrollParameter) {
var leftNavLayout = this.targetAry[0].target;
if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("NaviCell")) {
if (0 != this._fiCurrentFocus.node.name.indexOf("NaviCell")) {//如果不是TypeList之间跳转,则哪里来回哪里去
fiFocusTarget = cc.find("NaviCell" + this._oSceneContext._iCurrentLeftIndex, leftNavLayout).getComponent(FocusInfo);
}
}
return [fiFocusTarget, oScrollParameter];
},
onKeyDown: function (event) {
this._super(event);
var fiFocusTarget = null;
var fiCurrentFocus = this._fiCurrentFocus;
switch (event.keyCode) {
case cc.macro.KEY.up:
case Common.ANDROID_KEY.up:
fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, this._iSceneStatus, Common.MOVE_DIRECTION_UP);
if (!fiFocusTarget) { return; }
let iTargetTopUp = 0;
if (0 == fiFocusTarget.node.getParent().getParent().name.indexOf("block")) { //嵌套了两层的布局
iTargetTopUp = fiFocusTarget.node.getParent().getParent().getComponent(cc.Widget).top;
} else {
iTargetTopUp = fiFocusTarget.node.getParent().getComponent(cc.Widget).top;
}
// cc.log("目标节点: "+fiCurrentFocus.node.name);
let iCurrentFloorBottomUp = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度
// cc.log(iCurrentFloorBottomUp + "目标节点的高度:" + iTargetTopUp);
if (iTargetTopUp < iCurrentFloorBottomUp && fiCurrentFocus.node.name.indexOf("NaviCell") == -1) {
if (this._oSceneContext._iPageIndex > 1) {
//---------------隐藏焦点0.6秒,就看不到焦点框长时间的跳转------------------
this._cFocus.hide();
setTimeout(function () {
this._cFocus.show();
}.bind(this), 600);
//----------------------------------------------------------------------
this._oSceneContext._iPageIndex--;
let height = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0; //520,750,1177,1463,1737,2119,2239
this._scrollview.scrollToOffset(cc.v2(0, height), 0.5);
// cc.log("滚动到:" + height);
setTimeout(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_UP);
}.bind(this), 300);
return;
}
}
this.keyDownDirection(Common.MOVE_DIRECTION_UP);
break;
case cc.macro.KEY.right:
case Common.ANDROID_KEY.right:
this.keyDownDirection(Common.MOVE_DIRECTION_RIGHT);
break;
case cc.macro.KEY.down:
case Common.ANDROID_KEY.down:
fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, this._iSceneStatus, Common.MOVE_DIRECTION_DOWN);
if (!fiFocusTarget) { return; }
let iTargetTop = 0;
if (0 == fiFocusTarget.node.getParent().getParent().name.indexOf("block")) { //嵌套了两层的布局
iTargetTop = fiFocusTarget.node.getParent().getParent().getComponent(cc.Widget).top;
} else {
iTargetTop = fiFocusTarget.node.getParent().getComponent(cc.Widget).top;
}
let iCurrentFloorBottom = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0;//当前楼层底部高度
// cc.log(iCurrentFloorBottom+"目标节点的高度:"+iTargetTop);
if (iTargetTop > iCurrentFloorBottom && fiCurrentFocus.node.name.indexOf("NaviCell") == -1) {
if (this._oSceneContext._iPageIndex < this._aBgHeight.length - 1) {
//---------------隐藏焦点0.6秒,就看不到焦点框长时间的跳转------------------
this._cFocus.hide();
setTimeout(function () {
this._cFocus.show();
}.bind(this), 600);
//----------------------------------------------------------------------
let height = this._aBgHeight[this._oSceneContext._iPageIndex] || 0; //520,750,1177,1463,1737,2119,2239
this._scrollview.scrollToOffset(cc.v2(0, height), 0.5);
// cc.log("滚动到:"+height);
this._oSceneContext._iPageIndex++;
setTimeout(function () {
this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
}.bind(this), 300);
return;
}
}
this.keyDownDirection(Common.MOVE_DIRECTION_DOWN);
break;
case cc.macro.KEY.left:
case Common.ANDROID_KEY.left:
this.keyDownDirection(Common.MOVE_DIRECTION_LEFT);
break;
case cc.macro.KEY.enter:
case cc.macro.KEY.space:
case Common.ANDROID_KEY.enter:
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
break;
case cc.macro.KEY.backspace:
case Common.ANDROID_KEY.back:
this.backAScene();
break;
}
},
doCurrentFocusTVLinkAction: function (strAction) {
let strTVLink = this._fiCurrentFocus.getTVLink();
cc.log("tvlink===============" + strTVLink);
try {
let oTVLink = JSON.parse(strTVLink);
let aOperationList = oTVLink.click;
var rightNavLayout = this.targetAry[2].target;
rightNavLayout.destroyAllChildren(); //销毁完以前所有的子模块
this._oSceneContext._iPageIndex = 1;
for (let i = 0; i < aOperationList.length; i++) {
switch (aOperationList[i].action) {
case "changeLayout":
let model = aOperationList[i].parameters.layoutPath; //获取要加载的框架
if (-1 != model.indexOf("waterfall_recommend")) {
this.getRightRecommendRequest(waterfall_recommend); //渲染右侧推荐框架
} else if (-1 != model.indexOf("waterfall_parent")) {
this.getRightRecommendRequest(waterfall_parent); //渲染右侧推荐框架
} else if (-1 != model.indexOf("waterfall_course")) {
this.getRightRecommendRequest(waterfall_course); //渲染右侧推荐框架
} else if (-1 != model.indexOf("waterfall_primarySchool")) {
this.getRightRecommendRequest(waterfall_primarySchool); //渲染右侧推荐框架
} else if (-1 != model.indexOf("waterfall_three2six")) {
this.getRightRecommendRequest(waterfall_three2six); //渲染右侧推荐框架
}
break;
default:
// this.doTVLinkAction(aOperationList[i]);
break;
}
}
} catch (error) {
cc.log("runTVLinkAction Exception..." + error);
}
},
});
{
"ver": "1.0.5",
"uuid": "280c3aec-6492-4a9d-9f51-a9b00b570b4a",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//模拟动态数据
cc.Class({
extends: cc.Component,
statics: {
layout4Page: {
id: 121,//每个页面对应一个pageId,后台创建下发生成
name: "首页",//page layout名称
code: "eb954b1e-712e-415c-ba27-ddcf60f64adf",//每个页面对应一个pageCode,后台创建生成
layout: "absolute",//页面整理布局,非必填字段
children: [
{
"name": "Navigator",/* 左侧导航 */
"layout": "vertical",//浮动式垂直布局
"position": [44, 98],//框架的起始坐标
"childrenSize": [166, 94],//子元素尺寸
"childrenMargin": [0, 0, 3, 0],//子元素边距
"dataContainer": "promotion_list",//列表名称
"data": {/* 对于数据比较少的采取这种方式或者本地数据 */
"name": "Navigator",
"resultSet": [
{
"name": "recommend",//项名称 填写比较规范
"tvlink": '{"click": [{"action": "changeLayout","parameters": {"layoutPath": "layout/waterfall_recommend.json"}}]}',//项动作
"type": "promotion_item",//项类型 非必填
"imageURL": "image/navigator/recommend.png",//项图片路径
"top": 120,
"left": 100,
},
{
"name": "three2six",
"tvlink": '{"click": [{"action": "changeLayout","parameters": {"layoutPath": "layout/waterfall_three2six.json"}}]}',
"type": "promotion_item",
"imageURL": "image/navigator/three2six.png",
"top": 240,
"left": 100,
},
{
"name": "primarySchool",
"tvlink": '{"click": [{"action": "changeLayout","parameters": {"layoutPath": "layout/waterfall_primarySchool.json"}}]}',
"type": "promotion_item",
"imageURL": "image/navigator/primary.png",
"top": 360,
"left": 100,
},
{
"name": "course",
"tvlink": '{"click": [{"action": "changeLayout","parameters": {"layoutPath": "layout/waterfall_course.json"}}]}',
"type": "promotion_item",
"imageURL": "image/navigator/course.png",
"top": 480,
"left": 100,
},
{
"name": "parent",
"tvlink": '{"click": [{"action": "changeLayout","parameters": {"layoutPath": "layout/waterfall_parent.json"}}]}',
"type": "promotion_item",
"imageURL": "image/navigator/parent.png",
"top": 600,
"left": 100,
}
]
},
// "dataSrc" : "layout/navigator.json",
"dataTmpl": "tmplNavigator",//数据渲染jsrender模板
"cellName": "navigator_list_cell"//渲染元素class和id前缀
},
{
"name": "Additional",/* 我的、搜索、历史 - 在右上角 */
"layout": "absolute",//绝对布局
"position": [0, 0],//框架的起点坐标
"focusstatus": 2,//列表元素焦点状态位,默认是0
"dataContainer": "addition_list",//列表容器id
"data": {//数据列表
"name": "Addition",//模块名称
"resultSet": [
{
"name": "我的",
"left": 822,
"top": 19,
"width": 137,
"height": 65,
"tvlink": "{click: [{action: 'changeUI',parameters: {uiName: 'collection'}}]}",
"type" : "promotion_item",
"imageURL": "image/addition/my.png"
},
{
"name": "历史",
"left": 965,
"top": 19,
"width": 137,
"height": 65,
"tvlink": "{click: [{action: 'changeUI',parameters: {uiName: 'history'}}]}",
"type" : "promotion_item",
"imageURL": "image/addition/history.png"
},
{
"name": "搜索",
"left": 1108,
"top": 19,
"width": 137,
"height": 65,
"tvlink": "{click: [{action: 'changeUI',parameters: {uiName: 'search'}}]}",
"type" : "promotion_item",
"imageURL": "image/addition/search.png"
}
]
},
//"dataSrc" : "layout/addition.json",
"dataTmpl": "tmplAddition",
"cellName": "addition_list_cell"
},
{
"name": "WaterFall",/* 右侧瀑布流 */
"layout": "abosolute",
"position": [207, 78],
"width": 1100,//框架宽度
"height": 642,//框架高度
"extraClass": "move_transition",
"dataContainer": "waterfall_list_wrapper",
"data": {
"name": "WaterFallList",
"resultSet": [
{
"name": "WaterFallList",
"layout": "absolute",
"position": [20, 20],//这里是根据上下文拿
"disable": true,//是否是焦点控件
"containerId": "waterfall_list",//个性化元素id
"dataContainer": "waterfall_list",
"hasChildFrame": true,//是否有子框架
"frozen": true,//是否冻结获得的框架数据,在后续适当时机再解除冻结,继续渲染框架和数据 true 冻结 false 不冻结
"data": [],
"dataSrc": "layout/waterfall_recommend.json",//在没有data的情况下,dataSrc生效,并且成为请求数据路径的参考,是否要在远程服务器地址,视页面情况而定
"dataTmpl": "tmplPromotionGroup",//渲染jsrender模板
"cellName": "group_list",//同上
"childLayout": "absolute",//子元素布局,子元素框架可继承父元素框架
"childDataTmpl": "tmplPromotionGroupCell",//子元素渲染的jsrender模板
"childFramePath": "layout/recommend/"//子元素渲染框架路径
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",//jsrender渲染模板
"cellName": "waterfall_list"//同上
}
]
},
}
});
{
"ver": "1.0.5",
"uuid": "ad5a92b2-a39c-4f97-bc28-be933f018df5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "61ec49b6-05b5-4ed9-a3d4-e5a49ec26335",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
properties: {
//键值由具体场景决定
_aSceneContext:{default:[]},
/*
{
categoryId:123,
history:[]
}
/*/
_aSceneParameter:{default:[]},
_bBackStatus:false,
_iDefaultCollectionId:-1,
_iTotalFrames:0,
},
// use this for initialization
onLoad: function () {
this._aSceneContext=[];
this._aSceneParameter=[];
},
getSceneContext:function(){
return this._aSceneContext;
},
popSceneContext:function(){
return this._aSceneContext.pop();
},
getTopSceneContext:function(){
return this._aSceneContext[this._aSceneContext.length-1];
},
setSceneContext:function(aSceneContext){
this._aSceneContext=aSceneContext;
},
getSceneParameter:function(){
return this._aSceneParameter;
},
popSceneParameter:function(){
return this._aSceneParameter.pop();
},
getTopSceneParameter:function(){
return this._aSceneParameter[this._aSceneParameter.length-1];
},
setSceneParameter:function(aSceneParameter){
this._aSceneParameter=aSceneParameter;
},
getBackStatus:function(){
return this._bBackStatus;
},
setBackStatus:function(bBackStatus){
this._bBackStatus=bBackStatus;
},
getDefaultCollectionId:function(){
return this._iDefaultCollectionId;
},
setDefaultCollectionId:function(iCollectionId){
this._iDefaultCollectionId=iCollectionId;
},
setTotalFrames:function(iFrames){
this._iTotalFrames=iFrames;
},
getTotalFrames:function(){
return this._iTotalFrames;
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});
{
"ver": "1.0.5",
"uuid": "9e3446c8-49f7-4eeb-8b1d-eb7f6c0e2fd8",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//公用参数
cc.Class({
extends: cc.Component,
statics: {
CARTOON_SPECIAL: '0',
//各应用基础分类
SONG_CATEGORY:"20",
ENHLISH_CATEGORY:"34",
STORY_CATEGORY:"43",
SCIENCE_CATEGORY:"46",
EDUCATION_CATEGORY:"35",
CLASSICAL_CATEGORY:"32",
ART_CATEGORY:"65",
//各应用appId
SONG_APPID:"td9c60ab5ba1f3c44c",
ENHLISH_APPID:"tdde7add064d218a84",
STORY_APPID:"td16283e54e262f207",
SCIENCE_APPID:"td9eeab808e4d1a4b7",
EDUCATION_APPID:"td8765403b3f38d1a8",
CLASSICAL_APPID:"td7a74235419ac55ee",
ART_APPID:"tdd72ee5abf9a38754",
CARTOON_APPID:"tda7e47f868313d9f5",
//各应用免费分类id
SONG_FREE_CID:"143",
ENGLISH_FREE_CID:"149",
STORY_FREE_CID:"152",
SCIENCE_FREE_CID:"158",
EDUCATION_FREE_CID:"155",
CLASSICAL_FREE_CID:"146",
ART_FREE_CID:"161",
},
});
{
"ver": "1.0.5",
"uuid": "764bc77a-675b-4ee3-8a09-865c957071d7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//修改Network,解决闪屏问题
var Network = require('Network');
cc.Class({
extends: Network,
properties: {
},
// use this for initialization
onLoad: function () {
},
statics: {
//_count: 0,
/*
var txt = document.getElementById('txt');
//1.创建XMLHttpRequest对象
var xhr = null;
if(window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
}else {
xhr = new ActiveXObject('Microsoft.XMLHTTP');
}
//2.打开与服务器的链接
xhr.open('get',url,false);
//3.发送给服务器
xhr.send(null);
//4.响应就绪(同步请求)
var json = JSON.parse(xhr.responseText);
txt.innerHTML = json;
cc.log('其他程序');
*/
//ajax请求函数
ajax: function (strMethod, strURL, astrContentType, oDataOrPostBody, onSuccess, onError, oScope, oAdditionalData) {
var xlr = null;
var oResult = {};
if (window.XMLHttpRequest) {// code for IE7, Firefox, Opera, etc.
xlr = new XMLHttpRequest(); //Log.info('XMLHttpRequest');
} else if (window.ActiveXObject) {// code for IE6, IE5
xlr = new ActiveXObject("Microsoft.XMLHTTP"); //Log.info('ActiveXObject');
}
if (!xlr) {
cc.log("Your browser does not support XMLHTTP, using iframe instead..");
//退化到使用iframe 在cocos中无用 //这里两个函数名需要字符串输入
//iframeRequest(strMethod, strURL, astrContentType, oDataOrPostBody, onSuccess, onError, oAdditionalData)
return;
}
function onStateChange() {
if (xlr.readyState == 4) {// 4 = "loaded"
if (xlr.status == 200) {// 200 = OK
if (null != oScope) {
onSuccess.call(oScope, xlr.responseText, oAdditionalData);
} else {
onSuccess(xlr.responseText, oAdditionalData);
}
} else {
if (null != oScope) {
onError.call(oScope, xlr.responseText, oAdditionalData);
} else {
onError(xlr.responseText, oAdditionalData);
}
}
xlr = null;
}
}
strMethod = strMethod.toUpperCase();
var strDataOrPostBody = '';
if (strMethod == "GET") {
//以下这段可使用正则表达式改造
if (oDataOrPostBody) {
if (strURL.indexOf('?') > 0) { //有问号
if (strURL.indexOf('=') > strURL.indexOf('?') //并且有等号在问号右边
&& strURL.lastIndexOf('&') != strURL.length - 1) //最后一个不是&
{
strURL = strURL.concat('&');
} else { //光有问号没等号
cc.log('Unavailable Request URL!');
return;
}
} else {//没问号
strURL = strURL.concat('?');
}
if (typeof oDataOrPostBody == "string") {
strDataOrPostBody = oDataOrPostBody;
} else if (oDataOrPostBody instanceof Object) {
for (var key in oDataOrPostBody) {
strDataOrPostBody = strDataOrPostBody.concat(key).concat('=').concat(oDataOrPostBody[key]).concat('&');
}
strDataOrPostBody = strDataOrPostBody.substring(0, strDataOrPostBody.length - 1);
//strDataOrPostBody.TrimEnd('&');
} else {
cc.log('Unavailable Parameters!');
return;
}
}
strURL = strURL.concat(strDataOrPostBody);
}
xlr.onreadystatechange = onStateChange;
xlr.open(strMethod, strURL, true);
var isWWWFormURLEncoded = false;
if (astrContentType) {
for (var i = 0; i < astrContentType.length; i++) {
xlr.setRequestHeader('Content-type', astrContentType[i]);
if (astrContentType[i] == 'application/x-www-form-urlencoded') {
isWWWFormURLEncoded = true;
break;
}
}
}
//xlr.setRequestHeader('Connection', 'close');
switch (strMethod) {
case 'GET':
xlr.send(null);
break;
case 'POST':
if (isWWWFormURLEncoded) {
}
if (oDataOrPostBody) {
/*
if (isWWWFormURLEncoded) {
var fd=new FormData();
if (typeof oDataOrPostBody == "string") {
strDataOrPostBody = oDataOrPostBody;
var aParameters1=oDataOrPostBody.split('&');
for (var i=0;i<aParameters1.length;i++){
var aPairs1=aParameters1.split('=');
if (aPairs1[0] && aPairs1[1]){
fd.append(aPairs1[0],aPairs1[1]);
}
}
} else if (oDataOrPostBody instanceof Object) {
for (var key in oDataOrPostBody) {
fd.append(key,oDataOrPostBody[key]);
}
//strDataOrPostBody.TrimEnd('&');
//strDataOrPostBody = strDataOrPostBody.substring(0, strDataOrPostBody.length - 1);
} else {
console.log("Unavailable Parameters!");
return
}
xlr.send(fd);
}else{*/
if (typeof oDataOrPostBody == "string") {
strDataOrPostBody = oDataOrPostBody;
} else if (oDataOrPostBody instanceof Object) {
for (var key in oDataOrPostBody) {
strDataOrPostBody = strDataOrPostBody.concat(key).concat('=').concat(oDataOrPostBody[key]).concat('&');
}
//strDataOrPostBody.TrimEnd('&');
strDataOrPostBody = strDataOrPostBody.substring(0, strDataOrPostBody.length - 1);
} else {
oResult.businessCode = 'success';
oResult.description = 'Unavailable Parameters!';
return oResult;
}
xlr.send(strDataOrPostBody);
//}
} else {
xlr.send(null);
}
break;
}
// cc.director.on(cc.Director.EVENT_BEFORE_SCENE_LOADING, function () {
// // cc.log("运行新场景之前所触发的事件------------->");
// xlr.abort();
// });
},
loadImageInJSRuntime: function (strURL, iRequestId, onSuccess, onError, oScope) {
cc.loader.load(
{
url: strURL,
isCrossOrigin: false,
type: 'jpg' //防止跨域问题
},
function (err, texture) {
if (!err) {
if (null != oScope) {
onSuccess.call(oScope, texture, iRequestId);
} else {
onSuccess(texture);
}
} else {
if (null != oScope) {
onError.call(oScope, err, iRequestId);
} else {
onError(err);
}
}
}
);
},
loadImageInNativeRuntime: function (strURL, iRequestId, onSuccess, onError, oScope) {
cc.loader.load(strURL, function (err, texture) {
if (null != oScope) {
onSuccess.call(oScope, texture, iRequestId);
} else {
onSuccess(texture);
}
cc.log('Should load a texture from external url: ' + (texture instanceof cc.Texture2D));
});
},
},
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});
{
"ver": "1.0.5",
"uuid": "77b9f0db-8832-41b4-b51f-ca5fd671b093",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
properties: {
},
// use this for initialization
onLoad: function () {
},
statics: {
SCREEN_WIDTH: 1280.0,
SCREEN_HEIGHT: 720.0,
MOVE_DIRECTION_UP: 0,
MOVE_DIRECTION_RIGHT: 1,
MOVE_DIRECTION_DOWN: 2,
MOVE_DIRECTION_LEFT: 3,
FOCUS_FLY_DURATION: 0.3,
FOCUS_BREATH_DURATION: 0.8,
//Action Tag
FEATURE_NODE_TRANSFER: 1,
FOCUS_CELL_TRANSFER: 1,
FOCUS_CONTAINER_TRANSFER: 1,
FOCUS_CONTAINER_BREATH: 2,
FOCUS_CONTAINER_JOGGLE: 3,
OVERLENGTH_MOVING: 4,
SCROLL_BY_FOCUS_CHANGE: 5,
API_SORT_ASC: 'asc',
API_SORT_DESC: 'desc',
FEMALE: 0,
MALE: 1,
BAND: 2,
ANDROID_KEY: {
back: 6,
up: 1003,
right: 1001,
down: 1004,
left: 1000,
enter: 1005
},
BUSINESS_PARAMETER: {
// {:,
},
//天津少儿2.0测试接口
// TOPDRAW_API_SERVER:'http://202.99.114.74:52118/hyperion.chimera/',
// TOPDRAW_API_SERVER2:'http://202.99.114.74:52118/hyperion.archer/',
// TOPDRAW_IMAGE_SERVER:'http://202.99.114.74:52118/hyperion.resource/',
//新部署测试接口
TOPDRAW_API_SERVER: 'http://139.196.192.242:8080/hyperion.chimera/',
TOPDRAW_API_SERVER2: 'http://139.196.192.242:8080/hyperion.archer/',
TOPDRAW_IMAGE_SERVER: 'http://139.196.192.242:8080/hyperion.resource/',
// TOPDRAW_API_SERVER : "http://111.11.189.12:8080/hyperion.chimera/", //暂且取用EPG数据
// TOPDRAW_IMAGE_SERVER : "http://111.11.189.12:8080/hyperion.resource/",
// TOPDRAW_API_SERVER2:'http://111.11.189.12:8080/hyperion.archer/',
TEST_API_TOKEN: 'dd4b1968eb5b417e834c2687e23d2471',
//教育
TOPDRAW_API_SERVER_EDU: 'http://139.196.4.234:38080/hyperion.chimera/',
TOPDRAW_IMAGE_SERVER_EDU: 'http://139.196.4.234:38080/eduHall/pages/index/',
TOPDRAW_IMAGE_SERVER_EDU_RIGHT: 'http://139.196.4.234:38080/hyperion.resource/',
TEST_API_TOKEN_EDU: 'b4863228c5ef4593991ad4cc83f0cabf',
BI_BASE_PATH: 'http://139.196.192.242:82/1.gif',
TV_LINK_ACTION_CLICK: 100,
TV_LINK_ACTION_HOVER: 101,
// TEST_API_TOKEN:'8a56a215e7be4cf6910990d4d7c95e2c',
USER_ID: '1',
AUTH_STATUS: 0,
DEBUG_MODE: 0,//0非调试模式,1调试模式
APP_VERSION_NAME: '1.0.0',
g_strCurrentSceneName: "",
loadRes: function (strResourceURL,/*iResourceIndex,*/onSuccess, onError, oScope) {
cc.loader.loadRes(strResourceURL,
function (error, loadedResource) {
if (error) {
if (null != oScope) {
onError.call(oScope, error);
} else {
onError(error);
}
} else {
if (null != oScope) {
onSuccess.call(oScope, loadedResource/*,iResourceIndex*/);
} else {
onSuccess(loadedResource/*,iResourceIndex*/);
}
}
}
);
},
setTimeout: function (onTimeComplete, iDuration, oScope, argements) {
/*
window.setTimeout(onTimeComplete,iDuration,);
cc.loader.loadRes(strResourceURL,
function(error,loadedResource){
if (error){
if(null!=oScope){
onError.call(oScope,error);
}else{
onError(error);
}
}else{
if(null!=oScope){
onSuccess.call(oScope,loadedResource);
}else{
onSuccess(loadedResource);
}
}
}
);
*/
},
getAbsolutePositionX: function (node) {
},
getAbsolutePositionY: function (node) {
},
promiseAjax: function () {
},
getNodePath: function (node) {
let strPath = "";
while (node.parent && node.parent.parent) {//不算TopCanvas
strPath = "/" + node.name + strPath;
node = node.parent;
}
return strPath.substring(1);
},
getX: function (tempNode) {
let fCenterX = 0;
while (tempNode.parent.parent) {//不算TopCanvas
//cc.log(tempNode.name+" X: "+tempNode.x)
fCenterX += tempNode.x;
tempNode = tempNode.parent;
}
return fCenterX;
},
getY: function (tempNode) {
let fCenterY = 0;
while (tempNode.parent.parent) {//不算TopCanvas
//cc.log(tempNode.name+" Y: "+tempNode.y)
fCenterY += tempNode.y;
tempNode = tempNode.parent;
}
return fCenterY;
},
/**
* 用于合并对象 By Eva
* @param target
* @param firstSource
* @returns {any}
*/
assign: function (target, firstSource) {
if (target === undefined || target === null)
throw new TypeError("Cannot convert first argument to object");
var to = Object(target);
for (var i = 1; i < arguments.length; i++) {
var nextSource = arguments[i];
if (nextSource === undefined || nextSource === null) continue;
var keysArray = Object.keys(Object(nextSource));
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
var nextKey = keysArray[nextIndex];
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (desc !== undefined && desc.enumerable) to[nextKey] = nextSource[nextKey];
}
}
return to;
},
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});
{
"ver": "1.0.5",
"uuid": "23d179fb-41db-4a22-9803-860d7e587a34",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
var Common = require('Common');
var FocusInfo = require('FocusInfo');
cc.Class({
extends: cc.Component,
properties: {
// TODO: to be a real Component?
//_fLeft:0,
//_fTop:0,
//_fWidth:0,
//_fHeight:0,
//_oFocusNode:null,//deprecated
_strTVLink: '',
_bEnable: false,
_fScaleFactor: 1.06,
},
//ctor: function (fLeft,fTop,fWidth,fHeight,oFocusNode,strTVLink,bEnable,fnOnFocus,fnOnBlur) {
ctor: function () {
//this._fLeft=arguments[0];
//this._fTop=arguments[1];
//this._fWidth=arguments[2];
//this._fHeight=arguments[3];
//this._oFocusNode=arguments[4];
this._strTVLink = arguments[0];
this._bEnable = arguments[1];
this._fnOnFocus = arguments[2];
this._fnOnBlur = arguments[3];
//this._fLeft=fLeft;
//this._fTop=fTop;
//this._fWidth=fWidth;
//this._fHeight=fHeight;
//this._oFocusNode=oFocusNode;
},
init: function (/*fLeft,fTop,fWidth,fHeight,oFocusNode,*/strTVLink, bEnable, fnOnFocus, fnOnBlur, fScaleFactor) {
//this._fLeft=arguments[0];
//this._fTop=arguments[1];
//this._fWidth=arguments[2];
//this._fHeight=arguments[3];
//this._oFocusNode=arguments[4];
this._strTVLink = strTVLink;
this._bEnable = bEnable;
this._fnOnFocus = fnOnFocus;
this._fnOnBlur = fnOnBlur;
this._fScaleFactor = fScaleFactor;
//this._fLeft=fLeft;
//this._fTop=fTop;
//this._fWidth=fWidth;
//this._fHeight=fHeight;
//this._oFocusNode=oFocusNode;
},
// use this for initialization
onLoad: function () {
//气泡式向上传递 通常收不到
//this.node.on('foucs', this._fnOnFocus || function(){},this);
//this.node.on('blur', this._fnOnBlur || function(){},this);
},
getLeft: function () {
//return this._fLeft;
return Common.SCREEN_WIDTH / 2 + (this.getX() - this.node.width / 2);
},
//setLeft:function(fLeft){
// this._fLeft=fLeft;
//},
getTop: function () {
//return this._fTop;
return Common.SCREEN_HEIGHT / 2 - (this.getY() + this.node.height / 2);
},
getX: function () {
return Common.getX(this.node);
},
getY: function () {
return Common.getY(this.node);
},
//setTop:function(fTop){
// this._fTop=fTop;
//},
getWidth: function () {
//return this._fWidth;
return this.node.width;
},
setWidth: function (fWidth) {
// this._fWidth=fWidth;
this.node.width = fWidth;
},
getHeight: function () {
//return this._fHeight;
return this.node.height;
},
//setHeight:function(fHeight){
// this._fHeight=fHeight;
//},
//getFocusNode:function(){
// return this._oFocusNode;
//},
//setFocusNode:function(oFocusNode){
// this._oFocusNode=oFocusNode;
//},
getTVLink: function () {
return this._strTVLink;
},
setTVLink: function (strTVLink) {
this._strTVLink = strTVLink;
},
getEnable: function () {
return this._bEnable;
},
setEnable: function (bEnable) {
this._bEnable = bEnable;
},
onFocus: function (fiFrom) {
if (this._fnOnFocus) {
this._fnOnFocus(fiFrom);
}
},
onBlur: function (fiTo) {
if (this._fnOnBlur) {
this._fnOnBlur(fiTo);
}
},
getScaleFactor: function () {
return this._fScaleFactor;
},
setScaleFactor: function (fScaleFactor) {
this._fScaleFactor = fScaleFactor;
},
onEnable: function () { //修改节点的active属性为true时会执行挂载组件的onEnable方法
//注意:子节点有ListView要慎用!会使所有未初始化数据的子节点也改变焦点状态
// cc.log("执行FocusInfo中onEnable方法");
if (0 != this.node.name.indexOf('RoleInstallListCell') && 0 != this.node.name.indexOf('AchievementListCell')) {
this._bEnable = true;
}
},
onDisable: function () { //修改节点的active属性为false时会执行挂载组件的onDisable方法
// cc.log("执行FocusInfo中onDisable方法" + this.node.name);
this._bEnable = false;
},
onDestroy: function () {
// cc.log("节点销毁-------->" + this.node.name);
cc.director.emit('stop_render'); //分发事件
// this.node.removeComponent(FocusInfo);
},
});
{
"ver": "1.0.5",
"uuid": "af6c2393-5eef-4d0c-830e-ddcae637d713",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//全局类
window.APP_VERSION="";
window.FISRST_IN=true;
window.testJsLog=function(strDesc,isTrue){
cc.log(strDesc+"/////////////////////////Globals---->testJsLog"+isTrue);
}
{
"ver": "1.0.5",
"uuid": "fd60ed02-fd3e-4f8a-9168-fcbc22d30a65",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
var Network = require('Network');
var Common = require('Common');
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
_iLogCount:0,
_oScene:null,
},
init: function (oScene) {
this._oScene=oScene;
},
// use this for initialization
onLoad: function () {
//设置本身节点的宽高透明
this.node.x=0;
this.node.y=0;
this.node.width=Common.SCREEN_WIDTH;
this.node.height=Common.SCREEN_HEIGHT;
let nodeLogMask=new cc.Node('LogMask');
nodeLogMask.x=0;
nodeLogMask.y=0;
this.node.addChild(nodeLogMask,10);
//设置为全屏遮罩
// let urlSplash = cc.url.raw('resources/Texture/splash_black.png');
// let textureFocus = cc.textureCache.addImage(urlSplash);
let spriteSplash=nodeLogMask.addComponent(cc.Sprite);
// spriteSplash.spriteFrame = new cc.SpriteFrame(textureFocus);
//TODO:2.0移除cc.textureCache
// cc.loader.loadRes("Texture/ui/splash_black",cc.SpriteFrame,function(error,spriteFrame){
// spriteSplash.spriteFrame=spriteFrame;
// });
//因为纹理2*2所以这里写死了
nodeLogMask.setScale(Common.SCREEN_WIDTH/2,Common.SCREEN_HEIGHT/2);
nodeLogMask.opacity=100;
// nodeLogMask.setLocalZOrder(400);//2.0中所有子节点都会在父节点之后渲染
let nodeLogList=new cc.Node('LogList');
nodeLogList.x = 20 - Common.SCREEN_WIDTH/2;
nodeLogList.y = Common.SCREEN_HEIGHT/2 - 20;
nodeLogList.setAnchorPoint(0,1);
this.node.addChild(nodeLogList,10);
// nodeLogList.setLocalZOrder(402);
this._nodeLogList = nodeLogList;
//this.node.color=new cc.Color(0, 0, 0); //黑色
//this.node.cascadeOpacity=false;
//this.node.parent=this._oScene.node;
//this.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(Texture2D.);
//parentNode.cascadeOpacity=false;
},
//statics: {
serverD:function(strInfo){
},
screenD:function(strInfo){
this.flushLogToScreen(strInfo,'Debug');
},
serverI:function(strInfo){
},
screenI:function(strInfo){
this.flushLogToScreen(strInfo,'Info');
},
serverW:function(strInfo){
},
screenW:function(strInfo){
this.flushLogToScreen(strInfo,'Warning');
},
serverE:function(strInfo){
},
screenE:function(strInfo){
this.flushLogToScreen(strInfo,'Error');
},
flushLogToScreen:function(strInfo, strLevel){
let nodeInfo=new cc.Node('log_info_'+this._iLogCount);
let lblInfo=nodeInfo.addComponent(cc.Label);
this._iLogCount++;
//if _iLogCount>20
lblInfo.string=strLevel+':'+strInfo;//+(nodeInfo.width/2-Common.SCREEN_WIDTH/2);
lblInfo.fontSize=18;
lblInfo.lineHeight=20;
//nodeInfo.parent=this.node;
nodeInfo.parent=this._nodeLogList;
switch(strLevel){
case 'Debug':
nodeInfo.color=new cc.color(51,255,255,255);
break;
case 'Info':
nodeInfo.color=new cc.color(51,255,51,255);
break;
case 'Warning':
nodeInfo.color=new cc.color(255,255,51,255);
break;
case 'Error':
nodeInfo.color=new cc.color(255,51,51,255);
break;
default:
nodeInfo.color=new cc.color(255,255,255,255);
}
//nodeInfo.color=new cc.color(255,255,255,255);
nodeInfo.height=20;
nodeInfo.setAnchorPoint(0,1);
nodeInfo.y = -(this._iLogCount-1)*20;
// nodeInfo.setLocalZOrder(401);
this._nodeLogList.y = this._nodeLogList.y + ((this._iLogCount - parseInt(Common.SCREEN_HEIGHT/20)+1)>0 ? 20 : 0);
},
clearLogOnScreen : function () {
this._nodeLogList.destroy();
this._iLogCount = 0;
let nodeLogList=new cc.Node('LogList');
nodeLogList.x = 20 - Common.SCREEN_WIDTH/2;
nodeLogList.y = Common.SCREEN_HEIGHT/2 - 20;
nodeLogList.setAnchorPoint(0,1);
this.node.addChild(nodeLogList,10);
// nodeLogList.setLocalZOrder(402);
this._nodeLogList = nodeLogList;
},
flushLogToServer:function(){
}
//TODO:需要加一个清除(所有条目全删除)和删除日志(一条一条删除)的函数
//}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});
{
"ver": "1.0.5",
"uuid": "575ad62c-3a8f-452a-a7cf-8447bf43ac47",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
var Common = require('Common');
cc.Class({
extends: cc.Component,
properties: {
},
// use this for initialization
onLoad: function () {
},
statics: {
//_count: 0,
/*
var txt = document.getElementById('txt');
//1.创建XMLHttpRequest对象
var xhr = null;
if(window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
}else {
xhr = new ActiveXObject('Microsoft.XMLHTTP');
}
//2.打开与服务器的链接
xhr.open('get',url,false);
//3.发送给服务器
xhr.send(null);
//4.响应就绪(同步请求)
var json = JSON.parse(xhr.responseText);
txt.innerHTML = json;
cc.log('其他程序');
*/
//ajax请求函数
ajax: function (strMethod, strURL, astrContentType, oDataOrPostBody, onSuccess, onError, oScope, oAdditionalData) {
var xlr = null;
var oResult = {};
if (window.XMLHttpRequest) {// code for IE7, Firefox, Opera, etc.
xlr = new XMLHttpRequest(); //Log.info('XMLHttpRequest');
} else if (window.ActiveXObject) {// code for IE6, IE5
xlr = new ActiveXObject("Microsoft.XMLHTTP"); //Log.info('ActiveXObject');
}
if (!xlr) {
cc.log("Your browser does not support XMLHTTP, using iframe instead..");
//退化到使用iframe 在cocos中无用 //这里两个函数名需要字符串输入
//iframeRequest(strMethod, strURL, astrContentType, oDataOrPostBody, onSuccess, onError, oAdditionalData)
return;
}
function onStateChange() {
if (xlr.readyState == 4) {// 4 = "loaded"
if (xlr.status == 200) {// 200 = OK
if (null != oScope) {
onSuccess.call(oScope, xlr.responseText, oAdditionalData);
} else {
onSuccess(xlr.responseText, oAdditionalData);
}
} else {
if (null != oScope) {
onError.call(oScope, xlr.responseText, oAdditionalData);
} else {
onError(xlr.responseText, oAdditionalData);
}
}
xlr = null;
}
}
strMethod = strMethod.toUpperCase();
var strDataOrPostBody = '';
if (strMethod == "GET") {
//以下这段可使用正则表达式改造
if (oDataOrPostBody) {
if (strURL.indexOf('?') > 0) { //有问号
if (strURL.indexOf('=') > strURL.indexOf('?') //并且有等号在问号右边
&& strURL.lastIndexOf('&') != strURL.length - 1) //最后一个不是&
{
strURL = strURL.concat('&');
} else { //光有问号没等号
cc.log('Unavailable Request URL!');
return;
}
} else {//没问号
strURL = strURL.concat('?');
}
if (typeof oDataOrPostBody == "string") {
strDataOrPostBody = oDataOrPostBody;
} else if (oDataOrPostBody instanceof Object) {
for (var key in oDataOrPostBody) {
strDataOrPostBody = strDataOrPostBody.concat(key).concat('=').concat(oDataOrPostBody[key]).concat('&');
}
strDataOrPostBody = strDataOrPostBody.substring(0, strDataOrPostBody.length - 1);
//strDataOrPostBody.TrimEnd('&');
} else {
cc.log('Unavailable Parameters!');
return;
}
}
strURL = strURL.concat(strDataOrPostBody);
}
xlr.onreadystatechange = onStateChange;
xlr.open(strMethod, strURL, true);
var isWWWFormURLEncoded = false;
if (astrContentType) {
for (var i = 0; i < astrContentType.length; i++) {
xlr.setRequestHeader('Content-type', astrContentType[i]);
if (astrContentType[i] == 'application/x-www-form-urlencoded') {
isWWWFormURLEncoded = true;
break;
}
}
}
//xlr.setRequestHeader('Connection', 'close');
switch (strMethod) {
case 'GET':
xlr.send(null);
break;
case 'POST':
if (isWWWFormURLEncoded) {
}
if (oDataOrPostBody) {
/*
if (isWWWFormURLEncoded) {
var fd=new FormData();
if (typeof oDataOrPostBody == "string") {
strDataOrPostBody = oDataOrPostBody;
var aParameters1=oDataOrPostBody.split('&');
for (var i=0;i<aParameters1.length;i++){
var aPairs1=aParameters1.split('=');
if (aPairs1[0] && aPairs1[1]){
fd.append(aPairs1[0],aPairs1[1]);
}
}
} else if (oDataOrPostBody instanceof Object) {
for (var key in oDataOrPostBody) {
fd.append(key,oDataOrPostBody[key]);
}
//strDataOrPostBody.TrimEnd('&');
//strDataOrPostBody = strDataOrPostBody.substring(0, strDataOrPostBody.length - 1);
} else {
console.log("Unavailable Parameters!");
return
}
xlr.send(fd);
}else{*/
if (typeof oDataOrPostBody == "string") {
strDataOrPostBody = oDataOrPostBody;
} else if (oDataOrPostBody instanceof Object) {
for (var key in oDataOrPostBody) {
strDataOrPostBody = strDataOrPostBody.concat(key).concat('=').concat(oDataOrPostBody[key]).concat('&');
}
//strDataOrPostBody.TrimEnd('&');
strDataOrPostBody = strDataOrPostBody.substring(0, strDataOrPostBody.length - 1);
} else {
oResult.businessCode = 'success';
oResult.description = 'Unavailable Parameters!';
return oResult;
}
xlr.send(strDataOrPostBody);
//}
} else {
xlr.send(null);
}
break;
}
},
loadImageInJSRuntime: function (strURL, onSuccess, onError, oScope) {
cc.loader.load(
{
url: strURL,
isCrossOrigin: false,
type: 'jpg' //防止跨域问题
},
function (err, texture) {
if (!err) {
if (null != oScope) {
onSuccess.call(oScope, texture);
} else {
onSuccess(texture);
}
} else {
if (null != oScope) {
onError.call(oScope, err);
} else {
onError(err);
}
}
}
);
},
loadImageInNativeRuntime: function (strURL, onSuccess, onError, oScope, node, strAnimationTag) {//留个钩子以便为图片加载做动画
let flag = false;
//这里使用cc.director.once而不是cc.director.on避免多次累加注册
cc.director.once('stop_render', function (event) { //注册并监听事件
cc.log("Network(diapatchEvent)-------------------------->");
flag = true;
});
try {
cc.loader.load(strURL, function (err, texture) {
if (null != oScope) {
// let flag = false;
// if (Common.g_strCurrentSceneName && cc.director.getScene() && Common.g_strCurrentSceneName == cc.director.getScene().name) {
// flag = true;
// }
if (!flag) {//如果已经切换场景就不做下面这件事情
try {
onSuccess.call(oScope, texture);
} catch (err) {
cc.log(err);
}
}
} else {
onSuccess(texture);
}
// cc.log('Should load a texture from external url: ' + (texture instanceof cc.Texture2D));
});
} catch (err) {
cc.log(err);
}
},
},
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});
{
"ver": "1.0.5",
"uuid": "e213e4ae-14f8-406c-afba-9ad9aea75e06",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
var Common = require('Common');
var Network = require('Network');
var FocusInfo = require('FocusInfo');
var Application = require('Application');
var Log = require('Log');
cc.Topdraw = cc.Topdraw || {};
cc.Topdraw.TVCanvas =
cc.Class({
extends: cc.Component,
properties: {
//如果成功了要添加
//Log 版块
_cLog: null,
_cApplication: null,
_cFocus: null,
_aFocusTargets: [], //可被聚焦的块集合 分成状态区
_fiCurrentFocus: null,
_iSceneStatus: 0, //场景状态 和焦点寻找有关系
_fFocusScaleFactor: 1.06, //焦点缩放因数
//数据初始化状态
_bIsFocusInit: false,
_oSceneContext: null, //当前场景的上下文,用于后续恢复
//_oCurrentSceneParameter:null, //去下一个场景的参数
_oNextSceneParameter: null, //去下一个场景的参数
_compPlayer: null,
_aTouchContext: [],
_defaultBackScene: null,//每个场景Canvas都有的 默认返回场景 每个场景自己构造函数内设置值
_oFocusScaleFactorInfo: null,
holdClick: false, //检测是否长按
_bShowExitBox: false,
},
// use this for initialization
onLoad: function () {
//关掉调试信息
cc.debug.setDisplayStats(true);
//设置背景为透明
//TODO:2.0警告建议cc.Camera.main.backgroundColor = cc.Color.TRANSPARENT;
// cc.director.setClearColor(cc.Color.TRANSPARENT);
cc.Camera.main.backgroundColor = cc.Color.TRANSPARENT;
this._oSceneContext = {};
this._oNextSceneParameter = {};
//获得应用级别的上下文状态
if (cc.find('application')) {
this._cApplication = cc.find('application').getComponent(Application);
} else {
let nodeApplication = new cc.Node('application');
cc.game.addPersistRootNode(nodeApplication);
this._cApplication = nodeApplication.addComponent(Application);
}
//创建Log节点
let nodeLog = new cc.Node('Log');
this._cLog = nodeLog.addComponent(Log);
this._cLog.init(this);
nodeLog.parent = this.node;
nodeLog.opacity = 0;
//注册键盘事件
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, this.onKeyDown, this);
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, this.onKeyUp, this);
//注册摸来摸去事件
this.node.on('touchstart', this.onTouchStart, this);
this.node.on('touchmove', this.onTouchMove, this);
this.node.on('touchend', this.onTouchEnd, this);
this.node.on('before_focus_change', this.onBeforeFocusChange, this);
this.node.on('after_focus_change', this.onAfterFocusChange, this);
this.node.on('focus', this.onFocus, this);
this.node.on('blur', this.onBlur, this);
//以后再考虑是否用这种做法
//this.node.on('focus_leave', this.onFocusLeave,this);
//this.node.on('focus_hover', this.onFocusHover,this);
//初始化焦点临接表
if (null == this._aFocusTargets[0]) {
this._aFocusTargets[0] = [];
}
//添加探针
this.sceneBIProbe();
},
onKeyUp: function (event) {
cc.log('OnKeyUp In TVCanvas');
//-----------------------禁止长按-------------------------------
this.holdClick = false;
//------------------------------------------------------
},
onKeyDown: function (event) {
//-------------------------禁止长按------------------------------
if (!this.holdClick) {
this.holdClick = true;
} else {
event.keyCode = 0; //更改keyCode值使该键值失效,
// return;
}
//-------------------------------------------------------
let nodeLog = null;
switch (event.keyCode) {
case cc.macro.KEY.t:
nodeLog = this.node.getChildByName('Log');
nodeLog.opacity = ((nodeLog.opacity == 0) ? 255 : 0);
this._cLog.screenD('....日志测试Test-' + nodeLog.opacity + '-a');
this._cLog.screenI('....日志测试Test-' + nodeLog.opacity + '-b');
this._cLog.screenW('....日志测试Test-' + nodeLog.opacity + '-c');
this._cLog.screenE('....日志测试Test-' + nodeLog.opacity + '-d');
break;
case cc.macro.KEY.enter:
case cc.macro.KEY.space:
case Common.ANDROID_KEY.enter:
if (0 == this._fiCurrentFocus.node.getName().indexOf('AppIcon')) {
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
if (0 == this._fiCurrentFocus.node.getName().indexOf('BtnBackTop')) {
this.backAScene();
}
break;
}
},
onTouchStart: function (event) {
cc.log('OnTouchStart In TVCanvas');
},
onTouchMove: function (event) {
cc.log('OnTouchMove In TVCanvas');
},
onTouchEnd: function (event) {
cc.log('OnTouchEnd In TVCanvas');
},
setCurrentFocus: function (fiCurrentFocus) {
this._fiCurrentFocus = fiCurrentFocus;
},
/**
* 返回上一个场景
*/
backAScene: function () {
//上下文
let compApplication = cc.find('application').getComponent(Application);
let aSceneContext = compApplication.getSceneContext();
let aSceneParameter = compApplication.getSceneParameter();
cc.log(aSceneContext);
if (aSceneParameter.length) {
this._bShowExitBox = false;
let oSceneParameter = aSceneParameter.pop();
cc.director.loadScene(oSceneParameter.backSceneName);
compApplication.setBackStatus(true);
} else {
if (!this._bShowExitBox) { //弹出挽留界面
this.showExitBox();
} else {
cc.log("退出应用!");
cc.game.end();
}
}
},
doTVLinkAction: function (oOperation) {
let nodeApplication = cc.find('application').getComponent(Application);
let aSceneContext = nodeApplication.getSceneContext();
let aSceneParameter = nodeApplication.getSceneParameter();
//---------------
nodeApplication.setTotalFrames(cc.director.getTotalFrames());
//---------------
let strForwardSceneName = "";
this._oNextSceneParameter.backSceneName = cc.director.getScene().name;
if (this._bShowExitBox && this._focusPath) { //挽留页跳转采用原先的值
this._oSceneContext.focusPath = this._focusPath;
} else {
this._oSceneContext.focusPath = Common.getNodePath(this._fiCurrentFocus.node);
}
switch (oOperation.action) {
case "ChangeScene":
strForwardSceneName = oOperation.parameters.sceneName;
for (let key in oOperation.parameters) {
if (null != oOperation.parameters[key] && '' != oOperation.parameters[key])
this._oNextSceneParameter[key] = oOperation.parameters[key];
}
break;
case "promotionBIProbe":
this.promotionBIProbe(oOperation.parameters.id);
break;
case "changeLayout":
cc.log("改变模型布局");
break;
default:
/*
oSceneContext.categoryId="10";
oSceneContext.songListPageIndex="10";
oSceneContext.focusPath=""; //光标对象 如何保存 从场景中往下寻找Node
aSceneContext.push(oSceneContext);
cc.director.loadScene('sceneSearch');
*/
}
if (null != strForwardSceneName && 0 < strForwardSceneName.length) {
aSceneParameter.push(this._oNextSceneParameter);
aSceneContext.push(this._oSceneContext);
cc.director.loadScene(strForwardSceneName, function () {
cc.sys.garbageCollect();
});
}
},
addNodeToFocusTarget: function (iStatus, strKey, nodeFocusable) {
this._aFocusTargets[iStatus][strKey] = nodeFocusable;
},
getFocus: function () {
return this._cFocus;
},
getCurrentFocusInfo: function () {
return this._fiCurrentFocus;
},
getFocusTargets: function () {
return this._aFocusTargets;
},
onFocus: function (event) {
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
fiTo.onFocus(fiFrom);
},
onBlur: function (event) {
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
fiFrom.onBlur(fiTo);
},
/**
* 仅供测试使用
* @param strPlayURL 回调后得到的播放地址
*
*/
onGetPlayURL: function (strPlayURL) {
cc.log('TVCanvas onGetPlayURL..:' + strPlayURL);
if (this._compPlayer) {
this._compPlayer.remoteURL = strPlayURL;
this._compPlayer.play();
}
},
getPageBg: function (context, kind, spriteBg) {
let oRankingRequestParameters = {
"view": "json",
"token": Common.TEST_API_TOKEN,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER2 + 'ArrangeHut/GetWallPaperFrame', null, oRankingRequestParameters,
function (strResponse) {
// cc.log("Success When Get Ranking..."+strResponse);
try {
var oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == 'success') {
if (oJSONResult.resultSet.length > 0) {
let nodeLeftRecommendPic = cc.find('Bg', context.node);
let normal = oJSONResult.resultSet[0].images.map.normal[0];
let background = oJSONResult.resultSet[0].images.map.background[0];
var strUrl = "";
if (kind == 'background') {
strUrl = Common.TOPDRAW_IMAGE_SERVER + oJSONResult.resultSet[0].images.list[background].fileUrl;
} else if (kind == 'normal') {
strUrl = Common.TOPDRAW_IMAGE_SERVER + oJSONResult.resultSet[0].images.list[normal].fileUrl;
}
if (spriteBg) { //新增骚操作
cc.loader.load(strUrl, function (err, texture) {
spriteBg.spriteFrame = new cc.SpriteFrame(texture);
});
return;
}
if (strUrl) {
cc.loader.load(strUrl, function (err, texture) {
nodeLeftRecommendPic.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
});
}
} else {
cc.log("Nothing...");
}
} else {
cc.log("Error When Get WallPaper..." + oJSONResult.description);
}
} catch (error) {
cc.log("Exception When Get WallPaper..." + error);
}
},
function (strResponse) {
cc.log("Error When Get WallPaper..." + strResponse);
}, this, "uuid");
},
//添加场景BI探针
sceneBIProbe: function () {
try {
//场景参数
let oSceneParameter = this._cApplication.getTopSceneParameter() || {};
let strCurSceneName = cc.director.getScene().name;
let strCurURL = strCurSceneName + "?";
for (let key in oSceneParameter) {
if (key != "sceneName") {
strCurURL += (key + "=" + oSceneParameter[key] + "&");
}
}
strCurURL = strCurURL.substring(0, strCurURL.length - 1);
//附加参数
oSceneParameter.platformAccount = Common.USER_ID;
oSceneParameter.url = encodeURIComponent(strCurURL);
oSceneParameter.referURL = oSceneParameter.backSceneName || "";
Network.ajax('GET', Common.BI_BASE_PATH, null, oSceneParameter,
function (strResponse) {
try {
// var oJSONResult = JSON.parse(strResponse);
// if (oJSONResult.businessCode == "success") {
// cc.log("Business Success : Page BI Probe Request Success");
// } else {
// cc.log("Business Error : Page BI Probe Request failed..." + oJSONResult.description);
// }
} catch (ex) {
cc.log("Business Exception : Page BI Probe Request Error.." + ex);
}
},
function (strResponse) {
cc.log("Communication Error : Page BI Probe Request Error..." + strResponse + "\r\n");
}, this, "uuid"
);
} catch (err) {
cc.log("Page BI Probe Request Error in promotionBIProbe..." + err);
}
},
/*推荐位BI探针*/
createPromotionBIProbeAction: function (strTVLink, strId) {
let joTVLink = JSON.parse(strTVLink);
joTVLink.click.push({ "action": "promotionBIProbe", "parameters": { "id": strId } });
return JSON.stringify(joTVLink);
},
promotionBIProbe: function (strPromotionId) {
try {
//为了BI方便统计,做些变形
let strBIURL = './NoPage/TopdrawPromotion?id=' + strPromotionId;//todo:这个地址其实还不确定
let oParams = {
"platformAccount": Common.USER_ID,
"url": strBIURL,
};
Network.ajax('GET', Common.BI_BASE_PATH, null, oParams,
function (strResponse) {
try {
let oJSONResult = JSON.parse(strResponse);
if (oJSONResult.businessCode == "success") {
cc.log("Business Success : Promotion BI Probe Request Success");
} else {
cc.log("Business Error : Promotion BI Probe Request failed..." + oJSONResult.description);
}
} catch (ex) {
cc.log("Business Exception : Promotion BI Probe Request Error.." + ex);
}
},
function (strResponse) {
cc.log("Communication Error : Promotion BI Probe Request Error..." + strResponse + "\r\n");
}, this, "uuid"
);
} catch (err) {
cc.log("Promotion BI Probe Request Error in promotionBIProbe..." + err);
}
},
/**
*黄色提示框
* @param strTip String
* @param iTime Number
*/
commonTip: function (strTip, iTime) {
if (!this.commonTipFnCallback) {
this.commonTipFnCallback = function () {
nodeTip.opacity = 0;
}
}
this.unschedule(this.commonTipFnCallback);
if (!strTip) return;
iTime = iTime || 5;
let labelText = null;
let nodeTip = cc.find("CommonTip", this.node);
let nodeText = nodeTip && nodeTip.getChildByName("TipText");
if (!nodeText) {
nodeTip = new cc.Node("CommonTip");
let layout = nodeTip.addComponent(cc.Layout);
layout.type = 1;
layout.resizeMode = 1;
layout.paddingLeft = 20;
layout.paddingRight = 20;
layout.horizontalDirection = 0;
let spriteTipBg = nodeTip.addComponent(cc.Sprite);
// spriteTipBg.spriteFrame = new cc.SpriteFrame(cc.textureCache.addImage(cc.url.raw('resources/Texture/common_tip_bg.png')));
cc.loader.loadRes("Texture/cabin/common_tip_bg", cc.SpriteFrame, function (err, spriteFrame) {
spriteTipBg.spriteFrame = spriteFrame;
});
nodeTip.parent = this.node;
// nodeTip.setLocalZOrder(1000);
nodeTip.zIndex = 1000;
nodeText = new cc.Node("TipText");
labelText = nodeText.addComponent(cc.Label);
nodeText.color = cc.Color.RED;
nodeTip.addChild(nodeText);
} else {
labelText = nodeText.getComponent(cc.Label);
}
labelText.string = strTip;
nodeTip.opacity = 255;
this.scheduleOnce(this.commonTipFnCallback, iTime); //修改tip时间
},
/**
* 统一添加订购、推荐等按钮
*/
addHomeIcon: function (context) {
// var nodeOrder = new cc.Node('OrderIcon'); //订购
// nodeOrder.addComponent(cc.Sprite);
// var widgetOrder = nodeOrder.addComponent(cc.Widget);
// widgetOrder.isAlignLeft = true;
// widgetOrder.isAlignTop = true;
// widgetOrder.top = 44;
// widgetOrder.left = 1150;
// cc.loader.loadRes("Texture/common/order_icon", cc.SpriteFrame, function (err, spriteFrame) {
// spriteFrame.setTexture(null, cc.rect(0, 0, 54, 68));
// nodeOrder.getComponent(cc.Sprite).spriteFrame = spriteFrame;
// spriteFrame._calculateUV();
// });
// var fiOrderIcon = nodeOrder.addComponent(FocusInfo);
// context._aFocusTargets[0]['to_order_icon'] = nodeOrder;
// fiOrderIcon.init(
// null, true
// );
// context.node.addChild(nodeOrder, 10);
// var nodeApp = new cc.Node('AppIcon'); //首页
// nodeApp.addComponent(cc.Sprite);
// var widgetApp = nodeApp.addComponent(cc.Widget);
// widgetApp.isAlignLeft = true;
// widgetApp.isAlignTop = true;
// widgetApp.top = 44;
// widgetApp.left = 1213;
// cc.loader.loadRes("Texture/common/level_icon", cc.SpriteFrame, function (err, spriteFrame) {
// spriteFrame.setTexture(null, cc.rect(0, 0, 54, 68));
// nodeApp.getComponent(cc.Sprite).spriteFrame = spriteFrame;
// spriteFrame._calculateUV();
// });
// var fiAppIcon = nodeApp.addComponent(FocusInfo);
// context._aFocusTargets[0]['to_app_icon'] = nodeApp;
// fiAppIcon.init(
// '{"click": [{"action": "ChangeScene","parameters": {"sceneName":"sceneRecommend"}}]}', true
// );
// context.node.addChild(nodeApp, 10);
},
//弹出挽留界面
showExitBox: function () {
this._bShowExitBox = true;
if (this._nodeExitBox) {
this._focusPath = Common.getNodePath(this._fiCurrentFocus.node); //记录原来值
//焦点框跳到第二次后不会干扰第一层级
this._cFocus.flyFocus(this._fiCurrentFocus, this._aFocusTargets[1]['back_right_btn'].getComponent(FocusInfo),
Common.MOVE_DIRECTION_UP, this._fFocusScaleFactor, null);
var oIndexBackPromotionPara = {
'view': 'json',
'limit': 2,
'start': 0,
'name': 'BabyDontGo',
"sortField": "left",
"sortDirection": "asc",
token: Common.TEST_API_TOKEN,
};
Network.ajax('GET', Common.TOPDRAW_API_SERVER + "Promotion/ListItemByName", null, oIndexBackPromotionPara,
function (strResponse) {
try {
var oJSONResult = JSON.parse(strResponse);
for (let i = 0; i < oJSONResult.resultSet.length; i++) {
let nodeBackPromotion = new cc.Node("backPromotion" + i);
nodeBackPromotion.width = oJSONResult.resultSet[i].width;
nodeBackPromotion.height = oJSONResult.resultSet[i].height;
let spritePromotion = nodeBackPromotion.addComponent(cc.Sprite);
spritePromotion.type = cc.Sprite.Type.SIMPLE;
spritePromotion.sizeMode = cc.Sprite.SizeMode.CUSTOM;
var widgetPromotion = nodeBackPromotion.addComponent(cc.Widget);
widgetPromotion.isAlignTop = true;
widgetPromotion.isAlignLeft = true;
if (oJSONResult.resultSet[i].image[0].fileUrl) {
nodeBackPromotion.zIndex = 101; //让导航栏背景处于最底层
cc.loader.load(Common.TOPDRAW_IMAGE_SERVER + oJSONResult.resultSet[i].image[0].fileUrl, function (err, texture) {
spritePromotion.spriteFrame = new cc.SpriteFrame(texture);
});
}
widgetPromotion.top = oJSONResult.resultSet[i].top;
widgetPromotion.left = oJSONResult.resultSet[i].left;
nodeBackPromotion.parent = this._nodeExitBox;
}
//绑定立即观看按钮的tvlink
cc.find("BtnBackLeft", this._nodeExitBox).getComponent(FocusInfo).init(
oJSONResult.resultSet[0].tvlink, true
);
cc.find("BtnBackRight", this._nodeExitBox).getComponent(FocusInfo).init(
oJSONResult.resultSet[1].tvlink, true
);
} catch (error) {
cc.log("Exception When IndexBackPromotion..." + error);
}
},
function (strResponse) {
cc.log("Error When IndexBackPromotion..." + strResponse);
}, this, "uuid");
} else {
Common.loadRes("prefab/home/pfbExitBox", //挽留弹窗预制
function (loadedResource) {
this._nodeExitBox = cc.instantiate(loadedResource);
this._nodeExitBox.parent = this.node;
this._nodeExitBox.zIndex = 400; //假设400为最高zIndex
cc.find("BtnBackLeft", this._nodeExitBox).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 294, 102));
cc.find("BtnBackRight", this._nodeExitBox).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 294, 102));
cc.find("BtnBackTop", this._nodeExitBox).getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, 140, 50));
cc.find("BtnBackLeft", this._nodeExitBox).addComponent(FocusInfo);
cc.find("BtnBackRight", this._nodeExitBox).addComponent(FocusInfo);
cc.find("BtnBackTop", this._nodeExitBox).addComponent(FocusInfo);
if (null == this._aFocusTargets[1]) { //focus放到第二层级,避免冲突
this._aFocusTargets[1] = [];
}
this._aFocusTargets[1]['back_left_btn'] = cc.find("BtnBackLeft", this._nodeExitBox);
this._aFocusTargets[1]['back_right_btn'] = cc.find("BtnBackRight", this._nodeExitBox);
this._aFocusTargets[1]['back_top_btn'] = cc.find("BtnBackTop", this._nodeExitBox);
this.showExitBox();
},
function (error) {
cc.log("Error When Loading Prefab pfbExitBox ...");
}, this)
}
},
onBeforeFocusChange: function (event) {
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
if (0 == fiFrom.node.getName().indexOf('AppIcon')) {
var appIconSprite = cc.find("AppIcon", this.node).getComponent(cc.Sprite); //
cc.loader.loadRes("Texture/common/level_icon", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, 0, 54, 68));
appIconSprite.spriteFrame = spriteFrame;
});
}
if (0 == fiFrom.node.getName().indexOf('OrderIcon')) {
var orderIconSprite = cc.find("OrderIcon", this.node).getComponent(cc.Sprite); //
cc.loader.loadRes("Texture/common/order_icon", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, 0, 54, 68));
// spriteFrame.setTexture(null, cc.rect(0, 50, 130, 50));
orderIconSprite.spriteFrame = spriteFrame;
});
}
if (0 == fiFrom.node.getName().indexOf('BtnBackTop')) { //TODO:
// fiFrom.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
cc.loader.loadRes("texture/button/back_btn", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
fiFrom.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
}
if (0 == fiFrom.node.getName().indexOf('BtnBackLeft') || 0 == fiFrom.node.getName().indexOf('BtnBackRight')) {
cc.loader.loadRes("texture/button/back_promotion_btn", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, 0, fiFrom.node.width, fiFrom.node.height));
fiFrom.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
}
},
onAfterFocusChange: function (event) {
let fiFrom = event.detail.from;
let fiTo = event.detail.to;
if (0 == fiTo.node.getName().indexOf('AppIcon')) {
var appIconSprite = cc.find("AppIcon", this.node).getComponent(cc.Sprite); //
cc.loader.loadRes("Texture/common/level_icon", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, 68, 54, 68));
appIconSprite.spriteFrame = spriteFrame;
});
}
if (0 == fiTo.node.getName().indexOf('OrderIcon')) {
var orderIconSprite = cc.find("OrderIcon", this.node).getComponent(cc.Sprite); //
cc.loader.loadRes("Texture/common/order_icon", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, 68, 54, 68));
orderIconSprite.spriteFrame = spriteFrame;
});
}
if (0 == fiTo.node.getName().indexOf('BtnBackTop')) { //TODO:
// fiTo.node.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
cc.loader.loadRes("texture/button/back_btn", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
fiTo.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
}
if (0 == fiTo.node.getName().indexOf('BtnBackLeft') || 0 == fiTo.node.getName().indexOf('BtnBackRight')) {
cc.loader.loadRes("texture/button/back_promotion_btn", cc.Texture2D, function (err, Texture) {
var spriteFrame = new cc.SpriteFrame(Texture, cc.rect(0, fiTo.node.height, fiTo.node.width, fiTo.node.height));
fiTo.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
}
},
});
{
"ver": "1.0.5",
"uuid": "445864d0-7911-43e7-ab0a-a27ad0ae4705",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
var Common = require('Common');
var FocusInfo = require('FocusInfo');
//var AbstractTVFocus=require('AbstractTVFocus');
cc.Class({
//name:"TVFocus",
extends: cc.Component,
//extends: cc.Node, 引擎团队的人不推荐这么做
properties: {
_cornerOuterRadius: 18,
_cornerInnerRadius: 12,
_screenWidth: Common.SCREEN_WIDTH,
_screenHeight: Common.SCREEN_HEIGHT,
_oScene: null,
//_tvlink:null,
//sprites:[],
//nodes:[],
//isShow:false
/*
{
breath:[],
cellTransform:[], //move+scale
containerTansfer[]
}
*/
},
//由于addComponent时会新建Focus调用默认构造函数,其不支持参数输入,所以这个函数基本没用
ctor: function (/*strName,oScene,fLeft,fTop,fObjectWidth,fObjectHeight,fScreenWidth,fScreenHeight,fCornerOuterRadius,fCornerInnerRadius*/) {
//cc.log(this instanceof Sprite); // true
//参数处理
let strName = arguments[0];
let oScene = arguments[1];
let fLeft = arguments[2];
let fTop = arguments[3];
let fObjectWidth = arguments[4];
let fObjectHeight = arguments[5];
let fScreenWidth = arguments[6];
let fScreenHeight = arguments[7];
let fCornerOuterRadius = arguments[8];
let fCornerInnerRadius = arguments[9];
this.name = (strName ? strName : "focusContainer");
this._oScene = oScene;
//this.width=fObjectWidth;
//this.height=fObjectHeight;
fLeft = (fLeft ? fLeft : 10);
fTop = (fTop ? fTop : 10);
fObjectWidth = (fObjectWidth ? fObjectWidth : 30);
fObjectHeight = (fObjectHeight ? fObjectHeight : 30);
this._screenWidth = (fScreenWidth ? fScreenWidth : Common.SCREEN_WIDTH);
this._screenHeight = (fScreenHeight ? fScreenHeight : Common.SCREEN_HEIGHT);
this._cornerOuterRadius = (fCornerOuterRadius ? fCornerOuterRadius : 18);
this._cornerInnerRadius = (fCornerInnerRadius ? fCornerInnerRadius : 12);
/*
var oTransformedPosition=this.transformCoordinatesWeb2Cocos(fLeft,fTop,fObjectWidth,fObjectHeight);
this.node.x=oTransformedPosition.x;
this.node.y=oTransformedPosition.y;
var urlFocus=null;
var textureFocus = null;
//1 2 3
//4 6
//7 8 9
for (var i=1;i<=9;i++){
this.node.children[i-1] = new cc.Node('focus_'+i);
if (5==i){
continue;
}
urlFocus = cc.url.raw('Texture/Focus/'+i+'.png');
textureFocus = cc.textureCache.addImage(urlFocus);
var spriteTemp = this.node.children[i-1].addComponent(cc.Sprite);
spriteTemp.spriteFrame = new cc.SpriteFrame(textureFocus);
//this.node.child[i-1].parent=this.node;
this.node.children[i-1].x=i*20;
if (2==i || 8==i){
spriteTemp.fillType = cc.Sprite.FillType.HORIZONTAL;
}else if (4==i || 6==i){
spriteTemp.fillType = cc.Sprite.FillType.VERTICAL;
}
}
//this.fly(fLeft,fTop,fObjectWidth,fObjectHeight,10,1.0);
*/
},
init: function (strName, oScene, fiCurrentFocus,//Left,fTop,fObjectWidth,fObjectHeight,
fScreenWidth, fScreenHeight, fCornerOuterRadius, fCornerInnerRadius, fScaleFactor) {
//TODO:这个函数里面是否要做onbeforeFocus和onAfterFocus的操作 --question from eva
//cc.log(this instanceof Sprite); // true
if (strName) {
this.name = strName;
} else {
cc.log('No Focus Name Specified');
return;
}
if (oScene) {
this._oScene = oScene;
} else {
cc.log('No Scene Specified for Focus');
}
fScaleFactor = fScaleFactor || fiCurrentFocus.getScaleFactor();
//this.width=fObjectWidth;
//this.height=fObjectHeight;
var fLeft = fiCurrentFocus.getLeft();
var fTop = fiCurrentFocus.getTop();
var fObjectWidth = fiCurrentFocus.getWidth();
var fObjectHeight = fiCurrentFocus.getHeight();
if (fScreenWidth) {
this._screenWidth = fScreenWidth;
}
if (fScreenHeight) {
this._screenHeight = fScreenHeight;
}
if (fCornerOuterRadius) {
this._cornerOuterRadius = fCornerOuterRadius;
}
if (fCornerInnerRadius) {
this._cornerInnerRadius = fCornerInnerRadius;
}
var oTransformedPosition = this.transformCoordinatesWeb2Cocos(fLeft, fTop, fObjectWidth, fObjectHeight);
this.node.x = oTransformedPosition.x;
this.node.y = oTransformedPosition.y;
var urlFocus = null;
var textureFocus = null;
//1 2 3
//4 6
//7 8 9
for (var i = 1; i <= 9; i++) {
//this.node.children[i-1] = new cc.Node('focus_'+i);
this.node.addChild(new cc.Node('focus_' + i), 10);
if (5 == i) {
continue;
}
// urlFocus = cc.url.raw('resources/Texture/Focus/'+i+'.png');
// textureFocus = cc.textureCache.addImage(urlFocus);
var spriteTemp = this.node.getChildByName('focus_' + i).addComponent(cc.Sprite);
// spriteTemp.spriteFrame = new cc.SpriteFrame(textureFocus);
var ftaScaleTo = null
if (2 == i || 8 == i) {
//spriteTemp.sizeMode = cc.Sprite.SizeMode.CUSTOM;
//spriteTemp.type= cc.Sprite.Type.FILLED;
//spriteTemp.fillType = cc.Sprite.FillType.HORIZONTAL;
//spriteTemp.width=fObjectWidth-2*fCornerInnerRadius;
//this.node.children[i-1].width=fObjectWidth-2*fCornerInnerRadius;
//this.node.children[i-1].height=fCornerOuterRadius;
ftaScaleTo = cc.scaleTo(0, fScaleFactor * (fObjectWidth - 2 * fCornerInnerRadius), fScaleFactor * 1.0);
} else if (4 == i || 6 == i) {
//spriteTemp.sizeMode = cc.Sprite.SizeMode.CUSTOM;
//spriteTemp.type= cc.Sprite.Type.FILLED;
//spriteTemp.fillType = cc.Sprite.FillType.VERTICAL;
//spriteTemp.height=fObjectHeight-2*fCornerInnerRadius;
//this.node.children[i-1].setContentSize();
//this.node.children[i-1].width=fCornerOuterRadius;
//this.node.children[i-1].height=fObjectHeight-2*fCornerInnerRadius;
ftaScaleTo = cc.scaleTo(0, fScaleFactor * 1.0, fScaleFactor * (fObjectHeight - 2 * fCornerInnerRadius));
} else {
ftaScaleTo = cc.scaleTo(0, fScaleFactor, fScaleFactor);
}
ftaScaleTo.setTag(Common.FOCUS_CELL_TRANSFER);
this.node.children[i - 1].stopAllActions();
this.node.children[i - 1].runAction(ftaScaleTo);
}
//TODO:2.0版本采用异步加载本地图片,在焦点初始完成后在批量处理图片
//TODO:循环中焦点框不是连续的,而批量加载的图地址是连续的需特殊处理下
var self = this;
cc.loader.loadResDir("focus", cc.Texture2D, function (err, textures) {
for (let i = 1; i < 10; i++) {
if (i == 2 || i == 4 || i == 6 || i == 8) continue; //暂时将焦点框一部分隐藏
if (i >= 5) {
if (i == 5) continue;
self.node.getChildByName('focus_' + i).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(textures[i - 2]);
} else {
self.node.getChildByName('focus_' + i).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(textures[i - 1]);
}
}
});
this.node.children[0].x = fScaleFactor * (-fObjectWidth / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[0].y = fScaleFactor * (fObjectHeight / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[1].x = 0;
this.node.children[1].y = fScaleFactor * (fObjectHeight / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[2].x = fScaleFactor * (fObjectWidth / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[2].y = fScaleFactor * (fObjectHeight / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[3].x = fScaleFactor * (-fObjectWidth / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[3].y = 0;
//this.node.children[4].x=0;
//this.node.children[4].y=0;
this.node.children[5].x = fScaleFactor * (fObjectWidth / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[5].y = 0;
this.node.children[6].x = fScaleFactor * (-fObjectWidth / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[6].y = fScaleFactor * (-fObjectHeight / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[7].x = 0;
this.node.children[7].y = fScaleFactor * (-fObjectHeight / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[8].x = fScaleFactor * (fObjectWidth / 2 + (fCornerOuterRadius / 2 - fCornerInnerRadius));
this.node.children[8].y = fScaleFactor * (-fObjectHeight / 2 - (fCornerOuterRadius / 2 - fCornerInnerRadius));
//放大 当前选中的Node
var ftaScaleCurrentFocus = cc.scaleTo(0, fScaleFactor, fScaleFactor);
ftaScaleCurrentFocus.setTag(Common.FEATURE_NODE_TRANSFER);
//fiCurrentFocus.node.setLocalZOrder(40);
//fiCurrentFocus.node.stopAllActions();
//fiCurrentFocus.node.runAction(ftaScaleCurrentFocus);
// fiCurrentFocus.node.setLocalZOrder(40);
fiCurrentFocus.node.zIndex = 40;
fiCurrentFocus.node.stopAllActions();
fiCurrentFocus.node.runAction(ftaScaleCurrentFocus);
//开始呼吸动画
var aiFocusBreath = cc.repeatForever(cc.sequence(cc.fadeTo(1, 100), cc.fadeTo(1, 255), cc.fadeTo(2, 255)));
aiFocusBreath.setTag(Common.FOCUS_CONTAINER_BREATH);
this.node.stopAllActions();
this.node.runAction(aiFocusBreath);
this._oScene.setCurrentFocus(fiCurrentFocus);
},
// use this for initialization
onLoad: function () {
cc.log("Focus onLoad...");
},
/*
test: function(){
var imgUrl1 = cc.url.raw('Texture/Focus/1.png');
var texture1 = cc.textureCache.addImage(imgUrl1);
this.node.getChildByName('focus_'+i).getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture1);
},*/
hide: function () {
//this.node.opacity=0;
this.node.children[0].opacity = 0;
this.node.children[1].opacity = 0;
this.node.children[2].opacity = 0;
this.node.children[3].opacity = 0;
this.node.children[4].opacity = 0;
this.node.children[5].opacity = 0;
this.node.children[6].opacity = 0;
this.node.children[7].opacity = 0;
this.node.children[8].opacity = 0;
},
show: function () {
//this.node.opacity=255;
this.node.children[0].opacity = 255;
this.node.children[1].opacity = 255;
this.node.children[2].opacity = 255;
this.node.children[3].opacity = 255;
this.node.children[4].opacity = 255;
this.node.children[5].opacity = 255;
this.node.children[6].opacity = 255;
this.node.children[7].opacity = 255;
this.node.children[8].opacity = 255;
},
//分别处理9块区域 输入坐标为左上角所需
fly: function (fLeft, fTop, fObjectWidth, fObjectHeight, fDuration, fScaleFactor) {
//1 2 3
//4 6
//7 8 9
var oTransformedPosition = this.transformCoordinatesWeb2Cocos(fLeft, fTop, fObjectWidth, fObjectHeight);
var ftaContainerMoveTo = cc.moveTo(fDuration, oTransformedPosition.x, oTransformedPosition.y);
ftaContainerMoveTo.setTag(Common.FOCUS_CONTAINER_TRANSFER);
//var blink=cc.blink(5.0,5);
//this.node.runAction(blink);
//this.node.x=oTransformedPosition.x;
//this.node.y=oTransformedPosition.y;
var ftaMoveTo = [];
var ftaScaleTo = null;
var ftaCombined = [];
ftaMoveTo[0] = cc.moveTo(fDuration,
fScaleFactor * (-fObjectWidth / 2 - (this._cornerOuterRadius / 2 - this._cornerInnerRadius)),
fScaleFactor * (fObjectHeight / 2 + (this._cornerOuterRadius / 2 - this._cornerInnerRadius))
);
ftaMoveTo[1] = cc.moveTo(fDuration,
0,
fScaleFactor * (fObjectHeight / 2 + (this._cornerOuterRadius / 2 - this._cornerInnerRadius))
);
ftaMoveTo[2] = cc.moveTo(fDuration,
fScaleFactor * (fObjectWidth / 2 + (this._cornerOuterRadius / 2 - this._cornerInnerRadius)),
fScaleFactor * (fObjectHeight / 2 + (this._cornerOuterRadius / 2 - this._cornerInnerRadius))
);
ftaMoveTo[3] = cc.moveTo(fDuration,
fScaleFactor * (-fObjectWidth / 2 - (this._cornerOuterRadius / 2 - this._cornerInnerRadius)),
0
);
//Nothing should be done for 4
ftaMoveTo[5] = cc.moveTo(fDuration,
fScaleFactor * (fObjectWidth / 2 + (this._cornerOuterRadius / 2 - this._cornerInnerRadius)),
0
);
ftaMoveTo[6] = cc.moveTo(fDuration,
fScaleFactor * (-fObjectWidth / 2 - (this._cornerOuterRadius / 2 - this._cornerInnerRadius)),
fScaleFactor * (-fObjectHeight / 2 - (this._cornerOuterRadius / 2 - this._cornerInnerRadius))
);
ftaMoveTo[7] = cc.moveTo(fDuration,
0,
fScaleFactor * (-fObjectHeight / 2 - (this._cornerOuterRadius / 2 - this._cornerInnerRadius))
);
ftaMoveTo[8] = cc.moveTo(fDuration,
fScaleFactor * (fObjectWidth / 2 + (this._cornerOuterRadius / 2 - this._cornerInnerRadius)),
fScaleFactor * (-fObjectHeight / 2 - (this._cornerOuterRadius / 2 - this._cornerInnerRadius))
);
//if (null!=this.node.getActionByTag(Common.FOCUS_CONTAINER_TRANSFER)){
// this.node.stopAction(Common.FOCUS_CONTAINER_TRANSFER);
//}
//this.node.stopAllActions();
this.node.stopAction(this.node.getActionByTag(Common.FOCUS_CONTAINER_TRANSFER));
this.node.runAction(ftaContainerMoveTo);
for (var i = 1; i <= 9; i++) {
if (5 == i) {
continue;
}
if (2 == i || 8 == i) {
ftaScaleTo = cc.scaleTo(fDuration, fScaleFactor * (fObjectWidth - 2 * this._cornerInnerRadius), fScaleFactor * 1.0);
} else if (4 == i || 6 == i) {
ftaScaleTo = cc.scaleTo(fDuration, fScaleFactor * 1.0, fScaleFactor * (fObjectHeight - 2 * this._cornerInnerRadius));
} else {
ftaScaleTo = cc.scaleTo(fDuration, fScaleFactor, fScaleFactor);
}
ftaCombined[i - 1] = cc.spawn(ftaMoveTo[i - 1], ftaScaleTo);
ftaCombined[i - 1].setTag(Common.FOCUS_CELL_TRANSFER);
/*
if (null!=this.node.children[i-1].getActionByTag(Common.FOCUS_CELL_TRANSFER)){
this.node.children[i-1].stopAction(Common.FOCUS_CELL_TRANSFER);
}*/
//this.node.stopAllActions();
this.node.children[i - 1].stopAction(this.node.children[i - 1].getActionByTag(Common.FOCUS_CELL_TRANSFER));
this.node.children[i - 1].runAction(ftaCombined[i - 1]);
}
},
findTarget: function (oCurrentFocusInfo, aInFocusTargets, iStatus, iDirection) {
if (null == oCurrentFocusInfo) {
oCurrentFocusInfo = this._oScene.getCurrentFocusInfo();
}
if (null == aInFocusTargets) {
aInFocusTargets = this._oScene.getFocusTargets()
}
var aFocusTargets = aInFocusTargets[iStatus];
//var elFocusNow=document.getElementById(g_strFocusElementId);
var fCurrentLeft = oCurrentFocusInfo.getLeft();
var fCurrentTop = oCurrentFocusInfo.getTop();
var fCurrentWidth = oCurrentFocusInfo.getWidth();
var fCurrentHeight = oCurrentFocusInfo.getHeight();
var oFocusTarget = null; //node?
var fDirectionWeight = 5.0;
var fEvaluationRecord = 99999;
//决定要搞哪一个
var j = 0;
if (Common.MOVE_DIRECTION_UP <= iDirection && iDirection <= Common.MOVE_DIRECTION_LEFT) {
for (var key in aFocusTargets) { //for (var i=0;i<aFocusTargets.length;i++){
// cc.log("循环次数:"+j+++"/////"+key);
//if (aFocusTargets[i].id == g_strFocusElementId || !doesElementDisplay(aFocusTargets[i])) continue;
// cc.log(key + "=============" + aFocusTargets[key].name);
if (!cc.isValid(aFocusTargets[key])) continue; //TODO-jinwawa:注意有些节点已经destroy,但是实际销毁操作会延迟到当前帧渲染前执行,从下一帧开始,该对象将不再可用
// 故使用cc.isValid(obj)来检查对象是否已被销毁
let fiByKey = aFocusTargets[key].getComponent(FocusInfo);
if (!fiByKey.getEnable()) {//不显示的不参与寻找
continue;
}
var fTargetLeft = fiByKey.getLeft();
var fTargetTop = fiByKey.getTop();
var fTargetWidth = fiByKey.getWidth();
var fTargetHeight = fiByKey.getHeight();
// cc.log("循环中目标左边距:"+fTargetLeft);
// cc.log("循环中目标上边距:"+fTargetTop);
//权重计算 移动方向上距离*3+和移动方向垂直的方向中心距离差 的和最小为最近控件
var fDistanceOfEdge = 0.0; //移动方向边缘的距离
var fOffsetOfCenter = 0.0; //垂直移动方向两块区域中心的距离
var fOverlapWidth = 0.0; //在移动方向上重叠的距离 复数为不重叠
var fSmallEdgeWidth = 0.0; //短的那个边缘的宽度
if (true) { //如果目标在限制区域内
switch (iDirection) {
case Common.MOVE_DIRECTION_UP:
// cc.log("参数:"+fCurrentTop+"///"+fTargetTop+"///"+fTargetHeight);
fDistanceOfEdge = fCurrentTop - fTargetTop - fTargetHeight;
fOffsetOfCenter = Math.abs(fTargetLeft + fTargetWidth / 2 - fCurrentLeft - fCurrentWidth / 2);
fOverlapWidth = ((fCurrentLeft + fCurrentWidth - fTargetLeft - fTargetWidth >= 0) ? fTargetLeft + fTargetWidth : fCurrentLeft + fCurrentWidth)
- ((fCurrentLeft - fTargetLeft >= 0) ? fCurrentLeft : fTargetLeft);
fSmallEdgeWidth = (fCurrentWidth < fTargetWidth) ? fCurrentWidth : fTargetWidth;
break;
case Common.MOVE_DIRECTION_DOWN:
fDistanceOfEdge = fTargetTop - fCurrentTop - fCurrentHeight;
fOffsetOfCenter = Math.abs(fTargetLeft + fTargetWidth / 2 - fCurrentLeft - fCurrentWidth / 2);
fOverlapWidth = ((fCurrentLeft + fCurrentWidth - fTargetLeft - fTargetWidth >= 0) ? fTargetLeft + fTargetWidth : fCurrentLeft + fCurrentWidth)
- ((fCurrentLeft - fTargetLeft >= 0) ? fCurrentLeft : fTargetLeft);
fSmallEdgeWidth = (fCurrentWidth < fTargetWidth) ? fCurrentWidth : fTargetWidth;
break;
case Common.MOVE_DIRECTION_LEFT:
fDistanceOfEdge = fCurrentLeft - fTargetLeft - fTargetWidth;
fOffsetOfCenter = Math.abs(fTargetTop + fTargetHeight / 2 - fCurrentTop - fCurrentHeight / 2);
fOverlapWidth = ((fCurrentTop + fCurrentHeight - fTargetTop - fTargetHeight >= 0) ? fTargetTop + fTargetHeight : fCurrentTop + fCurrentHeight)
- ((fCurrentTop - fTargetTop >= 0) ? fCurrentTop : fTargetTop);
fSmallEdgeWidth = (fCurrentHeight < fTargetHeight) ? fCurrentHeight : fTargetHeight;
break;
case Common.MOVE_DIRECTION_RIGHT:
fDistanceOfEdge = fTargetLeft - fCurrentLeft - fCurrentWidth;
fOffsetOfCenter = Math.abs(fTargetTop + fTargetHeight / 2 - fCurrentTop - fCurrentHeight / 2);
fOverlapWidth = ((fCurrentTop + fCurrentHeight - fTargetTop - fTargetHeight >= 0) ? fTargetTop + fTargetHeight : fCurrentTop + fCurrentHeight)
- ((fCurrentTop - fTargetTop >= 0) ? fCurrentTop : fTargetTop);
fSmallEdgeWidth = (fCurrentHeight < fTargetHeight) ? fCurrentHeight : fTargetHeight;
break;
}
// cc.log(fiByKey.node.name + "///////////////////估值" + fTargetLeft + "::" + fCurrentLeft + "::" + fCurrentWidth);
if (fDistanceOfEdge >= 0 /*&& fOffsetOfCenter<g_iBlockWidth*/) { //目标位置要在我前进的一侧(移动方向不能重叠),并且不能太偏离中心
// cc.log("fDistanceOfEdge>=0");
//估值=距离目标的邻边垂直距离*方向权重+重心所在轴偏移量
var fEvaluation = -100 * (fOverlapWidth / fSmallEdgeWidth) + fDistanceOfEdge;
//cc.log(aFocusTargets[i].id+"==> "+fEvaluation+" =-20*("+fSmallEdgeWidth+"/"+fOverlapWidth+")"+"+"+fDistanceOfEdge);
//+fOffsetOfCenter*fDirectionWeight;
if (fEvaluationRecord > fEvaluation) {
// cc.log(fEvaluationRecord+"/////"+fEvaluation);
fEvaluationRecord = fEvaluation;
//elFormerTarget=elFocusTarget;
//oFocusTarget=aFocusTargets[key];
oFocusTarget = fiByKey;
}
}
}
//elFocusTarget=FindNearestFocusTarget(strDirection,fFocusLeft,fFocusTop,fFocusWidth,fFocusHeight,fLeft,fTop,fWidth,fHeight);
}
//Log.warning("["+(elFormerTarget?elFormerTarget.id:"null")+","+(elFocusTarget?elFocusTarget.id:"null")+"]");
if (null == oFocusTarget) { //找不到目标 不移动,一般到了边界
cc.log("No Target Found: oFocusTarget = null...");
return null;
}
} else {
cc.log("No Target Found: unavailable direction");
return null
}
return oFocusTarget;
},
transformCoordinatesWeb2Cocos: function (fLeft, fTop, fObjectWidth, fObjectHeight) {
var oCocosCoordinates = {};
oCocosCoordinates.x = fLeft + fObjectWidth / 2 - this._screenWidth / 2;
oCocosCoordinates.y = this._screenHeight / 2 - fObjectHeight / 2 - fTop;
return oCocosCoordinates;
},
flyFocus: function (fiCurrentFocus, fiFocusTarget, iDirection, fScaleFactor, oScrollParameter, iDuration) {
if (null == fiFocusTarget) {//todo:先判断这个是否更划得来
//找不到目标的动画小交互
//var blink1=cc.blink(0.6,20);
//this.node.runAction(blink1);
let aiJoggle = cc.repeat(
cc.sequence(
cc.rotateTo(0.02, -2),
cc.rotateTo(0.02, 0),
cc.rotateTo(0.02, 2),
cc.rotateTo(0.02, 0)
),
4
);
aiJoggle.setTag(Common.FOCUS_CONTAINER_JOGGLE);
//if (null!=this.node.getActionByTag(Common.FOCUS_CONTAINER_JOGGLE)){
// this.node.stopAction(Common.FOCUS_CONTAINER_JOGGLE);
//}
this.node.stopAction(this.node.getActionByTag(Common.FOCUS_CONTAINER_JOGGLE));
this.node.runAction(aiJoggle);
return 0;
}
if (null == fiCurrentFocus) {
fiCurrentFocus = this._oScene.getCurrentFocusInfo();
}
fScaleFactor = fScaleFactor || fiFocusTarget.getScaleFactor();
if (null == fScaleFactor) {
fScaleFactor = 1.0;
}
if (null == iDuration) {
iDuration = Common.FOCUS_FLY_DURATION;
}
//是否是有效方向
if (Common.MOVE_DIRECTION_UP <= iDirection && iDirection <= Common.MOVE_DIRECTION_LEFT) {
//滚屏相关参数 elScroll,iScrollStep 如果都有效开始处理滚屏
//oScrollParameter.element 需要滚动的元素 Object[Element]
//oScrollParameter.step 滚动的距离 Integer
//oScrollParameter.relation 滚动是否和焦点元素有关? Integer [0|1]
//oScrollParameter.direction 滚动方向 ['left'|'right'|'up'|'down']
//旧的时间通知
//this.node.dispachEvent('before_focus_change', { from: fiCurrentFocus, to: fiFocusTarget});
let eventBeforeFocus = new cc.Event.EventCustom('before_focus_change', true);
eventBeforeFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventBeforeFocus);
let eventOnBlur = new cc.Event.EventCustom('blur', true);
eventOnBlur.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventOnBlur);
//let eventOnFocus=new cc.Event.
let nodeCurrent = fiCurrentFocus.node;//node;
let nodeTarget = fiFocusTarget.node;//node;
//if (fiCurrentFocus && fiCurrentFocus.onBlur && typeof fiCurrentFocus.onBlur =='function' ){
// fiCurrentFocus.onBlur();
//}
//处理因焦点移动导致的部分界面滑动
let fXScrollStep = 0;
let fYScrollStep = 0;
let fXScrollTarget = 0; //新方法
let fYScrollTarget = 0; //新方法
if (null != oScrollParameter && null != oScrollParameter.node
&& null != oScrollParameter.getStep() && null != oScrollParameter.getHasRelation()) { //满足此条件才考虑界面滚动
//MOVE_DIRECTION_UP:0,
//MOVE_DIRECTION_RIGHT:1,
//MOVE_DIRECTION_DOWN:2,
//MOVE_DIRECTION_LEFT:3,
//默认反向
if (null == oScrollParameter.getDirection()) {
switch (iDirection) {
case Common.MOVE_DIRECTION_UP: oScrollParameter.setDirection(Common.MOVE_DIRECTION_DOWN); break;
case Common.MOVE_DIRECTION_RIGHT: oScrollParameter.setDirection(Common.MOVE_DIRECTION_LEFT); break;
case Common.MOVE_DIRECTION_DOWN: oScrollParameter.setDirection(Common.MOVE_DIRECTION_UP); break;
case Common.MOVE_DIRECTION_LEFT: oScrollParameter.setDirection(Common.MOVE_DIRECTION_RIGHT); break;
}
}
//Deprecated Start
switch (oScrollParameter.getDirection()) {
case Common.MOVE_DIRECTION_UP:
fYScrollStep = oScrollParameter.getStep();
break;
case Common.MOVE_DIRECTION_DOWN:
fYScrollStep = -oScrollParameter.getStep();
break;
case Common.MOVE_DIRECTION_LEFT:
fXScrollStep = -oScrollParameter.getStep();
break;
case Common.MOVE_DIRECTION_RIGHT:
fXScrollStep = oScrollParameter.getStep();
break;
}
//let ftaMoveToScrollParameter = cc.moveTo(iDuration,
// oScrollParameter.node.x+fXScrollStep,
// oScrollParameter.node.y-fYScrollStep
// );
//Deprecated End
switch (oScrollParameter.getDirection()) { //正负在外面算好了
case Common.MOVE_DIRECTION_UP:
fYScrollTarget = oScrollParameter.getTargetPosition();
break;
case Common.MOVE_DIRECTION_DOWN:
fYScrollTarget = oScrollParameter.getTargetPosition();
break;
case Common.MOVE_DIRECTION_LEFT:
fXScrollTarget = oScrollParameter.getTargetPosition();
break;
case Common.MOVE_DIRECTION_RIGHT:
fXScrollTarget = oScrollParameter.getTargetPosition();
break;
}
let finished = cc.callFunc((oScrollParameter.callback ? oScrollParameter.callback : function () {
cc.log("do something");
}), this, oScrollParameter.scope);//todo:这里是否考虑要个回调
let ftaMoveToScrollParameter = cc.sequence(cc.moveTo(iDuration, fXScrollTarget, fYScrollTarget), finished);
ftaMoveToScrollParameter.setTag(Common.SCROLL_BY_FOCUS_CHANGE);
oScrollParameter.node.stopAction(oScrollParameter.node.getActionByTag(Common.SCROLL_BY_FOCUS_CHANGE));
//oScrollParameter.node.stopAllActions();
oScrollParameter.node.runAction(ftaMoveToScrollParameter);
oScrollParameter.setDirection(null);
//oScrollParameter.node.x+=fXScrollStep;
//oScrollParameter.node.y-=fYScrollStep;
}
//由于浮点数变成坐标必须取整所以不可避免会形成误差,其中的+1 -1为了保证边框不留空隙
//Target会比边框稍大
//let fDestFocusLeft = iScaledTargetLeft - g_iFocusFrameWidth + iXScrollStep + "px";
//let fDestFocusTop = iScaledTargetTop - g_iFocusFrameHeight + iYScrollStep + "px";
//let fDestFocusWidth = iScaledTargetWidth + 2 * g_iFocusFrameWidth + "px";
//let fDestFocusHeight = iScaledTargetHeight + 2 * g_iFocusFrameHeight + "px";
//只要改掉相对Left Top 就可
//此处需很小心处理和上下代码的关系
/*
if (null != oScrollParameter && null != oScrollParameter.node
&& null != oScrollParameter.getStep() && null != oScrollParameter.getHasRelation()) { //满足此条件才考虑界面滚动
let sizeVisible = cc.Director.getVisibleSize();
let fDestScrollElementLeft = oScrollParameter.node.x + fXScrollStep;
let fDestScrollElementTop = sizeVisible.height - oScrollParameter.node.y + fYScrollStep;
//这里还缺少动画 必须一起开始动
oScrollParameter.node.x=fDestScrollElementLeft;
oScrollParameter.node.y=oScrollParameter.node.y - fYScrollStep;
}*/
//准备好了所有数据 这里开始一起行动
//if (g_fnOnBeforeFocusChange) {
// g_fnOnBeforeFocusChange(elFocusNow, elFocusTarget, strDirection);
//}
//按比例将焦点目标的区域进行缩放 得注意浮点数的问题
let ftaScaleCurrentFocus = cc.scaleTo(iDuration, 1.0, 1.0);
let ftaScaleFocusTarget = cc.scaleTo(iDuration, fScaleFactor, fScaleFactor);
/*
log("ArchorPoint:%f,%f,%f,%f", pfiCurrentFocus->node->getAnchorPoint().x,
pfiCurrentFocus->node->getAnchorPoint().y,
pfiCurrentFocus->node->getAnchorPointInPoints().x,
pfiCurrentFocus->node->getAnchorPointInPoints().y );
*/
/*
//红点测试
auto sprite1 = cocos2d::Sprite::create("image/red_point.png");
sprite1->setPosition(0,0
// pfiCurrentFocus->node->getAnchorPointInPoints().x
//, pfiCurrentFocus->node->getAnchorPointInPoints().y);
pfiCurrentFocus->node->addChild(sprite1, 20, "PointFlag");
*/
// nodeCurrent.setLocalZOrder(10);
// nodeTarget.setLocalZOrder(40);
nodeCurrent.zIndex = 10;
nodeTarget.zIndex = 40;
ftaScaleCurrentFocus.setTag(Common.FEATURE_NODE_TRANSFER);
ftaScaleFocusTarget.setTag(Common.FEATURE_NODE_TRANSFER);
//if (null!=nodeCurrent.getActionByTag(Common.FEATURE_NODE_TRANSFER)){
// nodeCurrent.stopAction(Common.FEATURE_NODE_TRANSFER);
//}
//if (null!=nodeTarget.getActionByTag(Common.FEATURE_NODE_TRANSFER)){
// nodeTarget.stopAction(Common.FEATURE_NODE_TRANSFER);
//}
nodeCurrent.stopAction(nodeCurrent.getActionByTag(Common.FEATURE_NODE_TRANSFER));
nodeTarget.stopAction(nodeTarget.getActionByTag(Common.FEATURE_NODE_TRANSFER));
nodeCurrent.runAction(ftaScaleCurrentFocus);
nodeTarget.runAction(ftaScaleFocusTarget);
cc.log(fiFocusTarget.getLeft());
cc.log(fiFocusTarget.getTop());
this.fly(fiFocusTarget.getLeft() + fXScrollStep, fiFocusTarget.getTop() + fYScrollStep,
fiFocusTarget.getWidth(), fiFocusTarget.getHeight(),
iDuration, fScaleFactor);
//if (fiTarget.onFocus && typeof fiTarget.onFocus =='function' ){
// fiTarget.onFocus();
//}
let eventOnFocus = new cc.Event.EventCustom('focus', true);
eventOnFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventOnFocus);
//旧的事件通知
//this.node.emit('after_focus_change', { from: fiCurrentFocus, to: fiFocusTarget});
let eventAfterFocus = new cc.Event.EventCustom('after_focus_change', true);
eventAfterFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventAfterFocus);
//新的事件通知方式 是否科学有待检验
//let eventFocusLeave=new cc.Event.EventCustom('focus_leave',true);
//eventFocusLeave.setUserData({from:fiCurrentFocus,to:fiFocusTarget});
//nodeCurrent.dispatchEvent(eventFocusLeave);
//let eventFocusHover=new cc.Event.EventCustom('focus_hover',true);
//eventFocusHover.setUserData({from:fiCurrentFocus,to:fiFocusTarget});
//nodeTarget.dispatchEvent(eventFocusHover);
this._oScene.setCurrentFocus(fiFocusTarget);
//计算完成以下开始完成所有动作
//elFocusNow.style.zIndex = 0;
//elFocusTarget.style.zIndex = 20;
/*
var elFocusContainer = document.getElementById("focus_container");
//document.getElementById('view_port').style.left = destViewPortLeft;
elFocusContainer.style.left = destFocusLeft;
elFocusContainer.style.top = destFocusTop;
//document.getElementById("focus5").style.width = destFocusWidth;
//document.getElementById("focus5").style.height = destFocusHeight;
elFocusContainer.style.width = destFocusWidth;
elFocusContainer.style.height = destFocusHeight;
*/
//if (g_fnOnAfterFocusChange) {
// g_fnOnAfterFocusChange(elFocusNow, elFocusTarget, strDirection);
//}
//总要先将前面那个复原
//scaleElement(g_strFocusElementId, 1, 1);
//g_strFocusElementId = elFocusTarget.id;
return 1;
} else {
cc.log("No Target Found to Fly: Unavailable Direction");
return 0;
}
},
jumpFocus: function (fiCurrentFocus, fiFocusTarget, iDirection, fScaleFactor, oScrollParameter) {
if (null == fiFocusTarget) {
//找不到目标的动画小交互
//var blink1=cc.blink(0.6,20);
//this.node.runAction(blink1);
let aiJoggle = cc.repeat(
cc.sequence(
cc.rotateTo(0.02, -2),
cc.rotateTo(0.02, 0),
cc.rotateTo(0.02, 2),
cc.rotateTo(0.02, 0)
),
4
);
aiJoggle.setTag(Common.FOCUS_CONTAINER_JOGGLE);
this.node.stopAction(this.node.getActionByTag(Common.FOCUS_CONTAINER_JOGGLE));
this.node.runAction(aiJoggle);
return 0;
}
fScaleFactor = fScaleFactor || fiFocusTarget.getScaleFactor();
//是否是有效方向
if (Common.MOVE_DIRECTION_UP <= iDirection && iDirection <= Common.MOVE_DIRECTION_LEFT) {
//let eventBeforeFocus=new cc.Event.EventCustom('before_focus_change', true);
//eventBeforeFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget});
//this.node.dispatchEvent(eventBeforeFocus);
//处理因焦点移动导致的部分界面滑动
let fXScrollStep = 0;
let fYScrollStep = 0;
var ftaScaleCurrentFocus = cc.scaleTo(Common.FOCUS_FLY_DURATION, 1.0, 1.0);
var ftaScaleFocusTarget = cc.scaleTo(Common.FOCUS_FLY_DURATION, fScaleFactor, fScaleFactor);
var nodeCurrent = fiCurrentFocus.node;//node;
var nodeTarget = fiFocusTarget.node;//node;
nodeCurrent.setLocalZOrder(10);
nodeTarget.setLocalZOrder(40);
ftaScaleCurrentFocus.setTag(Common.FEATURE_NODE_TRANSFER);
ftaScaleFocusTarget.setTag(Common.FEATURE_NODE_TRANSFER);
nodeCurrent.stopAction(nodeCurrent.getActionByTag(Common.FEATURE_NODE_TRANSFER));
nodeTarget.stopAction(nodeTarget.getActionByTag(Common.FEATURE_NODE_TRANSFER));
nodeCurrent.runAction(ftaScaleCurrentFocus);
nodeTarget.runAction(ftaScaleFocusTarget);
this.fly(fiFocusTarget.getLeft(), fiFocusTarget.getTop(),
fiFocusTarget.getWidth(), fiFocusTarget.getHeight(),
0, fScaleFactor
);
//旧的事件通知
//this.node.emit('after_focus_change', { from: fiCurrentFocus, to: fiFocusTarget});
let eventAfterFocus = new cc.Event.EventCustom('after_focus_change', true);
eventAfterFocus.setUserData({ from: fiCurrentFocus, to: fiFocusTarget });
this.node.dispatchEvent(eventAfterFocus);
//新的事件通知方式 是否科学有待检验
//let eventFocusLeave=new cc.Event.EventCustom('focus_leave',true);
//eventFocusLeave.setUserData({from:fiCurrentFocus,to:fiFocusTarget});
//nodeCurrent.dispatchEvent(eventFocusLeave);
//let eventFocusHover=new cc.Event.EventCustom('focus_hover',true);
//eventFocusHover.setUserData({from:fiCurrentFocus,to:fiFocusTarget});
//nodeTarget.dispatchEvent(eventFocusHover);
this._oScene.setCurrentFocus(fiFocusTarget);
return 1;
} else {
cc.log("No Target Found to Fly: Unavailable Direction");
return 0;
}
},
//跳向一个未来某一刻才会出现的Focus
flyFocus2Fantasy: function (fiCurrentFocus, fiFocusTarget, iDirection, fScaleFactor, oScrollParameter) {
},
getCornerOuterRadius: function () {
return this._cornerOuterRadius;
},
setCornerOuterRadius: function (cornerOuterRadius) {
this._cornerOuterRadius = cornerOuterRadius;
},
getCornerInnerRadius: function () {
return this._cornerInnerRadius;
},
setCornerInnerRadius: function (cornerInnerRadius) {
this._cornerInnerRadius = cornerInnerRadius;
},
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});
{
"ver": "1.0.5",
"uuid": "a4e1b66d-6337-472f-bbf7-6d1a4a4c4b98",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
properties: {
_fStep:1,
_bHasRelation:true,
_oNode:null, //deprecated
_iDirection:0,
_fTargetPosition:0,
},
//ctor: function (fStep,bHasRelation,iDirection) {
ctor: function () {
this._fStep=arguments[0];
this._bHasRelation=arguments[1];
//this._oNode=arguments[2];
this._iDirection=arguments[2];
//this._fStep=fStep;
//this._bHasRelation=bHasRelation;
//this._oNode=oNode;
//this._iDirection=iDirection;
},
init: function (fStep,bHasRelation,iDirection) {
this._fStep=fStep;
this._bHasRelation=bHasRelation;
//this._oNode=oNode;
this._iDirection=iDirection;
},
getStep:function(){
return this._fStep;
},
setStep:function(fStep){
this._fStep=fStep;
},
getHasRelation:function(){
return this._bHasRelation;
},
setHasRelation:function(bHasRelation){
this._bHasRelation=bHasRelation;
},
/*
getNode:function(){
return this._oNode;
},
setNode:function(oNode){
this._oNode=oNode;
},*/
getDirection:function(){
return this._iDirection;
},
setDirection:function(iDirection){
this._iDirection=iDirection;
},
getTargetNode:function(){
return this._oTargetNode;
},
setTargetNode:function(oTargetNode){
this._oTargetNode=oTargetNode;
},
//明确目标位置 比设置Step更为有效
getTargetPosition:function(){
return this._fTargetPosition;
},
setTargetPosition:function(fTargetPosition){
this._fTargetPosition=fTargetPosition;
}
});
{
"ver": "1.0.5",
"uuid": "2970f50b-b098-424a-8197-5208a926b646",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//测试界面
var TVCanvas = require('TVCanvas');
cc.Class({
extends: cc.Component,
properties: {
testSprite:cc.Sprite,
test:cc.Label,
},
onLoad: function () {
//获取页面背景
// this.getPageBg(this, "background");
},
// TestLog:function(){
// cc.log("测试js中Test->TestLog发送方法。。。。");
// },
});
{
"ver": "1.0.5",
"uuid": "ac4e29c4-f16f-41cb-9dbc-8432082945c4",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//工具
//导出变量给PersoanlListView使用
// module.exports.foo = function (strResponse) { //require 实际上获取的是目标脚本内的 module.exports 变量
//注意:一旦使用exports导出则static内函数全部获取不到
// var utils = new Utils();
// utils.setTest(strResponse);
// };
cc.Class({
extends: cc.Component,
properties: {
},
onLoad: function () {
// this._aCategoryMediaId.join(","); //将数组转化为','相隔的字符串
// if (typeof (oResult[i].images) != 'undefined' && oResult[i].images.map.normal != null) {//typeOf获取一个变量是否存在,即使oResult[i].images不存在(未声明)也不会出错
// var index = oResult[i].images.map.normal[0];
// fileURL = oResult[i].images.list[index].fileUrl;
// }
// cc.log("时间测试:" + this.formatDate(1522031521000));
// this._graphicsLine = cc.find('ScrollContent/GraphicsLine', this.node).getComponent(cc.Graphics);
// this._graphicsLine.roundRect(borderX, borderY, oResult[i].width, oResult[i].height, 20);//圆角矩形路径
// this._graphicsLine.stroke(); //绘制路径
// if (oJSONResult.resultSet[0].score) {
// cc.find("LeftGroup/Score", this.node).getComponent(cc.Label).string = parseInt(oJSONResult.resultSet[0].score * 10) / 10 + "分";
// }
//Label下一帧才刷新大小
//目前用户可以自行在设置 label 所有属性后在执行一次 label._updateRenderData(true); 就能带当帧获取大小
},
statics: {
/**
* 移除元素
*/
indexOfArr: function (arr, val) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == val) { return i; }
}
return -1;
},
remove: function (arr, val) {
var index = this.indexOfArr(arr, val);
// cc.log("index:"+index);
if (index > -1) { arr.splice(index, 1); }
},
/**
* 将时间字符串转成年月日
* @param {*} date
*/
formatDate: function (date) {
date = new Date(date);
var y = date.getFullYear();
var m = date.getMonth() + 1;
var d = date.getDate();
var h = date.getHours();
var m1 = date.getMinutes();
var s = date.getSeconds();
m = m < 10 ? ("0" + m) : m;
d = d < 10 ? ("0" + d) : d;
// return y+"-"+m+"-"+d+" "+h+":"+m1+":"+s;
return y + "-" + m + "-" + d;
},
// 提取url中的解析字符串
//使用 var params = UrlParamHash(url);
// var fr= params['fr']; //fr = iks
UrlParamHash: function (url) {
if(typeof(url)=='undefined') return;
var params = [], h;
var hash = url.slice(url.indexOf("?") + 1).split(/[&,']/); //以'或&分割,将变量放在数组里面,形如[fr=iks,word=slice,ie=gbk]
for (var i = 0; i < hash.length; i++) {
h = hash[i].split("="); //形如[fr,iks]
params[h[0]] = h[1];
}
return params;
},
//秒数转分钟 200.617083--03:21
formatSecond2Minute: function (second) {
var mm = Math.floor(second / 60);
if (mm < 10) mm = "0" + mm;
var ss = (second % 60).toFixed(0);
if (ss < 10) ss = "0" + ss;
return mm + ":" + ss;
},
//加载资源并且设置资源可以自动释放
loadRes: function (url, type, completeCallback) {
return cc.loader.loadRes(url, type, function (err, res) {
if (completeCallback) {
completeCallback(err, res);
}
if (!err) {
cc.loader.setAutoReleaseRecursively(res, true);
}
});
},
//判断是不是移动端
isMobile:function(){
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { //Web端不支持JSB
return true;
} else {
return false;
}
},
//筛选得到图片
getImageByTag: function (oData, strTag, index) {
var val = oData.images;
strTag = strTag || "normal";
index = index || 0;
var strUrl = null;
if (val && val != '' && val != 'null') {
if (val.list && val.list instanceof Array && val.list.length > 0
&& val.map[strTag] && val.map[strTag] instanceof Array && val.map[strTag].length > 0
) {
if (val.list[val.map[strTag][index]].fileUrl) {
strUrl = Common.TOPDRAW_IMAGE_SERVER + val.list[val.map[strTag][index]].fileUrl;
}
}
}
return strUrl;
},
},
});
{
"ver": "1.0.5",
"uuid": "118fab66-2ecc-4316-9d2b-0455ee265dba",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//推荐页
var Common = require('Common');
var Network = require('Network');
cc.Class({
extends: cc.Component,
properties: {
id: 0,
pic: cc.Sprite,
activeName1: cc.Label,
activeName2: cc.Label,
normalName: cc.Label,
},
// data: {id,iconSF,itemName,itemPrice}
init: function (data, funCallback) {
// cc.log("pfbRecommend->init: "+data.tvlink);
// this.id = data.id;
// this.node.width = data.width;
// this.node.height = data.height;
// this.node.getChildByName('Pic').width = data.width;
// this.node.getChildByName('Pic').height = data.height;
if (data.imageURL) {
var self = this;
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER_EDU + data.imageURL,
function (texture) {
self.pic.spriteFrame = new cc.SpriteFrame(texture,cc.rect(0,0,self.node.width,self.node.height));
if (null != funCallback && typeof funCallback == 'function') {
funCallback.call();
}
}, null, this
);
}
// this.node.getComponent(cc.Widget).top = data.top;
// this.node.getComponent(cc.Widget).left = data.left;
if (data.title_visible == 1) { //前三个不需要显示文字
cc.find('Name', this.node).active = true;
cc.find('Name', this.node).width = data.width - 10;
cc.find('Name/TextBg', this.node).width = data.width;
cc.find('Name/NormalName', this.node).width = data.width - 10;
cc.find('Name/ActiveName', this.node).width = data.width - 10;
cc.find('Name/ActiveName/NameContainer', this.node).width = data.width - 10;
cc.find('Name/ActiveName/NameContainer/NameText', this.node).width = data.width - 10;
this.normalName.node.width = data.width - 10;
this.activeName1.string = data.title;
this.activeName2.string = data.title;
this.normalName.string = data.title;
this.activeName1._updateRenderData(true);
this.activeName2._updateRenderData(true);
this.normalName._updateRenderData(true);
//调整文字位置
let nodeCellName = this.node.getChildByName('Name');
let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
let nodeScreenTitleText1 = nodeScreenTitleText.getChildByName('NameText1');
if (nodeScreenTitleText1.width > nodeScreenTitleText.width) {
this.normalName.overflow = cc.Label.Overflow.CLAMP;
this.normalName.enableWrapText = false;
this.normalName.horizontalAlign = cc.Label.HorizontalAlign.LEFT;
}
}
},
setUIWithFocus: function () {
let nodeCellName = this.node.getChildByName('Name');
cc.find("NormalName", nodeCellName).opacity = 255;
//超出滚动
let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
let fOriginalX = nodeScreenTitleText.x;
let fOriginalY = nodeScreenTitleText.y;
let nodeScreenTitleText1 = nodeScreenTitleText.getChildByName('NameText1');
let nodeScreenTitleText2 = nodeScreenTitleText.getChildByName('NameText2');
nodeScreenTitleText2.x = nodeScreenTitleText1.x + nodeScreenTitleText1.width + 10;//TODO:补丁,解决滚动重叠
cc.log(nodeScreenTitleText1.width + "------------" + nodeScreenTitleText.width);
if (nodeScreenTitleText1.width > nodeScreenTitleText.width) {
cc.find("ActiveName/NameContainer", nodeCellName).opacity = 255;
cc.find("NormalName", nodeCellName).opacity = 0;
let fEndPositionDelta = (nodeScreenTitleText1.width + 30);
//下方时长和字有关系,才能速度一样
var ftaScreenTitleMoveToTarget = cc.moveTo(10 * (nodeScreenTitleText1.width / nodeScreenTitleText.width), fOriginalX - fEndPositionDelta, fOriginalY);
var ftaScreenTitleMoveToBack = cc.moveTo(0, fOriginalX, fOriginalY);
var sequenceMediaTitle = cc.sequence(ftaScreenTitleMoveToTarget, ftaScreenTitleMoveToBack);
var repeatScreenTitle = cc.repeat(sequenceMediaTitle, 10);
repeatScreenTitle.setTag(Common.OVERLENGTH_MOVING);
nodeScreenTitleText.runAction(repeatScreenTitle);
nodeScreenTitleText2.active = true;
}
},
setUIWithoutFocus: function () {
let nodeCellName = this.node.getChildByName('Name');
cc.find("NormalName", nodeCellName).opacity = 255;
//如有滚动停止滚动
let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
if (null != nodeScreenTitleText.getActionByTag(Common.OVERLENGTH_MOVING)) {
nodeScreenTitleText.stopActionByTag(Common.OVERLENGTH_MOVING);
nodeScreenTitleText.getChildByName('NameText2').active = false;
cc.find("ActiveName/NameContainer", nodeCellName).opacity = 0;
}
nodeScreenTitleText.x = 0;
},
});
{
"ver": "1.0.5",
"uuid": "43a14b47-14de-42be-b1fc-5b7cfcc31cf8",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//推荐页
var Common = require('Common');
var Network = require('Network');
cc.Class({
extends: cc.Component,
properties: {
id: 0,
pic: cc.Sprite,
activeName1: cc.Label,
activeName2: cc.Label,
normalName: cc.Label,
},
// data: {id,iconSF,itemName,itemPrice}
init: function (data, funCallback) {
// cc.log("pfbRecommend->init: "+data.tvlink);
// this.id = data.id;
// this.node.width = data.width;
// this.node.height = data.height;
// this.node.getChildByName('Pic').width = data.width;
// this.node.getChildByName('Pic').height = data.height;
if (data.image[0].fileUrl) {
var self = this;
Network.loadImageInNativeRuntime(
Common.TOPDRAW_IMAGE_SERVER_EDU_RIGHT + data.image[0].fileUrl,
function (texture) {
self.pic.spriteFrame = new cc.SpriteFrame(texture);
if (null != funCallback && typeof funCallback == 'function') {
funCallback.call();
}
}, null, this
);
}
// this.node.getComponent(cc.Widget).top = data.top;
// this.node.getComponent(cc.Widget).left = data.left;
// if (data.title_visible == 1) { //前三个不需要显示文字
// cc.find('Name', this.node).active = true;
// cc.find('Name', this.node).width = data.width - 10;
// cc.find('Name/TextBg', this.node).width = data.width;
// cc.find('Name/NormalName', this.node).width = data.width - 10;
// cc.find('Name/ActiveName', this.node).width = data.width - 10;
// cc.find('Name/ActiveName/NameContainer', this.node).width = data.width - 10;
// cc.find('Name/ActiveName/NameContainer/NameText', this.node).width = data.width - 10;
// this.normalName.node.width = data.width - 10;
// this.activeName1.string = data.title;
// this.activeName2.string = data.title;
// this.normalName.string = data.title;
// this.activeName1._updateRenderData(true);
// this.activeName2._updateRenderData(true);
// this.normalName._updateRenderData(true);
// //调整文字位置
// let nodeCellName = this.node.getChildByName('Name');
// let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
// let nodeScreenTitleText1 = nodeScreenTitleText.getChildByName('NameText1');
// if (nodeScreenTitleText1.width > nodeScreenTitleText.width) {
// this.normalName.overflow = cc.Label.Overflow.CLAMP;
// this.normalName.enableWrapText = false;
// this.normalName.horizontalAlign = cc.Label.HorizontalAlign.LEFT;
// }
// }
},
setUIWithFocus: function () {
let nodeCellName = this.node.getChildByName('Name');
cc.find("NormalName", nodeCellName).opacity = 255;
//超出滚动
let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
let fOriginalX = nodeScreenTitleText.x;
let fOriginalY = nodeScreenTitleText.y;
let nodeScreenTitleText1 = nodeScreenTitleText.getChildByName('NameText1');
let nodeScreenTitleText2 = nodeScreenTitleText.getChildByName('NameText2');
nodeScreenTitleText2.x = nodeScreenTitleText1.x + nodeScreenTitleText1.width + 10;//TODO:补丁,解决滚动重叠
cc.log(nodeScreenTitleText1.width + "------------" + nodeScreenTitleText.width);
if (nodeScreenTitleText1.width > nodeScreenTitleText.width) {
cc.find("ActiveName/NameContainer", nodeCellName).opacity = 255;
cc.find("NormalName", nodeCellName).opacity = 0;
let fEndPositionDelta = (nodeScreenTitleText1.width + 30);
//下方时长和字有关系,才能速度一样
var ftaScreenTitleMoveToTarget = cc.moveTo(10 * (nodeScreenTitleText1.width / nodeScreenTitleText.width), fOriginalX - fEndPositionDelta, fOriginalY);
var ftaScreenTitleMoveToBack = cc.moveTo(0, fOriginalX, fOriginalY);
var sequenceMediaTitle = cc.sequence(ftaScreenTitleMoveToTarget, ftaScreenTitleMoveToBack);
var repeatScreenTitle = cc.repeat(sequenceMediaTitle, 10);
repeatScreenTitle.setTag(Common.OVERLENGTH_MOVING);
nodeScreenTitleText.runAction(repeatScreenTitle);
nodeScreenTitleText2.active = true;
}
},
setUIWithoutFocus: function () {
let nodeCellName = this.node.getChildByName('Name');
cc.find("NormalName", nodeCellName).opacity = 255;
//如有滚动停止滚动
let nodeScreenTitleText = cc.find('ActiveName/NameContainer/NameText', nodeCellName);
if (null != nodeScreenTitleText.getActionByTag(Common.OVERLENGTH_MOVING)) {
nodeScreenTitleText.stopActionByTag(Common.OVERLENGTH_MOVING);
nodeScreenTitleText.getChildByName('NameText2').active = false;
cc.find("ActiveName/NameContainer", nodeCellName).opacity = 0;
}
nodeScreenTitleText.x = 0;
},
});
{
"ver": "1.0.5",
"uuid": "4e3e0b43-0b64-4a48-b6fb-9cd3d734de73",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
statics: {
waterfall: {
"name": "Recommend",
"resultSet": [
{
"name": "block3",
"height": 427,
"hasChildFrame": true,
"data": {
"name": "frame3",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_ca662698-17fe-436b-8bee-9b5e0a255bdb",
"left": 0,
"top": 0,
"width": 220,
"height": 36,
"disable": true
},
{
"name": "SingerList",
"code": "promotionItem_0a911d4c-9223-4d49-bf63-6e4ed2a49668",
"left": 0,
"top": 60,
"width": 493,
"height": 316
},
{
"name": "SingerList",
"code": "promotionItem_c388af5a-0351-43c4-89f5-8c8bfbf5a443",
"left": 517,
"top": 60,
"width": 493,
"height": 316
}
]
}
},
{
"name": "block1",
"height": 526,
"hasChildFrame": true,
"data": {
"name": "frame1",
"resultSet": [
{
"name": "Carousel0",
"code": "promotionItem_fd456495-2e32-44e1-9d92-450227d4afa3",
"left": 0,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_4ca66642-33d0-41c9-9913-df131a79a375",
"left": 252,
"top": 0,
"width": 504,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_c5f58c16-48a5-4796-ab52-41679fc88a6d",
"left": 773,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_9fd6d854-2a72-42d5-a2c0-1ce824cf406c",
"left": 0,
"top": 308,
"width": 427,
"height": 169
},
{
"name": "dailyRecommend",
"code": "promotionItem_5b998526-fb2a-48f9-8977-1fc20ac91ae6",
"left": 445,
"top": 308,
"width": 274,
"height": 168
},
{
"name": "dailyRecommend",
"code": "promotionItem_2ff129e8-12aa-4384-a0b8-736b8ff029f1",
"left": 736,
"top": 308,
"width": 274,
"height": 168
}
]
}
},
{
"name": "block2",
"height": 224,
"hasChildFrame": true,
"data": {
"name": "frame2",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_8a4a1762-22e8-4a1e-8ce3-1fe81412855a",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 59],
"width": 1100,
"disable": true,
"childrenSize": [105, 123],
"childrenMargin": [0, 24, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_e432ac2d-c1f3-4d44-a42b-7000971affa1"
},
{
"name": "Subject2",
"code": "promotionItem_f90b7ff3-1f36-4019-9e77-cef871902343"
},
{
"name": "Subject3",
"code": "promotionItem_e29b33e4-8954-4ef9-a6fc-0d844c909c67"
},
{
"name": "Subject4",
"code": "promotionItem_57aea4b3-7716-4224-bc77-43272c35ee32"
},
{
"name": "Subject4",
"code": "promotionItem_55c68c1c-451a-4197-84a1-6a39a1668a90"
},
{
"name": "Subject4",
"code": "promotionItem_2ac9afea-aa83-4fc1-a651-4f465b3cb1c3"
},
{
"name": "Subject4",
"code": "promotionItem_8ab81a46-b81e-4acf-bbcd-13315747eab3"
},
{
"name": "Subject4",
"code": "promotionItem_3e6642ab-517c-49ea-8788-cdc9130716d7"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block4",
"height": 286,
"hasChildFrame": true,
"data": {
"name": "frame4",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f4c1169d-1778-48af-a449-3d195f8ca146",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 57],
"width": 1100,
"disable": true,
"childrenSize": [159, 175],
"childrenMargin": [0, 11, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_df4a26f1-bfd9-4781-9495-ba74f53bf285"
},
{
"name": "Subject2",
"code": "promotionItem_4727bb73-6d27-455d-b573-d2bb18074b07"
},
{
"name": "Subject3",
"code": "promotionItem_d2be83c4-78da-466b-b16d-e433bbaa4cac"
},
{
"name": "Subject4",
"code": "promotionItem_d8bfc7e3-0df3-488a-8655-795ad48e9b74"
},
{
"name": "Subject4",
"code": "promotionItem_9c4e1710-e9cb-4698-83eb-91cd2e85ba2e"
},
{
"name": "Subject4",
"code": "promotionItem_edfd1449-ea73-4a19-b605-e09af698e615"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block5",
"height": 274,
"hasChildFrame": true,
"data": {
"name": "frame5",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_e6bf3f27-97a7-4990-85bb-b07f75d90ef6",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_c39cdbc6-aa7b-4bf0-a700-0d396bc7bd47",
"left": 0,
"top": 58,
"width": 369,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_0b3263db-d600-4ad3-b2ba-4787315ca51c",
"left": 379,
"top": 58,
"width": 254,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_cf020301-6346-4b61-9bd8-325a976ce4b4",
"left": 641,
"top": 58,
"width": 369,
"height": 155
}
]
}
},
{
"name": "block6",
"height": 382,
"hasChildFrame": true,
"data": {
"name": "frame6",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f26f6b36-de3f-4f2d-8f9a-4509764b7289",
"left": 0,
"top": 0,
"width": 220,
"height": 34,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_502e5100-223b-4088-85e6-bcbf637e2ea3",
"left": 0,
"top": 58,
"width": 221,
"height": 135
},
{
"name": "Title",
"code": "promotionItem_05dd1dca-53e6-4fc6-b621-6c32b5ffe2f7",
"left": 237,
"top": 11,
"width": 521,
"height": 333
},
{
"name": "Title",
"code": "promotionItem_f2445926-7065-48e2-aefd-a766512be5a6",
"left": 774,
"top": 58,
"width": 236,
"height": 286
},
{
"name": "Title",
"code": "promotionItem_ffbf27dd-0c0a-4332-a39e-3234f83de867",
"left": 0,
"top": 209,
"width": 221,
"height": 135
}
]
}
},
{
"name": "block7",
"height": 120,
"hasChildFrame": true,
"data": {
"name": "frame7",
"resultSet": [
{
"name": "back2Top",
"code": "promotionItem_f3975526-213a-4292-95ea-ab39897e1560",
"left": 337,
"top": 0,
"width": 322,
"height": 86,
"containerId": "back2Top"
}
]
}
}
]
}
}
});
{
"ver": "1.0.5",
"uuid": "aa753a4e-3b13-4828-ad1b-a7d1af1e6272",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
statics: {
waterfall: {
"name": "Recommend",
"resultSet": [
{
"name": "block6",
"height": 382,
"hasChildFrame": true,
"data": {
"name": "frame6",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f26f6b36-de3f-4f2d-8f9a-4509764b7289",
"left": 0,
"top": 0,
"width": 220,
"height": 34,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_502e5100-223b-4088-85e6-bcbf637e2ea3",
"left": 0,
"top": 58,
"width": 221,
"height": 135
},
{
"name": "Title",
"code": "promotionItem_05dd1dca-53e6-4fc6-b621-6c32b5ffe2f7",
"left": 237,
"top": 11,
"width": 521,
"height": 333
},
{
"name": "Title",
"code": "promotionItem_f2445926-7065-48e2-aefd-a766512be5a6",
"left": 774,
"top": 58,
"width": 236,
"height": 286
},
{
"name": "Title",
"code": "promotionItem_ffbf27dd-0c0a-4332-a39e-3234f83de867",
"left": 0,
"top": 209,
"width": 221,
"height": 135
}
]
}
},
{
"name": "block1",
"height": 526,
"hasChildFrame": true,
"data": {
"name": "frame1",
"resultSet": [
{
"name": "Carousel0",
"code": "promotionItem_fd456495-2e32-44e1-9d92-450227d4afa3",
"left": 0,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_4ca66642-33d0-41c9-9913-df131a79a375",
"left": 252,
"top": 0,
"width": 504,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_c5f58c16-48a5-4796-ab52-41679fc88a6d",
"left": 773,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_9fd6d854-2a72-42d5-a2c0-1ce824cf406c",
"left": 0,
"top": 308,
"width": 427,
"height": 169
},
{
"name": "dailyRecommend",
"code": "promotionItem_5b998526-fb2a-48f9-8977-1fc20ac91ae6",
"left": 445,
"top": 308,
"width": 274,
"height": 168
},
{
"name": "dailyRecommend",
"code": "promotionItem_2ff129e8-12aa-4384-a0b8-736b8ff029f1",
"left": 736,
"top": 308,
"width": 274,
"height": 168
}
]
}
},
{
"name": "block2",
"height": 224,
"hasChildFrame": true,
"data": {
"name": "frame2",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_8a4a1762-22e8-4a1e-8ce3-1fe81412855a",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 59],
"width": 1100,
"disable": true,
"childrenSize": [105, 123],
"childrenMargin": [0, 24, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_e432ac2d-c1f3-4d44-a42b-7000971affa1"
},
{
"name": "Subject2",
"code": "promotionItem_f90b7ff3-1f36-4019-9e77-cef871902343"
},
{
"name": "Subject3",
"code": "promotionItem_e29b33e4-8954-4ef9-a6fc-0d844c909c67"
},
{
"name": "Subject4",
"code": "promotionItem_57aea4b3-7716-4224-bc77-43272c35ee32"
},
{
"name": "Subject4",
"code": "promotionItem_55c68c1c-451a-4197-84a1-6a39a1668a90"
},
{
"name": "Subject4",
"code": "promotionItem_2ac9afea-aa83-4fc1-a651-4f465b3cb1c3"
},
{
"name": "Subject4",
"code": "promotionItem_8ab81a46-b81e-4acf-bbcd-13315747eab3"
},
{
"name": "Subject4",
"code": "promotionItem_3e6642ab-517c-49ea-8788-cdc9130716d7"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block3",
"height": 427,
"hasChildFrame": true,
"data": {
"name": "frame3",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_ca662698-17fe-436b-8bee-9b5e0a255bdb",
"left": 0,
"top": 0,
"width": 220,
"height": 36,
"disable": true
},
{
"name": "SingerList",
"code": "promotionItem_0a911d4c-9223-4d49-bf63-6e4ed2a49668",
"left": 0,
"top": 60,
"width": 493,
"height": 316
},
{
"name": "SingerList",
"code": "promotionItem_c388af5a-0351-43c4-89f5-8c8bfbf5a443",
"left": 517,
"top": 60,
"width": 493,
"height": 316
}
]
}
},
{
"name": "block4",
"height": 286,
"hasChildFrame": true,
"data": {
"name": "frame4",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f4c1169d-1778-48af-a449-3d195f8ca146",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 57],
"width": 1100,
"disable": true,
"childrenSize": [159, 175],
"childrenMargin": [0, 11, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_df4a26f1-bfd9-4781-9495-ba74f53bf285"
},
{
"name": "Subject2",
"code": "promotionItem_4727bb73-6d27-455d-b573-d2bb18074b07"
},
{
"name": "Subject3",
"code": "promotionItem_d2be83c4-78da-466b-b16d-e433bbaa4cac"
},
{
"name": "Subject4",
"code": "promotionItem_d8bfc7e3-0df3-488a-8655-795ad48e9b74"
},
{
"name": "Subject4",
"code": "promotionItem_9c4e1710-e9cb-4698-83eb-91cd2e85ba2e"
},
{
"name": "Subject4",
"code": "promotionItem_edfd1449-ea73-4a19-b605-e09af698e615"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block5",
"height": 274,
"hasChildFrame": true,
"data": {
"name": "frame5",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_e6bf3f27-97a7-4990-85bb-b07f75d90ef6",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_c39cdbc6-aa7b-4bf0-a700-0d396bc7bd47",
"left": 0,
"top": 58,
"width": 369,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_0b3263db-d600-4ad3-b2ba-4787315ca51c",
"left": 379,
"top": 58,
"width": 254,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_cf020301-6346-4b61-9bd8-325a976ce4b4",
"left": 641,
"top": 58,
"width": 369,
"height": 155
}
]
}
},
{
"name": "block7",
"height": 120,
"hasChildFrame": true,
"data": {
"name": "frame7",
"resultSet": [
{
"name": "back2Top",
"code": "promotionItem_f3975526-213a-4292-95ea-ab39897e1560",
"left": 337,
"top": 0,
"width": 322,
"height": 86,
"containerId": "back2Top"
}
]
}
}
]
}
}
});
\ No newline at end of file
{
"ver": "1.0.5",
"uuid": "97fdacf1-0a54-46e5-960d-8017fba2261f",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
statics: {
waterfall: {
"name": "Recommend",
"resultSet": [
{
"name": "block5",
"height": 274,
"hasChildFrame": true,
"data": {
"name": "frame5",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_e6bf3f27-97a7-4990-85bb-b07f75d90ef6",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_c39cdbc6-aa7b-4bf0-a700-0d396bc7bd47",
"left": 0,
"top": 58,
"width": 369,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_0b3263db-d600-4ad3-b2ba-4787315ca51c",
"left": 379,
"top": 58,
"width": 254,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_cf020301-6346-4b61-9bd8-325a976ce4b4",
"left": 641,
"top": 58,
"width": 369,
"height": 155
}
]
}
},
{
"name": "block1",
"height": 526,
"hasChildFrame": true,
"data": {
"name": "frame1",
"resultSet": [
{
"name": "Carousel0",
"code": "promotionItem_fd456495-2e32-44e1-9d92-450227d4afa3",
"left": 0,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_4ca66642-33d0-41c9-9913-df131a79a375",
"left": 252,
"top": 0,
"width": 504,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_c5f58c16-48a5-4796-ab52-41679fc88a6d",
"left": 773,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_9fd6d854-2a72-42d5-a2c0-1ce824cf406c",
"left": 0,
"top": 308,
"width": 427,
"height": 169
},
{
"name": "dailyRecommend",
"code": "promotionItem_5b998526-fb2a-48f9-8977-1fc20ac91ae6",
"left": 445,
"top": 308,
"width": 274,
"height": 168
},
{
"name": "dailyRecommend",
"code": "promotionItem_2ff129e8-12aa-4384-a0b8-736b8ff029f1",
"left": 736,
"top": 308,
"width": 274,
"height": 168
}
]
}
},
{
"name": "block2",
"height": 224,
"hasChildFrame": true,
"data": {
"name": "frame2",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_8a4a1762-22e8-4a1e-8ce3-1fe81412855a",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 59],
"width": 1100,
"disable": true,
"childrenSize": [105, 123],
"childrenMargin": [0, 24, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_e432ac2d-c1f3-4d44-a42b-7000971affa1"
},
{
"name": "Subject2",
"code": "promotionItem_f90b7ff3-1f36-4019-9e77-cef871902343"
},
{
"name": "Subject3",
"code": "promotionItem_e29b33e4-8954-4ef9-a6fc-0d844c909c67"
},
{
"name": "Subject4",
"code": "promotionItem_57aea4b3-7716-4224-bc77-43272c35ee32"
},
{
"name": "Subject4",
"code": "promotionItem_55c68c1c-451a-4197-84a1-6a39a1668a90"
},
{
"name": "Subject4",
"code": "promotionItem_2ac9afea-aa83-4fc1-a651-4f465b3cb1c3"
},
{
"name": "Subject4",
"code": "promotionItem_8ab81a46-b81e-4acf-bbcd-13315747eab3"
},
{
"name": "Subject4",
"code": "promotionItem_3e6642ab-517c-49ea-8788-cdc9130716d7"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block3",
"height": 427,
"hasChildFrame": true,
"data": {
"name": "frame3",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_ca662698-17fe-436b-8bee-9b5e0a255bdb",
"left": 0,
"top": 0,
"width": 220,
"height": 36,
"disable": true
},
{
"name": "SingerList",
"code": "promotionItem_0a911d4c-9223-4d49-bf63-6e4ed2a49668",
"left": 0,
"top": 60,
"width": 493,
"height": 316
},
{
"name": "SingerList",
"code": "promotionItem_c388af5a-0351-43c4-89f5-8c8bfbf5a443",
"left": 517,
"top": 60,
"width": 493,
"height": 316
}
]
}
},
{
"name": "block4",
"height": 286,
"hasChildFrame": true,
"data": {
"name": "frame4",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f4c1169d-1778-48af-a449-3d195f8ca146",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 57],
"width": 1100,
"disable": true,
"childrenSize": [159, 175],
"childrenMargin": [0, 11, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_df4a26f1-bfd9-4781-9495-ba74f53bf285"
},
{
"name": "Subject2",
"code": "promotionItem_4727bb73-6d27-455d-b573-d2bb18074b07"
},
{
"name": "Subject3",
"code": "promotionItem_d2be83c4-78da-466b-b16d-e433bbaa4cac"
},
{
"name": "Subject4",
"code": "promotionItem_d8bfc7e3-0df3-488a-8655-795ad48e9b74"
},
{
"name": "Subject4",
"code": "promotionItem_9c4e1710-e9cb-4698-83eb-91cd2e85ba2e"
},
{
"name": "Subject4",
"code": "promotionItem_edfd1449-ea73-4a19-b605-e09af698e615"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block6",
"height": 382,
"hasChildFrame": true,
"data": {
"name": "frame6",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f26f6b36-de3f-4f2d-8f9a-4509764b7289",
"left": 0,
"top": 0,
"width": 220,
"height": 34,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_502e5100-223b-4088-85e6-bcbf637e2ea3",
"left": 0,
"top": 58,
"width": 221,
"height": 135
},
{
"name": "Title",
"code": "promotionItem_05dd1dca-53e6-4fc6-b621-6c32b5ffe2f7",
"left": 237,
"top": 11,
"width": 521,
"height": 333
},
{
"name": "Title",
"code": "promotionItem_f2445926-7065-48e2-aefd-a766512be5a6",
"left": 774,
"top": 58,
"width": 236,
"height": 286
},
{
"name": "Title",
"code": "promotionItem_ffbf27dd-0c0a-4332-a39e-3234f83de867",
"left": 0,
"top": 209,
"width": 221,
"height": 135
}
]
}
},
{
"name": "block7",
"height": 120,
"hasChildFrame": true,
"data": {
"name": "frame7",
"resultSet": [
{
"name": "back2Top",
"code": "promotionItem_f3975526-213a-4292-95ea-ab39897e1560",
"left": 337,
"top": 0,
"width": 322,
"height": 86,
"containerId": "back2Top"
}
]
}
}
]
}
}
});
\ No newline at end of file
{
"ver": "1.0.5",
"uuid": "499fb139-3263-492e-94a2-495a8db820e9",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
//推荐瀑布流
cc.Class({
extends: cc.Component,
statics: {
waterfall:
{
"name": "Recommend",
"resultSet": [
{
"name": "block1",
"height": 526,
"hasChildFrame": true,
"data": {
"name": "frame1",
"resultSet": [
{
"name": "Carousel0",
"code": "promotionItem_fd456495-2e32-44e1-9d92-450227d4afa3",
"left": 0,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_4ca66642-33d0-41c9-9913-df131a79a375",
"left": 252,
"top": 0,
"width": 504,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_c5f58c16-48a5-4796-ab52-41679fc88a6d",
"left": 773,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_9fd6d854-2a72-42d5-a2c0-1ce824cf406c",
"left": 0,
"top": 308,
"width": 427,
"height": 169
},
{
"name": "dailyRecommend",
"code": "promotionItem_5b998526-fb2a-48f9-8977-1fc20ac91ae6",
"left": 445,
"top": 308,
"width": 274,
"height": 168
},
{
"name": "dailyRecommend",
"code": "promotionItem_2ff129e8-12aa-4384-a0b8-736b8ff029f1",
"left": 736,
"top": 308,
"width": 274,
"height": 168
}
]
}
},
{
"name": "block2",
"height": 224,
"hasChildFrame": true,
"data": {
"name": "frame2",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_8a4a1762-22e8-4a1e-8ce3-1fe81412855a",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 59],
"width": 1100,
"disable": true,
"childrenSize": [105, 123],
"childrenMargin": [0, 24, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_e432ac2d-c1f3-4d44-a42b-7000971affa1"
},
{
"name": "Subject2",
"code": "promotionItem_f90b7ff3-1f36-4019-9e77-cef871902343"
},
{
"name": "Subject3",
"code": "promotionItem_e29b33e4-8954-4ef9-a6fc-0d844c909c67"
},
{
"name": "Subject4",
"code": "promotionItem_57aea4b3-7716-4224-bc77-43272c35ee32"
},
{
"name": "Subject4",
"code": "promotionItem_55c68c1c-451a-4197-84a1-6a39a1668a90"
},
{
"name": "Subject4",
"code": "promotionItem_2ac9afea-aa83-4fc1-a651-4f465b3cb1c3"
},
{
"name": "Subject4",
"code": "promotionItem_8ab81a46-b81e-4acf-bbcd-13315747eab3"
},
{
"name": "Subject4",
"code": "promotionItem_3e6642ab-517c-49ea-8788-cdc9130716d7"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block3",
"height": 427,
"hasChildFrame": true,
"data": {
"name": "frame3",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_ca662698-17fe-436b-8bee-9b5e0a255bdb",
"left": 0,
"top": 0,
"width": 220,
"height": 36,
"disable": true
},
{
"name": "SingerList",
"code": "promotionItem_0a911d4c-9223-4d49-bf63-6e4ed2a49668",
"left": 0,
"top": 60,
"width": 493,
"height": 316
},
{
"name": "SingerList",
"code": "promotionItem_c388af5a-0351-43c4-89f5-8c8bfbf5a443",
"left": 517,
"top": 60,
"width": 493,
"height": 316
}
]
}
},
{
"name": "block4",
"height": 286,
"hasChildFrame": true,
"data": {
"name": "frame4",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f4c1169d-1778-48af-a449-3d195f8ca146",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 57],
"width": 1100,
"disable": true,
"childrenSize": [159, 175],
"childrenMargin": [0, 11, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_df4a26f1-bfd9-4781-9495-ba74f53bf285"
},
{
"name": "Subject2",
"code": "promotionItem_4727bb73-6d27-455d-b573-d2bb18074b07"
},
{
"name": "Subject3",
"code": "promotionItem_d2be83c4-78da-466b-b16d-e433bbaa4cac"
},
{
"name": "Subject4",
"code": "promotionItem_d8bfc7e3-0df3-488a-8655-795ad48e9b74"
},
{
"name": "Subject4",
"code": "promotionItem_9c4e1710-e9cb-4698-83eb-91cd2e85ba2e"
},
{
"name": "Subject4",
"code": "promotionItem_edfd1449-ea73-4a19-b605-e09af698e615"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block5",
"height": 274,
"hasChildFrame": true,
"data": {
"name": "frame5",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_e6bf3f27-97a7-4990-85bb-b07f75d90ef6",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_c39cdbc6-aa7b-4bf0-a700-0d396bc7bd47",
"left": 0,
"top": 58,
"width": 369,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_0b3263db-d600-4ad3-b2ba-4787315ca51c",
"left": 379,
"top": 58,
"width": 254,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_cf020301-6346-4b61-9bd8-325a976ce4b4",
"left": 641,
"top": 58,
"width": 369,
"height": 155
}
]
}
},
{
"name": "block6",
"height": 382,
"hasChildFrame": true,
"data": {
"name": "frame6",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f26f6b36-de3f-4f2d-8f9a-4509764b7289",
"left": 0,
"top": 0,
"width": 220,
"height": 34,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_502e5100-223b-4088-85e6-bcbf637e2ea3",
"left": 0,
"top": 58,
"width": 221,
"height": 135
},
{
"name": "Title",
"code": "promotionItem_05dd1dca-53e6-4fc6-b621-6c32b5ffe2f7",
"left": 237,
"top": 11,
"width": 521,
"height": 333
},
{
"name": "Title",
"code": "promotionItem_f2445926-7065-48e2-aefd-a766512be5a6",
"left": 774,
"top": 58,
"width": 236,
"height": 286
},
{
"name": "Title",
"code": "promotionItem_ffbf27dd-0c0a-4332-a39e-3234f83de867",
"left": 0,
"top": 209,
"width": 221,
"height": 135
}
]
}
},
{
"name": "block7",
"height": 120,
"hasChildFrame": true,
"data": {
"name": "frame7",
"resultSet": [
{
"name": "back2Top",
"code": "promotionItem_f3975526-213a-4292-95ea-ab39897e1560",
"left": 337,
"top": 0,
"width": 322,
"height": 86,
"containerId": "back2Top"
}
]
}
}
]
}
}
});
{
"ver": "1.0.5",
"uuid": "8d5835ea-26bc-4227-abd5-be997edcff8d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
statics: {
waterfall: {
"name": "Recommend",
"resultSet": [
{
"name": "block2",
"height": 224,
"hasChildFrame": true,
"data": {
"name": "frame2",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_8a4a1762-22e8-4a1e-8ce3-1fe81412855a",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 59],
"width": 1100,
"disable": true,
"childrenSize": [105, 123],
"childrenMargin": [0, 24, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_e432ac2d-c1f3-4d44-a42b-7000971affa1"
},
{
"name": "Subject2",
"code": "promotionItem_f90b7ff3-1f36-4019-9e77-cef871902343"
},
{
"name": "Subject3",
"code": "promotionItem_e29b33e4-8954-4ef9-a6fc-0d844c909c67"
},
{
"name": "Subject4",
"code": "promotionItem_57aea4b3-7716-4224-bc77-43272c35ee32"
},
{
"name": "Subject4",
"code": "promotionItem_55c68c1c-451a-4197-84a1-6a39a1668a90"
},
{
"name": "Subject4",
"code": "promotionItem_2ac9afea-aa83-4fc1-a651-4f465b3cb1c3"
},
{
"name": "Subject4",
"code": "promotionItem_8ab81a46-b81e-4acf-bbcd-13315747eab3"
},
{
"name": "Subject4",
"code": "promotionItem_3e6642ab-517c-49ea-8788-cdc9130716d7"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block1",
"height": 526,
"hasChildFrame": true,
"data": {
"name": "frame1",
"resultSet": [
{
"name": "Carousel0",
"code": "promotionItem_fd456495-2e32-44e1-9d92-450227d4afa3",
"left": 0,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_4ca66642-33d0-41c9-9913-df131a79a375",
"left": 252,
"top": 0,
"width": 504,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_c5f58c16-48a5-4796-ab52-41679fc88a6d",
"left": 773,
"top": 0,
"width": 235,
"height": 287
},
{
"name": "dailyRecommend",
"code": "promotionItem_9fd6d854-2a72-42d5-a2c0-1ce824cf406c",
"left": 0,
"top": 308,
"width": 427,
"height": 169
},
{
"name": "dailyRecommend",
"code": "promotionItem_5b998526-fb2a-48f9-8977-1fc20ac91ae6",
"left": 445,
"top": 308,
"width": 274,
"height": 168
},
{
"name": "dailyRecommend",
"code": "promotionItem_2ff129e8-12aa-4384-a0b8-736b8ff029f1",
"left": 736,
"top": 308,
"width": 274,
"height": 168
}
]
}
},
{
"name": "block3",
"height": 427,
"hasChildFrame": true,
"data": {
"name": "frame3",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_ca662698-17fe-436b-8bee-9b5e0a255bdb",
"left": 0,
"top": 0,
"width": 220,
"height": 36,
"disable": true
},
{
"name": "SingerList",
"code": "promotionItem_0a911d4c-9223-4d49-bf63-6e4ed2a49668",
"left": 0,
"top": 60,
"width": 493,
"height": 316
},
{
"name": "SingerList",
"code": "promotionItem_c388af5a-0351-43c4-89f5-8c8bfbf5a443",
"left": 517,
"top": 60,
"width": 493,
"height": 316
}
]
}
},
{
"name": "block4",
"height": 286,
"hasChildFrame": true,
"data": {
"name": "frame4",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f4c1169d-1778-48af-a449-3d195f8ca146",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "SubjectList",
"layout": "horizontal",
"position": [0, 57],
"width": 1100,
"disable": true,
"childrenSize": [159, 175],
"childrenMargin": [0, 11, 0, 0],
"hasChildFrame": true,
"data": {
"name": "subjectList",
"resultSet": [
{
"name": "Subject1",
"code": "promotionItem_df4a26f1-bfd9-4781-9495-ba74f53bf285"
},
{
"name": "Subject2",
"code": "promotionItem_4727bb73-6d27-455d-b573-d2bb18074b07"
},
{
"name": "Subject3",
"code": "promotionItem_d2be83c4-78da-466b-b16d-e433bbaa4cac"
},
{
"name": "Subject4",
"code": "promotionItem_d8bfc7e3-0df3-488a-8655-795ad48e9b74"
},
{
"name": "Subject4",
"code": "promotionItem_9c4e1710-e9cb-4698-83eb-91cd2e85ba2e"
},
{
"name": "Subject4",
"code": "promotionItem_edfd1449-ea73-4a19-b605-e09af698e615"
}
]
},
"dataTmpl": "tmplPromotionGroupCell2",
"childClass": "subject_list_cell"
}
]
}
},
{
"name": "block5",
"height": 274,
"hasChildFrame": true,
"data": {
"name": "frame5",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_e6bf3f27-97a7-4990-85bb-b07f75d90ef6",
"left": 0,
"top": 0,
"width": 220,
"height": 33,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_c39cdbc6-aa7b-4bf0-a700-0d396bc7bd47",
"left": 0,
"top": 58,
"width": 369,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_0b3263db-d600-4ad3-b2ba-4787315ca51c",
"left": 379,
"top": 58,
"width": 254,
"height": 155
},
{
"name": "Title",
"code": "promotionItem_cf020301-6346-4b61-9bd8-325a976ce4b4",
"left": 641,
"top": 58,
"width": 369,
"height": 155
}
]
}
},
{
"name": "block6",
"height": 382,
"hasChildFrame": true,
"data": {
"name": "frame6",
"resultSet": [
{
"name": "Title",
"code": "promotionItem_f26f6b36-de3f-4f2d-8f9a-4509764b7289",
"left": 0,
"top": 0,
"width": 220,
"height": 34,
"disable": true
},
{
"name": "Title",
"code": "promotionItem_502e5100-223b-4088-85e6-bcbf637e2ea3",
"left": 0,
"top": 58,
"width": 221,
"height": 135
},
{
"name": "Title",
"code": "promotionItem_05dd1dca-53e6-4fc6-b621-6c32b5ffe2f7",
"left": 237,
"top": 11,
"width": 521,
"height": 333
},
{
"name": "Title",
"code": "promotionItem_f2445926-7065-48e2-aefd-a766512be5a6",
"left": 774,
"top": 58,
"width": 236,
"height": 286
},
{
"name": "Title",
"code": "promotionItem_ffbf27dd-0c0a-4332-a39e-3234f83de867",
"left": 0,
"top": 209,
"width": 221,
"height": 135
}
]
}
},
{
"name": "block7",
"height": 120,
"hasChildFrame": true,
"data": {
"name": "frame7",
"resultSet": [
{
"name": "back2Top",
"code": "promotionItem_f3975526-213a-4292-95ea-ab39897e1560",
"left": 337,
"top": 0,
"width": 322,
"height": 86,
"containerId": "back2Top"
}
]
}
}
]
}
}
});
\ No newline at end of file
{
"ver": "1.0.5",
"uuid": "bb5c5a5e-89a9-4ed1-8918-b65df56166ad",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "7b81d4e8-ec84-4716-968d-500ac1d78a54",
"isGroup": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"HelloWorld": {
"ver": "1.0.4",
"uuid": "31bc895a-c003-4566-a9f3-2e54ae1c17dc",
"rawTextureUuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 195,
"height": 270,
"rawWidth": 195,
"rawHeight": 270,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "7b058b45-1d99-4a6f-af75-477dcbaa56dd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "eab92123-65ec-44fd-b9af-7b80346d5e64",
"rawTextureUuid": "7b058b45-1d99-4a6f-af75-477dcbaa56dd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 2885,
"rawWidth": 1280,
"rawHeight": 2885,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "90871d77-34d5-4fa5-8b14-0fc3d0acdf3d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"history": {
"ver": "1.0.4",
"uuid": "8c0c790b-4b85-43a1-8b6c-a8686b700df6",
"rawTextureUuid": "90871d77-34d5-4fa5-8b14-0fc3d0acdf3d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 108,
"height": 48,
"rawWidth": 108,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "bd1dfb5f-c75a-4fac-b539-585b0b231a4b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"logo": {
"ver": "1.0.4",
"uuid": "1af31773-8501-40fe-96e5-ec700c03162c",
"rawTextureUuid": "bd1dfb5f-c75a-4fac-b539-585b0b231a4b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -17,
"trimX": 2,
"trimY": 38,
"width": 649,
"height": 466,
"rawWidth": 653,
"rawHeight": 508,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "723c70d3-74ee-4a9e-9eb0-12e04f587bc7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"my": {
"ver": "1.0.4",
"uuid": "e74a5b86-b958-43cf-a583-6ebdeb00e071",
"rawTextureUuid": "723c70d3-74ee-4a9e-9eb0-12e04f587bc7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 127,
"height": 48,
"rawWidth": 127,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "pfbShowCategory",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Pic",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_level": 2,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0a9ac85b-6d8a-498b-92ce-d1b35b092920"
},
"fileId": "cahAospA9KiZ8bJwfuwSSJ",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": -20,
"_right": 0,
"_top": 702,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "43a14tHFN5CvrH8W3z8wxz4",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"id": 0,
"pic": {
"__id__": 3
},
"activeName1": null,
"activeName2": null,
"normalName": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0a9ac85b-6d8a-498b-92ce-d1b35b092920"
},
"fileId": "f3FKYd7SJEvrs4s48MPI1G",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.0",
"uuid": "0a9ac85b-6d8a-498b-92ce-d1b35b092920",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "pfbShowCategory",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Pic",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_level": 2,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"groupIndex": 0,
"_rotationX": 0,
"_rotationY": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "410fb916-8721-4663-bab8-34397391ace7"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "9058dd42-455f-43f3-93b4-ed587f2159bd"
},
"fileId": "cahAospA9KiZ8bJwfuwSSJ",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": -20,
"_right": 0,
"_top": 702,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "4e3e0tDC2RKSLb7nNPXNN5z",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"id": 0,
"pic": {
"__id__": 3
},
"activeName1": null,
"activeName2": null,
"normalName": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "9058dd42-455f-43f3-93b4-ed587f2159bd"
},
"fileId": "f3FKYd7SJEvrs4s48MPI1G",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.0",
"uuid": "9058dd42-455f-43f3-93b4-ed587f2159bd",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "f35038d7-351f-431f-87db-d06c657b0216",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"search": {
"ver": "1.0.4",
"uuid": "2724fd4d-8592-497d-9ab1-4e33968c0e89",
"rawTextureUuid": "f35038d7-351f-431f-87db-d06c657b0216",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 108,
"height": 48,
"rawWidth": 108,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"singleColor": {
"ver": "1.0.4",
"uuid": "410fb916-8721-4663-bab8-34397391ace7",
"rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2,
"height": 2,
"rawWidth": 2,
"rawHeight": 2,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "8465620c-9347-477f-be29-e246c6679147",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "af74e7fc-dc2d-4e3b-9e98-c77ca9ee7ebe",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"HelloWorld": {
"ver": "1.0.4",
"uuid": "837c982b-9cd1-4e5a-a97b-7ea38b39a2ed",
"rawTextureUuid": "af74e7fc-dc2d-4e3b-9e98-c77ca9ee7ebe",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 195,
"height": 270,
"rawWidth": 195,
"rawHeight": 270,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "9ab1d077-e501-4d49-af8d-66fa45d8d195",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"history": {
"ver": "1.0.4",
"uuid": "b9b775dd-436b-455f-bf36-de112de109e8",
"rawTextureUuid": "9ab1d077-e501-4d49-af8d-66fa45d8d195",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 108,
"height": 48,
"rawWidth": 108,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "ed1ff055-a16b-4f2a-9caf-e715e5273b95",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"my": {
"ver": "1.0.4",
"uuid": "244ccc93-62bc-4f79-81ba-2fd341419b2e",
"rawTextureUuid": "ed1ff055-a16b-4f2a-9caf-e715e5273b95",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 127,
"height": 48,
"rawWidth": 127,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "64db64a5-a07f-4743-abae-863219e4ed59",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"search": {
"ver": "1.0.4",
"uuid": "622d4902-61b7-4461-a5fe-bdeaa3f44ce2",
"rawTextureUuid": "64db64a5-a07f-4743-abae-863219e4ed59",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 108,
"height": 48,
"rawWidth": 108,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "8aafcb6f-79a9-4274-a8e6-11535d7db5c7",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "7a0fdfb4-67d2-4ce5-881f-27ba48398963",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "07c42853-44f6-44fd-b4a7-96c657273d5b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"1": {
"ver": "1.0.4",
"uuid": "2f12d7cb-336d-4d50-8523-d7336a40a1b6",
"rawTextureUuid": "07c42853-44f6-44fd-b4a7-96c657273d5b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 51,
"height": 51,
"rawWidth": 51,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "a17484ab-98b9-45a7-96c5-e2f115f20b9c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"2": {
"ver": "1.0.4",
"uuid": "d0f889f0-abdf-4e0b-b995-80b7e4d958db",
"rawTextureUuid": "a17484ab-98b9-45a7-96c5-e2f115f20b9c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 12,
"trimX": 0,
"trimY": 3,
"width": 1,
"height": 16,
"rawWidth": 1,
"rawHeight": 46,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "9009b50c-a6e9-4eea-b016-3b716af19308",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"3": {
"ver": "1.0.4",
"uuid": "57330949-d587-439b-b54a-d4a951b04b3f",
"rawTextureUuid": "9009b50c-a6e9-4eea-b016-3b716af19308",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 51,
"height": 51,
"rawWidth": 51,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "56f3cca9-2ea8-4982-a749-08244c283d8e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"4": {
"ver": "1.0.4",
"uuid": "d9cd3cd3-7f7c-4094-9580-346e8b03a3b4",
"rawTextureUuid": "56f3cca9-2ea8-4982-a749-08244c283d8e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -14,
"offsetY": 0,
"trimX": 1,
"trimY": 0,
"width": 16,
"height": 1,
"rawWidth": 46,
"rawHeight": 1,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "53e675f3-1400-4b57-b9fc-6a3f6a65da90",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"6": {
"ver": "1.0.4",
"uuid": "f976c075-cfeb-40be-8911-9eea7ed9b7bd",
"rawTextureUuid": "53e675f3-1400-4b57-b9fc-6a3f6a65da90",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 14,
"offsetY": 0,
"trimX": 29,
"trimY": 0,
"width": 16,
"height": 1,
"rawWidth": 46,
"rawHeight": 1,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "3c0252ba-5da0-4511-8d70-05afc35020c0",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"7": {
"ver": "1.0.4",
"uuid": "cac1da50-9322-4dd7-ad51-a4494493aceb",
"rawTextureUuid": "3c0252ba-5da0-4511-8d70-05afc35020c0",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 51,
"height": 51,
"rawWidth": 51,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "8d4922f8-8db2-46a0-a7ba-3ecc252a9318",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"8": {
"ver": "1.0.4",
"uuid": "86da34f4-416e-4542-be45-cebb63e5e69a",
"rawTextureUuid": "8d4922f8-8db2-46a0-a7ba-3ecc252a9318",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -16,
"trimX": 0,
"trimY": 32,
"width": 1,
"height": 14,
"rawWidth": 1,
"rawHeight": 46,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.1",
"uuid": "8d6083a5-99e9-475a-939a-e23506aec3bc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"platformSettings": {},
"subMetas": {
"9": {
"ver": "1.0.4",
"uuid": "9ab601dc-2f51-48d1-9764-b95f34930523",
"rawTextureUuid": "8d6083a5-99e9-475a-939a-e23506aec3bc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 51,
"height": 51,
"rawWidth": 51,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
No preview for this file type
{
"ver": "1.0.1",
"uuid": "2703bb67-36aa-4868-a9f7-c59e81baa9b2",
"subMetas": {}
}
\ No newline at end of file
This diff could not be displayed because it is too large.
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"experimentalDecorators": true
},
"exclude": [
"node_modules",
".vscode",
"library",
"local",
"settings",
"temp"
]
}
\ No newline at end of file
{
"engine": "cocos2d-html5",
"packages": "packages",
"version": "2.1.2"
}
\ No newline at end of file
{
"excludeScenes": [],
"orientation": {
"landscapeLeft": true,
"landscapeRight": true,
"portrait": false,
"upsideDown": false
},
"packageName": "org.cocos2d.helloworld",
"startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49",
"title": "hello_world",
"webOrientation": "auto"
}
\ No newline at end of file
{
"excludeScenes": [],
"packageName": "org.cocos2d.helloworld",
"platform": "web-mobile",
"startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49",
"title": "HelloWorld"
}
\ No newline at end of file
{
"collision-matrix": [
[
true
]
],
"excluded-modules": [],
"group-list": [
"default"
],
"start-scene": "current",
"design-resolution-width": 960,
"design-resolution-height": 640,
"fit-width": false,
"fit-height": true,
"use-project-simulator-setting": false,
"simulator-orientation": false,
"use-customize-simulator": false,
"simulator-resolution": {
"width": 960,
"height": 640
},
"last-module-event-record-time": 0,
"assets-sort-type": "name",
"facebook": {
"enable": false,
"appID": "",
"live": {
"enable": false
},
"audience": {
"enable": false
}
}
}
\ No newline at end of file
{
"services": [
{
"service_id": "235",
"service_name": "Cocos Analytics",
"service_icon": "https://account.cocos.com/client/3f8f31ccf66995e183044f167c092395.png",
"service_desc": "提供最核心最基本的数据、标准化界面功能简洁易用、数据准确性最好",
"service_title": "精准了解游戏的新增、活跃、留存、付费等数据",
"service_guide_url": "https://n-analytics.cocos.com/docs/",
"service_sample_url": "https://github.com/cocos-creator/tutorial-dark-slash/tree/analytics",
"service_dev_url": "http://analytics.cocos.com/realtime/jump_to/<app_id>",
"service_type": "3",
"service_type_zh": "公司和个人游戏",
"support_platform": [
"Android",
"iOS",
"HTML5"
],
"package_download_url": "http://download.cocos.com/CocosServices/plugins/service-analytics/1.2.0_2.1.0.zip",
"package_version_desc": "1、优化SDK,修复H5-SDK 与多个小游戏平台适配问题,删除和优化init事件无用接口<br>2、 如有相关问题咨询或者需求, 可以联系我们技术支持邮箱 <a href=' '>support-cocos@cocos.com</a>",
"service_component_name": "service-analytics",
"package_versions": [
"1.0.0_1.0.5",
"1.1.2_2.0.0",
"1.1.3_2.0.1",
"1.1.4_2.0.1",
"1.1.5_2.0.1",
"1.1.6_2.0.1_2.0.2",
"1.1.7_2.0.3",
"1.1.8_2.0.4",
"1.1.9_2.1.0",
"1.2.0_2.1.0"
],
"build_platform": [
"web-mobile",
"web-desktop",
"wechatgame",
"android",
"ios",
"fb-instant-games",
"android-instant",
"baidugame",
"quickgame",
"qgame",
"qqplay",
"huawei"
],
"require_verify": 0,
"service_price": "",
"packpage_version_desc": "",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
},
{
"service_id": "241",
"service_name": "Matchvs",
"service_icon": "https://account.cocos.com/client/14406719a07eb3d714d36e5edc6e06fa.png",
"service_desc": "通过SDK接入快速实现联网功能、帧同步、国内外多节点、服务器独立部署、gameServer自定义游戏服务端逻辑。\n技术支持群QQ群:822523258",
"service_title": "专业成熟的移动游戏联网与服务端解决方案",
"service_guide_url": "http://doc.matchvs.com/QuickStart/QuickStart-CocosCreator",
"service_sample_url": "http://www.matchvs.com/serviceCourse",
"service_dev_url": "http://www.matchvs.com/cocosLogin",
"service_type": "3",
"service_type_zh": "公司和个人游戏",
"support_platform": [
"Android",
"iOS",
"HTML5"
],
"package_download_url": "http://download.cocos.com/CocosServices/plugins/service-matchvs/1.0.9_3.7.9.9.zip",
"package_version_desc": "更新日期:2019-07-18<br>更新内容:<br>1、修复多节点登录返回值错误<br>2、修复FaceBook平台受限安全策略的问题",
"service_component_name": "service-matchvs",
"package_versions": [
"1.0.3_3.7.6.4",
"1.0.5_3.7.7.3",
"1.0.6_3.7.9.2",
"1.0.7_3.7.9.6",
"1.0.9_3.7.9.9"
],
"build_platform": [
"web-mobile",
"web-desktop",
"fb-instant-games",
"wechatgame",
"wechatgame-subcontext",
"qqplay",
"android",
"android-instant",
"ios",
"mac",
"quickgame",
"qgame",
"huawei"
],
"require_verify": 0,
"service_price": "该服务按使用量计费,<a href='https://www.matchvs.com/price'><font color='#dddddd'>计费规则</font></a>,所产生的费用将由第三方从您的 <a href='https://account.cocos.com/#/finance/finance_list'><font color='#dddddd'>Cocos 账户余额</font></a> 中扣除。",
"packpage_version_desc": "",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
},
{
"service_id": "242",
"service_name": "Agora Voice",
"service_icon": "https://account.cocos.com/uploads/client_icon/2019-07-16/273952d155b4cdb72d2b1bc61de91ade.png",
"service_desc": "稳定、低耗、76ms超低延时、全球200+数据中心覆盖;变声器、超高音质、听声辩位等丰富玩法极速接入;全平台支持:Android、iOS、Web。\n技术支持群QQ群:799099183\n",
"service_title": "游戏内置实时语音",
"service_guide_url": "https://docs.agora.io/cn/Interactive Gaming/game_c?platform=Cocos Creator",
"service_sample_url": "https://github.com/AgoraIO/Voice-Call-for-Mobile-Gaming/tree/master/Basic-Voice-Call-for-Gaming/Hello-CocosCreator-Voice-Agora",
"service_dev_url": "https://sso.agora.io/api/oauth/cocos/login",
"service_type": "3",
"service_type_zh": "公司和个人游戏",
"support_platform": [
"Android",
"iOS",
"HTML5"
],
"package_download_url": "http://download.cocos.com/CocosServices/plugins/service-agora/1.0.2_2.2.3.20_2.5.2.zip",
"package_version_desc": "解决Bug:onAudioVolumeIndication 回调收不到.",
"service_component_name": "service-agora",
"package_versions": [
"1.0.1_2.2.3.20_2.5.2",
"1.0.2_2.2.3.20_2.5.2"
],
"build_platform": [
"web-mobile",
"web-desktop",
"android",
"ios"
],
"require_verify": 1,
"service_price": "该服务按使用量计费,<a href='https://docs.agora.io/cn/Agora Platform/billing_faq?platform=All Platforms'><font color='#dddddd'>计费规则</font></a>,所产生的费用将由第三方从您的 <a href='https://account.cocos.com/#/finance/finance_list'><font color='#dddddd'>Cocos 账户余额</font></a> 中扣除。",
"packpage_version_desc": "",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
}
],
"game": {
"name": "未知游戏",
"appid": "UNKNOW"
}
}
\ No newline at end of file
{
"name": "TEMPLATES.helloworld.name",
"desc": "TEMPLATES.helloworld.desc",
"banner": "template-banner.png"
}
\ No newline at end of file