SA-MP Forums Archive
Textdraw can not be selected - 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: Textdraw can not be selected (/showthread.php?tid=457847)



OnPlayerClickTextdraw not called - dusk - 13.08.2013

Hello, i was trying to create a selecteable textdraw, when a problem occured: i can not select it. Code for creating it:
pawn Код:
VehArrows[0] = TextDrawCreate(298.000000, 240.000000, "<");
    TextDrawBackgroundColor(VehArrows[0], 255);
    TextDrawFont(VehArrows[0], 1);
    TextDrawLetterSize(VehArrows[0], 0.500000, 1.000000);
    TextDrawColor(VehArrows[0], -1);
    TextDrawSetOutline(VehArrows[0], 0);
    TextDrawSetProportional(VehArrows[0], 1);
    TextDrawSetShadow(VehArrows[0], 1);
    TextDrawUseBox(VehArrows[0], 1);
    TextDrawBoxColor(VehArrows[0], 255);
    TextDrawTextSize(VehArrows[0], 321.0, 10.0);
    TextDrawSetSelectable(VehArrows[0],1);

    VehArrows[1] = TextDrawCreate(322.000000, 240.000000, ">");
    TextDrawBackgroundColor(VehArrows[1], 255);
    TextDrawFont(VehArrows[1], 1);
    TextDrawLetterSize(VehArrows[1], 0.500000, 1.000000);
    TextDrawColor(VehArrows[1], -1);
    TextDrawSetOutline(VehArrows[1], 0);
    TextDrawSetProportional(VehArrows[1], 1);
    TextDrawSetShadow(VehArrows[1], 1);
    TextDrawUseBox(VehArrows[1], 1);
    TextDrawBoxColor(VehArrows[1], 255);
    TextDrawTextSize(VehArrows[1], 338.0, 10.0);
    TextDrawSetSelectable(VehArrows[1],1);
And the code for it to appear..(it's a command):
pawn Код:
SelectTextDraw(playerid,0xFFFFFFFF);
    TextDrawShowForPlayer(playerid,VehArrows[0]);
    TextDrawShowForPlayer(playerid,VehArrows[1]);
    PlayerTextDrawShow(playerid,VehInfo[playerid]);

I will be happy to hear any thoughts on it


Re: Textdraw can not be selected - Grimrandomer - 13.08.2013

Have you tried calling TextDrawShowForPlayer before SelectTextDraw. maybe that will fix it.

What colour is the font normally?


Re: Textdraw can not be selected - dusk - 13.08.2013

Thanks, but it didn't help.

It's white


Re: Textdraw can not be selected - dusk - 14.08.2013

Bump


EDIT: i removed the TextDrawColor function. Now when I hover over the textdraw with my mouse it changes color. But when i press - nothing happens.

EDIT2:I added prints on OnPlayerClickTextDraw callback, they were not printed.

EDIT3: The callback just doesn't get called. I pressed escape, and it didn't even print anything out then...
My code:
pawn Код:
printf("TExtdraw is cliked.");
   
    CancelSelectTextDraw(playerid);
    return 0;



Re: Textdraw can not be selected - dusk - 15.08.2013

bump