Multipage Textdraw?
#3

Thank you @ItsRobinson for the answer.
Sill I don't understand, how to whis will be working...
How I get current items? And how to get previous items?


Textdraw create code:
Код:
new Float:startPosX = 32.000000,
    Float:addToStartPosX = 42.000000,
    Float:startPosY = 150.000000,
    Float:addToStartPosY = 39.000000;
for(new a = 0; a < sizeof(Items); a++){
    if((a % 16) == 0){
        startPosY = 150.000000;
    }
    if((a % 4) == 0 && a >= 4){
        Textdraw[playerid][TD_Items][a] = CreatePlayerTextDraw(playerid, startPosX, startPosY, "Preview_Model");
        startPosX = 32.000000;
        startPosY += addToStartPosY;
    }
    Textdraw[playerid][TD_Items][a] = CreatePlayerTextDraw(playerid, startPosX, startPosY, "Preview_Model");
    startPosX += addToStartPosX;
    PlayerTextDrawFont(playerid, Textdraw[playerid][TD_Items][a], 5);
    PlayerTextDrawLetterSize(playerid, Textdraw[playerid][TD_Items][a], 0.600000, 2.000000);
    PlayerTextDrawTextSize(playerid, Textdraw[playerid][TD_Items][a], 37.500000, 34.500000);
    PlayerTextDrawSetOutline(playerid, Textdraw[playerid][TD_Items][a], 0);
    PlayerTextDrawSetShadow(playerid, Textdraw[playerid][TD_Items][a], 0);
    PlayerTextDrawAlignment(playerid, Textdraw[playerid][TD_Items][a], 1);
    PlayerTextDrawColor(playerid, Textdraw[playerid][TD_Items][a], -1);
    PlayerTextDrawBackgroundColor(playerid, Textdraw[playerid][TD_Items][a], 125);
    PlayerTextDrawBoxColor(playerid, Textdraw[playerid][TD_Items][a], 1097458175);
    PlayerTextDrawUseBox(playerid, Textdraw[playerid][TD_Items][a], 0);
    PlayerTextDrawSetProportional(playerid, Textdraw[playerid][TD_Items][a], 1);
    PlayerTextDrawSetSelectable(playerid, Textdraw[playerid][TD_Items][a], 1);
    PlayerTextDrawSetPreviewModel(playerid, Textdraw[playerid][TD_Items][a], ClothesHead[a][ItemID]);
    PlayerTextDrawSetPreviewRot(playerid, Textdraw[playerid][TD_Items][a], -115.000000, -108.000000, -90.000000, 0.579999);
}
Count of items depends on the array size (Items). Per page it's now 16. 4x4. Like this:

****
****
****
****


I don't know how many page will be there, because I will be add items to the array. is there any way to automate this?
Reply


Messages In This Thread
Multipage Textdraw? - by CherryMond - 15.02.2019, 17:21
Re: Multipage Textdraw? - by ItsRobinson - 15.02.2019, 20:41
Re: Multipage Textdraw? - by CherryMond - 16.02.2019, 14:11
Re: Multipage Textdraw? - by ItsRobinson - 16.02.2019, 16:00
Re: Multipage Textdraw? - by CherryMond - 17.02.2019, 09:38

Forum Jump:


Users browsing this thread: 2 Guest(s)