Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
120 stars 2 forks source link

Add support for truncation when rendering long text with text renderer #2037

Open 5H4D0W-X opened 1 month ago

5H4D0W-X commented 1 month ago

Is your feature request related to a problem? Please describe.

It can be very useful to take an arbitrary string and truncate it so that it can be displayed correctly in UI without scaling it.

Describe the solution you'd like

Describe alternatives you've considered

Using a hidden text renderer and iteratively measuring its size while removing characters until a target size is reached. This is hard to implement, especially dynamically where the size of UI elements may change at any time.

Additional Context

This should be able to deal with resized rich text as well, that should be taken into account.

Requesters

ShadowX

epicEaston197 commented 1 month ago

I'm having trouble understanding this do you mean something like this? image

5H4D0W-X commented 1 month ago

Exactly, it would make things like world names in the contacts list much more consistent