mirror of
https://github.com/BotChain-Robots/ui.git
synced 2026-07-08 15:07:22 +02:00
Fixed weird underline on UI text and made text bigger
Made-with: Cursor
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
/// <summary>
|
||||
/// Top banner with three buttons (1=Live View, 2=Inverse Kinematics, 3=Programmed Movements).
|
||||
@@ -163,13 +162,14 @@ public class ViewBannerUI : MonoBehaviour
|
||||
textRect.offsetMin = new Vector2(6, 4);
|
||||
textRect.offsetMax = new Vector2(-6, -4);
|
||||
|
||||
var tmp = textGo.AddComponent<TextMeshProUGUI>();
|
||||
tmp.text = label;
|
||||
tmp.fontSize = 18;
|
||||
tmp.fontStyle = FontStyles.Bold;
|
||||
tmp.alignment = TextAlignmentOptions.Center;
|
||||
tmp.color = buttonTextColor;
|
||||
tmp.enableWordWrapping = true;
|
||||
var txt = textGo.AddComponent<Text>();
|
||||
txt.font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
txt.text = label;
|
||||
txt.fontSize = 18;
|
||||
txt.fontStyle = FontStyle.Bold;
|
||||
txt.alignment = TextAnchor.MiddleCenter;
|
||||
txt.color = buttonTextColor;
|
||||
txt.horizontalOverflow = HorizontalWrapMode.Wrap;
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user