public void SetAmountOfItems(int amount)
{
topIndex = 0;
amountOfItems = amount;
if (!isSlider)
{
scrollButtonLength = (int)(((float)amountVisible / amountOfItems) * scrollBarLength);
if (scrollButtonLength < 16)
{
scrollButtonLength = 16;
}
if (isHorizontal)
{
Scroll.ResizeButton(scrollButtonLength, 16);
}
else
{
Scroll.ResizeButton(16, scrollButtonLength);
}
}
SetScrollButtonPosition();
}