SA-MP Forums Archive
[Question] using HEx in textdraw string - 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: [Question] using HEx in textdraw string (/showthread.php?tid=329913)



[Help] using HEx in textdraw string - Jonny5 - 30.03.2012

is it possible to use hex in a textdraw string to create different colors?

iv tried with {FF00FF} in the string and it does nothing.

I dont want to use the color codes like "~r~"
I assume its not possible as I have found nothing on it in the wiki or forums,
just wanting someone to confirm this

thanks,


Re: [Question] using HEx in textdraw string - Twisted_Insane - 30.03.2012

Why not? Example:

pawn Код:
Bla = TextDrawCreate(160.0, 240.0, "{FFFFFF}What's {COLOR2} up?")
Is it that what you mean?


Re: [Question] using HEx in textdraw string - ikey07 - 30.03.2012

why cant you use TextDrawColor and set there any color ya wish


Re: [Question] using HEx in textdraw string - Jonny5 - 30.03.2012

yes that didnt work with a PlayerTextDraw using PlayerTextDrawSetString
let me try on a global one.

thxs

edit: to the above post,

I can but if i want to have 2 colors in one td then this wont slove my problem ,

like i want it to be

Health: 100


reedit:

okay that did not work this is what I have

pawn Код:
PlayerStatsTD = TextDrawCreate(10 + 100,125.0,"{00FFFF}S{FFFFFF}t{FF00FF}a{00FFFF}t{FFFFFF}s");
    TextDrawAlignment(PlayerStatsTD,2);
    TextDrawTextSize(PlayerStatsTD,200.0, 200);
    TextDrawSetOutline(PlayerStatsTD,1);
    TextDrawUseBox(PlayerStatsTD,1);
    TextDrawFont(PlayerStatsTD,1);
    TextDrawSetShadow(PlayerStatsTD,0);
    TextDrawBackgroundColor(PlayerStatsTD,0x000000FF);
    TextDrawBoxColor(PlayerStatsTD,0x00000066);
    TextDrawColor(PlayerStatsTD,0xFFFF00FF);
and it is showing the hex code in the textdraw that is displayed on screen.


Re: [Question] using HEx in textdraw string - T0pAz - 30.03.2012

I don't think hex color supports on TextDraw string as they use different method.


Re: [Question] using HEx in textdraw string - Jonny5 - 30.03.2012

okay thanks,
I think of another way,


Re: [Question] using HEx in textdraw string - jotan. - 30.03.2012

You should make 2 textdrawsne what says Health: and one what says 100 in green color


Re: [Question] using HEx in textdraw string - Jonny5 - 30.03.2012

well really i was trying to avoid that as the TD will display more than just Health
and when the health gets to low it will turn red...
but other things that are displayed might not be in green or red, but will be on a newline
so I can go back to hex color and customize them with the inline colors.

I got it working,but without hex colors im just limited to the
~r~~g~~i~~b~ inline colors. and I can set the color of the td in general with a hex.
Ill just plan it out a little better,

thx


Re: [Question] using HEx in textdraw string - MP2 - 30.03.2012

~G~ and ~R~ are ok. If you want a lighter red, use ~R~~H~.


Re: [Question] using HEx in textdraw string - Twisted_Insane - 30.03.2012

Well, if they didn't work, try it like this:

pawn Код:
Bla = TextDrawCreate(160.0, 240.0, " "COLOR1" What's "COLOR2" up?")