Menus: Part 1 - Game Maker Studio 2

Поділитися
Вставка
  • Опубліковано 22 гру 2024

КОМЕНТАРІ • 178

  • @amrakarmaMisophoniac
    @amrakarmaMisophoniac 2 роки тому

    Nice dude, by the end I felt confident in easily adding my gamepad as well.

  • @balloonvine4222
    @balloonvine4222 6 років тому +17

    For those of you wondering how to put code into the new version of game maker, right click the space, and select "change to GML" then you will be able to type stuff in

  • @haydenap
    @haydenap 7 років тому +42

    Excellent tutorial. My only criticism is that the font size is pretty small when you're inputting code. If there's a way to increase it a few sizes for better readability that would be awesome! Thanks!

    • @CodeWorkshop
      @CodeWorkshop  7 років тому +11

      Good point. I will increase the font size next time.

    • @ashtonschuler683
      @ashtonschuler683 5 років тому

      Fluffy TKC to increase font size open your code and press f8. f7 shrinks it

  • @vaidenkelsier7757
    @vaidenkelsier7757 7 років тому +7

    Absolutely perfect, I was just getting ready to figure out how to do a menu system. Thank you!

  • @MrLurkingShadows
    @MrLurkingShadows 5 років тому +3

    Thanks,man! I always see videos about how to make menus but they all always with the old version of the program but your video with the new version made me make a menu for my game! thanks,man!

  • @GaamingPros
    @GaamingPros 4 роки тому +1

    I like the sound of your voice and how you make your videos. PLEASE DON'T STOP MAKING VIDEOS! Thanks.

    • @GaamingPros
      @GaamingPros 4 роки тому

      just realized it's been a year since you last made a video :(

    • @CodeWorkshop
      @CodeWorkshop  4 роки тому +1

      Hey, thank you for your very nice comment! Life has been very busy and I have not been able to make videos for a while, but there's always a chance I will come back. :)

    • @GaamingPros
      @GaamingPros 4 роки тому

      @@CodeWorkshop Awesome! I'll be looking forward to it!!

  • @bryankelly3300
    @bryankelly3300 5 років тому +5

    I followed literally character for character but it doesn't work, down in the Bottom under output it just says "FAILED: run program complete"

  • @marcusgorfer386
    @marcusgorfer386 4 роки тому +3

    For everyone who doesn't get it:
    At 10:00 he clearly says Va_center and you can't read it bc the quality is too bad.
    He actually means fa_center

  • @ichifish
    @ichifish 6 років тому +8

    Excellent tutorial, thanks. A suggestion: you occasionally drift into "coder logic," like at 14:20, that is a little difficult to follow. I mean, I get it when I see you do it, but I don't normally think like that, so some additional explanation of that style of imagining problems would be beneficial. For example, when you set up the buttons index, it wasn't clear what the reasoning was behind that until later. You said something like "you'll see why I did that later," but it would have been helpful to understand the *approach* you're taking.

  • @SpinaRCSpeed
    @SpinaRCSpeed Рік тому

    Great tutorial, thanks, i would like how i can select with click mouse ? please

  • @SonicMrSumo
    @SonicMrSumo 3 роки тому

    Thanks so so much. What a great tutorial! Bit of fiddling required for gamepad controls, but still works really well. Have used this as the basis for my pause menu also. Thanks again!

  • @shadoworb810
    @shadoworb810 3 роки тому

    Hi. I have small problem. I did everything liske you, but when I start the game, it shows me only black screen. Please help

  • @sampsonist
    @sampsonist 5 років тому +1

    Hello I have a question, when I've gotten up to 8:39 on this Video and when I run My Game nothing comes up it's just all black!!!?

    • @CodeWorkshop
      @CodeWorkshop  5 років тому +2

      Hmmm - the only thing I can think of is to make sure you placed the o_menu object in the room

  • @sadiejoh.6202
    @sadiejoh.6202 4 роки тому +1

    Thank you so much for this tutorial.
    I love my menu I just have a quick question.
    How do I give the players options to use things other than (vk_down) etc?
    I tried keyboard_check_pressed(vk_down) or keyboard_check_pressed(ord("S")) - keyboard_check_pressed(vk_up) or keyboard_check_pressed(ord("W"))
    And I also tried it separately like
    keyboard_check_pressed(vk_down) - keyboard_check_pressed(vk_up)
    or keyboard_check_pressed(ord("S") - keyboard_check_pressed(ord("W")
    But neither worked ): Tips?

    • @CodeWorkshop
      @CodeWorkshop  4 роки тому +1

      You were close with your first try. You need to add extra parenthesis around each of the parts checking for up and down. This is the pseudo code:
      (check_s or check_down) - (check_w or check_up)
      Now replace check_s, check_down, etc... with the real checks:
      (keyboard_check_pressed(ord("S")) or keyboard_check_pressed(vk_down)) - (keyboard_check_pressed(ord("W")) or keyboard_check_pressed(vk_up));

    • @sadiejoh.6202
      @sadiejoh.6202 4 роки тому

      @@CodeWorkshop This worked! Thank you so much!! :))

  • @justinlinville7290
    @justinlinville7290 5 років тому +1

    I'm getting a "trying to index a variable which is not an array" error on the buttons array in the Draw tab. Anyone else?

  • @jacfac9969
    @jacfac9969 5 років тому

    If you did all the code right and the text isn't showing up then in the draw event type in "draw_set_color(c_white);" on the very first line because it might default to black text on a black background.

  • @SwiftSN
    @SwiftSN 5 років тому +1

    Can you show how to do a warning screen before the game? I am missing several variables to make it.

  • @zoltankiss9569
    @zoltankiss9569 7 років тому

    Glad you're back! Can you please continue the tutorial. Cuz you're the only who made a tutorial from zero. Thank you so much. Regards.

    • @CodeWorkshop
      @CodeWorkshop  7 років тому

      Thanks. Which series? Zelda or the Game Maker Studio 2 series?

  • @afterlifenews2401
    @afterlifenews2401 3 роки тому

    Plz answer I’ve been stuck for days how on Mac keyboards do you get this*

  • @PeterTvonK
    @PeterTvonK Рік тому

    Great tutorial. Still works in 2023. I just made a small modification - I use Input library that takes care of the controller input. The code to check input then looks like this:
    if(input_check_pressed("down")) {
    menu_index += 1;
    }
    if(input_check_pressed("up")) {
    menu_index -= 1;
    }

  • @Owen-vt2zl
    @Owen-vt2zl 5 років тому

    ive found this problem a lot whenever i try coding ANYTHING it keeps crashing before even starting up saying that stuff hasnt been read before starting even though im copying the code down EXACTLY and triple checking everything i put down. somebody please help me because i really want to use this program but nothing seems to be working right

  • @Xerclipse
    @Xerclipse 4 роки тому

    How do you lock certain menu indexes so that the menu index will skip to the next one? Let's say that I can't select "Load Game" because I have no files available. If I move down to load game then it will skip to options, but if I move up to load game, it goes to new game.

  • @maxthegermanshepherd8942
    @maxthegermanshepherd8942 4 роки тому

    I, I want to put the different texts in different places, can you help me???? Please

  • @MadEzio
    @MadEzio 3 роки тому

    can somebody help me - all the menu options are overlapping with each other...

  • @afterlifenews2401
    @afterlifenews2401 3 роки тому

    I can’t find it can you tell me the code that started with draw_text (menu_x, menu_y

  • @chupacabras983
    @chupacabras983 6 років тому

    8:18 - I can't understand.... What symbol is that?

  • @michaelluke2306
    @michaelluke2306 5 років тому

    When I try to place curly brackets, it says "nested function calls are not allowed". Please Help.

  • @fwfwe48y4t
    @fwfwe48y4t 4 роки тому

    how do you make the same menu but with sprites instead of plain text?

  • @ok38sjdhfkj34
    @ok38sjdhfkj34 4 роки тому

    I need a slight bit of assistance,
    I followed everything as it was inputted, however the outcome on my end resulted in the text showing up, and even being highlighted red on option 1, but the problem is the arrow keys don't work, despite me writing code for them. Great video though!

  • @przemysawkoscielski1438
    @przemysawkoscielski1438 6 років тому +2

    whats write in 8:20 ?
    pls help

  • @hydrocityspd2698
    @hydrocityspd2698 5 років тому

    Is there a way to do these but horizontally?

  • @askofly_7754
    @askofly_7754 5 років тому +1

    Hi, so when i add another text to the room it changes his color too ' in this tutoriel it's red)

  • @dmac2016
    @dmac2016 4 роки тому

    How do you add actions for new game and load game?

  • @xxQued
    @xxQued 5 років тому

    For me its saying nested functions are not allowed.

  • @GameLog0
    @GameLog0 6 років тому

    Pardon me, but, how would i be able to use a different key than the arrows to select options in the menu? I was hoping to use the 'w' and 's' keys.

  • @hecticc_nomadic7116
    @hecticc_nomadic7116 5 років тому

    Why when you go down to the last entry that the other draw text objects ion the room also turn red? HOW DO I FIX THIS?

  • @Paul-ew5yh
    @Paul-ew5yh 5 років тому

    how do you do the 1 after var at 7:56 ?? or what is this for a symbol

    • @martinnn-y5j
      @martinnn-y5j 5 років тому

      you can change it for any letter ;)

  • @cices3196
    @cices3196 3 роки тому

    when I wrote "draw_text(menu_x, menu_y, + button_h * i, buttons[i])" it said "number of arguments for function draw_text expected 3 got 4" what can I do with it

    • @airconditioningac
      @airconditioningac 3 роки тому

      a bit late but for anyone who stumbles across this, remove the comma after menu_y since you're adding this with button_h and multiplying by buttons[i]
      revised code: draw_text(menu_x, menu_y + button_h * i, buttons[i])
      good luck and have a good day ✨

    • @cices3196
      @cices3196 3 роки тому

      @@airconditioningac thx a lot

  • @flyrehash5124
    @flyrehash5124 4 роки тому

    thank you so much!!! I tried another tutorial but it was too old, this one still works :D

  • @cantsc4ffold307
    @cantsc4ffold307 6 років тому

    when i set it up like you did code workshop and the game loads in, i press the key or the button that moves you know to the thing yiu want to press like new game, well when i press the up button it only goes to the first option and the last one and if i press down when its on the last option it goes off screen

  • @mcdrmtm9513
    @mcdrmtm9513 5 років тому

    hi im a complete noob at gamemaker, what shortcut did you use at the beginning to create the variables?

  • @Isakube
    @Isakube 5 років тому +1

    mine are gonna be in boxes, can you fix that?

  • @jakeo9724
    @jakeo9724 5 років тому

    How could one do this but using W and S keys instead

  • @mr.apothic6776
    @mr.apothic6776 6 років тому

    Just to toss thought a nice add to this, when you get to the step part and do the menu_move part, I suggest this snip of code, it aided me to use wsda or arrow keys.
    FYI I am using GMS-2.
    menu_move = max(keyboard_check_pressed(vk_down),keyboard_check_pressed(ord("S")),0) - max(keyboard_check_pressed(vk_up),keyboard_check_pressed(ord("W")),0);

    • @l_vs_maia
      @l_vs_maia 6 років тому +1

      Sorry to bother you asking this, but why exist a zero in the end of the max parameters? :o

    • @nbpraptor
      @nbpraptor 6 років тому

      how did it aid you? Not being a troll, rather some of the code i have never saw before so I am not able to understand why it would be helpful in that circumstance. :)

  • @whoverland
    @whoverland 6 років тому +4

    How i make to game start

    • @whoverland
      @whoverland 6 років тому +5

      Put "room_gotto(name of room)" in case 0

    • @borzageorgemarian4924
      @borzageorgemarian4924 5 років тому

      @@whoverland i did it it worked, changed a few things and now it freezes evry time PLS HEELP.

    • @Isakube
      @Isakube 5 років тому

      @@borzageorgemarian4924 you probably forgot to change the name of the room (or the room name in the code)

  • @paul6179
    @paul6179 6 років тому

    Hello Code Workshop, first of all, thank you for these videos they are such a huge help, I had some question about coding as I'm pretty new to it and attempting to create my first game. Is there any way I could ask you some questions about what to do after the menu stage of the game is complete.
    Thank You!

  • @dkracingfan2503
    @dkracingfan2503 4 роки тому

    When I click play I get unassigned variable buttons

  • @okeydesuka3167
    @okeydesuka3167 6 років тому

    can you please make a video with making buttons with your own sprites??

  • @aritpd
    @aritpd 5 років тому +4

    My computer was strait up not having a good time it had a fatal error

  • @MrDeath2545
    @MrDeath2545 6 років тому +2

    So I've followed this exactly and when I go to test it I get an error. "Object: o_menu Event: Draw at line 4 : unknown function or script button
    puu.sh/ADzk6/23ada538c8.png

    • @whywr
      @whywr 3 роки тому

      same here!

  • @kmv683
    @kmv683 7 років тому

    Looks good but I'd put the alignment and font assignments before the repeat statement, not in it. No need to set them for every menu item unless you're changing them based on the current selection.

  • @RefluxCitadelRevelations
    @RefluxCitadelRevelations 5 років тому

    So im trying to make it go to the game when i hit "start" but its not letting me this is my code, the case 2 works but not case 0
    switch(menu_index)
    {
    case 0:
    room_goto(0)
    break;

    case 2:
    game_end()
    break;
    }

    • @RefluxCitadelRevelations
      @RefluxCitadelRevelations 5 років тому

      okay i figured it out, but now it goes straight to the game

    • @CodeWorkshop
      @CodeWorkshop  5 років тому

      Glad you figured it out. "but now it goes straight to the game"...is that not what you want?

    • @RefluxCitadelRevelations
      @RefluxCitadelRevelations 5 років тому

      @@CodeWorkshop no like when I load up the game it doesnt go to the menu, it just goes to the game itself. Actually it does work, but it only works half of the time so, yeah

    • @AndreLuiz-xd8px
      @AndreLuiz-xd8px 3 роки тому

      hi, I followed his tutorial and also I'm not able to make the "0" button work, if for some reason you still remember how it was resolved, please tell me!

  • @x_kryx3546
    @x_kryx3546 6 років тому

    ?What if i wanted to make the buttons next to each other

  • @arteriop8910
    @arteriop8910 6 років тому

    im getting errors in my keypressed enter section despite the fact what you have and what I have is exactly the same

  • @Blenthor
    @Blenthor 7 років тому

    What would be the code for new game, save game, and load game?

  • @dbxblitz5634
    @dbxblitz5634 3 роки тому

    I have 1 complaint and that is why do you only show how to make the end game button work

  • @uneducatedbroadcasts9655
    @uneducatedbroadcasts9655 7 років тому

    Can you send me a link to the sound download

  • @tonystroemsnaes554
    @tonystroemsnaes554 7 років тому

    how do you do sliders, or a box where you can click and change a number?

    • @CodeWorkshop
      @CodeWorkshop  7 років тому

      I've added this to the list of potential future tutorials.

  • @fuixgaming7427
    @fuixgaming7427 5 років тому

    when i insert the first comands of menu, a yellow triangle appears. Why?

    • @CodeWorkshop
      @CodeWorkshop  5 років тому

      If you hover over the triangle, it should say something like "Variable XX only referenced once." This just means that you haven't used that variable in your code yet and this will always happen when you first set up your variables. Once you use the variable later in the code, the yellow triangle goes away.

  • @CrazyKiwiGaming
    @CrazyKiwiGaming 5 років тому

    all worked up until testing color change for selected. it either selected all or none... i triple checked and followed your every step
    update: my mistake was I had failed to check for ; at end of codes

    • @CodeWorkshop
      @CodeWorkshop  5 років тому

      Glad you were able to figure it out! :)

    • @CrazyKiwiGaming
      @CrazyKiwiGaming 5 років тому

      @@CodeWorkshop cheers. Iv made small games b4 but none have a menu so when I seeked help your videos came 1st. Absolutely love your style of tutorial

  • @Yami_Industries
    @Yami_Industries 6 років тому

    what about a menu similar to xenoblade chronicles with a backgroud that has its own day/night cycle and the item or monado flashing and pulsating at night

  • @yoramvriezen5782
    @yoramvriezen5782 5 років тому

    i cant type in the create event....

  • @tylerhughes4990
    @tylerhughes4990 6 років тому

    How exactly do you make this work with pre-made sprites though?

    • @CrazyKiwiGaming
      @CrazyKiwiGaming 5 років тому

      the same as any but rather then using a code to draw the menue use codes for pressing on "obj name" with if mouse_check_button_pressed(mb_left) in the step event

  • @razanoo2000
    @razanoo2000 6 років тому

    do a moving animation when you select an option it moves

  • @margeryv
    @margeryv 7 років тому +2

    how do add this in a current game

    • @PangoriaFallstar
      @PangoriaFallstar 7 років тому +3

      My suggestion is to make a room before the current room that has all the game stuff. Add this in and have New game go to the next room.

    • @CodeWorkshop
      @CodeWorkshop  7 років тому

      I will cover this in a future tutorial.

    • @margeryv
      @margeryv 7 років тому +3

      Code Workshop I did it I finally got it thank you so much

  • @notdevin7835
    @notdevin7835 6 років тому

    I did everything you said to do and double checked that I did it right multiple times but in the end it just made it so my project wouldn't work

  • @Anthro
    @Anthro 6 років тому

    everything seems fine but nothing is appearing at all,
    Attempting to set gamepadcount to 12
    DirectX11: Using hardware device
    Collision Event time(microsecs)=0
    Total memory used = 5464562(0x005361f2) bytes
    **********************************.
    Entering main loop.
    **********************************.

  • @filigenzilab9613
    @filigenzilab9613 6 років тому

    May I use this for a game I'm making?

  • @issacomics2249
    @issacomics2249 6 років тому

    How do you change rooms after clicking start

    • @Capn_
      @Capn_ 6 років тому +3

      you just have you put in the step event :
      if (menu_index == button[0]) room_goto(the room you want); (for the new game option)
      Do that for every single option but just don't forget to change the index of the button array !

    • @RampantOracle
      @RampantOracle 6 років тому +4

      I just put it in the "key press - enter" event. So instead of
      case 0:
      show_debug_message("New Menu");
      break;
      I have
      case 0:
      room_goto(room);
      break;

    • @Capn_
      @Capn_ 6 років тому

      RampantOracle Not bad actually ! It works too

    • @acbtrades
      @acbtrades 4 роки тому

      RampantOracle where do you live I want to hug you

  • @levigolstein9196
    @levigolstein9196 5 років тому

    how can I make the times symbol

    • @CrazyKiwiGaming
      @CrazyKiwiGaming 5 років тому

      hold shift and press 8 or enable number pad and its the star on the left of the - button

  • @koishiteruchan4422
    @koishiteruchan4422 5 років тому

    i have a problem with draw

  • @ajontop6460
    @ajontop6460 5 років тому

    This was exactly what i needed, many thanks :)

  • @MrX-qw6ph
    @MrX-qw6ph 6 років тому

    Nice! This is just what i need, thanks!

  • @maxthegermanshepherd8942
    @maxthegermanshepherd8942 4 роки тому

    what if I want to put a picture behind it? ( Solved it, just make a sprite, import the picture into the sprite, the go on the background layer in rooms and use that sprite as the background. )

  • @GalaxiaNetwork
    @GalaxiaNetwork 6 років тому +2

    Error on Line 8

    • @asrieldragon461
      @asrieldragon461 6 років тому

      your sound file name have to be exactly the same as in the source code

  • @UNIPIXEL
    @UNIPIXEL 6 років тому +6

    it didnt work for me

  • @bobbys1028
    @bobbys1028 7 років тому

    I know there are copyright issues, but can you make a Zelda series for GMS 2? The engines are becoming too different to follow your old series. Also will you continue the 4 part beginner series? (Long time fan and keep up the good work)!

    • @CodeWorkshop
      @CodeWorkshop  7 років тому

      Thanks for being a fan! :) I will start up the beginner series and I'm still looking into what to do with the Zelda series long-term.

  • @Darcola
    @Darcola 5 років тому

    I cant make the exit works

  • @dkracingfan2503
    @dkracingfan2503 4 роки тому

    This video is in 480p for me. I can't read what your typing.

  • @LEATHER550
    @LEATHER550 3 роки тому

    you can turn the quality of the video up if you can't see

  • @yeahimkencarson
    @yeahimkencarson 5 років тому

    THANK YOU!!!!!!!! Got a new sub☺️

  • @jamesloymartin
    @jamesloymartin 6 років тому

    Thanks for posting the video! life saver!

  • @matthewclarke5220
    @matthewclarke5220 6 років тому

    did'nt work for me it just kept switching nuttons in a infinate loop

    • @CodeWorkshop
      @CodeWorkshop  6 років тому +1

      I've added a link to the code in the description. See if comparing the code to yours helps.

  • @Old_Byte
    @Old_Byte 3 роки тому

    zoom the code please...

  • @nirooooon5109
    @nirooooon5109 4 роки тому +1

    Create event:
    menu_y =y;
    menu_x =x;
    menu_h =32;
    button[0] = "Novo Jogo";
    button[1] = "Carregar Jogo";
    button[2] = "Opções";
    button[3] = "Sair";
    buttons = array_length_1d(button);
    menu_index =0;
    last_selected=0;

  • @xluismrroblox1964
    @xluismrroblox1964 5 років тому

    error :/

  • @Paul-ew5yh
    @Paul-ew5yh 5 років тому

    Thanks for the video!

  • @kyuoma653
    @kyuoma653 3 роки тому

    thank you very much

  • @ericconnelly1554
    @ericconnelly1554 6 років тому

    Very Cool!!!! :)

  • @awsomesrebirth1549
    @awsomesrebirth1549 4 роки тому

    IT DIDNT WORK

  • @mikehudson792
    @mikehudson792 5 років тому

    My game crashed

  • @rheiartaghlia124
    @rheiartaghlia124 6 років тому

    well... it's a good tutorial thou..
    but. i can't see the code as well :)
    dang it man, dunno what to say

    • @CodeWorkshop
      @CodeWorkshop  6 років тому

      Thanks and sorry about the font size. I increase the size in the next video and you can also download the code from the description.

  • @cantsc4ffold307
    @cantsc4ffold307 6 років тому +1

    dude its 2018 now so the coding is gone, now its just this assign variable, what do i do next?

  • @danield0c
    @danield0c 5 років тому

    6:46

  • @JonPFS
    @JonPFS 6 років тому

    Hehehe... looks just like mine... ive put a round rectangle on top of the keys... its simple but not acurate
    aa1 = string_length(menuGM[menuPos])*4;
    draw_roundrect_colour(hori-aa1-2, vert-6+menuSpace, hori+aa1, vert+4+menuSpace, c_white, c_white, false);
    the rectangle width is the string lenght (aa1)

  • @zero-yw2rh
    @zero-yw2rh 4 роки тому

    is !=?

    • @CodeWorkshop
      @CodeWorkshop  4 роки тому

      "!=" is a comparison that means "not equal".

  • @cloakedd_
    @cloakedd_ 4 роки тому

    I had a fatal error so I downloaded it.

  • @NEOpury
    @NEOpury 3 роки тому

    ultra hd 4k :/

  • @Team_77_
    @Team_77_ 4 роки тому

    noicee

  • @matthewclarke5220
    @matthewclarke5220 6 років тому

    please help