SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/01/2015, 09:21 AM   #1
Mamal75
Big Clucker
 
Join Date: Sep 2013
Posts: 66
Reputation: 2
Default Is It Possible? Selectable Textdraw Box

hi
as title says is it possible to make a selectable box ?
i'm using iPLEOMAX's TextDraw Editor (iTD)
i don't want use TextDrawSetPreviewModel ... just a normal box.

thank you in advance
Mamal75 is offline   Reply With Quote
Old 30/01/2015, 09:37 AM   #2
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,772
Reputation: 854
Default Re: Is It Possible? Selectable Textdraw Box

Yes, just make a simple textdraw of font ranging 0 to 4 and make it selectable.
TextDrawUseBox(..), also textdraw boxes are responsible for limiting the selection range in 2d screen.
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 30/01/2015, 09:41 AM   #3
Mamal75
Big Clucker
 
Join Date: Sep 2013
Posts: 66
Reputation: 2
Default Re: Is It Possible? Selectable Textdraw Box

i tried this but didn't work... idk what is problem

Last edited by Mamal75; 30/01/2015 at 10:16 AM.
Mamal75 is offline   Reply With Quote
Old 30/01/2015, 10:18 AM   #4
Mamal75
Big Clucker
 
Join Date: Sep 2013
Posts: 66
Reputation: 2
Default Re: Is It Possible? Selectable Textdraw Box

anybody can help me please ?

why i cant select this textdraws ?

pawn Code:
Textdraw0 = TextDrawCreate(181.200012, 120.219993, "usebox");
TextDrawLetterSize(Textdraw0, 0.000000, 14.933710);
TextDrawTextSize(Textdraw0, 33.200000, 0.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, 0);
TextDrawUseBox(Textdraw0, true);
TextDrawBoxColor(Textdraw0, 41215);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawBackgroundColor(Textdraw0, -2139062017);
TextDrawFont(Textdraw0, 1);
TextDrawSetSelectable(Textdraw0, true);

Textdraw1 = TextDrawCreate(384.599548, 122.713256, "usebox");
TextDrawLetterSize(Textdraw1, 0.000000, 14.853706);
TextDrawTextSize(Textdraw1, 237.199951, 0.000000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, 0);
TextDrawUseBox(Textdraw1, true);
TextDrawBoxColor(Textdraw1, -5963521);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 0);
TextDrawFont(Textdraw1, 1);
TextDrawSetSelectable(Textdraw1, true);

when i click on boxes, nothing happen

pawn Code:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
   if(clickedid == Textdraw0) SendClientMessage(playerid, -1, "TD0!");
   else if(clickedid == Textdraw1) SendClientMessage(playerid, -1, "TD1!");
   else if(_:clickedid == INVALID_TEXT_DRAW)
   {
    SelectTextDraw(playerid, 0xFF0000FF);
    SendClientMessage(playerid, -1, "Don't Cancel Selection!");
   }
   return 1;
}
Mamal75 is offline   Reply With Quote
Old 30/01/2015, 10:42 AM   #5
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,079
Reputation: 2655
Default Re: Is It Possible? Selectable Textdraw Box

Did you read the wiki? Specifically the note? TextDrawTextSize values must not be 0. You will have to guess the height of the box (or take a screenshot, resize it to 640x480 and then measure it with the ruler tool in Photoshop).
__________________
Vince is offline   Reply With Quote
Old 30/01/2015, 02:38 PM   #6
Mamal75
Big Clucker
 
Join Date: Sep 2013
Posts: 66
Reputation: 2
Default Re: Is It Possible? Selectable Textdraw Box

Quote:
Originally Posted by Vince View Post
Did you read the wiki? Specifically the note? TextDrawTextSize values must not be 0. You will have to guess the height of the box (or take a screenshot, resize it to 640x480 and then measure it with the ruler tool in Photoshop).
Thank you so much Vince
Can i ask you for a help ?

Can you please explain me HOW TextdrawTextSize works ?

I mean what is X and Y parameters ?

Y is height of selectable area ?

I repped you for your help
Thank you in advance
Mamal75 is offline   Reply With Quote
Old 30/01/2015, 02:42 PM   #7
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,079
Reputation: 2655
Default Re: Is It Possible? Selectable Textdraw Box

Quote:
Originally Posted by Mamal75 View Post
Thank you so much Vince
I mean what is X and Y parameters ?

Y is height of selectable area ?
Yes, Y is height. The height of the box is normally automatically calculated from the text it contains (TextDrawLetterSize plus the amount of lines) unless TextDrawTextSize is used.
__________________
Vince is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] textdraw selectable color Luca12 Scripting Help 2 29/09/2014 10:34 AM


All times are GMT. The time now is 09:09 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.