View Full Version : Textdraw Selection

19/05/2012, 08:59 PM
I've looked over my code several times and I can't find a reason as to why I can't select this textdraw. It doesn't turn yellow when I put my mouse over it but the 'close' button under it works.

gPhoneEnterNum[2] = TextDrawCreate(533.000000, 362.000000, "1");
TextDrawBackgroundColor(gPhoneEnterNum[2], 255);
TextDrawFont(gPhoneEnterNum[2], 1);
TextDrawLetterSize(gPhoneEnterNum[2], 0.600000, 1.000000);
TextDrawColor(gPhoneEnterNum[2], -1);
TextDrawSetOutline(gPhoneEnterNum[2], 1);
TextDrawSetProportional(gPhoneEnterNum[2], 1);
TextDrawTextSize(gPhoneEnterNum[2], 100.000000, 20.000000);
TextDrawSetSelectable(gPhoneEnterNum[2], 1);

gPhoneMain[11] = TextDrawCreate(571.000000, 421.000000, "~r~close");
TextDrawAlignment(gPhoneMain[11], 2);
TextDrawBackgroundColor(gPhoneMain[11], 255);
TextDrawFont(gPhoneMain[11], 2);
TextDrawLetterSize(gPhoneMain[11], 0.419999, 1.300000);
TextDrawColor(gPhoneMain[11], -1);
TextDrawSetOutline(gPhoneMain[11], 1);
TextDrawSetProportional(gPhoneMain[11], 1);
TextDrawUseBox(gPhoneMain[11], 1);
TextDrawBoxColor(gPhoneMain[11], 53);
TextDrawTextSize(gPhoneMain[11], 15.000000, 86.000000);
TextDrawSetSelectable(gPhoneMain[11], 1);

19/05/2012, 09:02 PM
From this point onwards I refuse to reply to help in this section!, THis shouldn't be in the 0.3e Forum it should be in Normal Scripting discussion. FYI I reported this post.

19/05/2012, 09:04 PM
This is an 0.3e issue.

19/05/2012, 09:29 PM
It isnt a 0.3e issue, it works fine for everyone else please try to use your logic and look again.

19/05/2012, 09:34 PM
If you've actually read my post, you would see that I've already gone through the code several times. Instead of acting like a smartass, how about you attempt to help instead of stating that it's "logic", even when you can't find the issue.

19/05/2012, 09:47 PM
If you cant find the issue you ask for help on Scripting Discussion, I know it isnt a 0.3e issue as i've seen Numerous other servers using it and I have used it in my server without issue.

19/05/2012, 09:54 PM
It only bugs for my number textdraws, not my other ones. Don't post if you aren't gonna try to help.

19/05/2012, 09:55 PM
Once the thread is in the right section, I'll be prepared to help.

19/05/2012, 10:45 PM
IceCube is right. This is for the RC stage of 0.3e, which is over. Post in SCRIPTING DISCUSSION.

20/05/2012, 08:45 AM
From this point onwards I refuse to reply to help in this section!, THis shouldn't be in the 0.3e Forum it should be in Normal Scripting discussion. FYI I reported this post.


Shut up about your 'wrong section' and just help the guy already. Right now you're just being a hypocrite.

OT: The close button does not change colour because of the ~r~ in the textdraw, making it permanent red (You can, however, just get the RGBA code of it and use it in TextDrawColor)

The other button requires a bit more explanation: You need to use TextDrawTextSize with the second parameter as created_x_position + x_offset.

Your code was:
gPhoneEnterNum[2] = TextDrawCreate(533.000000, 362.000000, "1");
TextDrawTextSize(gPhoneEnterNum[2], 100.000000, 20.000000);

It should be:
gPhoneEnterNum[2] = TextDrawCreate(533.000000, 362.000000, "1");
TextDrawTextSize(gPhoneEnterNum[2], 533.0 + 100.0, 20.000000);

Which should work. I do recommend changing the offset (+ 100.0) to something smaller like 17.0 (Which I used in testing it on my localhost, and worked great ;)).

Working with textdraws (and especially selectable ones) is a lot of trial and error work ^^.