Clickable textdraw 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: Clickable textdraw problem. (
/showthread.php?tid=582052)
Clickable textdraw problem. -
alanhutch - 17.07.2015
Hi.
I have this textdraw
pawn Код:
Textdrawinserirecarta7 = TextDrawCreate(254.095336, 314.026611, "Inserire la carta di credito.");
TextDrawLetterSize(Textdrawinserirecarta7, 0.259142, 1.254400);
TextDrawTextSize(Textdrawinserirecarta7, 378.285797, -42.239997);
TextDrawAlignment(Textdrawinserirecarta7, 1);
TextDrawColor(Textdrawinserirecarta7, -1);
TextDrawUseBox(Textdrawinserirecarta7, true);
TextDrawBoxColor(Textdrawinserirecarta7, 255);
TextDrawSetShadow(Textdrawinserirecarta7, 0);
TextDrawSetOutline(Textdrawinserirecarta7, 1);
TextDrawBackgroundColor(Textdrawinserirecarta7, 51);
TextDrawFont(Textdrawinserirecarta7, 1);
TextDrawSetProportional(Textdrawinserirecarta7, 1);
TextDrawSetSelectable(Textdrawinserirecarta7, true);
But when I do the SelectTextDraw, it's not selectable.
What can I do?
Re: Clickable textdraw problem. -
Jstylezzz - 17.07.2015
Only thing I can think of right now, did you keep this warning in mind?
Quote:
Originally Posted by SA-MP Wiki
TextDrawSetSelectable must be used BEFORE the textdraw is shown to players for it to be selectable.
|
Rest of the code look good as far as I can see. I also had a problem that multiple textdraws got selected after hovering over them, it ended up to be because I didn't set the box size or something, maybe someone else can elaborate on that..
EDIT: Yes, exactly that what the 2 replies below me said. That was the same solution I had to use when I had problems
AW: Clickable textdraw problem. -
Nero_3D - 17.07.2015
Your Text Size is negative! Also read that to convert the letter size to text size
https://sampwiki.blast.hk/wiki/TextDrawLetterSize
TextSize Y ~ LetterSize Y / 0.135 to fit the box for ONE LINE
The selectable box isn't the visible box!, the selectable box only uses Text Size
Re : Clickable textdraw problem. -
KillerDVX - 17.07.2015
TextDrawTextSize(Textdrawinserirecarta7, 378.285797, -42.239997);
The "Y" is negative, try changing it to 10 - 20. It's fine.
Re: Clickable textdraw problem. -
alanhutch - 18.07.2015
Thank you Nero_3D and KillerDVX, now it works.