SA-MP Forums Archive
How to get the exact TextDrawSetSize value? - 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: How to get the exact TextDrawSetSize value? (/showthread.php?tid=438745)



How to get the exact TextDrawSetSize value? - BaubaS - 21.05.2013

Hello. I dont think that Im the only person that need helps at getting correct value of TextDrawSetSize when using clickable textdraws. I have tried using iTD, Zamaroth's textdraw editor and it just doesnt work. Either it highlights all the selections when you try to press on one or sometimes you can't even press on any of the selections buttons.

Thanks in advance, really.


Re: How to get the exact TextDrawSetSize value? - Joe Staff - 21.05.2013

Well that depends on the technique you're using. I personally like to place a rectangular textdraw as my button and then lay text, or whatever, on top of it. There is a much more easy way to get exact sizes, by using a GTA sprite that's literally just a white square, you can make perfect boxes.

CODE:
pawn Код:
stock PlayerText:TDCreateBox(playerid,Float:x,Float:y,Float:width,Float:height,color)
{
    new PlayerText:t;
    t=CreatePlayerTextDraw(playerid,x,y,"ld_spac:white");
    PlayerTextDrawFont(playerid,t,4);
    PlayerTextDrawTextSize(playerid,t,width,height);
    PlayerTextDrawColor(playerid,t,color);
    return t;
}
Example:
[ame]http://www.youtube.com/watch?v=xukiEmEn2HI[/ame]


Re: How to get the exact TextDrawSetSize value? - BaubaS - 21.05.2013

Thank you for trying to help, but I dont think that this will fix that I want to (thats because I have explained it badly :3). The problem is not on the box, the problem is on the selection button, well for example there are 3 buttons

Quote:

Login
Register
Quit

The selection color for example is red. So when you set your mouse at login, not only the login but also register and quit buttons gets red. Like in the video, when you would set your mouse at Login it would also highlight Create and Quit. If you really dont understand what do I want to say, I could take some pics tommorow.


Re: How to get the exact TextDrawSetSize value? - Joe Staff - 21.05.2013

That's happening because of your 'TextDrawSetTextSize'. It follows the same rules as the GTA sprites do in that TextDrawSetTextSize is setting the Width and Height of the selectable TextDraw.

Example:
TextDrawSetTextSize(loltext,50.0,50.0);
Will generate a selectable area that's 50 by 50 from the TextDraw's origin point.


Re: How to get the exact TextDrawSetSize value? - BaubaS - 21.05.2013

Oops, I've made a mistake with a function name Okay, I think I've got it, I'll try to make something tommorow. Thank you again.


Re: How to get the exact TextDrawSetSize value? - BaubaS - 24.05.2013

Still, doesnt work.. Tried many ways : > Any tips?


Re: How to get the exact TextDrawSetSize value? - BaubaS - 24.05.2013

up