ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1353

Help with scroller

by boxtech123 - 12-30-2018 - 12:53 AM
#1
im trying  to making a menu base and I cant get my scroller to work. I can scroll through my menu but the GRAPHICS::DRAW_RECT wont follow, if you know what I mean. does anyone know what im doing wrong. 

float XSS = 0.0;
float ScrollY = (0.1 / 3) + ((1 * 0.03) + 0.1250);
void Scrolling(char* Option, char* Description = NULL) {
  float toPos;
  if (MenuVariables::OptionCount > MenuVariables::MaxOptions)
  {
   if (MenuVariables::CurrentOption > MenuVariables::MaxOptions)
    toPos = (0.1 / 3) + ((MenuVariables::MaxOptions * 0.03) + 0.237) - 0.034 + Y;
   else
    toPos = (0.1 / 3) + ((MenuVariables::CurrentOption * 0.03) + 0.237) - 0.034 + Y;
  }
  else
  {
   toPos = (0.1 / 3) + ((MenuVariables::CurrentOption * 0.03) + 0.237) - 0.034 + Y;
  }
  if (ScrollY > toPos)
   ScrollY -= 0.0005;
  if (ScrollY < toPos)
   ScrollY += 0.0005;
 }

/*scroller*/ GRAPHICS::DRAW_RECT(0.4890625, ScrollY, XSS, 0.02361111, scrollerRed, scrollerGreen, scrollerBlue, ScrollOpacity);




              
Fire    ??????? ????  Fire
Reply
#2
lol try removing char* Option, char* Description = NULL
Reply
#3
You could have `char* Option, char* Description = NULL` if you want.

If your code is correct, only thing you need is to loop that option indefinitely, if you want it that way. Otherwise, add a toggle in your menu to toggle between smooth scroll.
Reply

Users browsing: 1 Guest(s)