• 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!

Scrolling Menu

P

Pelican

Guest
GM Version: Game Maker Studio
Target Platform: Windows
Download: http://www.host-a.net/u/Pelican/Scrolling_Menu.gmz
Links: None

Summary
Creates a scrolling menu, allowing you to have more menu options than just the amount of space you have on your screen. The example does this for a menu with three rows, and six options.

Tutorial
The code is explained thoroughly in the download itself, however I’ll briefly explain it here:
Variables:
menuChoices = menu choice names (choice[0] = 1st option, choice[1] = 2nd etc…)
choice = index of menu choices
topChoice = index of menu choice shown at the top of the menu
selectorPos = position of menu selector
________
This is generally what the program does:
When scrolling up:
Code:
If(selectorPos>0){
  selectorPos--;
}
else{
  if(topChoice>0){
  topChoice--;
  }
}
When scrolling down:
Code:
If(selectorPos<array_length_1d(menuChoices)){
  selectorPos++;
}
else{
  if(topChoice<array_length_1d(menuChoices)-3){
  topChoice++;
  }
}
 
A

Astal

Guest
DUDE THIS IS EPIC. I think I can modify this to replace my inventory from 8.1 that doesnt work in studio, thank you so much
 
Top