So in my script I want to know how many lines are displayed in a Textmeshpro - text (UI).
public TextMeshProUGUI commentaryText;
Debug.Log("number of lines " + (commentaryText.text.Split('\n').Length - 1));
I tried something like above but it will only show the number of lines with a \n newline character, however I also want to know about lines that are caused by wraparound when they reach the limit of the textbox. Is there a way to get the number of lines that the user sees?
Any advice appreciated. Thanks