SA-MP Forums Archive
Issue with 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: Issue with selectable textdraw? (/showthread.php?tid=642973)



Issue with selectable textdraw? - Dokins - 10.10.2017

I'm unsure as to why this happens.

When I click the first textdraw it works, but when I select the ones along it seems to highlight them all and work incorrectly, like this.

I've tried changing the TextSize etc as I know it's the area.

PICTURES:
https://imgur.com/a/vb7Ry


Re: Issue with selectable textdraw? - jlalt - 10.10.2017

may you post your create textdraw codes so we can take a deeper look into the issue?


Re: Issue with selectable textdraw? - kAn3 - 10.10.2017

I bet you've used TDE. Happened to me too, I've just used TextSize and it worked, just check if the value you've insered into TextSize are correct


Re: Issue with selectable textdraw? - Dokins - 10.10.2017

I did indeed.

What do you mean?


Re: Issue with selectable textdraw? - kAn3 - 10.10.2017

TDE doesn't give you the TextDrawTextSize lines when you export the project. Add the TextSize for every textdraw and test the values. In my case I created some textdraws used like buttons. I had to use
Код HTML:
TextDrawTextSize(Server[MainTD][2], 90.000000, 90.000000);
before that every textdraw got highlighted


Re: Issue with selectable textdraw? - Dokins - 10.10.2017

All of the selectable textdraws or all of them entirely? Thanks for the info.


Re: Issue with selectable textdraw? - kAn3 - 10.10.2017

All of the selectable tds


Re: Issue with selectable textdraw? - Dokins - 10.10.2017

I've done that and now they aren't clickable at all.
Here's the code for the textdraws.

pawn Код:
QMark[i][0] = TextDrawCreate(214.801742, 194.480072, " ");//?
        TextDrawLetterSize(QMark[i][0], 0.565599, 2.565685);
                TextDrawTextSize(QMark[i][0], 90.000000, 90.000000);
        TextDrawAlignment(QMark[i][0], 1);
        TextDrawColor(QMark[i][0], -1);
        TextDrawSetShadow(QMark[i][0], 0);
        TextDrawSetOutline(QMark[i][0], 0);
        TextDrawBackgroundColor(QMark[i][0], 255);
        TextDrawFont(QMark[i][0], 1);
        TextDrawSetProportional(QMark[i][0], 1);
        TextDrawSetShadow(QMark[i][0], 0);
        TextDrawSetSelectable(QMark[i][0], true);
       
        QMark[i][1] = TextDrawCreate(280.001312, 194.480072, " ");//?
        TextDrawLetterSize(QMark[i][1], 0.565599, 2.565685);
        TextDrawTextSize(QMark[i][1], 90.000000, 90.000000);
        TextDrawAlignment(QMark[i][1], 1);
        TextDrawColor(QMark[i][1], -1);
        TextDrawSetShadow(QMark[i][1], 0);
        TextDrawSetOutline(QMark[i][1], 0);
        TextDrawBackgroundColor(QMark[i][1], 255);
        TextDrawFont(QMark[i][1], 1);
        TextDrawSetProportional(QMark[i][1], 1);
        TextDrawSetShadow(QMark[i][1], 0);
        TextDrawSetSelectable(QMark[i][1], true);
       
        QMark[i][2] = TextDrawCreate(346.800384, 194.480056, " ");//?
        TextDrawLetterSize(QMark[i][2], 0.565599, 2.565685);
        TextDrawTextSize(QMark[i][2], 90.000000, 90.000000);
        TextDrawAlignment(QMark[i][2], 1);
        TextDrawColor(QMark[i][2], -1);
        TextDrawSetShadow(QMark[i][2], 0);
        TextDrawSetOutline(QMark[i][2], 0);
        TextDrawBackgroundColor(QMark[i][2], 255);
        TextDrawFont(QMark[i][2], 1);
        TextDrawSetProportional(QMark[i][2], 1);
        TextDrawSetShadow(QMark[i][2], 0);
        TextDrawSetSelectable(QMark[i][2], true);
       
        QMark[i][3] = TextDrawCreate(411.999938, 193.484497, " "); //"?"
        TextDrawLetterSize(QMark[i][3], 0.565599, 2.565685);
        TextDrawTextSize(QMark[i][3], 90.000000, 90.000000);
        TextDrawAlignment(QMark[i][3], 1);
        TextDrawColor(QMark[i][3], -1);
        TextDrawSetShadow(QMark[i][3], 0);
        TextDrawSetOutline(QMark[i][3], 0);
        TextDrawBackgroundColor(QMark[i][3], 255);
        TextDrawFont(QMark[i][3], 1);
        TextDrawSetProportional(QMark[i][3], 1);
        TextDrawSetShadow(QMark[i][3], 0);
        TextDrawSetSelectable(QMark[i][3], true);
Where I use them and how I do:

pawn Код:
if(AccID[playerid][x] == 0)
{
    TextDrawFont(CharSel[playerid][y], 1); //Setting the font to anything other than 5 makes it not display
    TextDrawSetString(QMark[playerid][x], "?");
    TextDrawShowForPlayer(playerid, QMark[playerid][x]);
    TextDrawSetSelectable(QMark[playerid][x], true);
    TextDrawSetString(CharSel[playerid][n], "Create_Character");
    TextDrawSetString(CharSel[playerid][l], "N/A");
}
else
{
    TextDrawFont(CharSel[playerid][y], 5);
    TextDrawSetPreviewModel(CharSel[playerid][y], AccIDSkin[playerid][x]); //Setting the preview model (skin)
    TextDrawSetPreviewRot(CharSel[playerid][y], 0.000000, 0.000000, 0.000000, 1.000000);
    TextDrawSetString(CharSel[playerid][n], GetSQLName(AccID[playerid][x])); // Set the name under the skin
    format(leve, sizeof(leve), "Level_%d", AccIDLevel[playerid][x]); //Set the level
    TextDrawSetString(CharSel[playerid][l], leve);
    TextDrawSetString(CharSel[playerid][y], " ");
}



Re: Issue with selectable textdraw? - kAn3 - 10.10.2017

Change the 90.000 value to another value. In my case the textdraw was a square box, in your case if it is a rectangle try for example with 20.0000, 80.0000 values and try until you find the right X Y values.


Re: Issue with selectable textdraw? - Dokins - 10.10.2017

It doesn't actually let me click them, that's the issue, surely it would regardless of size?