Search Unity

Feedback [Feature request] Apply autosize button

Discussion in 'UGUI & TextMesh Pro' started by Epsilon_Delta, Sep 29, 2020.

  1. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    258
    Hi,

    the title pretty much sums it up. It would be nice to have a button somewhere next to autosize checkbox (and visible only when this checkbox is ticked) that will set generated autosize as size of text and uncheck the autosize. E.g:
    upload_2020-9-29_9-37-56.png
    when hitting the hypothetical button, 55.45 text would be set. Now when I want to apply the ideal size (that I figured out with autosize feature), I have to manually uncheck the box and copypaste the value on each and every object. When dealing with many text elements, a multiobject editing with two steps: check the autosize box and apply autosize would greatly improve the workflow.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    See the following post which includes a example script to determine the optimum point size of multiple text objects.

    My suggestion would be to modify this script to be some editor tool where it would still find the optimum point size for a group of text objects and then in the Editor set the size on those objects.

    With such tool, you could define groups of text element that should have the same point size and then set this size on all of them in one click. Could this be a valid alternative?
     
    Epsilon_Delta likes this.
  3. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    258
    Well, my intention was to be able to use it on all of the texts at the same time (resulting in many different sizes) as I have many texts, all of which are unique in size.

    I could have of course written an editor script, but it wasn't so much work to do, so I haven't. I just posted this idea of applying autosize, as I realized many people may have the same problem. But I see your point in the other thread you posted, that one should have only few different sizes of text and therefore my usecase might be too rare to waste time on it.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Can you provide more insight on your use case in the sense of each text object potentially having different point size?

    As per that previous post / thread, typically and in accordance with typographic rules, you want like text objects or types and groups of text objects such as Titles, labels, tooltips, dialogues, etc. to have the same point sizes.
     
  5. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    258
    We are prototyping games, and there are many text elements, in one prototype in particular (almost all are static in terms of layout). It is a canvas containing many different settings and subsettings with checkboxes, labels, headers, lists and so on, every recttransform slightly different in size. I don't need polished experience for end user, I need to be time efficient and have readable UI that roughly fits its rectransform, deploy playable prototype and move on. However, I did not want to left autosize turned on as it has non negligible effect on performance.

    But what I didn't realize and you pointed out, this is almost never the case for production stage of the game. Still, I think this feature would be nice for faster prototyping, which is a substantial part of game development.
     
    Last edited: Sep 30, 2020