Textdraws Returns
#1

How To Make It Like That If Player Is Seeing 1 Textdraw The Other Goes Automatically Down Of It Not On Top Of It ~n~?
Reply
#2

Anyone?
Reply
#3

I do not understand what you are looking for.
Reply
#4

Can you say again in more detail?
You mean when there is a text draw showing you want another one to hide?
Reply
#5

No. I Mean If One Textdraw Is Show At 1 Pos. The Other One Goes Down Of It. Not On The Same Pos So It Won't Mix Up.
Reply
#6

Anyone Who Can Help Me?
Reply
#7

You mean same like chatbox is working? I have no idea, I would like to know as well
Reply
#8

you could destroy and recreate a little more down

but thats mostly not needed

just create the textdraws at different positions

and set the data to the correct one, move the data to the next lower one if the first is needed


Here a little example

First we create our textdraws
pawn Код:
new Text: TextDraw[3];

//OnGameModeInit
    for(new i, Float: offset = 0.0; i != sizeof TextDraw; ++i, offset += 10.0) {
        TextDraw[i] = TextDrawCreate(30.0, 50.0 + offset, "_");
    }
Second we write a function which puts the new data always in the first one
pawn Код:
stock TextDrawSetData(string[]) {
    enum E_TextdrawData {
        tText[256] //only 256 because over that you cant use ~r~, ...
    }
    static TextDrawData[sizeof TextDraw][E_TextdrawData];

    if(string[0] != EOS) {
        new i = sizeof TextDraw;
        while(--i != 0) {
            TextDrawData[i][tText] = TextDrawData[i - 1][tText];
            TextDrawSetString(TextDraw[i], TextDrawData[i][tText]);
        }
        TextDrawData[0][tText][0] = EOS;
        TextDrawSetString(TextDraw[0], string);
        strcat(TextDrawData[0][tText], string, 256);
    }
}
Reply
#9

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
you could destroy and recreate a little more down

but thats mostly not needed

just create the textdraws at different positions

and set the data to the correct one, move the data to the next lower one if the first is needed


Here a little example

First we create our textdraws
pawn Код:
new Text: TextDraw[3];

//OnGameModeInit
    for(new i, Float: offset = 0.0; i != sizeof TextDraw; ++i, offset += 10.0) {
        TextDraw[i] = TextDrawCreate(30.0, 50.0 + offset, "_");
    }
Second we write a function which puts the new data always in the first one
pawn Код:
stock TextDrawSetData(string[]) {
    enum E_TextdrawData {
        tText[256] //only 256 because over that you cant use ~r~, ...
    }
    static TextDrawData[sizeof TextDraw][E_TextdrawData];

    if(string[0] != EOS) {
        new i = sizeof TextDraw;
        while(--i != 0) {
            TextDrawData[i][tText] = TextDrawData[i - 1][tText];
            TextDrawSetString(TextDraw[i], TextDrawData[i][tText]);
        }
        TextDrawData[0][tText][0] = EOS;
        TextDrawSetString(TextDraw[0], string);
        strcat(TextDrawData[0][tText], string, 256);
    }
}
So That Acutally Works As Chatbox Right?
Reply
#10

Quote:
Originally Posted by 0_o
Посмотреть сообщение
So That Acutally Works As Chatbox Right?
Yes that would work

But the main problem of such a chatbox would be that you cant send privat data

For that you would need an extra system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)