PDA

View Full Version : Textdraw


Youtube12
25/08/2012, 10:43 PM
Hi Guys,

I need help to make a Textdraw that every letter changes the color of it.

For Example:

http://i45.tinypic.com/2q34q5s.png

Regards Youtube12.

Roko_foko
25/08/2012, 10:48 PM
http://wiki.sa-mp.com/wiki/GameTextStyle#Text_Styles look at the colors on the beggining. What you need to do is put a string like this:" H~b~e~r~l~g~l~y~o" and it will send colored Hello.

Youtube12
26/08/2012, 12:32 PM
Look the video and see what I mean

http://tinypic.com/player.php?v=f2byd&s=6

[MM]RoXoR[FS]
26/08/2012, 01:00 PM
This is quite boring but easy to do

First, create a textdraw variable and another variable which we will need to color specific word.

new Text:Textdraw0;
new Textdraw0_var=0;


Now, UnderOnGameModeInit create TD and a timer
public OnGameModeInit()
{
/*Your Textdraw create code*/
SetTimer("UpdateTextdraw0",500,true);
}

Now, Add this anywhere

forward UpdateTextdraw0();
public UpdateTextdraw0()
{
switch(Textdraw0_var)
{
case 0 : TextDrawSetString(Textdraw0,"~r~H~w~ello");
case 1 : TextDrawSetString(Textdraw0,"~W~H~g~e~w~llo");
case 2 : TextDrawSetString(Textdraw0,"~w~He~b~l~w~lo");
case 3 : TextDrawSetString(Textdraw0,"~w~Hel~y~l~w~o");
case 4 : TextDrawSetString(Textdraw0,"~w~Hell~r~o");
}
if(Textdraw0_var == 4) Textdraw0_var = -1;
++Textdraw0_var;
return 1;
}

Youtube12
26/08/2012, 01:39 PM
Thank you Men ;D

Youtube12
26/08/2012, 02:56 PM
Only 1 problem,

http://i50.tinypic.com/214eart.png

The Size Letter is small

My Code:


SetTimer("UpdateTextdraw2",1000,true);
Textdraw00 = TextDrawCreate(498.0000, 8.0000, "www.test.com");
TextDrawAlignment(Textdraw00,3);
TextDrawAlignment(Textdraw00,3);
TextDrawBackgroundColor(Textdraw00,0x000000ff);
TextDrawBackgroundColor(Textdraw00,0x000000ff);
TextDrawFont(Textdraw00,3);
TextDrawLetterSize(Textdraw00,0.299999,3.399999);
TextDrawFont(Textdraw00,3);
TextDrawLetterSize(Textdraw00,0.199999,3.000000);
TextDrawColor(Textdraw00,0xffffffff);
TextDrawColor(Textdraw00,0xffffffff);
TextDrawSetOutline(Textdraw00,3);
TextDrawSetProportional(Textdraw00,3);
TextDrawSetProportional(Textdraw00,3);
TextDrawSetShadow(Textdraw00,3);
TextDrawSetShadow(Textdraw00,3);

When I change the Letter Size to

TextDrawLetterSize(Textdraw00,3.199999,3.000000);

Nothing happen

Help me pls :D

Regards

Akira297
26/08/2012, 02:57 PM
TextDrawLetterSize(Textdraw00, 0.541100, 1.200000); ~ This is mine. It's medium sized. I edited so you can just put it into your script.

Youtube12
26/08/2012, 03:13 PM
Nothing happend again,
Can u give me your TextDraw Create Code?

Regards

Akira297
26/08/2012, 03:44 PM
Recommending this(Sorry I fell asleep :/ ) : http://bsndesign.webs.com/tde.htm