[Tutorial] Text draw tips
#48

Quote:
Originally Posted by SpiderWalk
View Post
Anyone have idea how to create Progress bar with textdraw??
Use three textdraws
  • The first is the border
  • The second one would be the whole bar just a bit darker as the real bar
  • And the last would be the real bar
As the original bars from gta-sa (health bar as example) -> IMAGE

The calculation is the easiest thing
pawn Code:
new
    Float: health
;
GetPlayerHealth(playerid, health);
/*
    100 hp = 50 px // 50 is the size of the bar
    health = x px // x would be the calculated size

    x = health * 50 / 100 = health * 0.5 = health / 2
*/

TextDrawTextSize(
    textdraw,
    150.0 + (health / 2), // 150.0 is start position of the textdraw
    3.6
); // TextDrawTextSize doesnt update the textdraw, so we show it again to the player
TextDrawShowForPlayer(playerid, textdraw);
Reply


Messages In This Thread
Text draw tips - by Betamaster - 03.06.2007, 22:55
Re: 'Text draw' tip - by 50p - 04.06.2007, 00:35
Re: 'Text draw' tip - by Betamaster - 04.06.2007, 09:18
Re: Text draw tips - by Dami - 04.06.2007, 18:37
Re: Text draw tips - by 50p - 04.06.2007, 21:01
Re: Text draw tips - by Betamaster - 04.06.2007, 22:21
Re: Text draw tips - by ZET - 05.06.2007, 08:05
Re: Text draw tips - by ZET - 05.06.2007, 09:03
Re: Text draw tips - by Zamaroht - 11.06.2007, 00:00
Re: Text draw tips - by Simon - 11.06.2007, 10:40
Re: Text draw tips - by thisforumlags - 11.06.2007, 19:26
Re: Text draw tips - by Recycler - 11.06.2007, 19:46
Re: Text draw tips - by thisforumlags - 11.06.2007, 21:23
Re: Text draw tips - by CodeMaster - 14.06.2007, 10:24
Re: Text draw tips - by CodeMaster - 14.06.2007, 12:13
Re: Text draw tips - by Betamaster - 14.06.2007, 12:22
Re: Text draw tips - by boylett - 14.06.2007, 19:16
Re: Text draw tips - by Simon - 15.06.2007, 01:07
Re: Text draw tips - by Simbad De Zeeman - 22.06.2007, 14:50
Re: Text draw tips - by C0met - 22.06.2007, 21:44
Re: Text draw tips - by Betamaster - 22.06.2007, 22:42
Re: Betamaster: Text draw tips - by Simbad De Zeeman - 23.06.2007, 11:47
Re: Text draw tips - by Mauzen - 27.06.2007, 20:01
Re: Text draw tips - by Mauzen - 29.06.2007, 12:53
Re: Text draw tips - by michael2572 - 29.06.2007, 18:22
Re: Text draw tips - by boylett - 29.06.2007, 18:51
Re: Text draw tips - by Betamaster - 30.06.2007, 17:46
Re: Text draw tips - by michael2572 - 01.07.2007, 01:06
Re: Text draw tips - by johnathon956 - 16.03.2010, 18:32
Re: Text draw tips - by [Mr]Fred - 09.05.2010, 20:43
Re: Text draw tips - by Warfish - 25.08.2010, 13:52
Re: Text draw tips - by Betamaster - 14.09.2010, 10:26
Re: Text draw tips - by MBX97 - 18.09.2010, 00:40
Re: Text draw tips - by Luka P. - 15.10.2010, 14:12
Re: Text draw tips - by Stefan_Toretto - 11.12.2010, 21:01
Re: Text draw tips - by SkizzoTrick - 11.12.2010, 22:01
Re: Text draw tips - by [aKa]sEnZaTzIE - 12.12.2010, 00:32
Re: Text draw tips - by Warfish - 31.12.2010, 09:37
Re: Text draw tips - by Garciano44 - 27.02.2011, 16:00
Re: Text draw tips - by boyan96 - 11.04.2011, 04:57
Re: Text draw tips - by Intoxicated - 14.08.2011, 09:15
Re: Text draw tips - by ModianO - 14.08.2011, 16:33
Re: Text draw tips - by Shadow_ - 24.02.2012, 14:32
Re: Text draw tips - by T0pAz - 24.02.2012, 15:03
Re: Text draw tips - by Shadow_ - 24.02.2012, 15:14
Re: Text draw tips - by Universal Member - 20.04.2012, 12:28
Re: Text draw tips - by SpiderWalk - 14.05.2012, 12:12
AW: Re: Text draw tips - by Nero_3D - 14.05.2012, 17:02
Re: Text draw tips - by SampLoverNo123 - 10.06.2012, 03:55
Re: Text draw tips - by im - 05.08.2012, 12:45
Re: Text draw tips - by Virus. - 10.11.2012, 12:08
Re: Text draw tips - by Virus. - 11.11.2012, 15:19
Re: Text draw tips - by NoahF - 11.11.2012, 16:22
Respuesta: Re: Text draw tips - by xblade2k10 - 18.01.2013, 22:44
Re: Text draw tips - by qazwsx - 19.07.2013, 15:15

Forum Jump:


Users browsing this thread: 12 Guest(s)