• 🏆 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!

Precise Floating Text positioning

Status
Not open for further replies.
Level 9
Joined
Apr 19, 2011
Messages
447
Hi.

I need to create floating texts with very precise positioning. Is there a way to create a floating text centered in a certain region?

I'm doing this:


  • Floating Text - Create floating text that reads TEXT at (Center of PLACE), using font size X, color (X, X, X), and X transparency
But the text is not centered in the PLACE region. Is the left bottom corner of the text what is positioned in the center of PLACE. I need the text to be in the center, not its left bottom corner.

Anyone knows?

Regards
 
Level 9
Joined
Apr 19, 2011
Messages
447
That's what I've been trying all this time, and it's not what I want.
See the attached picture [Cap01]? That's the Region 0000, and I want the text centered in it. So, I do exactly what you told me to do, but I set font size 40.00, the problem is easier to see with that size.
See now the picture [Cap02]? The text is not centered in the region.
I need it to be centered.

Regards
 

Attachments

  • Cap01.jpg
    Cap01.jpg
    822.2 KB · Views: 202
  • Cap02.jpg
    Cap02.jpg
    1 MB · Views: 180
Level 33
Joined
Mar 27, 2008
Messages
8,035
Well then, adjust the text to the left a bit ?
Because initial letter starts from the center, and the rest would go to the right.

Like this;
  • Floating Text - Create floating text that reads blablabla at ((Center of Region 000 <gen>) offset by 100.00 towards 180.00 degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Point With Polar Offset
This will create a Floating Text that will initially start at left-side offset by 100.
Remember leaks and what not to clean it :)
 
Level 9
Joined
Apr 19, 2011
Messages
447
Okay... I already knew how to do that, but I was searching for a general way to do it, not matter the size of the region or the size of the text...

And you could say, "Why? Why don't you just adjust it manually?".
Well, there's a reason: I have to do this for 30 or 40 floating texts.
It will be a pain to adjust them manually one by one.
Besides, there are some of them that change during gameplay, so it could be very helpful if someone could give a way to adjust it directly, no matter the size of the text or the region.

If I had to adjust just one floating text, or two... Of course I would adjust them manually, as you say. However... I just feel too lazy to do that with 30 or 40... Because I'll probably have to test several times until I get the desired effect.

:vw_death:

If what I want doesn't exist... well, I'll have to do it manually. But if there's an easier way, please tell me.

Regards
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
There is a way to do it by setting just 1 variable and other Floating Text creation will follow that variable.
Now since you have used a generic setting for each Floating Text function you have created, eventhough you changed it via variable, you need to change the function to accept variable values, it's the same as 40 times the work.

You should start this initially by using variable, so if you change this variable, all affected Floating Text function will follow the setting of a single variable.

Perhaps, too late for that ?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Let me explain to you by using my own statement in a quote, okay ?
You should start this initially by using variable, so if you change this variable, all affected Floating Text function will follow the setting of a single variable.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Offset = 100.00
      • Set Angle = 180.00
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 000 <gen>) offset by Offset towards Angle degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 001 <gen>) offset by Offset towards Angle degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 002 <gen>) offset by Offset towards Angle degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 003 <gen>) offset by Offset towards Angle degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
As you can see the trigger above, all Floating Text will follow the variable Offset and Angle, and if I change the variable either Offset or Angle or both, with just a change of those 2 variables will affect other Floating Text creation location since initially I used them as a variable.

Compared to;
Now since you have used a generic setting for each Floating Text function you have created, eventhough you changed it via variable, you need to change the function to accept variable values, it's the same as 40 times the work.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 000 <gen>) offset by 100.00 towards 180.00 degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 001 <gen>) offset by 100.00 towards 180.00 degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 002 <gen>) offset by 100.00 towards 180.00 degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads blablabla at ((Center of Region 003 <gen>) offset by 100.00 towards 180.00 degrees) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
This time you used a generic value set by your own for each Floating Text Function, therefore if you want to change every single Floating Text creation location, you would go to every single Floating Text Function and change the 100.00 and 180.00 by yourselves.
If you have 40 of them, it's 40 times the work.

If you did it like what I did in trigger #1, it would save you time since I just use 2 variables to set globally for all Floating Text creation, a simple change of those 2 variables will affect the Floating Text function.

That's why I said, perhaps, it's too late for that to change, you have to repeat the work 40 times. A map maker can't be lazy, truth be told.

And also;
Besides, there are some of them that change during gameplay
A "thing" that changes (not constant) is called as Variable, this is where it comes in handy of using Variable.
So if you want to change it during gameplay, you must save it in a variable. Else, the system can't interpret which data you are referring to (unless it's Last Created Floating Text) but that is limited to 1 reference at a time.
 
Status
Not open for further replies.
Top