mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-09-25 05:50:20 +00:00
完善 docs
This commit is contained in:
File diff suppressed because it is too large
Load Diff
54
demo/assets/text-render/char-mode/char-mode.ts
Normal file
54
demo/assets/text-render/char-mode/char-mode.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { chars } from "../chars";
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class CharMode extends cc.Component {
|
||||
|
||||
@property(cc.Label)
|
||||
bitmapFont1: cc.Label = null;
|
||||
|
||||
@property(cc.Label)
|
||||
bitmapFont2: cc.Label = null;
|
||||
|
||||
@property(cc.Label)
|
||||
bitmapFont3: cc.Label = null;
|
||||
|
||||
@property(cc.Label)
|
||||
charFont1: cc.Label = null;
|
||||
|
||||
@property(cc.Label)
|
||||
charFont2: cc.Label = null;
|
||||
|
||||
@property(cc.Label)
|
||||
charFont3: 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.charFont1.string = this.getRandomText(15);
|
||||
this.charFont2.string = this.getRandomText(15);
|
||||
this.charFont3.string = this.getRandomText(15);
|
||||
|
||||
this.schedule(() => {
|
||||
this.bitmapFont1.string = this.getRandomText(15);
|
||||
this.bitmapFont2.string = this.getRandomText(15);
|
||||
this.bitmapFont3.string = this.getRandomText(15);
|
||||
this.charFont1.string = this.getRandomText(15);
|
||||
this.charFont2.string = this.getRandomText(15);
|
||||
this.charFont3.string = this.getRandomText(15);
|
||||
}, 0.1);
|
||||
}
|
||||
|
||||
|
||||
getRandomText(length: number) {
|
||||
let str = '';
|
||||
while (str.length < length) {
|
||||
str += chars[Math.floor(Math.random() * chars.length)];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
9
demo/assets/text-render/char-mode/char-mode.ts.meta
Normal file
9
demo/assets/text-render/char-mode/char-mode.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "59d30214-6082-40ab-96d5-2704f05b10b5",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
1
demo/assets/text-render/chars.ts
Normal file
1
demo/assets/text-render/chars.ts
Normal file
File diff suppressed because one or more lines are too long
9
demo/assets/text-render/chars.ts.meta
Normal file
9
demo/assets/text-render/chars.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "0f37373d-8dc4-40cb-a343-5e7761491c53",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
12
demo/assets/text-render/high-dpi.meta
Normal file
12
demo/assets/text-render/high-dpi.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "0574009e-3e43-4b85-a325-89f9dede6c68",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
1503
demo/assets/text-render/high-dpi/high-dpi.prefab
Normal file
1503
demo/assets/text-render/high-dpi/high-dpi.prefab
Normal file
File diff suppressed because it is too large
Load Diff
8
demo/assets/text-render/high-dpi/high-dpi.prefab.meta
Normal file
8
demo/assets/text-render/high-dpi/high-dpi.prefab.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "e267c12a-39ac-41db-9e97-de8e196c296d",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
Reference in New Issue
Block a user