SA-MP Forums Archive
Selectable TD text area problem - 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: Selectable TD text area problem (/showthread.php?tid=630332)



Selectable TD text area problem - Riwerry - 12.03.2017

Hey guys, I've created two textdraws, one is created as sprite and the second one is simply text, containing one letter "X".

So, I've marked the text textdraw as selectable, when I hover over it with cursor, it's working fine, but when I'm leaving from the text "area" to the right or down, the text still seems, like I have cursor on it (it doesn't change text's color back to white :O)



pawn Code:
test[playerid] = CreatePlayerTextDraw(playerid, 456.000000, 161.000000, "X");
PlayerTextDrawAlignment(playerid, test[playerid], 2);
PlayerTextDrawBackgroundColor(playerid, test[playerid], 255);
PlayerTextDrawFont(playerid, test[playerid], 1);
PlayerTextDrawLetterSize(playerid, test[playerid], 0.390000, 1.100000);
PlayerTextDrawColor(playerid, test[playerid], -1);
PlayerTextDrawSetOutline(playerid, test[playerid], 0);
PlayerTextDrawSetProportional(playerid, test[playerid], 1);
PlayerTextDrawSetShadow(playerid, test[playerid], 0);
PlayerTextDrawSetSelectable(playerid, test[playerid], 1);

test2[playerid] = CreatePlayerTextDraw(playerid, 452.000000, 161.000000, "ld_dual:white");
PlayerTextDrawAlignment(playerid, test2[playerid], 2);
PlayerTextDrawBackgroundColor(playerid, test2[playerid], 255);
PlayerTextDrawFont(playerid, test2[playerid], 4);
PlayerTextDrawLetterSize(playerid, test2[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, test2[playerid], -1238555905);
PlayerTextDrawSetOutline(playerid, test2[playerid], 0);
PlayerTextDrawSetProportional(playerid, test2[playerid], 1);
PlayerTextDrawSetShadow(playerid, test2[playerid], 1);
PlayerTextDrawUseBox(playerid, test2[playerid], 1);
PlayerTextDrawBoxColor(playerid, test2[playerid], 255);
PlayerTextDrawTextSize(playerid, test2[playerid], 17.000000, 11.000000);
PlayerTextDrawSetSelectable(playerid, test2[playerid], 0);
Where's problem? Thank you.


Re: Selectable TD text area problem - TitanX - 12.03.2017

as Vince said

Quote:

Clickable area is defined by TextDrawTextSize. My advice is to create a box behind the items. You can set the color of the box to an invisible one.




Re: Selectable TD text area problem - Riwerry - 13.03.2017

Yeah, but when I did this, selection works fine, but it changes whole box color and want to make black only the 'X' textdraw, not whole box.