• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Question] WordWrap + Centered TextTag

Status
Not open for further replies.
Level 19
Joined
Mar 18, 2012
Messages
1,716
Can someone recommend a snippet which checks for a maximum chars per line
like WordWrap and furthermore centers the texttag to a x/y coordinate.

I need it to display item names in a custom window. Those item names
are generated randomly, hence have random char sizes.

Example:
item 1: Iron Sword
item 2: Mighty Iron Sword of Blood.

While the first name is within the max chars size per line it should be centered,
so it appears in the middle of the custom window box.

The second name is too long and has to be split i.e. "Mighty Iron Sword of" and "Blood". "Blood" will appear one row below "Mighty Iron Sword of",
but both have to be centered to x/y ( middle of the custom window box )

Basically I only need a good snippet which centers texttags as WordWrap will do the rest.
 
Status
Not open for further replies.
Top