Tooltip background doesn't scale with respect to text.
Describe the bug If you attach the string dynamically to tooltip text. the background doesn't scale. I tried even with static prefab, although the scripts for scaling is written but doesn't work as expected.
To Reproduce https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/Assets/HoloToolkit-Examples/UX/Readme/README_TooltipExample.md Steps to reproduce the behavior:
- Go to TooltipExample scene set any tooltip text dynamically or statically load the screen text goes out of the background.
Expected behavior Text should fit in the background, as I observed in "ToolTip.cs" , "RefreshLocalContent()" resizes the background based on the content size but it doesn't work.
Unity Editor Version Unity 2018.2.5
Mixed Reality Toolkit Release Version MRTK version(s) 2017.4.1.0
Additional context Add any other context about the problem here.
Hi @rohitdesaidev,
Do you know if there is a quick solution for this problem until a new release solves it?
Regards, Cristian.
@Cris21395 I Didn't find any solution yet as we have to modify MRTK scripts. But rather than using dynamic sizing I prefer a static box size for every prefab. Hope they solve this in coming release. @StephenHodgson can please provide any solutions if you came across ?
Thanks, Rohit Desai
My solution was commenting out all the contentParent.SetActive(false) in Tooltip.cs.
I found out that Textmeshpro.ForceMeshUpdate won't work when the gameobject is inactive. This leads to cachedLabelText.textBounds.size to not calculate right and output (0,0,0). Read more at (https://forum.unity.com/threads/textmesh-pro-forcemeshupdate-true-not-working-when-object-inactive.524507/).
HTK requires unity 2017.4
Closing older HTK issue as we are no longer actively working on HTK.
Please upgrade to MRTK V2 for the latest fixes.