Clickable textdraws.
#1

Hey everyone,
When i created the TD, and make him a clickable, it's not work.

Код:
	GLOBAL_TD[14] = TextDrawCreate(550.000000, 136.000000, "YES");
	TextDrawBackgroundColor(GLOBAL_TD[14], 255);
	TextDrawFont(GLOBAL_TD[14], 3);
	TextDrawLetterSize(GLOBAL_TD[14], 0.340000, 1.300000);
	TextDrawColor(GLOBAL_TD[14], 65535);
	TextDrawSetOutline(GLOBAL_TD[14], 0);
	TextDrawSetProportional(GLOBAL_TD[14], 0);
	TextDrawSetShadow(GLOBAL_TD[14], 1);
	TextDrawSetSelectable(GLOBAL_TD[14], true);

	GLOBAL_TD[15] = TextDrawCreate(589.000000, 136.000000, "NO");
	TextDrawBackgroundColor(GLOBAL_TD[15], 255);
	TextDrawFont(GLOBAL_TD[15], 3);
	TextDrawLetterSize(GLOBAL_TD[15], 0.340000, 1.300000);
	TextDrawColor(GLOBAL_TD[15], -16776961);
	TextDrawSetOutline(GLOBAL_TD[15], 0);
	TextDrawSetProportional(GLOBAL_TD[15], 0);
	TextDrawSetShadow(GLOBAL_TD[15], 1);
	TextDrawSetSelectable(GLOBAL_TD[15], true);
I make a little search, and i saw that i need to make TextDrawTextSize, but i don't know the coordinates.
Thanks for helping.
Reply
#2

UP! Please,
I Think i got a problem with TextDrawTextSize.

Код:
	GLOBAL_TD[14] = TextDrawCreate(550.000000, 136.000000, "YES");
	TextDrawBackgroundColor(GLOBAL_TD[14], 255);
	TextDrawFont(GLOBAL_TD[14], 3);
	TextDrawLetterSize(GLOBAL_TD[14], 0.340000, 1.299999);
	TextDrawColor(GLOBAL_TD[14], 65535);
	TextDrawSetOutline(GLOBAL_TD[14], 0);
	TextDrawSetProportional(GLOBAL_TD[14], 0);
	TextDrawSetShadow(GLOBAL_TD[14], 1);
	TextDrawUseBox(GLOBAL_TD[14], 1);
	TextDrawBoxColor(GLOBAL_TD[14], 0);
	TextDrawTextSize(GLOBAL_TD[14], 570.000000, 0.000000);
	TextDrawAlignment(GLOBAL_TD[14], 0);
	TextDrawSetSelectable(Text:GLOBAL_TD[14], true);

	GLOBAL_TD[15] = TextDrawCreate(589.000000, 136.000000, "NO");
	TextDrawBackgroundColor(GLOBAL_TD[15], 255);
	TextDrawFont(GLOBAL_TD[15], 3);
	TextDrawLetterSize(GLOBAL_TD[15], 0.340000, 1.299999);
	TextDrawColor(GLOBAL_TD[15], -16776961);
	TextDrawSetOutline(GLOBAL_TD[15], 0);
	TextDrawSetProportional(GLOBAL_TD[15], 0);
	TextDrawSetShadow(GLOBAL_TD[15], 1);
	TextDrawUseBox(GLOBAL_TD[15], 1);
	TextDrawBoxColor(GLOBAL_TD[15], 0);
	TextDrawTextSize(GLOBAL_TD[15], 602.000000, 0.000000);
	TextDrawAlignment(GLOBAL_TD[15], 0);
	TextDrawSetSelectable(Text:GLOBAL_TD[15], true);
I did this, but it still doesn't work. It's not able to click.
Reply
#3

UP..
Reply
#4

TextDrawSetSelectable is key here. You need to use that on the textdraws you want to be able to select.
pawn Код:
TextDrawSetSelectable(Text:i, 1);
The first parameter is the id of the textdraw and the second is the set value so 1 or 0.
Reply
#5

Quote:
Originally Posted by Madd92
Посмотреть сообщение
TextDrawSetSelectable is key here. You need to use that on the textdraws you want to be able to select.
pawn Код:
TextDrawSetSelectable(Text:i, 1);
The first parameter is the id of the textdraw and the second is the set value so 1 or 0.
I already did this.
Код:
TextDrawSetSelectable(Text:GLOBAL_TD[15], true);
Reply
#6

UP..
Reply
#7

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == GLOBAL_TD[15])
    {
         //your functions
         CancelSelectTextDraw(playerid);
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by xConnor
Посмотреть сообщение
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == GLOBAL_TD[15])
    {
         //your functions
         CancelSelectTextDraw(playerid);
    }
    return 1;
}
WTF? i telling you i cannot to click on the TD, so you send me this code?!
Read again my FIRST message.
Reply
#9

I'm always using player textdraw for clickable textdraws.

In your case I think you don't need that Text:

Код:
TextDrawSetSelectable(GLOBAL_TD[14], 1);
This is how i'm creating them

Код:
Name[playerid] = CreatePlayerTextDraw(playerid, 550.000000, 136.000000, "YES");
PlayerTextDrawSetSelectable(playerid, Name[playerid], 1);
Reply
#10

Quote:
Originally Posted by edzis84
Посмотреть сообщение
I'm always using player textdraw for clickable textdraws.

In your case I think you don't need that Text:

Код:
TextDrawSetSelectable(GLOBAL_TD[14], 1);
This is how i'm creating them

Код:
Name[playerid] = CreatePlayerTextDraw(playerid, 550.000000, 136.000000, "YES");
PlayerTextDrawSetSelectable(playerid, Name[playerid], 1);
Thanks for the trying, but it isn't helping me. I need help in my case.
I'm sure in 100 precent that the problem is:
Код:
TextDrawTextSize(GLOBAL_TD[15], 602.000000, 0.000000);
I dont know which X&Y to write.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)