Commit a66129e0 authored by limingzhe's avatar limingzhe

fix: debug 按钮字体

parent 849a0a81
{"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":{}}
\ No newline at end of file
{
"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": {}
}
\ No newline at end of file
......@@ -73,15 +73,18 @@
},
{
"__id__": 5
},
{
"__id__": 421
}
],
"_active": true,
"_components": [
{
"__id__": 421
"__id__": 425
},
{
"__id__": 422
"__id__": 426
}
],
"_prefab": null,
......@@ -17723,6 +17726,227 @@
],
"_id": "dbT6tMZutH/Y58xXsjUXqp"
},
{
"__type__": "cc.Node",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 422
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "04MQ3fPiNFZZVQ0bmj1Bnx"
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 421
},
"_children": [
{
"__id__": 423
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "6051dFmZJP/bLa9po3KKoh"
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 422
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 424
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 50.4
},
"_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": "dfq8GjBcpHLJ+iFxN4OK7V"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 423
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "2eXQdeVrRKkKLJ9ROFJKCL"
},
{
"__type__": "cc.Canvas",
"_name": "",
......
......@@ -204,19 +204,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
lock.active = true;
const titleNode = attr.querySelector('.title');
// const outline = '#000';
// const name = "";
// const richText = titleNode.getComponent(cc.RichText);
// if ( !richText.fontSizeBase ) {
// richText.fontSizeBase = richText.fontSize;
// }
// richText.fontSize = richText.fontSizeBase;
// if (name.length > 14) {
// richText.fontSize = richText.fontSizeBase * 0.7;
// }
const outline = '#000';
const name = "";
const richText = titleNode.getComponent(cc.RichText);
if ( !richText.fontSizeBase ) {
richText.fontSizeBase = richText.fontSize;
}
richText.fontSize = richText.fontSizeBase;
if (name.length > 14) {
richText.fontSize = richText.fontSizeBase * 0.7;
}
richText.font = cc.find("Canvas/res/font/BRLNSDB").getComponent(cc.Label).font;
// 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>`
});
......@@ -272,10 +273,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (name.length > 14) {
richText.fontSize = richText.fontSizeBase * 0.7;
}
richText.font = cc.find("Canvas/res/font/BRLNSDB").getComponent(cc.Label).font;
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>`;
......
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