Commit 849a0a81 authored by limingzhe's avatar limingzhe

fix: debug 字体不显示

parent 29fdedfc
{ {"ver":"1.1.2","uuid":"b4b62bd3-1442-4e7e-8b59-38c0f3bf6c52","isBundle":false,"bundleName":"","priority":1,"compressionType":{"android":"default"},"optimizeHotUpdate":{"android":true},"inlineSpriteFrames":{"android":false},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
"ver": "1.1.2", \ No newline at end of file
"uuid": "b4b62bd3-1442-4e7e-8b59-38c0f3bf6c52",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {
"android": "default"
},
"optimizeHotUpdate": {
"android": true
},
"inlineSpriteFrames": {
"android": false
},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
...@@ -204,23 +204,19 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -204,23 +204,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
lock.active = true; lock.active = true;
const titleNode = attr.querySelector('.title'); const titleNode = attr.querySelector('.title');
const outline = '#000'; // const outline = '#000';
const name = ""; // const name = "";
const richText = titleNode.getComponent(cc.RichText); // const richText = titleNode.getComponent(cc.RichText);
if ( !richText.fontSizeBase ) { // if ( !richText.fontSizeBase ) {
richText.fontSizeBase = richText.fontSize; // richText.fontSizeBase = richText.fontSize;
} // }
richText.fontSize = richText.fontSizeBase; // richText.fontSize = richText.fontSizeBase;
if (name.length > 14) { // if (name.length > 14) {
richText.fontSize = richText.fontSizeBase * 0.7; // richText.fontSize = richText.fontSizeBase * 0.7;
} // }
titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>` // titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
// width=4>${name}</outline>`
delayCall(0.2, () => {
titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>`
})
}); });
...@@ -279,6 +275,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -279,6 +275,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline} titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>`; width=4>${name}</outline>`;
delayCall(0.2, () => {
titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>`;
})
} }
}); });
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment