selectable textdraws
#4

Looks like SA-MP issue for me.

Code that I've tested:
pawn Code:
#include    <a_samp>

new Text:gTextDraw;

public OnGameModeInit()
{
    gTextDraw = TextDrawCreate(10.000000, 141.000000, "MyTextDraw");
    TextDrawTextSize(gTextDraw,60.000000, 20.000000);
    TextDrawAlignment(gTextDraw,0);
    TextDrawBackgroundColor(gTextDraw,0x000000ff);
    TextDrawFont(gTextDraw,1);
    TextDrawLetterSize(gTextDraw,0.250000, 1.000000);
    TextDrawColor(gTextDraw,0xffffffff);
    TextDrawSetProportional(gTextDraw,1);
    TextDrawSetShadow(gTextDraw,1);
    TextDrawSetSelectable(gTextDraw, 1);
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        TextDrawSetString(gTextDraw, "~r~MyTextDraw");
        TextDrawShowForPlayer(playerid, gTextDraw);
        SelectTextDraw(playerid, 0x00FF00FF);
    }
    return 1;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == gTextDraw)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
    }
    return 1;
}
Image:
http://bankfotek.pl/image/1668935 (I am actually hovering the textdraw there, but mouse has not been captured).

Note:
There are some other issues with ~r~ specifier anyway. Like displaying number '1' after '~r~' won't display the number. That must be SA-MPs issue, try ~h~~r~ and check what happens.
Reply


Messages In This Thread
selectable textdraws - by PawnoQ - 10.02.2014, 15:42
Re: selectable textdraws - by Riddick94 - 10.02.2014, 16:12
Re: selectable textdraws - by PawnoQ - 11.02.2014, 16:03
Re: selectable textdraws - by Riddick94 - 11.02.2014, 20:54
Re: selectable textdraws - by PawnoQ - 11.02.2014, 21:01
Re: selectable textdraws - by Riddick94 - 11.02.2014, 21:04
Re: selectable textdraws - by PawnoQ - 11.02.2014, 21:12
Re: selectable textdraws - by Riddick94 - 11.02.2014, 21:17
Re: selectable textdraws - by PawnoQ - 11.02.2014, 21:24
Re: selectable textdraws - by Riddick94 - 11.02.2014, 21:28
Re: selectable textdraws - by PawnoQ - 11.02.2014, 22:26
Re: selectable textdraws - by Riddick94 - 11.02.2014, 22:33

Forum Jump:


Users browsing this thread: 5 Guest(s)