Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

UI react transform height can cause a line of text to not be shown?

A topic by TheEclipsedLock created Jan 11, 2020 Views: 205 Replies: 4
Viewing posts 1 to 2

Hello, hello! I'd like to first say, thank you for creating this really cool asset! I've been trying out various bits and pieces of how SMT works, and I've been playing around with some of the initial scenes and scripts that were included. 

After seeing how it worked from the TextMeshExample scene (within the StageScene folder), I decided to try and integrate a custom SMT component into some of the UI I've already created, along with using the STMDialogueSample script for the sake of convenience. I set its width and height accordingly, and I write a long test string to see how it would work along with the script. It works, but interestingly, two effects have happened:

1) When the read delay is set to 0, and I press enter with the script in play, the component seems to ignore the height boundaries and "overflows" past where it was supposed to stop. However, changing it to a value above 0 (though, I only tested it with 0.1) seems to stop that.

2) The other effect is when there is some space left as more text is coming through, and I press "continue" to keep going through the dialogue, a pause seemingly takes place which I believe is actually loading the text but is somehow not being displayed. There is a subtle height difference that makes me believe that is the case. I happen to have a video down below to show it in detail:

https://drive.google.com/file/d/1Mx3OY9O7LsNSoH46Jm2Qsi8o97WHId-5/view?usp=shari...

The most interesting thing is that when I placed the same string of text in the TextMeshExample scene, it all came out just fine. (though setting the delay back to 0 made it "overflow" text. I assume I overlooked something in the documentation somewhere?) Even more interesting, when I changed the height to 160, everything worked out pretty well, no missing lines. I've also tried to emulate pretty closely to what was in the TextMeshExample scene, but there must be something I'm overlooking. 

Also, the effect I want to replicate is all the text disappearing before the new set of text comes in. Changing the vertical limit mode from auto pause full to auto pause seems to be a great option and solution to this problem since no lines of text go missing, but I would like to know more about what I've been experiencing. Thank you. :)

Developer

Hey! I'm about to go to sleep, so here's my immediate thoughts before I dig deeper into this...


For the "auto pause" functions, STM is picky about the height of a text box being a multiple of the text size. (If the text is 2 units tall, the box height should be exactly 8 if you want 4 lines, for example) Could it be that? That's an old, unfortunate behaviour I never got around to changing... but hopefully an easy enough one to work around. So I'm just wondering if it's this... even though you said it's only effecting auto pause full. Please let me know what happens and I'll take a closer look soon!

Ahh, I understand what you mean! The size I was using was 32, and the height was 150. 32 x 5 = 160, which was the height that I coincidentally changed it to, which fixed things. I'll be running some tests with the attached dialog sample script with a size of 2, the first index being a long string that the text box can't cover fully, and the second index being a short string that the text can more than cover fully: Setting the height to 150 and the size to 30 also fixed things. And as you said, I tried testing incompatible multiples of 150 between all vertical limit modes just to be safe. (along with a read delay of 0.1) It only affects the auto pause full effect.

When changing the read delay to 0, things seem a bit weird. With auto-pause, it seemed show just the last four lines of text (of the longer string), with auto pause full only showing the last two lines of text. (the short-string index was also missing for some reason) Setting the size to 30 to be compatible with the 150 (with auto pause full) just shows the last line, while with auto pause showing only two of the last lines, yet the string on the short-stringed index was missing entirely, despite it appearing on the inspector text.

I don't think anything in my current project should be adversely affecting this, but I may as well isolate the testing into a new unity project.

However, the effects still appear the same. As long as there is some read delay, (and keeping size a multiple of height in regards to auto pause full), everything is all there, no disappearances of text. While I don't plan on leaving the delay to 0, I do find this to be strange behavior, or maybe what I'm experiencing is due to me not activating a certain other setting in the component?

Developer

Catching this before bed again, it could just be that when the read delay is 0, it's skipping to the end of the text and otherwise behaving fine? If you can send me a sample scene to my email posted on my website, I can check for sure!

Good afternoon! Sorry for the super late reply, but I will be emailing you later today! Attached in the email are all the files I've created for a default scene, along with three game objects under a canvas: One where the text is a multiple of height, one where the text is not a multiple height where each have tests for auto pause without delay, auto pause with delay, auto pause full without delay, and auto pause full with delay (interestingly, with auto pause full and a delay of 0.1 it seems to cut text), and my own example that I've been working on (one with a multiple height, and one without. The already active object of multiple of height that highlights the problem). I hope we can gain a better understanding of this. :)