Using makros with inline Textdrawcolors?
#1

Ahoy guys


Thats what i have

Код:
#define FIRST_TEAM_COLOR_TAG "{610D96}VIOLET"

format(astring,sizeof(astring),"Team: "#FIRST_TEAM_COLOR_TAG);
PlayerTextDrawSetString(playerid, TeamText[playerid], astring);
PlayerTextDrawShow(playerid,TeamText[playerid]);
Ingame it looks like: Team: ? 610D96 VIOLET (without any color)

If i do it this way

Код:
format(astring,sizeof(astring),"Team: {610D96}VIOLET ");
PlayerTextDrawSetString(playerid, TeamText[playerid], astring);
PlayerTextDrawShow(playerid,TeamText[playerid]);
Its fine.
How can i fix my first part to get the same result like in the second, working part?
Reply
#2

When defining you have to use hexadecimal colors (the ones that start with 0x)
Reply
#3

Test without the VIOLET in it:

PHP код:
#define FIRST_TEAM_COLOR_TAG "{610D96}"
format(astring,sizeof(astring),"Team: "#FIRST_TEAM_COLOR_TAG" VIOLET"); 
Reply
#4

Textdraw doesn't actually support embedded colors. You're limited to the default colors than can be achieved with ~r~, ~g~, ~b~ etc. You can use TextDrawColor but then it will change the color of the entire string. There's no way to have it start somewhere in the middle.
Reply
#5

I was going to EDIT my thing and say what Vince said, but then I gave a second look to OP post and saw this

Quote:
Originally Posted by faxxe
Посмотреть сообщение
If i do it this way

Код:
format(astring,sizeof(astring),"Team: {610D96}VIOLET ");
PlayerTextDrawSetString(playerid, TeamText[playerid], astring);
PlayerTextDrawShow(playerid,TeamText[playerid]);
Its fine.
How can i fix my first part to get the same result like in the second, working part?
Which got me confused.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)