How do I change text size dependant on how much text is present?
2 replies, posted
What's happenin' forum?
I'm making (another) Garry's Mod HUD for DarkRP, and I was wondering if there was a possible way to change text size corresponding to how much text is in a variable. So for example
If you have $2,000,000, the text would stay the same size since it can fit within my HUD's boundary. However, if you had an absurd amount like $2,000,000,000,000, it would downscale to fit the HUD's box. Is there any way to achieve something like this?
create multiple font sizes, and then use surface.SetFont("DesirableFont") and surface.GetTextSize(text), it will return the size it takes, iterate trhough your fonts until you find the best that fits
https://wiki.garrysmod.com/page/cam/PushModelMatrix
see the example
Sorry, you need to Log In to post a reply to this thread.