Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hw_lettersort
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
hw_lettersort
Commits
cdbb4bb3
Commit
cdbb4bb3
authored
May 24, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
7e1760fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
320 additions
and
143 deletions
+320
-143
hw_lettersort.fire
assets/hw_lettersort/scene/hw_lettersort.fire
+255
-138
hw_lettersort.js
assets/hw_lettersort/scene/hw_lettersort.js
+65
-5
No files found.
assets/hw_lettersort/scene/hw_lettersort.fire
View file @
cdbb4bb3
...
...
@@ -17,10 +17,10 @@
"__id__": 2
},
{
"__id__":
59
"__id__":
62
},
{
"__id__": 8
0
"__id__": 8
3
}
],
"_active": false,
...
...
@@ -87,13 +87,13 @@
"_active": true,
"_components": [
{
"__id__": 5
6
"__id__": 5
9
},
{
"__id__":
57
"__id__":
60
},
{
"__id__":
58
"__id__":
61
}
],
"_prefab": null,
...
...
@@ -411,13 +411,13 @@
"__id__": 21
},
{
"__id__": 2
4
"__id__": 2
7
},
{
"__id__":
49
"__id__":
52
},
{
"__id__": 5
5
"__id__": 5
8
}
],
"_active": false,
...
...
@@ -1004,6 +1004,9 @@
"_children": [
{
"__id__": 22
},
{
"__id__": 24
}
],
"_active": true,
...
...
@@ -1149,6 +1152,120 @@
"_N$cacheMode": 0,
"_id": "7eR2W2mtdP34+kdle7Vyfw"
},
{
"__type__": "cc.Node",
"_name": "MMTB_label",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": true,
"_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": 128,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b5abwb+M9JaYP+iibHRDmY"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "762b4844-65c4-443a-96a1-d32b8cbb0cd0"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "f16IG718FFQpQOM8SO4BOB"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_width": 1,
"_id": "650G4bVBtC7p853Pzh9ejv"
},
{
"__type__": "cc.Node",
"_name": "audio",
...
...
@@ -1158,40 +1275,40 @@
},
"_children": [
{
"__id__": 2
5
"__id__": 2
8
},
{
"__id__":
27
"__id__":
30
},
{
"__id__":
29
"__id__":
32
},
{
"__id__": 3
1
"__id__": 3
4
},
{
"__id__": 3
3
"__id__": 3
6
},
{
"__id__": 3
5
"__id__": 3
8
},
{
"__id__":
37
"__id__":
40
},
{
"__id__":
39
"__id__":
42
},
{
"__id__": 4
1
"__id__": 4
4
},
{
"__id__": 4
3
"__id__": 4
6
},
{
"__id__": 4
5
"__id__": 4
8
},
{
"__id__":
47
"__id__":
50
}
],
"_active": true,
...
...
@@ -1249,13 +1366,13 @@
"_name": "click",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
6
"__id__": 2
9
}
],
"_prefab": null,
...
...
@@ -1311,7 +1428,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
5
"__id__": 2
8
},
"_enabled": true,
"_clip": {
...
...
@@ -1330,13 +1447,13 @@
"_name": "next",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
28
"__id__":
31
}
],
"_prefab": null,
...
...
@@ -1392,7 +1509,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
27
"__id__":
30
},
"_enabled": true,
"_clip": {
...
...
@@ -1411,13 +1528,13 @@
"_name": "move_3",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
0
"__id__": 3
3
}
],
"_prefab": null,
...
...
@@ -1473,7 +1590,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
29
"__id__":
32
},
"_enabled": true,
"_clip": {
...
...
@@ -1492,13 +1609,13 @@
"_name": "move_1",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
2
"__id__": 3
5
}
],
"_prefab": null,
...
...
@@ -1554,7 +1671,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
1
"__id__": 3
4
},
"_enabled": true,
"_clip": {
...
...
@@ -1573,13 +1690,13 @@
"_name": "move_2",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
4
"__id__": 3
7
}
],
"_prefab": null,
...
...
@@ -1635,7 +1752,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
3
"__id__": 3
6
},
"_enabled": true,
"_clip": {
...
...
@@ -1654,13 +1771,13 @@
"_name": "move_2_2",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
6
"__id__": 3
9
}
],
"_prefab": null,
...
...
@@ -1716,7 +1833,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
5
"__id__": 3
8
},
"_enabled": true,
"_clip": {
...
...
@@ -1735,13 +1852,13 @@
"_name": "right",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
38
"__id__":
41
}
],
"_prefab": null,
...
...
@@ -1797,7 +1914,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
37
"__id__":
40
},
"_enabled": true,
"_clip": {
...
...
@@ -1816,13 +1933,13 @@
"_name": "fail_1",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
0
"__id__": 4
3
}
],
"_prefab": null,
...
...
@@ -1878,7 +1995,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
39
"__id__":
42
},
"_enabled": true,
"_clip": {
...
...
@@ -1897,13 +2014,13 @@
"_name": "fail_2",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
2
"__id__": 4
5
}
],
"_prefab": null,
...
...
@@ -1959,7 +2076,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
1
"__id__": 4
4
},
"_enabled": true,
"_clip": {
...
...
@@ -1978,13 +2095,13 @@
"_name": "fail_4",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
4
"__id__": 4
7
}
],
"_prefab": null,
...
...
@@ -2040,7 +2157,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
3
"__id__": 4
6
},
"_enabled": true,
"_clip": {
...
...
@@ -2059,13 +2176,13 @@
"_name": "fail_3",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
6
"__id__": 4
9
}
],
"_prefab": null,
...
...
@@ -2121,7 +2238,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
5
"__id__": 4
8
},
"_enabled": true,
"_clip": {
...
...
@@ -2140,13 +2257,13 @@
"_name": "fail_5",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
48
"__id__":
51
}
],
"_prefab": null,
...
...
@@ -2202,7 +2319,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
47
"__id__":
50
},
"_enabled": true,
"_clip": {
...
...
@@ -2225,10 +2342,10 @@
},
"_children": [
{
"__id__": 5
0
"__id__": 5
3
},
{
"__id__": 5
2
"__id__": 5
5
}
],
"_active": true,
...
...
@@ -2286,13 +2403,13 @@
"_name": "right",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 5
1
"__id__": 5
4
}
],
"_prefab": null,
...
...
@@ -2348,7 +2465,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
0
"__id__": 5
3
},
"_enabled": true,
"_materials": [],
...
...
@@ -2384,16 +2501,16 @@
"_name": "soundAnim",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 5
3
"__id__": 5
6
},
{
"__id__": 5
4
"__id__": 5
7
}
],
"_prefab": null,
...
...
@@ -2449,7 +2566,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
2
"__id__": 5
5
},
"_enabled": true,
"_materials": [
...
...
@@ -2481,7 +2598,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
2
"__id__": 5
5
},
"_enabled": true,
"_defaultClip": {
...
...
@@ -2618,19 +2735,19 @@
},
"_children": [
{
"__id__": 6
0
"__id__": 6
3
},
{
"__id__": 6
4
"__id__": 6
7
},
{
"__id__":
68
"__id__":
71
},
{
"__id__": 7
2
"__id__": 7
5
},
{
"__id__": 7
6
"__id__": 7
9
}
],
"_active": false,
...
...
@@ -2688,11 +2805,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [
{
"__id__": 6
1
"__id__": 6
4
}
],
"_active": true,
...
...
@@ -2750,11 +2867,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 6
0
"__id__": 6
3
},
"_children": [
{
"__id__": 6
2
"__id__": 6
5
}
],
"_active": true,
...
...
@@ -2812,13 +2929,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 6
1
"__id__": 6
4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
3
"__id__": 6
6
}
],
"_prefab": null,
...
...
@@ -2874,7 +2991,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
2
"__id__": 6
5
},
"_enabled": true,
"_materials": [
...
...
@@ -2904,11 +3021,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [
{
"__id__": 6
5
"__id__": 6
8
}
],
"_active": true,
...
...
@@ -2966,11 +3083,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 6
4
"__id__": 6
7
},
"_children": [
{
"__id__": 6
6
"__id__": 6
9
}
],
"_active": true,
...
...
@@ -3028,13 +3145,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 6
5
"__id__": 6
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
67
"__id__":
70
}
],
"_prefab": null,
...
...
@@ -3090,7 +3207,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
6
"__id__": 6
9
},
"_enabled": true,
"_materials": [
...
...
@@ -3120,11 +3237,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [
{
"__id__":
69
"__id__":
72
}
],
"_active": true,
...
...
@@ -3182,11 +3299,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__":
68
"__id__":
71
},
"_children": [
{
"__id__": 7
0
"__id__": 7
3
}
],
"_active": true,
...
...
@@ -3244,13 +3361,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__":
69
"__id__":
72
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
1
"__id__": 7
4
}
],
"_prefab": null,
...
...
@@ -3306,7 +3423,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
0
"__id__": 7
3
},
"_enabled": true,
"_materials": [
...
...
@@ -3336,11 +3453,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [
{
"__id__": 7
3
"__id__": 7
6
}
],
"_active": true,
...
...
@@ -3398,11 +3515,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 7
2
"__id__": 7
5
},
"_children": [
{
"__id__": 7
4
"__id__": 7
7
}
],
"_active": true,
...
...
@@ -3460,13 +3577,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 7
3
"__id__": 7
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
5
"__id__": 7
8
}
],
"_prefab": null,
...
...
@@ -3522,7 +3639,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
4
"__id__": 7
7
},
"_enabled": true,
"_materials": [
...
...
@@ -3552,11 +3669,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__":
59
"__id__":
62
},
"_children": [
{
"__id__":
77
"__id__":
80
}
],
"_active": true,
...
...
@@ -3614,11 +3731,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 7
6
"__id__": 7
9
},
"_children": [
{
"__id__":
78
"__id__":
81
}
],
"_active": true,
...
...
@@ -3676,13 +3793,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
80
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
79
"__id__":
82
}
],
"_prefab": null,
...
...
@@ -3738,7 +3855,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
78
"__id__":
81
},
"_enabled": true,
"_materials": [
...
...
@@ -3772,28 +3889,28 @@
},
"_children": [
{
"__id__": 8
1
"__id__": 8
4
},
{
"__id__": 8
3
"__id__": 8
6
},
{
"__id__": 8
5
"__id__": 8
8
},
{
"__id__":
87
"__id__":
90
},
{
"__id__":
89
"__id__":
92
},
{
"__id__": 9
1
"__id__": 9
4
},
{
"__id__": 9
3
"__id__": 9
6
},
{
"__id__": 9
5
"__id__": 9
8
}
],
"_active": false,
...
...
@@ -3851,13 +3968,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 8
2
"__id__": 8
5
}
],
"_prefab": null,
...
...
@@ -3913,7 +4030,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
1
"__id__": 8
4
},
"_enabled": true,
"_materials": [
...
...
@@ -3943,13 +4060,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 8
4
"__id__": 8
7
}
],
"_prefab": null,
...
...
@@ -4005,7 +4122,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
3
"__id__": 8
6
},
"_enabled": true,
"_materials": [
...
...
@@ -4035,13 +4152,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 8
6
"__id__": 8
9
}
],
"_prefab": null,
...
...
@@ -4097,7 +4214,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
5
"__id__": 8
8
},
"_enabled": true,
"_materials": [
...
...
@@ -4127,13 +4244,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
88
"__id__":
91
}
],
"_prefab": null,
...
...
@@ -4189,7 +4306,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
87
"__id__":
90
},
"_enabled": true,
"_materials": [
...
...
@@ -4219,13 +4336,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
0
"__id__": 9
3
}
],
"_prefab": null,
...
...
@@ -4281,7 +4398,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
89
"__id__":
92
},
"_enabled": true,
"_materials": [
...
...
@@ -4311,13 +4428,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
2
"__id__": 9
5
}
],
"_prefab": null,
...
...
@@ -4373,7 +4490,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
1
"__id__": 9
4
},
"_enabled": true,
"_materials": [
...
...
@@ -4403,13 +4520,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
4
"__id__": 9
7
}
],
"_prefab": null,
...
...
@@ -4465,7 +4582,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
3
"__id__": 9
6
},
"_enabled": true,
"_materials": [
...
...
@@ -4495,13 +4612,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 8
0
"__id__": 8
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
6
"__id__": 9
9
}
],
"_prefab": null,
...
...
@@ -4557,7 +4674,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
5
"__id__": 9
8
},
"_enabled": true,
"_materials": [
...
...
assets/hw_lettersort/scene/hw_lettersort.js
View file @
cdbb4bb3
...
...
@@ -1460,8 +1460,10 @@ cc.Class({
getLetter
(
text
)
{
const
node
=
new
cc
.
Node
();
const
letterY
=
this
.
getRichText
(
text
,
140
,
"
#b4502e
"
,
2
,
"
#ffffff
"
,
true
,
true
);
const
letterB
=
this
.
getRichText
(
text
,
140
,
"
#3a77ad
"
,
2
,
"
#ffffff
"
,
true
,
true
);
// const letterY = this.getRichText(text, 140, "#b4502e", 2, "#ffffff", true, true);
// const letterB = this.getRichText(text, 140, "#3a77ad", 2, "#ffffff", true, true);
const
letterY
=
this
.
getLabelNew
(
text
,
140
,
"
#b4502e
"
,
2
,
"
#ffffff
"
,
true
);
const
letterB
=
this
.
getLabelNew
(
text
,
140
,
"
#3a77ad
"
,
2
,
"
#ffffff
"
,
true
);
letterY
.
active
=
false
;
node
.
yNode
=
letterY
;
...
...
@@ -1543,16 +1545,16 @@ cc.Class({
getRichText
(
text
,
fontSize
,
color
,
outlineWidth
,
outlineColor
,
isB
lo
d
=
false
,
isFont
=
false
)
{
getRichText
(
text
,
fontSize
,
color
,
outlineWidth
,
outlineColor
,
isB
ol
d
=
false
,
isFont
=
false
)
{
const
labelNode
=
new
cc
.
Node
();
const
label
=
labelNode
.
addComponent
(
cc
.
RichText
);
label
.
string
=
`<outline color=
${
outlineColor
}
width=
${
outlineWidth
}
><color=
${
color
}
><size=
${
fontSize
}
>
${
text
}
</></color></outline>`
if
(
isB
lo
d
)
{
if
(
isB
ol
d
)
{
label
.
string
=
`<b>
${
label
.
string
}
</b>`
labelNode
.
isB
lo
d
=
true
;
labelNode
.
isB
ol
d
=
true
;
}
labelNode
.
color
=
cc
.
Color
.
BLACK
;
...
...
@@ -6139,6 +6141,64 @@ cc.Class({
return
labelNode
;
},
getLabelNew
(
text
,
fontSize
,
color
,
outlineWidth
,
outlineColor
,
isBold
=
false
)
{
const
baseNode
=
cc
.
find
(
'
Canvas/res/font/MMTB_label
'
);
const
labelNode
=
cc
.
instantiate
(
baseNode
);
const
label
=
labelNode
.
getComponent
(
cc
.
Label
);
const
labelOutline
=
labelNode
.
getComponent
(
cc
.
LabelOutline
);
label
.
string
=
text
;
label
.
fontSize
=
fontSize
;
labelNode
.
color
=
cc
.
Color
.
fromHEX
(
new
cc
.
Color
(),
color
);
labelOutline
.
width
=
outlineWidth
;
labelOutline
.
color
=
cc
.
Color
.
fromHEX
(
new
cc
.
Color
(),
outlineColor
);
// label.enableBold = isBold;
label
.
lineHeight
=
fontSize
;
// const labelNode = new cc.Node();
// const label = labelNode.addComponent(cc.Label);
// label.string = text;
// labelNode.color = cc.Color.BLACK;
// label.fontSize = fontSize;
// label.lineHeight = fontSize;
// label.font = cc.find('Canvas/res/font/MMTB').getComponent(cc.Label).font;
// if (isBold) {
// label.string = `<b>${label.string}</b>`
// labelNode.isBold = true;
// }
// labelNode.color = cc.Color.BLACK;
// // label.fontSize = fontSize;
// labelNode.baseFontSize = fontSize;
// labelNode.baseColor = color;
// labelNode.baseOutlineColor = outlineColor;
// labelNode.baseOutlineWidth = outlineWidth;
// label.lineHeight = fontSize * 1.2;
// label.horizontalAlign = cc.macro.TextAlignment.CENTER;
// if (isFont) {
// label.font = cc.find('Canvas/res/font/MMTB').getComponent(cc.Label).font;
// label.MMTB = label.font;
// }
return
labelNode
;
},
debugLayer
:
null
,
...
...
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