SelectTextDraw - TextDraws in same line(bug?)
#1

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 Код:
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]);
            }
        }
Reply
#2

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

Is really not selectable, I clicked in everything, just worked for the first one.
pawn Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    print("test");
    return 1;
}
Reply
#4

Try this;
pawn Код:
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.
Reply
#5

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 Код:
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;
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)