Amateur Game Publish Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Text-Based Menu Tutorial (Game Maker)

2 posters

Go down

Text-Based Menu Tutorial (Game Maker) Empty Text-Based Menu Tutorial (Game Maker)

Post  FAAAEBS Wed Aug 15, 2012 4:14 pm

Text-Based Menu Tutorial for Game Maker
This is only for those who own the Standard Version of Game Maker. I will be posting however a tutorial later on on how to do this with the lite verison

Here I will post all the steps needed to make the Text-Based Menu:
Step 1. Make a new object, and name it menu. Also make sure you decide how many options your menu will have (Play Game, Credits, Options, End Game, etc.).
Step 2. In the Create Event, put the following code:
Code:
menu_option=1 menu_options=//Amount of menu options you have
Step 3. In the Step Event write:
Code:
if menu_option>menu_options then menu_option=1
if menu_option<1 then menu_option=menu_options
Step 4. In the Key Press Down Event write:
Code:
menu_option+=1
And in the Key Press Up Event write:
Code:
menu_option-=1
Step 5. Make a script and call it draw_menu_text. Inside the script write
Code:
draw_text_color(argument0,argument1,argument2,argument3,argument3,argument3,argument3,255)
This is to make the Draw code less painful.
Step 6. Make a Draw Event, and inside it put the following code (I will explain how to change it to your favor later):
Code:
draw_set_font(font_menu)
draw_set_halign(fa_center)
//Category 1
draw_menu_text(320,50,"Story Mode",c_white)
draw_menu_text(320,150,"Arcade Mode",c_white)
draw_menu_text(320,250,"Credits",c_white)
draw_menu_text(320,350,"End Game",c_white)
//Category 2
if menu_option=1 draw_menu_text(320,50,"Story Mode",c_red)
if menu_option=2 draw_menu_text(320,150,"Arcade Mode",c_red)
if menu_option=3 draw_menu_text(320,250,"Credits",c_red)
if menu_option=4 draw_menu_text(320,350,"End Game",c_red)
Step 7. Change the code like this:
Change font_menu to whatever font you want
Change Story Mode, Arcade Mode, Credits, and End Game to whatever your game has (add more or add less depending on your menu).
IMPORTANT: Make sure that the first function in category 2 matches the first function in category 1 (excluding the color), and the same thing with the 2nd, 3rd, and 4th functions.
Change the y coordinates of the functions, however make sure the ones in category 2 match the ones in category 1.
Step 8. In the Press Enter Key Event write this code:
Code:
if menu_option=1{room_goto_next()}
if menu_option=2{room_goto(rm_arcade_mode)}
if menu_option=3{room_goto(rm_credits)}
if menu_option=4{game_end()}
However be sure to change the function to whatever you want to happen when the player chooses that specific option.

That's it! Now you have a nice looking text-based menu, and you don't even have to give credit to me! I will be making more tutorials in the future, and if you have a specific one you want me to do, just reply to this tutorial, or pm me asking me to do one!
FAAAEBS
FAAAEBS
Admin

Posts : 44
Posting Points : 482
Reputation : 318
Join date : 2012-06-13
Age : 36

https://amateurgamepublish.forumeiros.com

Back to top Go down

Text-Based Menu Tutorial (Game Maker) Empty Re: Text-Based Menu Tutorial (Game Maker)

Post  Mr. 76 Wed Aug 15, 2012 4:21 pm

Thanks FAAAEBS! I can clearly see that this is the exact thing you used in Contrast! Thanks a lot man!
Mr. 76
Mr. 76

Posts : 5
Posting Points : 8
Reputation : 1
Join date : 2012-08-01

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum