SA-MP Forums Archive
Cant click on selectable textdraw. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cant click on selectable textdraw. (/showthread.php?tid=444616)



Cant click on selectable textdraw. - BaubaS - 17.06.2013

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.


Re: Cant click on selectable textdraw. - Pottus - 17.06.2013

Not enough code man.


Re: Cant click on selectable textdraw. - BaubaS - 18.06.2013

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);
}



Re: Cant click on selectable textdraw. - Dragonsaurus - 18.06.2013

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);
}



Re: Cant click on selectable textdraw. - Pottus - 18.06.2013

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);


Re: Cant click on selectable textdraw. - BaubaS - 18.06.2013

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?


Re: Cant click on selectable textdraw. - Alternative112 - 18.06.2013

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!


Respuesta: Cant click on selectable textdraw. - Spreadhaz - 24.10.2014

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