Split GUI ?

Hey guys :slight_smile: how can i split this GUI if the bullets Left Variable is greater than 25. here is my scrip:

function OnGUI(){

     
     for(var DisBullets: int = 1; DisBullets <= BulletsLeft; DisBullets++){
     
     GUI.DrawTexture(Rect(StartingPosBullet +((DisBullets) *(bulletAmmoSizeWH.x + BulletSpread)),
      BulletYAxis, bulletAmmoSizeWH.x, bulletAmmoSizeWH.y),bulletTexture);
       
     }
     GUI.Label(bulletRect,"" +BulletsLeft);
     
     

} 

at the moment the GUI goes across the page and i dont want that if the DisBullet or BulletsLeft is greater than 25 split the GUI into 2 parts so some of the remaining bullet texture goes underneath the top ones. As always thanks for your time and thanks in advance :slight_smile:

function OnGUI()
{
    var BulletsInRow : int = 25;
    for(var DisBullets : int = 1; DisBullets <= BulletsLeft; DisBullets++)
    {
        var row : int = (DisBullets - 1) / BulletsInRow;
        var column : int = DisBullets - row * BulletsInRow;
        GUI.DrawTexture(Rect(
            StartingPosBullet + column *(bulletAmmoSizeWH.x + BulletSpread),
            BulletYAxis + row * bulletAmmoSizeWH.y,
            bulletAmmoSizeWH.x,
            bulletAmmoSizeWH.y),bulletTexture);
    }
}