Clickable textdraw doesnt work...
#1

can't click textdraw...

pawn Код:
[B]OnGamemode:[/B]


Textdraw12 = TextDrawCreate(194.400054, 404.693237, "-->");
    TextDrawLetterSize(Textdraw12, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw12, 1);
    TextDrawColor(Textdraw12, 255);
    TextDrawSetShadow(Textdraw12, 0);
    TextDrawSetOutline(Textdraw12, 1);
    TextDrawBackgroundColor(Textdraw12, 51);
    TextDrawFont(Textdraw12, 3);
    TextDrawSetProportional(Textdraw12, 1);
    TextDrawSetSelectable(Textdraw12, true);
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        TextDrawShowForPlayer(playerid, Textdraw12);
        SelectTextDraw(playerid, 0xFF4040AA);
    }
    return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Textdraw12)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
    }

    return 1;
}
Reply
#2

Most common error with clickable textdraw is.....

TextDrawSetTextSize() which you are missing.

Now the values might be slightly confusing the X indicates the start position of the clickable area on the X-axis the Y-Position indicates the height of the clickable area not the position.
Reply
#3

Hmmh I used iPLEOMAXs TextDraw Editor fs.. idk which one to use then... I want to make everything run as good as possible.. Just I dont know where to get those x y coords..

Btw isn't it TextDrawLetterSize? the same?
Reply
#4

No it's not... Just set the X coord to that of your create position then y to the height you want of the clickable areas.

Side note: I won't use that textdraw editor because of this TextDrawCreate(194.400054, 404.693237, "-->");
You want to use whole values otherwise you'll have troubles with different resolutions when you got a bunch of TD's.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)