Scroll

Posts 14 of 4 · Page 1 of 1
Scroll
Hey there
Could you guys help me please,with a simple d3d which scroll down when you reach the last shown text ?

Thanks
Quote Originally Posted by OneCa View Post
Hey there
Could you guys help me please,with a simple d3d which scroll down when you reach the last shown text ?

Thanks
Please explain more, what do u mean "scroll down when you reach the last shown text"? Do u want it to scroll down to the last text or when u select a text and some is off, it scrolls to show the whole text of the selected item.
Quote Originally Posted by topblast View Post
Please explain more, what do u mean "scroll down when you reach the last shown text"? Do u want it to scroll down to the last text or when u select a text and some is off, it scrolls to show the whole text of the selected item.
I mean something like if selected item is less that the scroll meanin that the selected item is not drawn on the screen decrease scroll until it is shown
so that if I have 50 items in menu only 10 are shown and when you reach the last one and press down first item will invisibile and a new item is shown

thanks for your help
i hope i understand correctly, but what you could do is a for loop for 10 items and an offset value.

So lets say u have 50 items, and you're showing 10
Code:
//I dont know, all code below if just a rush example
int offset = 20;
for(int i = offset; i <  (offset + min(10, noItems)); i++)
{
      if ( i >= noItems)
             i -= noItems;
     
      DrawItem( x, y  + i * 13, ......);
}
Using the offset to skip the values not drawn and if u want to draw the first item below that for a continuous loop the if statement should help with that.
If you selected item is at the bottom and you press down, u can increase the offset by 1.

I hope you understand, if not I released a menu and hack base using scroll a while back, click here. It used the mouse wheel for the scroll, please forgive the messy code.
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?