Alignment Dialog
#1

Hello,
i wrote this code:
pawn Код:
#include <a_samp>

new Text[][] = {//Is not constant text
    "Something",
    "Something else",
    "Other"
};

new Text2[][] = {
    "Yes",
    "No",
    "Yes"
};

public OnPlayerSpawn(playerid)
{
    new string[256];
    for(new i;i<sizeof(Text);i++)
    {
        strcat(string,Text[i]);
        if(strlen(Text[i]) < 4) strcat(string,"\t");
        if(strlen(Text[i]) < 8) strcat(string,"\t");
        if(strlen(Text[i]) < 12) strcat(string,"\t");
        if(strlen(Text[i]) < 16) strcat(string,"\t");
        strcat(string,Text2[i]);
        strcat(string,"\n");
    }
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Caption",string,"OK","Cancel");
    return 1;
}
dialog looks like this:

But I need to look like this:

how to do it using tabs?
Reply
#2

The font is not monospaced, so you can't base tabulation on the number of characters, as different characters are different widths.

For example, 10 chars:

WWWWWWWWWW
llllllllll

Very obvious to see. The second line will need more tabs.

I can't think of any way you can resolve this. I've had this problem before.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)