完善 docs

This commit is contained in:
SmallMain
2022-06-20 17:43:35 +08:00
parent 798d456fb2
commit 11e48119c9
9 changed files with 566 additions and 206 deletions

View File

@@ -24,14 +24,14 @@
"_active": true,
"_components": [
{
"__id__": 49
"__id__": 55
},
{
"__id__": 50
"__id__": 56
}
],
"_prefab": {
"__id__": 51
"__id__": 57
},
"_opacity": 255,
"_color": {
@@ -92,23 +92,23 @@
"__id__": 3
},
{
"__id__": 37
"__id__": 43
}
],
"_active": true,
"_components": [
{
"__id__": 42
"__id__": 48
},
{
"__id__": 46
"__id__": 52
},
{
"__id__": 47
"__id__": 53
}
],
"_prefab": {
"__id__": 48
"__id__": 54
},
"_opacity": 255,
"_color": {
@@ -172,11 +172,11 @@
"_active": true,
"_components": [
{
"__id__": 35
"__id__": 41
}
],
"_prefab": {
"__id__": 36
"__id__": 42
},
"_opacity": 255,
"_color": {
@@ -249,29 +249,35 @@
"__id__": 18
},
{
"__id__": 22
"__id__": 21
},
{
"__id__": 25
},
{
"__id__": 28
},
{
"__id__": 31
},
{
"__id__": 34
}
],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 37
},
{
"__id__": 32
"__id__": 38
},
{
"__id__": 33
"__id__": 39
}
],
"_prefab": {
"__id__": 34
"__id__": 40
},
"_opacity": 255,
"_color": {
@@ -284,7 +290,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 785.815,
"height": 503.4
"height": 548.04
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -363,7 +369,7 @@
"ctor": "Float64Array",
"array": [
0,
-50,
-70,
0,
0,
0,
@@ -434,7 +440,7 @@
"_alignFlags": 17,
"_left": 95.11500000000001,
"_right": 0,
"_top": 30,
"_top": 50,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
@@ -487,7 +493,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 58.725,
"height": 37.8
"height": 32.76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -499,7 +505,7 @@
"ctor": "Float64Array",
"array": [
0,
-108.9,
-119.38,
0,
0,
0,
@@ -541,7 +547,7 @@
"_string": "Label",
"_N$string": "Label",
"_fontSize": 24,
"_lineHeight": 30,
"_lineHeight": 26,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
@@ -598,7 +604,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 58.725,
"height": 37.8
"height": 32.76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -610,7 +616,7 @@
"ctor": "Float64Array",
"array": [
0,
-166.70000000000002,
-165.14,
0,
0,
0,
@@ -652,7 +658,7 @@
"_string": "Label",
"_N$string": "Label",
"_fontSize": 24,
"_lineHeight": 30,
"_lineHeight": 26,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
@@ -709,7 +715,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 58.725,
"height": 37.8
"height": 32.76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -721,7 +727,7 @@
"ctor": "Float64Array",
"array": [
0,
-224.50000000000003,
-210.89999999999998,
0,
0,
0,
@@ -763,7 +769,7 @@
"_string": "Label",
"_N$string": "Label",
"_fontSize": 24,
"_lineHeight": 30,
"_lineHeight": 26,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
@@ -794,7 +800,7 @@
},
{
"__type__": "cc.Node",
"_name": "tips",
"_name": "label4",
"_objFlags": 0,
"_parent": {
"__id__": 4
@@ -804,13 +810,10 @@
"_components": [
{
"__id__": 19
},
{
"__id__": 20
}
],
"_prefab": {
"__id__": 21
"__id__": 20
},
"_opacity": 255,
"_color": {
@@ -822,8 +825,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 375.18,
"height": 90
"width": 58.725,
"height": 32.76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -835,7 +838,7 @@
"ctor": "Float64Array",
"array": [
0,
-308.40000000000003,
-256.65999999999997,
0,
0,
0,
@@ -867,6 +870,120 @@
"__id__": 18
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 24,
"_lineHeight": 26,
"_enableWrapText": true,
"_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": 1,
"_N$autoSwitchMaterial": 0,
"_N$allowDynamicAtlas": 0,
"_N$enableRetina": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "f48ef4d1-7483-4868-8096-115ae0431c76"
},
"fileId": "a0j7wReqhLWIiL84nlII3F",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "tips",
"_objFlags": 0,
"_parent": {
"__id__": 4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 22
},
{
"__id__": 23
}
],
"_prefab": {
"__id__": 24
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 375.18,
"height": 90
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-331.03999999999996,
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": ""
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
},
"_enabled": true,
"_materials": [
null
],
@@ -898,7 +1015,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
"__id__": 21
},
"_enabled": true,
"alignMode": 1,
@@ -906,7 +1023,7 @@
"_alignFlags": 17,
"_left": 95.11500000000001,
"_right": 0,
"_top": 263.40000000000003,
"_top": 286.03999999999996,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
@@ -940,115 +1057,6 @@
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
}
],
"_prefab": {
"__id__": 24
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 58.73,
"height": 30
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-388.40000000000003,
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": ""
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_materials": [
null
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 24,
"_lineHeight": 30,
"_enableWrapText": true,
"_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": 2,
"_N$autoSwitchMaterial": 0,
"_N$allowDynamicAtlas": 0,
"_N$enableRetina": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "f48ef4d1-7483-4868-8096-115ae0431c76"
},
"fileId": "53ohPrY4VPPaTL8Y+GWL2b",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "label2",
"_objFlags": 0,
"_parent": {
"__id__": 4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
@@ -1080,7 +1088,7 @@
"ctor": "Float64Array",
"array": [
0,
-438.40000000000003,
-404.03999999999996,
0,
0,
0,
@@ -1146,12 +1154,12 @@
"asset": {
"__uuid__": "f48ef4d1-7483-4868-8096-115ae0431c76"
},
"fileId": "ecP5qke91J8JmKY2vRuQZb",
"fileId": "53ohPrY4VPPaTL8Y+GWL2b",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "label3",
"_name": "label2",
"_objFlags": 0,
"_parent": {
"__id__": 4
@@ -1189,7 +1197,7 @@
"ctor": "Float64Array",
"array": [
0,
-488.40000000000003,
-447.03999999999996,
0,
0,
0,
@@ -1247,6 +1255,115 @@
"_N$enableRetina": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "f48ef4d1-7483-4868-8096-115ae0431c76"
},
"fileId": "ecP5qke91J8JmKY2vRuQZb",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "label3",
"_objFlags": 0,
"_parent": {
"__id__": 4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 32
}
],
"_prefab": {
"__id__": 33
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 58.73,
"height": 30
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-490.03999999999996,
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": ""
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
},
"_enabled": true,
"_materials": [
null
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 24,
"_lineHeight": 30,
"_enableWrapText": true,
"_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": 2,
"_N$autoSwitchMaterial": 0,
"_N$allowDynamicAtlas": 0,
"_N$enableRetina": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
@@ -1258,6 +1375,115 @@
"fileId": "f0KGVrovlF0qoYJg33NKVZ",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "label4",
"_objFlags": 0,
"_parent": {
"__id__": 4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 35
}
],
"_prefab": {
"__id__": 36
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 58.73,
"height": 30
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-533.04,
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": ""
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
},
"_enabled": true,
"_materials": [
null
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Label",
"_N$string": "Label",
"_fontSize": 24,
"_lineHeight": 30,
"_enableWrapText": true,
"_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": 2,
"_N$autoSwitchMaterial": 0,
"_N$allowDynamicAtlas": 0,
"_N$enableRetina": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "f48ef4d1-7483-4868-8096-115ae0431c76"
},
"fileId": "06LxFIAa9PdaJ2pzqvz75W",
"sync": false
},
{
"__type__": "cc.ToggleContainer",
"_name": "",
@@ -1281,7 +1507,7 @@
"_layoutSize": {
"__type__": "cc.Size",
"width": 785.815,
"height": 503.4
"height": 548.04
},
"_resize": 1,
"_N$layoutType": 2,
@@ -1293,10 +1519,10 @@
"_N$startAxis": 1,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 30,
"_N$paddingTop": 50,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 20,
"_N$spacingY": 13,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
@@ -1387,23 +1613,23 @@
},
"_children": [
{
"__id__": 38
"__id__": 44
}
],
"_active": true,
"_components": [
{
"__id__": 41
"__id__": 47
},
{
"__id__": 43
"__id__": 49
},
{
"__id__": 44
"__id__": 50
}
],
"_prefab": {
"__id__": 45
"__id__": 51
},
"_opacity": 255,
"_color": {
@@ -1457,17 +1683,17 @@
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 37
"__id__": 43
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 39
"__id__": 45
}
],
"_prefab": {
"__id__": 40
"__id__": 46
},
"_opacity": 255,
"_color": {
@@ -1521,7 +1747,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 38
"__id__": 44
},
"_enabled": true,
"_materials": [
@@ -1566,18 +1792,18 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 43
},
"_enabled": true,
"_scrollView": {
"__id__": 42
"__id__": 48
},
"_touching": false,
"_opacity": 255,
"enableAutoHide": false,
"autoHideTime": 1,
"_N$handle": {
"__id__": 39
"__id__": 45
},
"_N$direction": 1,
"_id": ""
@@ -1606,7 +1832,7 @@
},
"_N$horizontalScrollBar": null,
"_N$verticalScrollBar": {
"__id__": 41
"__id__": 47
},
"_id": ""
},
@@ -1615,7 +1841,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 43
},
"_enabled": true,
"alignMode": 0,
@@ -1642,7 +1868,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 43
},
"_enabled": true,
"_materials": [
@@ -1798,15 +2024,21 @@
"bitmapFont3": {
"__id__": 16
},
"charFont1": {
"__id__": 23
"bitmapFont4": {
"__id__": 19
},
"charFont2": {
"charFont1": {
"__id__": 26
},
"charFont3": {
"charFont2": {
"__id__": 29
},
"charFont3": {
"__id__": 32
},
"charFont4": {
"__id__": 35
},
"_id": ""
},
{

View File

@@ -14,6 +14,9 @@ export default class CharMode extends cc.Component {
@property(cc.Label)
bitmapFont3: cc.Label = null;
@property(cc.Label)
bitmapFont4: cc.Label = null;
@property(cc.Label)
charFont1: cc.Label = null;
@@ -23,22 +26,28 @@ export default class CharMode extends cc.Component {
@property(cc.Label)
charFont3: cc.Label = null;
@property(cc.Label)
charFont4: cc.Label = null;
protected onLoad(): void {
this.bitmapFont1.string = this.getRandomText(15);
this.bitmapFont2.string = this.getRandomText(15);
this.bitmapFont3.string = this.getRandomText(15);
this.bitmapFont4.string = this.getRandomTextEnglish(30);
this.charFont1.string = this.getRandomText(15);
this.charFont2.string = this.getRandomText(15);
this.charFont3.string = this.getRandomText(15);
this.charFont4.string = this.getRandomTextEnglish(30);
this.schedule(() => {
this.bitmapFont1.string = this.getRandomText(15);
this.bitmapFont2.string = this.getRandomText(15);
this.bitmapFont3.string = this.getRandomText(15);
this.bitmapFont4.string = this.getRandomTextEnglish(30);
this.charFont1.string = this.getRandomText(15);
this.charFont2.string = this.getRandomText(15);
this.charFont3.string = this.getRandomText(15);
this.charFont4.string = this.getRandomTextEnglish(30);
}, 0.1);
}
@@ -51,4 +60,15 @@ export default class CharMode extends cc.Component {
return str;
}
enChars = "abcdefghijklmnopqrstuvwxyz.,/ 1234567890!@#$%^&*()-=_+`~,./;'<>?;[]{}|";
getRandomTextEnglish(length: number) {
let str = '';
while (str.length < length) {
str += this.enChars[Math.floor(Math.random() * this.enChars.length)];
}
return str;
}
}