Center TextDraw - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Center TextDraw (
/showthread.php?tid=368305)
Center TextDraw -
GXLZPGX - 12.08.2012
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.
Re: Center TextDraw -
FalconX - 12.08.2012
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
Re: Center TextDraw -
GXLZPGX - 12.08.2012
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!