• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Option menu scrollbars and smooth transition

R

RealsLife

Guest
Hello, I want to make an option menu that when clicked on the arrow of a category inside the option menu it needs to dropdown and push the other categories down. Also if you look on the image it needs to be in a small box so I can't make a long room to fit all the space needed...

1) How can I make a space inside a box with a scrollbar?
2) How can I show everything with a smooth dropdown transition?
3) What is the best way to push everything down?option menu.png
 
A

AndrewFM

Guest
Draw your form data onto a surface, and then draw the part of the form that should be visible within the box onto the screen using draw_surface_part. You should keep an offset variable that is controlled by the scrollbar, which you should use to alter the vertical offset in the draw_surface_part function. This will effectively let you scroll the visible area up and down with the scrollbar.

As for pushing each section down, keep a series of vertical offsets (probably in an array) for each section. Expanding/contracting a category will change the offset value in the array for that category. The y position of each section will be the sum of the offsets that come before it.
 
Top