TMP typewriter scroll issue issue
TMP typewriter scroll issue issue
Hi Tony,
I've run into a problem when switching to using TextMesh Pro for the dialogue panel subtitle text. After switching to TMP + TMP typewriter effect, when the typewriter is stopped due to a continue input, the subtitle box doesn't expand if there are additional lines of dialogue left to be typed. The text simply overflows and is cut off by the panel, without being able to scroll down.
The continue button does correctly end the typewriter effect and the text is fully displayed, but the subtitle text box doesn't expand, so the layout doesn't update the scroll bar etc to accommodate it. Have I simply not properly assigned something or some extra code needed to get this to work like the normal text component? I'll attach some settings images below, hopefully that will reveal whatever mistake I've made in the switch over.
Cheers,
Rob
I've run into a problem when switching to using TextMesh Pro for the dialogue panel subtitle text. After switching to TMP + TMP typewriter effect, when the typewriter is stopped due to a continue input, the subtitle box doesn't expand if there are additional lines of dialogue left to be typed. The text simply overflows and is cut off by the panel, without being able to scroll down.
The continue button does correctly end the typewriter effect and the text is fully displayed, but the subtitle text box doesn't expand, so the layout doesn't update the scroll bar etc to accommodate it. Have I simply not properly assigned something or some extra code needed to get this to work like the normal text component? I'll attach some settings images below, hopefully that will reveal whatever mistake I've made in the switch over.
Cheers,
Rob
Re: TMP typewriter scroll issue issue
Hi Rob,
It looks like Trim And Size Previous Text Subtitle Panel is a custom subclass of StandardUISubtitlePanel. Is this responsible for resizing?
Generally speaking, when the TMPro typewriter stops, it makes sure the TextMeshProUGUI.maxVisibleCharacters property is set to the whole text, and then adjusts the UI element's size. However, I do see one potential issue that may be a bug. Would you please confirm that this fixes it?
Edit TextMeshProTypewriterEffect.cs, and change line 427 from this:
to this:
It looks like Trim And Size Previous Text Subtitle Panel is a custom subclass of StandardUISubtitlePanel. Is this responsible for resizing?
Generally speaking, when the TMPro typewriter stops, it makes sure the TextMeshProUGUI.maxVisibleCharacters property is set to the whole text, and then adjusts the UI element's size. However, I do see one potential issue that may be a bug. Would you please confirm that this fixes it?
Edit TextMeshProTypewriterEffect.cs, and change line 427 from this:
Code: Select all
if (textComponent != null) textComponent.maxVisibleCharacters = textComponent.textInfo.characterCount;
Code: Select all
if (textComponent != null)
{
textComponent.maxVisibleCharacters = textComponent.textInfo.characterCount;
textComponent.ForceMeshUpdate();
}
Re: TMP typewriter scroll issue issue
Hi Tony,
Thanks for getting back to me so quickly. That did fix the issue of the text box not resizing correctly! But after the mesh update, the panel doesn't scroll down to the new line correctly, it has to be done manually. Should another line be added after the mesh update to scroll to the bottom? Or would it be better to have that handled in another way?
Cheers,
Rob
Thanks for getting back to me so quickly. That did fix the issue of the text box not resizing correctly! But after the mesh update, the panel doesn't scroll down to the new line correctly, it has to be done manually. Should another line be added after the mesh update to scroll to the bottom? Or would it be better to have that handled in another way?
Cheers,
Rob
Re: TMP typewriter scroll issue issue
Hi Rob,
Hmm, it should jump down to the bottom. Maybe Unity UI isn't updating immediately. Try adding the extra line shown below:
Hmm, it should jump down to the bottom. Maybe Unity UI isn't updating immediately. Try adding the extra line shown below:
Code: Select all
if (textComponent != null)
{
textComponent.maxVisibleCharacters = textComponent.textInfo.characterCount;
textComponent.ForceMeshUpdate();
Canvas.ForceUpdateCanvases();
}
Re: TMP typewriter scroll issue issue
Hey Tony,
That doesn't seem to do it either :S. Rather strange, I can see the literal next line of code calls the method that should prevent this exact issue. There's some juddery behavior too as new lines of text are added that I wasn't getting before changing over to TMP. It look like that's also due to not scrolling down correctly.
That doesn't seem to do it either :S. Rather strange, I can see the literal next line of code calls the method that should prevent this exact issue. There's some juddery behavior too as new lines of text are added that I wasn't getting before changing over to TMP. It look like that's also due to not scrolling down correctly.
Re: TMP typewriter scroll issue issue
I'll try to set up a reproduction project here. If I can reproduce the same issue, I'll provide a solution. Otherwise I may need to ask you for a reproduction project/scene.
Re: TMP typewriter scroll issue issue
Just wanted to add timeline expectations here. It may take me until tomorrow to reproduce the issue and post a resolution, or to ask you for a repro project if I can't reproduce it.
Re: TMP typewriter scroll issue issue
Not a problem Tony, thanks for looking into it!
Re: TMP typewriter scroll issue issue
Hi,
I'm not sure how to reproduce this. Would you please send a reproduction project to tony (at) pixelcrushers.com?
I'm not sure how to reproduce this. Would you please send a reproduction project to tony (at) pixelcrushers.com?
Re: TMP typewriter scroll issue issue
Hi Tony,
I've sent through the repro-project, hopefully it can shed some light on the issue.
Cheers,
Rob
I've sent through the repro-project, hopefully it can shed some light on the issue.
Cheers,
Rob