SA-MP Forums Archive
Textdraws problems - 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: Textdraws problems (/showthread.php?tid=528903)



Textdraws problems - fordawinzz - 30.07.2014

I have 3 clickable textdraws, one downside the other. If I try clicking the 3rd textdraw it will 'click me' the 1st, the same happens with the 2nd.

Another problem is the highlighting area. I've tried setting the box and it still won't work okay..


Re: Textdraws problems - jessejanssen - 30.07.2014

You should provide the code where you create the textdraws and the pieces from 'OnPlayerClickTextDraw' where you click these specific textdraws. Further what I can say about the clickable area, play around with TextDrawTextSize.

Best regards,
Jesse


Respuesta: Textdraws problems - FullCircle - 30.07.2014

Change TextDrawAligment to 2 and edit selectable area with TextDrawTextSize


Re: Textdraws problems - fordawinzz - 30.07.2014

FullCircle, that's what I actually did.


Re: Textdraws problems - fordawinzz - 30.07.2014

here is what I'm talking about:


sorry for bumping, I don't know why I couldn't post the picture in the above post, lol

if I click 'leave garage' it will install the component, wtf?


Respuesta: Re: Textdraws problems - FullCircle - 30.07.2014

Quote:
Originally Posted by fordawinzz
Посмотреть сообщение
here is what I'm talking about:


sorry for bumping, I don't know why I couldn't post the picture in the above post, lol

if I click 'leave garage' it will install the component, wtf?
Look if you look at all well in OnPlayerClickTextDraw


Re: Textdraws problems - jessejanssen - 30.07.2014

Quote:
Originally Posted by fordawinzz
Посмотреть сообщение
here is what I'm talking about:


sorry for bumping, I don't know why I couldn't post the picture in the above post, lol

if I click 'leave garage' it will install the component, wtf?
As I said before, show code, without showing code all we can do is guess just like you. It's up to yourself but if you're not providing any code creating a topic like this is useless as you already know about TextDrawTextSize and TextDrawAlignment.

Jesse


Re: Textdraws problems - fordawinzz - 02.08.2014

Here's the code for the textdraws:
pawn Код:
Text_Tuning[3] = TextDrawCreate(571.555664, 376.319885, "buy component(s)");
    TextDrawLetterSize(Text_Tuning[3], 0.226888, 0.858308);
    TextDrawTextSize(Text_Tuning[3], 753.332702, 94.577728);
    TextDrawAlignment(Text_Tuning[3], 2);
    TextDrawColor(Text_Tuning[3], -1);
    TextDrawSetShadow(Text_Tuning[3], 0);
    TextDrawSetOutline(Text_Tuning[3], 1);
    TextDrawBackgroundColor(Text_Tuning[3], 51);
    TextDrawFont(Text_Tuning[3], 2);
    TextDrawUseBox(Text_Tuning[3], true);
    TextDrawBoxColor(Text_Tuning[3], 140);
    TextDrawSetProportional(Text_Tuning[3], 1);
    TextDrawSetSelectable(Text_Tuning[3], true);
   
    Text_Tuning[4] = TextDrawCreate(575.111450, 356.40896, "add component");
    TextDrawLetterSize(Text_Tuning[4], 0.226888, 0.858308);
    TextDrawTextSize(Text_Tuning[4], 284.888275, 102.044441);
    TextDrawAlignment(Text_Tuning[4], 2);
    TextDrawColor(Text_Tuning[4], -1);
    TextDrawSetShadow(Text_Tuning[4], 0);
    TextDrawSetOutline(Text_Tuning[4], 1);
    TextDrawBackgroundColor(Text_Tuning[4], 51);
    TextDrawFont(Text_Tuning[4], 2);
    TextDrawSetProportional(Text_Tuning[4], 1);
    TextDrawUseBox(Text_Tuning[4], true);
    TextDrawBoxColor(Text_Tuning[4], 140);
    TextDrawSetSelectable(Text_Tuning[4], true);
I removed the Leave button because I use a command now.

pawn Код:
public OnPlayerClickTextDraw(playerid, Text: clickedid) {
    if(clickedid == Text_Tuning[3]) { // Buy components
        // code here...
    }
    else if(clickedid == Text_Tuning[4]) { // Add/remove a component
        // more code here ...
    }
    return 1;
}



Re: Textdraws problems - fordawinzz - 09.08.2014

still didn't find any solution ..


Re: Textdraws problems - jessejanssen - 09.08.2014

Код:
TextDrawTextSize(Text_Tuning[4], 284.888275, 102.044441);
TextDrawTextSize(Text_Tuning[3], 753.332702, 94.577728);
These values are way too high, at least, what I can tell from the screenshots the textdraws aren't so big so you should get the right TextDrawTextSize, I use different sizes but actually not one of my clickable textdraws has a TextSize bigger then 39.000000, 335.000000 and that's the very limit I'm using, the average TextSize(s) are ~20.000000, ~35.000000 in my script.

Best regards,
Jesse