HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How To Center Text

03-26-2007, 08:21 PM#1
thehellman
Anyone know how to center the text. WE Unlimited use to do it, but anyone know another way.

(like in the intros of AotZ or AoM)
03-26-2007, 08:45 PM#2
The)TideHunter(
When using the display text natives, they also take coordinates on the screen.
I'm sure its been posted somewhere which shows you which coordinates go where.
Anyway, if you look at the natives you can see where they go.

Collapse JASS:
native DisplayTimedTextFromPlayer   takes player toPlayer, real x, real y, real duration, string message returns nothing
native DisplayTextToPlayer          takes player toPlayer, real x, real y, string message returns nothing
native DisplayTimedTextToPlayer     takes player toPlayer, real x, real y, real duration, string message returns nothing

See the x and y.
03-26-2007, 08:52 PM#3
thehellman
Thanks I'll do some testing.
06-07-2014, 09:23 PM#4
MasterofSickness
Collapse JASS:
native DisplayTextToPlayer          takes player toPlayer, real x, real y, string message returns nothing

forum search for max values of real x & real y of above function didnt produce any results. as i just wanted to quickly know what the max values are, i will add this info to this thread as it belongs together i think (shouldnt be 'threadomancy' as i dont try to contact any former reply authors), so:
- min of x & y is 0 (bottom left corner)
- to see only the first letter at the top right corner, i had to use 2.4 for x & 1.5 for y
- doesnt matter whether game is in full screen or in window mode
- havent tested whether it depends on screen resolution
06-08-2014, 10:36 AM#5
Anitarf
I remember looking into game messages a long time ago. Here are my results. I used my findings to write a library that could make centred game messages.