Textdraws Returns
#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


Messages In This Thread
Textdraws Returns - by 0_o - 04.08.2011, 21:25
Re: Textdraws Returns - by 0_o - 04.08.2011, 21:38
Re: Textdraws Returns - by sleepysnowflake - 04.08.2011, 21:42
Re: Textdraws Returns - by fie - 04.08.2011, 21:45
Re: Textdraws Returns - by 0_o - 04.08.2011, 21:47
Re: Textdraws Returns - by 0_o - 04.08.2011, 22:01
Re: Textdraws Returns - by [P4] - 04.08.2011, 22:03
AW: Textdraws Returns - by Nero_3D - 04.08.2011, 22:03
Re: AW: Textdraws Returns - by 0_o - 06.08.2011, 21:06
AW: Re: AW: Textdraws Returns - by Nero_3D - 06.08.2011, 22:19

Forum Jump:


Users browsing this thread: 1 Guest(s)