In my canvas component I print text one symbol after another and I need to stop printing if text does not fit. After press next button other part of the text will be printed.
But how can I check if there is no free space in the Text component? I don’t need slider here.
If all symbols are “i”, then I can print 432 of it. And if “w” - then 126.
private IEnumerator TextDelay()
{
isTextTyping = true;
foreach (char i in
contentToPrint.stringsToPrint[NumberOfStringToPrint])
{
if (i != ' ')
audioTapText.Play();
textComponent.text += i;
yield return new WaitForSeconds(0.04f);
}
isTextTyping = false;
}
And I don’t want to print half of the word at the end. Then, after press next, print other half