Center my textdraw
#1

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);
Reply
#2

One solution could be,showing '1' as '001' etc which you could do by formatting the text as %03d
Reply
#3

Other?
Reply
#4

Well,try formatting it to %3d which might give '1' as ' 1'.
Reply
#5

Yeeah
Reply
#6

How about if you align the textdraw to the right instead left

https://sampwiki.blast.hk/wiki/PlayerTextDrawAlignment
Reply
#7

change PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);

to

PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 2);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)