SA-MP Forums Archive
Textdraw box - 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: Textdraw box (/showthread.php?tid=421017)



Textdraw box - absolute - 07.03.2013

hey .
im trying to create a textdraw box as a progress bar that shows the player skill by looking at the score...
i'm done but the problem is :
Are there any way to add to the "y" scale for every range of scores?
for example , when the player's score is under 100 the scale of bar be : ▬▬
and when it gets to 100 , the scale of bar be : ▬▬▬▬


Re: Textdraw box - LarzI - 07.03.2013

Isn't that the x-axis?

https://sampwiki.blast.hk/wiki/TextDrawTextSize


Re: Textdraw box - MP2 - 07.03.2013

You need to align the box left, and then use percentages (very easy maths).

If the width is set to 100 then it's fairly obvious - width == the percentage. If the bar is 125 wide, you need to work out what one percent is.

125/100 = 1.25
1.25 for every percent.
If you want it to be half full (50 percent), 50 x 1.25 = 62.5.

Width = full_width / 100 * percentage;


Quote:
Originally Posted by LarzI
Посмотреть сообщение
If a textdraw's alignment is centered the Y axis becomes the X axis.


Re: Textdraw box - LarzI - 07.03.2013

Quote:
Originally Posted by MP2
Посмотреть сообщение
If a textdraw's alignment is centered the Y axis becomes the X axis.
Ah okay.


Re: Textdraw box - absolute - 08.03.2013

thanks so much gonna try it