| | |
| | | textEx.fontSize = textFontSize;
|
| | | textEx.raycastTarget = false;
|
| | | textEx.alignment = TextAnchor.MiddleCenter;
|
| | | textEx.horizontalOverflow = HorizontalWrapMode.Wrap;
|
| | | textEx.verticalOverflow = VerticalWrapMode.Truncate;
|
| | | //默认设置为可超出,具体情况根据需求修改
|
| | | //原因:大多数文本都是少量字,但更换字体或者统一修改字体大小(多语言)容易导致显示不了问题
|
| | | // 以多数情况为基准,其他文本根据情况修改
|
| | | textEx.horizontalOverflow = HorizontalWrapMode.Overflow;
|
| | | textEx.verticalOverflow = VerticalWrapMode.Overflow;
|
| | | textEx.resizeTextForBestFit = false;
|
| | | textEx.color = textColor;
|
| | |
|
| | | textEx.rectTransform.sizeDelta = new Vector2(width + 6, height + 6);
|
| | | //虽然是Overflow 依然保留,方便以后可能修改情况
|
| | | textEx.rectTransform.sizeDelta = new Vector2(width + 6, height + 6); |
| | |
|
| | | }
|
| | |
|