SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 03/04/2012, 04:16 PM   #1
CyNiC
High-roller
 
CyNiC's Avatar
 
Join Date: Jan 2009
Location: Brazil
Posts: 1,347
Reputation: 145
Post SelectTextDraw - TextDraws in same line(bug?)

Firstly, I use TextDrawTextSize + TextDrawSetSelectable and each word is one textdraw.

I have a problem with horizontal textdraws(columns), just the first column works, I can't figure out how to make the another columns selectable.

On the first image is alright, my cursor is over the first column.

In this another, my cursor is over the second column.


pawn Code:
for(new col = 0; col < 7; col++)
        {
            for(new i = 0; i < 15; i++)
            {
                HColName[col][i] = CreatePlayerTextDraw(playerid, HColPos[col][0], HColPos[col][1], "/Comando");
                PlayerTextDrawBackgroundColor(playerid, HColName[col][i], 255);
                PlayerTextDrawFont(playerid, HColName[col][i], 2);
                PlayerTextDrawLetterSize(playerid, HColName[col][i], 0.180000, 1.200000);
                PlayerTextDrawColor(playerid, HColName[col][i], -1);
                PlayerTextDrawSetOutline(playerid, HColName[col][i], 0);
                PlayerTextDrawSetProportional(playerid, HColName[col][i], 1);
                PlayerTextDrawSetShadow(playerid, HColName[col][i], 1);
                PlayerTextDrawTextSize(playerid, HColName[col][i], 50.000000, 10.000000);
                PlayerTextDrawSetSelectable(playerid, HColName[col][i], 1);
                PlayerTextDrawShow(playerid, HColName[col][i]);
            }
        }
__________________
since 2006

Online Objects Viewer
My scripts
Revolution is coming!
CyNiC is offline   Reply With Quote
Old 03/04/2012, 04:38 PM   #2
Hiddos
High-roller
 
Hiddos's Avatar
 
Join Date: Sep 2008
Posts: 3,926
Reputation: 1851
Default Re: SelectTextDraw - TextDraws in same line(bug?)

Are they really not selectable or does the color not change when you hover over them? Textdraws not lighting up usually has something to do with (Player)TextDrawTextSize, even though it seems pretty correct.
__________________
Don't PM me.
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 03/04/2012, 04:56 PM   #3
CyNiC
High-roller
 
CyNiC's Avatar
 
Join Date: Jan 2009
Location: Brazil
Posts: 1,347
Reputation: 145
Default Re: SelectTextDraw - TextDraws in same line(bug?)

Is really not selectable, I clicked in everything, just worked for the first one.
pawn Code:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    print("test");
    return 1;
}
__________________
since 2006

Online Objects Viewer
My scripts
Revolution is coming!
CyNiC is offline   Reply With Quote
Old 03/04/2012, 05:21 PM   #4
Psymetrix
Huge Clucker
 
Join Date: Oct 2011
Posts: 302
Reputation: 88
Default Re: SelectTextDraw - TextDraws in same line(bug?)

Try this;
pawn Code:
for(new col = 0; col < 7; col++)
        {
            for(new i = 0; i < 15; i++)
            {
                HColName[col][i] = CreatePlayerTextDraw(playerid, HColPos[col][0], HColPos[col][1], "/Comando");
                PlayerTextDrawBackgroundColor(playerid, HColName[col][i], 255);
                PlayerTextDrawFont(playerid, HColName[col][i], 2);
                PlayerTextDrawLetterSize(playerid, HColName[col][i], 0.180000, 1.200000);
                PlayerTextDrawColor(playerid, HColName[col][i], -1);
                PlayerTextDrawSetOutline(playerid, HColName[col][i], 0);
                PlayerTextDrawSetProportional(playerid, HColName[col][i], 1);
                PlayerTextDrawSetShadow(playerid, HColName[col][i], 1);
                PlayerTextDrawTextSize(playerid, HColName[col][i], HColPos[col][0] + 50.000000, 10.000000);
                PlayerTextDrawSetSelectable(playerid, HColName[col][i], 1);
                PlayerTextDrawShow(playerid, HColName[col][i]);
            }
        }
Using on-screen-keyboard so I can't really explain.

Last edited by Psymetrix; 03/04/2012 at 05:22 PM. Reason: tags
Psymetrix is offline   Reply With Quote
Old 03/04/2012, 05:42 PM   #5
CyNiC
High-roller
 
CyNiC's Avatar
 
Join Date: Jan 2009
Location: Brazil
Posts: 1,347
Reputation: 145
Post Re: SelectTextDraw - TextDraws in same line(bug?)

It works and I already knew, but using large text size the previous columns are highlighted too.

Cursor on the third column:


EDIT:

Now it works perfectly, I remade the calculations, for each column the textsize X was duplicated, thank you, Psymetrix.

pawn Code:
for(new cmdid = 1, col, i, str[10]; cmdid < MAX_COMMANDS; cmdid++)
        {
            format(str, sizeof str, "cmd_%d", cmdid);
            if(dini_Isset("comandos.brz", str))
            {
                if(i) HColName[col][i] = CreatePlayerTextDraw(playerid, HColPos[col][0], HColPos[col][1] + float(i) * 12, dini_Get("comandos.brz", str));
                else HColName[col][i] = CreatePlayerTextDraw(playerid, HColPos[col][0], HColPos[col][1], dini_Get("comandos.brz", str));
                PlayerTextDrawBackgroundColor(playerid, HColName[col][i], 80);
                PlayerTextDrawFont(playerid, HColName[col][i], 2);
                PlayerTextDrawLetterSize(playerid, HColName[col][i], 0.23000, 1.200000);
                PlayerTextDrawColor(playerid, HColName[col][i], -1);
                PlayerTextDrawSetOutline(playerid, HColName[col][i], 1);
                PlayerTextDrawSetProportional(playerid, HColName[col][i], 1);
                PlayerTextDrawTextSize(playerid, HColName[col][i], 70.000000 + float(col) * 70.0, 15.000000);
                PlayerTextDrawSetSelectable(playerid, HColName[col][i], 1);
                PlayerTextDrawShow(playerid, HColName[col][i]);
                i++;
                if(i == 10) col++, i = 0;
                continue;
            }
            break;
        }
__________________
since 2006

Online Objects Viewer
My scripts
Revolution is coming!
CyNiC 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
Textdraw keypad using 0.3e SelectTextDraw! MP2 Screenshots and Videos 19 14/05/2012 05:33 PM
[BUG] SelectTextDraw Lynn Scripting Help 2 02/04/2012 12:24 AM
[Bug] SelectTextDraw Asasi Scripting Help 1 31/03/2012 04:21 PM
[BUG] Selecting textdraws lighting up multiple textdraws Hiddos Scripting Help 3 24/03/2012 02:44 PM
SelectTextDraw issues MP2 Scripting Help 19 21/03/2012 08:07 AM


All times are GMT. The time now is 02:59 AM.


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