SA-MP Forums Archive
Making an XP bar with PlayerTextdraws - Issue with resizing? - 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: Making an XP bar with PlayerTextdraws - Issue with resizing? (/showthread.php?tid=642083)



Making an XP bar with PlayerTextdraws - Issue with resizing? - Pizzy - 24.09.2017

I am trying to make an XP bar which increases in size once XP is received, textdraws create successfully, but I can't seem to update the size of it for some reason.

Код:
	Player_XPBar[playerid][1] = CreatePlayerTextDraw(playerid, 500.666870, 104.548019, "_");
	PlayerTextDrawLetterSize(playerid, Player_XPBar[playerid][1], 0.370666, 0.285037);
	PlayerTextDrawTextSize(playerid, Player_XPBar[playerid][1], 500.000000, 0.000000); //Was: 605.00
	PlayerTextDrawAlignment(playerid, Player_XPBar[playerid][1], 1);
	PlayerTextDrawColor(playerid, Player_XPBar[playerid][1], -10158081);
	PlayerTextDrawUseBox(playerid, Player_XPBar[playerid][1], 1);
	PlayerTextDrawBoxColor(playerid, Player_XPBar[playerid][1], 10354943);
	PlayerTextDrawSetShadow(playerid, Player_XPBar[playerid][1], 0);
	PlayerTextDrawSetOutline(playerid, Player_XPBar[playerid][1], 0);
	PlayerTextDrawBackgroundColor(playerid, Player_XPBar[playerid][1], 16711935);
	PlayerTextDrawFont(playerid, Player_XPBar[playerid][1], 1);
	PlayerTextDrawSetProportional(playerid, Player_XPBar[playerid][1], 1);
	PlayerTextDrawSetShadow(playerid, Player_XPBar[playerid][1], 0);
This is my working playertextdraw code which creates it.

I then go to update the textdraw the textdraw a few seconds later with this code:

Код:
PlayerTextDrawTextSize(playerid, Player_XPBar[playerid][1], 550.000000, 0.000000);
But this does not change the textdraw at all.

If I edit the first 'PlayerTextDrawTextSize' - when the textdraws are created, the size changes accordingly.

But updating it with this, does nothing.


Do I need to delete player textdraws to update the size? Haven't really used playertextdraws before so would appreciate a little help on this!

Thanks


Re: Making an XP bar with PlayerTextdraws - Issue with resizing? - Dello - 24.09.2017

Is not better use a Progressbar?


Re: Making an XP bar with PlayerTextdraws - Issue with resizing? - RxErT - 24.09.2017

Yep progress bar will solve your problem,

https://github.com/Southclaws/progress2


Re: Making an XP bar with PlayerTextdraws - Issue with resizing? - jlalt - 24.09.2017

Not sure but you may need to reshow the text after changing its size.

so after using PlayerTextDrawTextSize use PlayerTextDrawShow again.