Center my 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 my textdraw (
/showthread.php?tid=545642)
Center my textdraw -
Baltimore - 09.11.2014
Hello!
I have a textdraw for vehicles that shows speed.
When the speed is below 10 everything is good.
When it exceeds 10 and that it is below 100 km / h it shifts to the right, and when it exceeds 100, it is shifted further to the right.
How to focus my textdraw it does not shift right every time
++
pawn Код:
Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 587.994506, 357.583343, "0"); // km/h
PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw2[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw2[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw2[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);
Re: Center my textdraw -
DavidBilla - 09.11.2014
One solution could be,showing '1' as '001' etc which you could do by formatting the text as %03d
Re: Center my textdraw -
Baltimore - 09.11.2014
Other?
Re: Center my textdraw -
DavidBilla - 09.11.2014
Well,try formatting it to %3d which might give '1' as ' 1'.
Re: Center my textdraw -
Lorruan - 09.11.2014
Yeeah
AW: Center my textdraw -
Nero_3D - 09.11.2014
How about if you align the textdraw to the right instead left
https://sampwiki.blast.hk/wiki/PlayerTextDrawAlignment
Re: Center my textdraw -
tommzy09 - 10.11.2014
change PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
to
PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 2);