TextDraw alignment
#1

hi, for my server there's always a little textdraw on the bottom of the screen wich gives you some information...
now, to make it look a bit professional, I would Like to aligne the text and set the alignment to 2
wich must set the TextDraw in the middle of the screen, right?
now, when I try to use the alignment function, it says the middle of the text to the beginning of the text it used to be...
So instead of setting
The beginning of the text to the middle of the text it used to be

it does
The middle of the the text to the beginning of the text it used to be...

Can anyone please explain me how to use this function properly, and make it that there will be an equal space on the right and left side of my screen between the beginnin char and the end char of the TD?
Reply
#2

Hmm, i suggest you to use an In-game Textdraw editor (ps: where you from (in belgium) ?)
Reply
#3

Yes I am : )
but an InGame TD editor, wont work when the td string becomes longer...
Reply
#4

Put one char in the middle of the screen, then use TextDrawAlignment (center) and the letters will spread out from the center in both directons. For instance if you put the test to align to the right; instead of spreading evenly they will just move to the right. I hope this makes it more clear for you.
Reply
#5

Uhm, just a bit
so if I set to the right, I get the effect that my text is in the middle?

EDIT: but I see some servers having a perfectly middle TD even when the string chagnes...
Reply
#6

You need to align to the center. You just have to keep in mind that you may have to insert line breaks depending on the string length. The alignment doesn't control where the textdraw goes, you set the position for that. So if you put one char in the center of the screen with the textdraweditor with alignment to center (use those co-ordinates and change the string). And the text will spread in both directions evenly.
Reply
#7

ah, now I get it!
is there any math calculation to get the middle of the screen chords?
isn't it chordleftunder/chordrightunder*2 ?
Reply
#8

https://sampwiki.blast.hk/wiki/TextDrawAlignment
Reply
#9

Most of the time when i want text centered, just use Aligment and a box.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)