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

making a main menu swipeable

Y

Yvalson

Guest
so I'm creating this mobile game in which you can select tons of minigames (that i'm still creating) and you can select them in the main menu.
but there are alot of buttons required that dont all fit the view. is it possible to make like a swipeable menu
that uses views so I can basically swipe through the main menu.
if that is possible what would be the best way to get at it?
 

samspade

Member
so I'm creating this mobile game in which you can select tons of minigames (that i'm still creating) and you can select them in the main menu.
but there are alot of buttons required that dont all fit the view. is it possible to make like a swipeable menu
that uses views so I can basically swipe through the main menu.
if that is possible what would be the best way to get at it?
I've never used the mobile features, but it would be really easy to do with regular PC controls, so I assume it wouldn't be hard to translate to swipe controls. There are a lot of different ways to do it, basically any menu tutorial would probably work. If your menu is really simple, e.g. each screen is a game and you can either select the game or go to the next screen, then you could easily accomplish all of this with a single object. Set up a counter in the create event. In the step event make it so that swiping left or right increases or decreases the counter and then tie each game to a specific position in the counter, and then in the draw event just draw what you want based on that counter. Something like this:

Code:
///create event
selected_game = 0;
total_number_of_games = 10 //whatever number you want

///step event

if (swipe_left) selected_game -= 1;
if (swipe_right) selected_game += 1;

if (selected_game > total_number_of_games) selected_game = total_number_of_games;
if (selected_game < 0) selected_game = 0;

if (choose_game) {
      if (selected_game == 0) //go to game
     //repeat as desired
}

///draw event

if (selected_game == 0) {
     //draw that screen
}

//repeat as desired
This would only work if it was simple, but you could easily modify any of the many menu tutorials out there for a variety of different options.
 
Y

Yvalson

Guest
I've never used the mobile features, but it would be really easy to do with regular PC controls, so I assume it wouldn't be hard to translate to swipe controls. There are a lot of different ways to do it, basically any menu tutorial would probably work. If your menu is really simple, e.g. each screen is a game and you can either select the game or go to the next screen, then you could easily accomplish all of this with a single object. Set up a counter in the create event. In the step event make it so that swiping left or right increases or decreases the counter and then tie each game to a specific position in the counter, and then in the draw event just draw what you want based on that counter. Something like this:

Code:
///create event
selected_game = 0;
total_number_of_games = 10 //whatever number you want

///step event

if (swipe_left) selected_game -= 1;
if (swipe_right) selected_game += 1;

if (selected_game > total_number_of_games) selected_game = total_number_of_games;
if (selected_game < 0) selected_game = 0;

if (choose_game) {
      if (selected_game == 0) //go to game
     //repeat as desired
}

///draw event

if (selected_game == 0) {
     //draw that screen
}

//repeat as desired
This would only work if it was simple, but you could easily modify any of the many menu tutorials out there for a variety of different options.
Thanks for you reply but it's a little bit different you see I have like 19 buttons currently all over the room which is 1600 x 2700
My view is 1600 x 900 and what I want to do is make it so if I swipe the view will go up or down
 

samspade

Member
Thanks for you reply but it's a little bit different you see I have like 19 buttons currently all over the room which is 1600 x 2700
My view is 1600 x 900 and what I want to do is make it so if I swipe the view will go up or down
It's true that my method is different. If your saying that you have all of the buttons laid out in a room and you just want the view to move around when you swipe, that is also doable. Just have swiping change where the view is located.
 
Y

Yvalson

Guest
It's true that my method is different. If your saying that you have all of the buttons laid out in a room and you just want the view to move around when you swipe, that is also doable. Just have swiping change where the view is located.
Alright I'll try that out thank you
 
Top