Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg18_tianci
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
dg18_tianci
Commits
ba3576ae
Commit
ba3576ae
authored
Jan 03, 2024
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 文本自适应
parent
bb4d34b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
388 additions
and
87 deletions
+388
-87
dg18_tianci.fire
assets/dg18_tianci/scene/dg18_tianci.fire
+283
-87
dg18_tianci.ts
assets/dg18_tianci/scene/dg18_tianci.ts
+105
-0
No files found.
assets/dg18_tianci/scene/dg18_tianci.fire
View file @
ba3576ae
...
@@ -102,28 +102,28 @@
...
@@ -102,28 +102,28 @@
"__id__": 79
"__id__": 79
},
},
{
{
"__id__":
97
"__id__":
101
},
},
{
{
"__id__": 10
3
"__id__": 10
7
},
},
{
{
"__id__": 1
09
"__id__": 1
13
},
},
{
{
"__id__": 1
17
"__id__": 1
21
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
37
"__id__": 1
41
},
},
{
{
"__id__": 1
38
"__id__": 1
42
},
},
{
{
"__id__": 1
39
"__id__": 1
43
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3578,7 +3578,7 @@
...
@@ -3578,7 +3578,7 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
-
825
,
-
1638.806
,
280,
280,
0,
0,
0,
0,
...
@@ -4254,12 +4254,18 @@
...
@@ -4254,12 +4254,18 @@
"_children": [
"_children": [
{
{
"__id__": 94
"__id__": 94
},
{
"__id__": 96
},
{
"__id__": 98
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
96
"__id__":
100
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4318,7 +4324,7 @@
...
@@ -4318,7 +4324,7 @@
"__id__": 93
"__id__": 93
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 95
"__id__": 95
...
@@ -4348,7 +4354,7 @@
...
@@ -4348,7 +4354,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
9.706,
9.706,
3.397
,
4
,
0,
0,
0,
0,
0,
0,
...
@@ -4389,8 +4395,8 @@
...
@@ -4389,8 +4395,8 @@
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_string": "Label",
"_string": "Label",
"_N$string": "Label",
"_N$string": "Label",
"_fontSize":
7
0,
"_fontSize":
5
0,
"_lineHeight":
7
0,
"_lineHeight":
5
0,
"_enableWrapText": false,
"_enableWrapText": false,
"_N$file": null,
"_N$file": null,
"_isSystemFontUsed": true,
"_isSystemFontUsed": true,
...
@@ -4405,6 +4411,196 @@
...
@@ -4405,6 +4411,196 @@
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "19riTcfoFHC6rIuKU2L2Wo"
"_id": "19riTcfoFHC6rIuKU2L2Wo"
},
},
{
"__type__": "cc.Node",
"_name": "text_1",
"_objFlags": 0,
"_parent": {
"__id__": 93
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 97
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 122.34,
"height": 63
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
9.706,
27.774,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cdB3Kh4+FG77GXqEawCT5I"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 96
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 50,
"_lineHeight": 50,
"_enableWrapText": false,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "b2tK0TUbxFF6LSEmxePNZz"
},
{
"__type__": "cc.Node",
"_name": "text_2",
"_objFlags": 0,
"_parent": {
"__id__": 93
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 99
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 122.34,
"height": 63
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
9.706,
-24.303,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "7dJPwVXfFE9Z4voDIqw1GC"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 98
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 50,
"_lineHeight": 50,
"_enableWrapText": false,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "11WdqbzeVIwKKPZuOgT+SX"
},
{
{
"__type__": "cc.Button",
"__type__": "cc.Button",
"_name": "",
"_name": "",
...
@@ -4482,16 +4678,16 @@
...
@@ -4482,16 +4678,16 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
98
"__id__":
102
},
},
{
{
"__id__": 10
0
"__id__": 10
4
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 10
2
"__id__": 10
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4547,13 +4743,13 @@
...
@@ -4547,13 +4743,13 @@
"_name": "img_1",
"_name": "img_1",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
97
"__id__":
101
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
99
"__id__":
103
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4609,7 +4805,7 @@
...
@@ -4609,7 +4805,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
98
"__id__":
102
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4641,13 +4837,13 @@
...
@@ -4641,13 +4837,13 @@
"_name": "img_2",
"_name": "img_2",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
97
"__id__":
101
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
1
"__id__": 10
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4703,7 +4899,7 @@
...
@@ -4703,7 +4899,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
0
"__id__": 10
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4735,7 +4931,7 @@
...
@@ -4735,7 +4931,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
97
"__id__":
101
},
},
"_enabled": true,
"_enabled": true,
"_id": "22vw/sJf1FcqZqummVQC8S"
"_id": "22vw/sJf1FcqZqummVQC8S"
...
@@ -4749,16 +4945,16 @@
...
@@ -4749,16 +4945,16 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 10
4
"__id__": 10
8
},
},
{
{
"__id__": 1
06
"__id__": 1
10
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 1
08
"__id__": 1
12
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4814,13 +5010,13 @@
...
@@ -4814,13 +5010,13 @@
"_name": "img_1",
"_name": "img_1",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 10
3
"__id__": 10
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
5
"__id__": 10
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4876,7 +5072,7 @@
...
@@ -4876,7 +5072,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
4
"__id__": 10
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4908,13 +5104,13 @@
...
@@ -4908,13 +5104,13 @@
"_name": "img_2",
"_name": "img_2",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 10
3
"__id__": 10
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
07
"__id__": 1
11
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4970,7 +5166,7 @@
...
@@ -4970,7 +5166,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
06
"__id__": 1
10
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5002,7 +5198,7 @@
...
@@ -5002,7 +5198,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
3
"__id__": 10
7
},
},
"_enabled": true,
"_enabled": true,
"_id": "99+apunKpKbK8WdfjFGb2F"
"_id": "99+apunKpKbK8WdfjFGb2F"
...
@@ -5016,16 +5212,16 @@
...
@@ -5016,16 +5212,16 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 11
0
"__id__": 11
4
},
},
{
{
"__id__": 11
2
"__id__": 11
6
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
16
"__id__": 1
20
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5081,13 +5277,13 @@
...
@@ -5081,13 +5277,13 @@
"_name": "ani",
"_name": "ani",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
09
"__id__": 1
13
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 11
1
"__id__": 11
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5143,7 +5339,7 @@
...
@@ -5143,7 +5339,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
0
"__id__": 11
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5183,17 +5379,17 @@
...
@@ -5183,17 +5379,17 @@
"_name": "btn_go",
"_name": "btn_go",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
09
"__id__": 1
13
},
},
"_children": [
"_children": [
{
{
"__id__": 11
3
"__id__": 11
7
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 11
5
"__id__": 11
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5249,13 +5445,13 @@
...
@@ -5249,13 +5445,13 @@
"_name": "text",
"_name": "text",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 11
2
"__id__": 11
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 11
4
"__id__": 11
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5311,7 +5507,7 @@
...
@@ -5311,7 +5507,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
3
"__id__": 11
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5344,7 +5540,7 @@
...
@@ -5344,7 +5540,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
2
"__id__": 11
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5376,11 +5572,11 @@
...
@@ -5376,11 +5572,11 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
09
"__id__": 1
13
},
},
"_enabled": true,
"_enabled": true,
"aniRole": {
"aniRole": {
"__id__": 11
0
"__id__": 11
4
},
},
"moveX": 500,
"moveX": 500,
"_id": "e4RrOXSNJGd68Mq3UTYY0p"
"_id": "e4RrOXSNJGd68Mq3UTYY0p"
...
@@ -5394,13 +5590,13 @@
...
@@ -5394,13 +5590,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 1
18
"__id__": 1
22
},
},
{
{
"__id__": 12
1
"__id__": 12
5
},
},
{
{
"__id__": 12
2
"__id__": 12
6
}
}
],
],
"_active": true,
"_active": true,
...
@@ -5458,11 +5654,11 @@
...
@@ -5458,11 +5654,11 @@
"_name": "font",
"_name": "font",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
17
"__id__": 1
21
},
},
"_children": [
"_children": [
{
{
"__id__": 1
19
"__id__": 1
23
}
}
],
],
"_active": true,
"_active": true,
...
@@ -5520,13 +5716,13 @@
...
@@ -5520,13 +5716,13 @@
"_name": "BRLNSDB",
"_name": "BRLNSDB",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
18
"__id__": 1
22
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 12
0
"__id__": 12
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5582,7 +5778,7 @@
...
@@ -5582,7 +5778,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
19
"__id__": 1
23
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5617,7 +5813,7 @@
...
@@ -5617,7 +5813,7 @@
"_name": "img",
"_name": "img",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
17
"__id__": 1
21
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
...
@@ -5675,15 +5871,9 @@
...
@@ -5675,15 +5871,9 @@
"_name": "audio",
"_name": "audio",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
17
"__id__": 1
21
},
},
"_children": [
"_children": [
{
"__id__": 123
},
{
"__id__": 125
},
{
{
"__id__": 127
"__id__": 127
},
},
...
@@ -5698,6 +5888,12 @@
...
@@ -5698,6 +5888,12 @@
},
},
{
{
"__id__": 135
"__id__": 135
},
{
"__id__": 137
},
{
"__id__": 139
}
}
],
],
"_active": true,
"_active": true,
...
@@ -5755,13 +5951,13 @@
...
@@ -5755,13 +5951,13 @@
"_name": "btn",
"_name": "btn",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
2
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 12
4
"__id__": 12
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5817,7 +6013,7 @@
...
@@ -5817,7 +6013,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
3
"__id__": 12
7
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -5836,13 +6032,13 @@
...
@@ -5836,13 +6032,13 @@
"_name": "right",
"_name": "right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
2
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
26
"__id__": 1
30
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5898,7 +6094,7 @@
...
@@ -5898,7 +6094,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
5
"__id__": 12
9
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -5917,13 +6113,13 @@
...
@@ -5917,13 +6113,13 @@
"_name": "bettery",
"_name": "bettery",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
2
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
28
"__id__": 1
32
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5979,7 +6175,7 @@
...
@@ -5979,7 +6175,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
27
"__id__": 1
31
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -5998,13 +6194,13 @@
...
@@ -5998,13 +6194,13 @@
"_name": "error",
"_name": "error",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
2
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
0
"__id__": 13
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6060,7 +6256,7 @@
...
@@ -6060,7 +6256,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
29
"__id__": 1
33
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -6079,13 +6275,13 @@
...
@@ -6079,13 +6275,13 @@
"_name": "bgm",
"_name": "bgm",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
2
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
2
"__id__": 13
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6141,7 +6337,7 @@
...
@@ -6141,7 +6337,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
1
"__id__": 13
5
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -6160,13 +6356,13 @@
...
@@ -6160,13 +6356,13 @@
"_name": "opendoor",
"_name": "opendoor",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
2
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
4
"__id__": 13
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6222,7 +6418,7 @@
...
@@ -6222,7 +6418,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
3
"__id__": 13
7
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -6241,13 +6437,13 @@
...
@@ -6241,13 +6437,13 @@
"_name": "light",
"_name": "light",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
2
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
36
"__id__": 1
40
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6303,7 +6499,7 @@
...
@@ -6303,7 +6499,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
5
"__id__": 13
9
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -6391,10 +6587,10 @@
...
@@ -6391,10 +6587,10 @@
"__id__": 71
"__id__": 71
},
},
"img_left": {
"img_left": {
"__id__":
97
"__id__":
101
},
},
"img_right": {
"img_right": {
"__id__": 10
3
"__id__": 10
7
},
},
"ani_star": {
"ani_star": {
"__id__": 69
"__id__": 69
...
...
assets/dg18_tianci/scene/dg18_tianci.ts
View file @
ba3576ae
...
@@ -167,12 +167,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -167,12 +167,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
lastY
=
null
;
lastY
=
null
;
}
}
if
(
data
.
itemType
==
'
text
'
)
{
if
(
data
.
itemType
==
'
text
'
)
{
data
.
text
+=
'
aaa bbb cc dd
'
;
let
item
=
pg
.
view
.
clone
(
this
.
item_battery_text
)
let
item
=
pg
.
view
.
clone
(
this
.
item_battery_text
)
item
.
active
=
true
;
item
.
active
=
true
;
item
.
x
=
0
;
item
.
x
=
0
;
let
item_text
=
pg
.
view
.
find
(
item
,
'
item_text
'
);
let
item_text
=
pg
.
view
.
find
(
item
,
'
item_text
'
);
pg
.
view
.
setString
(
pg
.
view
.
find
(
item_text
,
'
text
'
),
data
.
text
)
pg
.
view
.
setString
(
pg
.
view
.
find
(
item_text
,
'
text
'
),
data
.
text
)
this
.
setItemText
(
item_text
,
data
.
text
);
pg
.
view
.
setColor
(
pg
.
view
.
find
(
item_text
,
'
text
'
),
"
#FEFE24
"
)
pg
.
view
.
setColor
(
pg
.
view
.
find
(
item_text
,
'
text
'
),
"
#FEFE24
"
)
pg
.
view
.
setColor
(
pg
.
view
.
find
(
item_text
,
'
text_1
'
),
"
#FEFE24
"
)
pg
.
view
.
setColor
(
pg
.
view
.
find
(
item_text
,
'
text_2
'
),
"
#FEFE24
"
)
for
(
let
n
=
1
;
n
<=
6
;
n
++
)
{
for
(
let
n
=
1
;
n
<=
6
;
n
++
)
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
item
,
'
bg/img_battery
'
+
n
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
item
,
'
bg/img_battery
'
+
n
),
false
)
...
@@ -337,6 +344,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -337,6 +344,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
node
.
y
=
targetData
.
pos
.
y
;
node
.
y
=
targetData
.
pos
.
y
;
let
text
=
pg
.
view
.
find
(
node
,
'
text
'
);
let
text
=
pg
.
view
.
find
(
node
,
'
text
'
);
text
.
active
=
true
;
let
text1
=
pg
.
view
.
find
(
node
,
'
text_1
'
);
let
text2
=
pg
.
view
.
find
(
node
,
'
text_2
'
);
text1
.
active
=
false
;
text2
.
active
=
false
;
pg
.
view
.
setColor
(
text
,
'
#1D8B38
'
)
pg
.
view
.
setColor
(
text
,
'
#1D8B38
'
)
text
.
getComponent
(
cc
.
Label
).
fontSize
=
targetData
.
fontSize
;
text
.
getComponent
(
cc
.
Label
).
fontSize
=
targetData
.
fontSize
;
text
.
getComponent
(
cc
.
Label
).
overflow
=
cc
.
Label
.
Overflow
.
NONE
;
text
.
getComponent
(
cc
.
Label
).
overflow
=
cc
.
Label
.
Overflow
.
NONE
;
...
@@ -453,6 +467,97 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -453,6 +467,97 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
});
})
})
}
}
async
setItemText
(
itemText
,
text
)
{
const
maxW
=
180
;
const
disH
=
26
;
const
baseY
=
4
;
const
labelNode1
=
cc
.
find
(
"
text_1
"
,
itemText
);
const
labelNode2
=
cc
.
find
(
"
text_2
"
,
itemText
);
const
label1
=
labelNode1
.
getComponent
(
cc
.
Label
);
const
label2
=
labelNode2
.
getComponent
(
cc
.
Label
);
const
textArr
=
text
.
split
(
'
'
);
let
isLabel1Max
=
false
;
let
isLabel2Max
=
false
;
const
checkLabelWidthMax
=
async
(
label
,
text
)
=>
{
label
.
string
=
text
;
await
asyncDelay
(
0.01
);
const
labelWidth
=
label
.
node
.
getBoundingBox
().
width
;
console
.
log
(
'
labelWidth:
'
,
labelWidth
);
if
(
labelWidth
>
maxW
)
{
return
true
;
}
return
false
;
}
const
checkPutTextByScale
=
async
(
scale
)
=>
{
label1
.
node
.
scale
=
scale
;
label2
.
node
.
scale
=
scale
;
isLabel1Max
=
false
;
isLabel2Max
=
false
;
let
label1Text
=
''
;
let
label2Text
=
''
;
for
(
let
i
=
0
;
i
<
textArr
.
length
;
i
++
)
{
let
checkText
=
textArr
[
i
];
if
(
!
isLabel1Max
&&
label1Text
!=
''
)
{
checkText
=
label1Text
+
'
'
+
checkText
;
}
let
isCurMax1
=
await
checkLabelWidthMax
(
label1
,
checkText
);
if
(
!
isLabel1Max
&&
!
isCurMax1
)
{
label1Text
=
checkText
;
}
else
{
isLabel1Max
=
true
;
label1
.
string
=
label1Text
;
checkText
=
textArr
[
i
];
if
(
label2Text
!=
''
)
{
checkText
=
label2Text
+
'
'
+
checkText
;
}
let
isCurMax2
=
await
checkLabelWidthMax
(
label2
,
checkText
);
if
(
!
isLabel2Max
&&
!
isCurMax2
)
{
label2Text
=
checkText
;
label2
.
string
=
label2Text
;
}
else
{
return
false
;
}
}
}
return
true
;
}
const
testScale
=
[
1
,
0.9
,
0.8
,
0.7
,
0.6
,
0.5
,
0.4
,
0.3
,
0.2
,
0.1
];
for
(
let
i
=
0
;
i
<
testScale
.
length
;
i
++
)
{
const
scale
=
testScale
[
i
];
const
isCanPut
=
await
checkPutTextByScale
(
scale
);
if
(
isCanPut
)
{
if
(
!
isLabel1Max
)
{
label1
.
node
.
y
=
baseY
;
label2
.
node
.
active
=
false
;
}
else
{
label1
.
node
.
y
=
baseY
+
disH
*
0.5
+
disH
*
scale
*
0.5
;
label2
.
node
.
y
=
baseY
-
disH
*
0.5
-
disH
*
scale
*
0.5
;
label2
.
node
.
active
=
true
;
}
break
;
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment