There’s a messy playground… where I am testing GUI textBlock.text changes… after a 5-second delay.
Both GUI rectangle… and scrollViewer… are tested.
There is a statement in the resizeToFit section of the GUI textBlock docs… that says…
“Notice that textWrapping is ignored when resizeToFit is set to true. It doesn’t make sense logically for both properties to be used at the same time as they contradict each other.”
That MIGHT BE an incorrect claim. Lines 80 & 81 are being used together in the blue-background rectangle. You can NOP line 80 and then re-run, and wait 5 seconds… to see that wrapping is not ignored.
The same situation happens in lines 126 & 127 of the scrollViewer.
So, perhaps that docs line needs some adjusting.
Minor subject change:
Notice lines 40 & 41… adapt blue rect (container) width/height to children.
I thought this would be a fun place to experiment, too… as the textBlock is resizingToFIt after 5 seconds. The blue rect container will need to change, too… to re-adapt to the new textBlock width / height.
It does. It adapts… at least height-wise. No adapting needed on the width, as the word wrapper took care of that.
Interesting! Fun interplay between word-wrapping, and GUI textBlock resizes, and container size-adaptations. (at least i think so)
Need extra space around the text of the blue rectangle? You need to use NEGATIVE paddings on the rectangle... like seen in lines 58-61. Interesting. And, we get a new parody song from Wingnut, too! :)
I didn't know where to post this. We don't have a category to fit this. It's a test playground, open for discussions and experiments and learning. Join-in... tell us what you try/learn. Admin, move it, at-will... or delete, as needed.