Center TextDraw
#1

Is there any possible way to specifically center X and/or Y coordinates?

TextDrawCreate( Float, Float:y, "Whatever I want." )

Because depending on text length, they end up being off center, and it's not exactly enjoyable to go in an out of game testing each X coordinate to see if I got it right.
Reply
#2

Quote:
Originally Posted by GXLZPGX
Посмотреть сообщение
Is there any possible way to specifically center X and/or Y coordinates?

TextDrawCreate( Float, Float:y, "Whatever I want." )

Because depending on text length, they end up being off center, and it's not exactly enjoyable to go in an out of game testing each X coordinate to see if I got it right.
https://sampwiki.blast.hk/wiki/TextDrawAlignment

Yes,

pawn Код:
new Text:MyTextdraw;
 
public OnGameModeInit()
{
    MyTextdraw= TextDrawCreate(320.0, 425.0, "This is an example textdraw");
    TextDrawAlignment(MyTextdraw, 2); // Align the textdraw in the center
    return 1;
}
1-left
2-centered
3-right

You can move it anywhere you want by using Zamaroht's Textdraw Editor:

https://sampforum.blast.hk/showthread.php?tid=117851
Reply
#3

Quote:
Originally Posted by FalconX
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/TextDrawAlignment

Yes,

pawn Код:
new Text:MyTextdraw;
 
public OnGameModeInit()
{
    MyTextdraw= TextDrawCreate(320.0, 425.0, "This is an example textdraw");
    TextDrawAlignment(MyTextdraw, 2); // Align the textdraw in the center
    return 1;
}
1-left
2-centered
3-right
I appreciate that, thanks a ton!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)