The general thing I want to do is optimize the text in my widgets for localizations.
In particular I want to scale text of any length appropriately into a button image.
I can calculate the “Wrap Text At” size easily, but when using a scale box, it doesn’t scale the “Wrap Text At” size with it.
So my thoughts were:
I. Can I access the scale of the scale box in BP? Then I could set the “Wrap Text At” value more accurately
II. Can I somehow get the number of rows my wrapped text is at? X scaling works fine, but not Y. I figured a more or less accurate heuristic: (Initial Wrap Size) * #Rows = Wrap Text At Size
Can someone answer any of the above questions or has a different approach to this problem? Highly appreciate if you could share your thoughts!
Thanks for your reply. Yes I was using “Down Only” as well, good hint!
Could you elaborate on point 1 a little bit please?
My classic example is the following:
I have a description widget with header and text body that appears when examining an object in the world. I usually like the widget to be of fixed size (i.e. dependent on screen resolution and not on text content). The english header would be “heater” (6 chars), translating to italian “riscaldamento” (13 chars). Same goes for simple buttons: english: “End” (3 chars), german: “Beenden” (7 chars).
I recently discovered the node “Wrapped Text Size” which could be very handy in determining the x-length of a given text and setting rules for that.
Since writing this post, I feel more confident in C++, so would you mind sharing your insights?
In combination with the node “Wrapped Text Size”, I can calculate the scale needed to fit the text inside the buttons / text fields, thats a solid plan!
Actually I was thinking of the scale that the box decided to scale my text at currently which automatically changes whenever I change the text. I need to examine the source code of the scale box to see what kind of math it is doing and maybe manipulate it there