Cant click on selectable textdraw.
#1

Hello, I have a problem which I can solve for a month now I think. I tried many other methods to get the textdraw size, result is the same - I cant clink on the textdraw. I use this order:

Create textdraw
Set text size
Set selectable
Show textdraws for player
Make him select textdraw.

Tried manyyyy sizes, but I just cant press on it. For example, there is text "Atsijungti", size is

Quote:

TextDrawTextSize(Textdraw1, 73.125000, 26.250005);

I think its clearly enough as the letter size is even smaller then the default size, but still I cant press on it.
Reply
#2

Not enough code man.
Reply
#3

Oh, okay. ;> Here you go:

pawn Код:
tdLeaveServer = TextDrawCreate(564.375000, 3.499987, "Atsijungti");
TextDrawLetterSize(tdLeaveServer, 0.313122, 1.150832);
TextDrawTextSize(tdLeaveServer, 73.125000, 26.250005);
TextDrawAlignment(tdLeaveServer, 1);
TextDrawColor(tdLeaveServer, -5963521);
TextDrawSetShadow(tdLeaveServer, 0);
TextDrawSetOutline(tdLeaveServer, 1);
TextDrawBackgroundColor(tdLeaveServer, 51);
TextDrawFont(tdLeaveServer, 3);
TextDrawSetProportional(tdLeaveServer, 1);
TextDrawSetSelectable(tdLeaveServer, true);
pawn Код:
CMD:menu(playerid, params[])
{
    TextDrawShowForPlayer(playerid, tdLeaveServer);
   
    SelectTextDraw(playerid, 0xFF0000FF);
   
    SetPlayerPos(playerid, -1191.8755, 402.5694, -4.0130);
    InterpolateCameraPos(playerid, -1388.070800, 762.595275, 68.215957, -1388.070800, 762.595275, 68.215957, 1000);
    InterpolateCameraLookAt(playerid, -1383.098632, 762.138366, 68.478767, -1383.098632, 762.138366, 68.478767, 1000);

    return (true);
}
Reply
#4

I am not completely sure, but try to set:
pawn Код:
TextDrawSetSelectable(tdLeaveServer, true);
Under the command, after TextDrawShowForPlayer(playerid, tdLeaveServer);
So it should look like this:
pawn Код:
CMD:menu(playerid, params[])
{
    TextDrawShowForPlayer(playerid, tdLeaveServer);
    TextDrawSetSelectable(tdLeaveServer, true);
    SelectTextDraw(playerid, 0xFF0000FF);
   
    SetPlayerPos(playerid, -1191.8755, 402.5694, -4.0130);
    InterpolateCameraPos(playerid, -1388.070800, 762.595275, 68.215957, -1388.070800, 762.595275, 68.215957, 1000);
    InterpolateCameraLookAt(playerid, -1383.098632, 762.138366, 68.478767, -1383.098632, 762.138366, 68.478767, 1000);

    return (true);
}
Reply
#5

tdLeaveServer = TextDrawCreate(564.375000, 3.499987, "Atsijungti");
TextDrawLetterSize(tdLeaveServer, 0.313122, 1.150832);
TextDrawTextSize(tdLeaveServer, 73.125000, 26.250005);

TextDrawTextSize is incorrect, it be something like

TextDrawTextSize(tdLeaveServer, 637.125000, 26.250005);
Reply
#6

So the X axis size must be some hundreds? I tried to use Zamaroths's textdraw editor, tried to turn on the box and then get the size of X axis by setting the box all over the text, the size was really big [yeah, more than 300], and as I was searching, Y axis size is always around 10-20, am I right?
Reply
#7

I had this problem yesterday. You need to use SelectTextDraw(playerid, hexColor); just before you send the text draw. Make sure you use CancelSelectTextDraw(playerid); after you are done!
Reply
#8

Have the same problem, code is perfect but nothing happens after click
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)