Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.74k stars 332 forks source link

Add TextScale property to ToolTip #2702

Open ArshvirGoraya opened 1 month ago

ArshvirGoraya commented 1 month ago

I got a request for one of my mods to be able to scale the text of tool tips (specifically in the exterior automap).

I couldn't find an easy way of doing this so I created this property. This property is also in other files such as TextLabel.cs, and works the same way.

This lets me adjust the ToolTip scaling very easily for individual ToolTips.

ArshvirGoraya commented 2 weeks ago

For anyone wanting to see this functioning, here is a video example of everything working as I intend it.

I am targetting the tooltips in the exterior automap and changing their size. I also show tooltips I am not targetting, whose sizes don't change.

https://github.com/user-attachments/assets/2100e79b-af04-4f2e-94fe-9b18c112606b

I also removed some TextScale variables I added in my first commit as they were not needed. In fact, some of them were causing problems with the positioning of the ToolTip if they got too big (so its good I made this video or I wouldn't have caught it this early).

To test it yourself just do this on any toolTip: ToolTip.TextScale = x;

You can also check the ToolTipSizeChanging branch in my repo here to see how I am doing it: https://github.com/ArshvirGoraya/Map-Hours/tree/ToolTipSizeChanging