SA-MP Forums Archive
Clickable textdraws - 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: Clickable textdraws (/showthread.php?tid=483272)



Clickable textdraws - willsuckformoney - 25.12.2013

I've been struggling with making these textdraws work for a minute now. It's keeping me from progressing into further work. It creates the textdraws but it wont let me select any textdraws. Here's the code, if anyone knows how to fix this.
http://pastebin.com/AkRUCeJ4


Re: Clickable textdraws - Lordzy - 25.12.2013

Looks like you've set the selection before showing up the textdraws. I'm not very sure, but give a try to this :
pawn Код:
CMD:menu(playerid, params[])
{
    if(one[playerid] == 0)
    {
        TextDrawShowForPlayer(playerid,MainBox);
        TextDrawShowForPlayer(playerid,title);
        TextDrawShowForPlayer(playerid,Info);
        TextDrawShowForPlayer(playerid,Divider);
        TextDrawShowForPlayer(playerid,Close);
        for(new i; i < 10; i++)
        {
            TextDrawShowForPlayer(playerid, Item[i]);
        }
        one[playerid] = 1;
                SelectTextDraw(playerid,0x33CCFFAA);
    }
    else
    {
        TextDrawHideForPlayer(playerid,MainBox);
        TextDrawHideForPlayer(playerid,title);
        TextDrawHideForPlayer(playerid,Info);
        TextDrawHideForPlayer(playerid,Divider);
        TextDrawHideForPlayer(playerid,Close);
        for(new i; i < 10; i++)
        {
            TextDrawHideForPlayer(playerid, Item[i]);
        }
        one[playerid] = 0;
        CancelSelectTextDraw(playerid);
    }
    return 1;
}



Re: Clickable textdraws - ikey07 - 25.12.2013

TextDrawTextSize(Item[6], 0.000000, 0.000000);


This parameter sets selectable area of the textdraw, adjust it according to your textdraw size.


Re: Clickable textdraws - willsuckformoney - 25.12.2013

What might I have to set those parameters too?


AW: Clickable textdraws - Nero_3D - 25.12.2013

Its the size of the textdraw box (should be called TextDrawBoxSize)
Just enable the box and change to value to fit the text