SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/04/2012, 07:33 PM   #1
WooTFTW
Huge Clucker
 
WooTFTW's Avatar
 
Join Date: May 2011
Location: = GetPlayerPos(WooTFTW);
Posts: 241
Reputation: 37
Default Need help with TextDrawTextSize | A problem with selectable textdraws.

pawn Code:
cCharacter1[playerid] = CreatePlayerTextDraw(playerid, 547.000000, 170.000000, charName[0]);
                    PlayerTextDrawAlignment(playerid, cCharacter1[playerid], 2);
                    PlayerTextDrawBackgroundColor(playerid, cCharacter1[playerid], 255);
                    PlayerTextDrawFont(playerid, cCharacter1[playerid], 2);
                    PlayerTextDrawLetterSize(playerid, cCharacter1[playerid], 0.220000, 1.200000);
                    PlayerTextDrawColor(playerid, cCharacter1[playerid], -1);
                    PlayerTextDrawSetOutline(playerid, cCharacter1[playerid], 0);
                    PlayerTextDrawSetProportional(playerid, cCharacter1[playerid], 1);
                    PlayerTextDrawSetShadow(playerid, cCharacter1[playerid], 0);

                    PlayerTextDrawSetSelectable(playerid, cCharacter1[playerid], 1);
                    PlayerTextDrawShow(playerid, cCharacter1[playerid]);
                    PlayerTextDrawTextSize(playerid, cCharacter1[playerid], 23.0, 23.0);

I know that the problem is in PlayerTextDrawTextSize, i don't get what coords I should put in there, I have looked at other scripts, which uses the same function, I just don't get how I am supposed to get the coords. When I hover the mouse over this text, it's ok, but if I hover it under the text, it sets the hover color.

Last edited by WooTFTW; 09/04/2012 at 08:13 PM.
WooTFTW is offline   Reply With Quote
Old 09/04/2012, 08:16 PM   #2
Hiddos
High-roller
 
Hiddos's Avatar
 
Join Date: Sep 2008
Posts: 3,304
Reputation: 2184
Default Re: Need help with TextDrawTextSize

Basically, it means how many points to the right/down on the screen from the top-left corner of the textdraw the size of the overlay part is for clickable textdraws.

For example:
pawn Code:
new Text:td = TextDrawCreate(120.0, 24.0, "herro");
TextDrawTextSize(td, 20.0, 80.0);

This means that the textdraw lights up in the area of x(120.0 - 140.0) and y(24.0 - 104.0).
__________________
Quote:
Originally Posted by DeWolf View Post
For fuck's sake people, this whole thread is fucked up now.
Hiddos is offline   Reply With Quote
Old 09/04/2012, 08:30 PM   #3
WooTFTW
Huge Clucker
 
WooTFTW's Avatar
 
Join Date: May 2011
Location: = GetPlayerPos(WooTFTW);
Posts: 241
Reputation: 37
Default Re: Need help with TextDrawTextSize

Quote:
Originally Posted by Hiddos View Post
Basically, it means how many points to the right/down on the screen from the top-left corner of the textdraw the size of the overlay part is for clickable textdraws.

For example:
pawn Code:
new Text:td = TextDrawCreate(120.0, 24.0, "herro");
TextDrawTextSize(td, 20.0, 80.0);

This means that the textdraw lights up in the area of x(120.0 - 140.0) and y(24.0 - 104.0).
Thanks, I'll try to play around with it.
Anyways, it isn't possible to use with boxes with text in it? Because the box uses the info for the box sizes of TextDrawTextSize.
And how do you personally get the coords of x,y?
WooTFTW is offline   Reply With Quote
Old 09/04/2012, 09:47 PM   #4
CyNiC
High-roller
 
Join Date: Jan 2009
Location: Brazil
Posts: 1,420
Reputation: 203
Default Re: Need help with TextDrawTextSize

Use a textdraw text like "_", this way the box textdraw will not be coloured when hover over but will work.
__________________
My scripts
Brazucas'Server
CyNiC is offline   Reply With Quote
Old 09/04/2012, 10:06 PM   #5
WooTFTW
Huge Clucker
 
WooTFTW's Avatar
 
Join Date: May 2011
Location: = GetPlayerPos(WooTFTW);
Posts: 241
Reputation: 37
Default Re: Need help with TextDrawTextSize

Yellow is the hover color.
NOTE: It didn't take screenshot of the cursor, don't know why, render problems? So i drew it myself.

1. The mouse is out of the 'hover zone'.
2. The mouse is in the 'hover zone'.
3. The mouse is under the box and in the box's 'hover zone'
(See attachments.)

Someone, please, help me fix this problem.

The box:
pawn Code:
CharacterButton[playerid] = CreatePlayerTextDraw(playerid, 319.000000, 390.000000, "Spelet ar:~g~ Izvelieties telu");
PlayerTextDrawTextSize(playerid, CharacterButton[playerid], 390.000000, 140.000000);

The names:
pawn Code:
cCharacter1[playerid] = CreatePlayerTextDraw(playerid, 547.000000, 170.000000, charName[0]);
PlayerTextDrawTextSize(playerid, cCharacter1[playerid], 15.0, 15.0);
Attached Images
File Type: jpg sa-mp-017.jpg (151.5 KB, 123 views)
File Type: jpg sa-mp-018.jpg (137.6 KB, 85 views)
File Type: jpg sa-mp-019.jpg (141.3 KB, 85 views)
WooTFTW is offline   Reply With Quote
Old 09/04/2012, 10:49 PM   #6
CyNiC
High-roller
 
Join Date: Jan 2009
Location: Brazil
Posts: 1,420
Reputation: 203
Default Re: Need help with TextDrawTextSize

2. The mouse is in the 'hover zone'.
3. The mouse is under the box and in the box's 'hover zone'


Try to decrease the Y size.
__________________
My scripts
Brazucas'Server
CyNiC is offline   Reply With Quote
Old 10/04/2012, 08:21 AM   #7
WooTFTW
Huge Clucker
 
WooTFTW's Avatar
 
Join Date: May 2011
Location: = GetPlayerPos(WooTFTW);
Posts: 241
Reputation: 37
Default Re: Need help with TextDrawTextSize

Quote:
Originally Posted by CyNiC View Post
2. The mouse is in the 'hover zone'.
3. The mouse is under the box and in the box's 'hover zone'


Try to decrease the Y size.
Thanks, I fixed the Box size, but I don't know how to fix the other textdraw.
EDIT: OMG, I fixed this.
I had PlayerTextDrawTextSize after PlayerTextDrawSetSelectable, it needed to be vice versa!!
WooTFTW 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
TextDrawTextSize Jack Shred Scripting Help 2 09/04/2012 08:38 AM
how get textdrawtextsize? adri1 Scripting Help 1 07/04/2012 05:44 PM


All times are GMT. The time now is 01:12 PM.


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