Commit 0eec7054 authored by Tt's avatar Tt

feat(场景): 根据文本长度调整字体大小并更新字体资源

parent 6d9e48ba
{
"ver": "1.1.0",
"uuid": "27818f94-6cfd-484a-8976-832b41eb6647",
"subMetas": {}
}
\ No newline at end of file
...@@ -4422,8 +4422,8 @@ ...@@ -4422,8 +4422,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 930, "width": 938.6,
"height": 363.8 "height": 667.8
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -4474,13 +4474,13 @@ ...@@ -4474,13 +4474,13 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "apple", "_string": "umbrella",
"_N$string": "apple", "_N$string": "umbrella",
"_fontSize": 130, "_fontSize": 250,
"_lineHeight": 130, "_lineHeight": 530,
"_enableWrapText": false, "_enableWrapText": false,
"_N$file": { "_N$file": {
"__uuid__": "5b4dcbfb-131d-4819-b59c-e74c8888b18b" "__uuid__": "27818f94-6cfd-484a-8976-832b41eb6647"
}, },
"_isSystemFontUsed": false, "_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
...@@ -4490,7 +4490,7 @@ ...@@ -4490,7 +4490,7 @@
"_N$horizontalAlign": 1, "_N$horizontalAlign": 1,
"_N$verticalAlign": 1, "_N$verticalAlign": 1,
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 2, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "9dhkE7tNFHUa0HW9v2NTCt" "_id": "9dhkE7tNFHUa0HW9v2NTCt"
}, },
......
...@@ -736,6 +736,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -736,6 +736,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 设置文字内容 // 设置文字内容
if (currentData.txt) { if (currentData.txt) {
pg.view.setString(word, currentData.txt); pg.view.setString(word, currentData.txt);
if (currentData.txt > 6) {
word.getComponent(cc.Label).fontSize = 250;
} else {
word.getComponent(cc.Label).fontSize = 350;
}
} }
} }
} }
......
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