[Question] using HEx in textdraw string
#1

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,
Reply
#2

Why not? Example:

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

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

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.
Reply
#5

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

okay thanks,
I think of another way,
Reply
#7

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

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
Reply
#9

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)