• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[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.
Back
Top