How to get the exact TextDrawSetSize value?
#1

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.
Reply
#2

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]
Reply
#3

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.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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

up
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)