How to Make a Functional Game Menu in Godot 3.2 | Godot UI Tutorial

Поділитися
Вставка
  • Опубліковано 7 лют 2025
  • In this Godot Tutorial, I will teach you how to make a functional game menu in Godot 3.2. We will have a look at the design of the game menu, programming the game menu, and changing options at runtime in the game menu.
    Every game needs a game menu and most likely your Godot games need to. In this Godot Tutorial, we will design, implement and code a game menu that is going to be handling your main menu functions. We will add an options menu and change the mode of our experience bar from the last Godot tutorial.
    Link to the experience bar video referenced in this video:
    • How to Make an Experie...
    ⬧⬧⬧⬧⬧ GDC TUTORIALS ⬧⬧⬧⬧⬧
    I believe educational material should be available to all, for free
    Support this vision by joining the GDC-Club and get perks in return
    / gamedevelopmentcenter
    / gamedevelopmentcenter
    ⬧⬧⬧⬧⬧ LEARN MORE GAMEDEV ⬧⬧⬧⬧⬧
    These books have helped me in my game design and programming, I whole fully recommend them to you!
    Level Up! The Guide to Great Video Game Design ►► amzn.to/3hIg6dE
    Game Programming Patterns ►► amzn.to/35IoDsH
    The Art of Game Design: A Book of Lenses ►► amzn.to/35MSHoU
    ⬧⬧⬧⬧⬧ LIVESTREAMS ⬧⬧⬧⬧⬧
    I Livestream game development twice a week right here on UA-cam.
    Subscribe and hit that Bell Icon to make sure you don't miss it!
    www.youtube.co...
    Tuesday and Thursday
    1900 to 2200 (GMT+1/2 (winter/summertime), that's;
    1200 to 1500 (PST), or
    1500 to 1800 (EST).
    ⬧⬧⬧⬧⬧ COMMUNITY & SOCIAL ⬧⬧⬧⬧⬧
    Join the community! Follow me on Social!
    DISCORD ►► / discord
    TWITTER ►► / gamedevstefan
    ⬧⬧⬧⬧⬧ ABOUT GDC ⬧⬧⬧⬧⬧
    GDC, Game Development Center, was created to provide in-depth tutorials on game design theory and game development using the Godot Game Engine. I aim for multi-part Godot tutorials, allowing me to dive deeper into Godot's features.
    ⬧⬧⬧⬧⬧ ASSETS USED ⬧⬧⬧⬧⬧
    opengameart.or...
    ⬧⬧⬧⬧⬧ DISCLAIMER ⬧⬧⬧⬧⬧
    Some of these links go to one of my websites and some are affiliate links where I'll earn a small commission if you make a purchase at no additional cost or disadvantage to you. You will receive the same price and service.

КОМЕНТАРІ • 86

  • @GameDevelopmentCenter
    @GameDevelopmentCenter  4 роки тому +15

    Do you believe that Godot education should be free? Me too!
    You will never find me on Udemy, Mavenseed, or Gumroad.
    Support these tutorials in any way you believe is appropriate; like, comment, subscribe or become a member of the GDC Club, thank you!
    ua-cam.com/users/GameDevelopmentCenterjoin

  • @mesolagic
    @mesolagic 4 роки тому +9

    great tutorial my friend! This was honestly a good tutorial to go over control type nodes overall. I actually didn't even need to build a game menu, I was trying to build a crafting menu that pops up when a player clicks a crafting bench. This video really helped me get in the right direction since I have very little gui experience in godot so thank you!

  • @vasilylevitskiy6775
    @vasilylevitskiy6775 4 роки тому +7

    Thanks for doing these!

  • @nowayjosedaniel
    @nowayjosedaniel 4 роки тому +2

    This was really helpful understanding how instantiated objects and their dependencies work in relation to Parent/Child nodes and their scripts. It's also really helpful to see "The Godot Way", especially when I'm coming from 10 years of Unity experience and don't want to just guess or try to jam in "The Unity Way". So thank you!
    Your content is high quality, especially compared to most Godot resources. I can't stand GDQuest content and most Godot tutorials/users don't seem to really know what they're doing. And although some aspects of the Godot docs are great, other parts are lacking - especially in establishing best practice and definitely in terms of C# support. Godot really needs members in the community to help establish best practice. Linking everything with Signals and having things in their own independent Scene seems like how it should be.
    Of course I am beginning to see why the C# support still has the warning. I get constant crashes and weird problems with Godot recognizing changes when the project is rebuilt. Your resources are great though because I can see the way to engineer games in Godot, then figure out the small things like syntax myself. That deeper explanation for WHY things are done is what separates the better tutorials like yours from the crappier ones which seems to be closer to trying to achieve newbie copypasta but without explaining the real meat of what is happening. Especially for us experienced developers who just need to learn Godot's nuances and strengths (something the Godot community doesn't seem capable of listing outside of its License, but which Strengths seem to be there when you dive deeper).
    Also tbh, the style of games and content you're doing is the exact type of awesome multiplayer RPG I wanted to make 10 years ago when I first started. You seem to tackle some of the best things people need to know. I would have killed for tutorials like these. You spoil kids these days - no doubt about it! It's also such a breath of fresh air to see a tutorial series that isn't yet another stale as ass platformer. hahaha ;)

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому +2

      Wow dude, thank you for sharing your view is such a detailed way, and the many compliments as you do.
      Many of the 'issues' you list is what inspired me to make this channel and are how I try to differentiate.
      Coming from 3,5 years of Unity myself, I recognize a lot of what you have written down :)
      Thank you, hope my content will see you realize some awesome projects and express your creativity!

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

      @@GameDevelopmentCenter He speaks facts! :)

    • @FameMonsterD3
      @FameMonsterD3 4 роки тому +2

      You are correct, GDQuest sucks and a sellout, I mean the guy tries but some people weren't just made to teach. Stefan has the teaching gift and the structural knowledge.

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

      @@FameMonsterD3 Thx Fame Monster. Maybe I should have become a high-school teacher after all :P

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

    Thanks to you, now I understand how cool Godot actually is...

  • @bodhii
    @bodhii 4 роки тому +2

    Very helpful as always!

  • @SobanTheRed
    @SobanTheRed 3 роки тому +2

    Thanks for the tutorial!
    I was super stuck trying to figure out how to build a well structured menu system in Godot. Your videos really helped me figure things out!

  • @losatu8389
    @losatu8389 3 роки тому +1

    You are great. Thank you.

  • @nowayjosedaniel
    @nowayjosedaniel 4 роки тому +2

    Just to help out our C# brothers,
    GDScript
    "signal CloseOptionsMenu"
    C# would be
    "[Signal]
    public delegate void CloseOptionsMenu();"
    Same thing.

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

    Hello! I appreciate the time you take making these series, this video was incredibly helpful.
    Since you are taking suggestions, I'm very interested in making a deck building game (slay the spire for example). So the question would be a good way to have a shop display cards, the player buys cards, and they then are added to the players deck and drawn later. Basically how to neatly move that information between scenes I guess! I suppose items would be fairly similar as well.
    If you already have a video that you think is applicable, please let me know! Thanks!

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

      I just looked at your earlier videos and you literally have a series called advanced inventory! Whoops, I'll go watch that

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

      @@GEM4sta Hehe, I don't think I would recommend that one, although some lessons likely translate to your specific challenge. Things you can take out of there is a the item database in JSON. Can make a card database like that. The way I load images based on item name could be done the same with cards. I also deal with a fair bit of randomness in that tutorial. Which doesn't apply to the stats of your cards, but could be tweaked for the drawing of cards, or for what is available in the shop.
      As a closing remark, my advanced inventory series introduces a lot of elements, UI, Randomness, signals, JSON data, saving and loading. So as a general introduction, it likely provides you with a lot of the concepts you are going to require.

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

      @@GameDevelopmentCenter hey thanks so much for taking the time to reply! Really awesome, subscribed.
      Yeah, I have already started watching the json video and it seems exactly what I need. I'm thinking cards are essentially items with skills attached, and you have skill videos as well! Hopefully I can piece it together.

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

      @@GEM4sta Awesome, thx! You are welcome to join the discord. Whatever piecing together you have a problem with I'm sure the 100 or so Godot Devs on the discord can help you out with :)
      discord.gg/DwcFXyS

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

    Awesome as always.

  • @robinvandervegt3422
    @robinvandervegt3422 3 роки тому +1

    Why do you set the options values of the option dropdownmenu in the gui? And not in its own scene?

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

      Because I dislike scattered code. Feel free to code it in the scene itself :)

  • @aleksitjvladica.
    @aleksitjvladica. 4 роки тому

    Thank you My saviour!

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

    Very cool and useful!)😎But, how I can to make menu like Prototype 1?🤓

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

    Fantastic
    Super tutorial.

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

      Glad you liked it Syed :) Let me know if there is other topics you seek tutorials on :)

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

      @@GameDevelopmentCenter Thanks a lot.
      I watched many of your tutorials. This is the only one, which I can understand.
      I am a sturggling Godot learner, with no other experience in game making or sprite making things.
      If you can help, I need basics of godot like click drag and drop sprite, pushing an object with sprite. putting an scene in main scene.
      I will be greatful if you could provide some link for simple tutorials.
      I am watching your tutotials, so that I can ask you when have some experience in making games, as you are teaching a level above, what I can follow.

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

      @@GameDevelopmentCenter I purchased Udemy course, Ben teaches how to make game Hoppy days, in which a bunny jumps.

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

      @@syedrizvi6408 I heard good things about that course, I got a basic Godot series coming up as an introduction to a 'make a game series' :)

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

      @@GameDevelopmentCenter WOW. I will look forward for 'make a game series'

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

    Very nice, thanks a lot. But why do you have Options.Exit signal to Options which then signals to UI and not just straight away signal to UI itself? What do you gain by this "propagation"?

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

      Manageability, creating deep connections makes the code inflexible. It will require more maintenance if you ever decide to change the tree structure. Or would like to reuse the same options menu in another game.

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

      @@GameDevelopmentCenter Stuff like this is what I like most about your tutorials. You don't just explain things, you do things correctly too.

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

    how do I close the menu if I hit ESC again?

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

      Add a variable, a boolean, that keeps track if the menu is open or not.
      On input event = esc
      If state == true:
      close it
      else:
      open it

  • @ct-arg
    @ct-arg 4 роки тому

    Hi mate- I hope you are in good health..Most games when started have an introductory video ... before I get to the menu start, continue, options, etc ... My question is how could I add an mp4 introductory video and create the start menu afterwards.Could you help me with any tutorial?

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

      That is a good suggestion for a future video, Although there are nearly 150 video ideas on the list, that one is new! Thx! I would probably have a game root start a introscene with a video player. I would run a signal of the video player on_complete back to the root, which will queue_free the video scene and load the menu scene.

    • @ct-arg
      @ct-arg 4 роки тому

      @@GameDevelopmentCenter Thanks friend, I was able to do this by creating new scenes individually and not placing them within an already created one. Now the most difficult thing for me ... It is creating players from each team and giving them names ... that I have no idea

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

      @@ct-arg Step-by-step one step at the time :) It sounds like you want to do multiplayer? That is a steep learning curve. I would advise to try making singleplayer first :)
      Multiplayer and server-client interaction and dedicated server methods are topics we talk about very often on the discord. If you really want to go multiplayer, joining the discord could be very valuable :)

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

    in state machine, instead of int, enums would be perfect place to use but I don't think in gdscript there is any advantage of using them
    I also have request for tutorials: saving and loading game and also multiple maps support like in entering building or next level of dungeon

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

      Hey Piotr, I agree, for this use application enums would be nice, but hold no real performance advantage. Saving and loading is coming up in the next 1-2 weeks. That second request is a very interesting idea, adding it to the list!

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

      @@GameDevelopmentCenter I was thinking more about safety, by confining variable to specific allowed values like in statically typed languages

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

      @@piotrwojcicki5992 Well the only states it can now have is ID's from the optionButton, so by default, it is already confined to those options. Turning the ID to an enum will need another convert command most likely. So it is slimmer like this too, and people are welcome to improve upon it of course :)

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

    How would I go about having one input toggle the menu? I'm not sure how to get set up a single input to execute two different things under different circumstances. What I've tried hasn't worked.

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

      Make a state if the menu is open, true or false, check the state on input received and make the opposite happen with a if/else function

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

      @@GameDevelopmentCenter That did it! Of course! I'm still quite new, but I'm learning that creating a state machine for like everything makes things simpler.

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

      This wouldn't be classified as a statemachine, but storing the state of things, even UI panels is very common :)

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

    Hi friend ! Great tutorial its very useful. Can you also advise on how to fix on which resolution to use for android and IOS devices for non-pixel art games ? I'm a programmer and I'm trying to make a game all on my own but I'm confused on how to use the art and which resolution to use. Currently made the project 960x640 and my sprites are 240x160 but in Godot when I run debug it seems a little blurry. I increased the sprites resolution but it didn't look any better than the sprites at 240x160. Would be great if you could clear this confusion for me. Thanks

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

      This depends on the market you are targeting, and the saturation and distribution of screen sizes. Why did you pick 960x640?

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

      @@GameDevelopmentCenter I'm targeting only android and iOS devices. Want to make a simple mobile + tablet game right now. Honestly I'm a complete noob I picked 960x640 because I read somewhere that 3:2 scaling is good for mobile devices. A couple of months back for trials I once made a scene which was 2048x1536, I dont remember the sprites size, in godot debug mode I thought it looked blurry but I exported it to my ipad pro and it looked really sharp and good. However with such large size and many sprites I thought going for smaller resolution maybe better for memory and performance since I'm targeting only mobile and tablet. What do you think and how would you go about it ?

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

      @@chethanmohan I develop for Mobile, I use 720×1280

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

      @@GameDevelopmentCenter Ok can you tell me why you chose that resolution? Also for sprites do you use double of that, like 1440×2560 ? Ive read about some people doing that on forums. Do you check for screen size and use different Sprite resolution and background or is it only 720x1280? Sorry if it's too many questions this is very interesting for me :)

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

      @@chethanmohan That is a rhetorical question. In my first reply I suggest you choose a resolution for your target audience. So when you ask me why I choose my resolution, it is obviously because I target 720x1280. Maybe you should try a google search. 'Most used mobile screen resolution'. I would love to discuss the topic in depth, but currently have the feeling you have done no research on it. There are dozens of blog post on mobile target resolution that pop up when you Google. That answer these basic question with much more depth than I ever will be able to in a UA-cam comment :)

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

    I have watched your combat series
    And can u plz help me as i want to edit skill bar such a way by which the exp bar and skill bar will be linked and after certain level new skill unlocked...plz help

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому +4

      Hey Freak Star, I got a series coming up in for player development in which we take a look at character sheet stats, stat point, skillpoints and a skilltree. I'm sure that series will have the answers you're looking for :)

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

    I'm typing as i watch thanks for these clear tutorials much apprecited. Im wondering if you could do a tutorial series of building a text based adventure game from the 90's potentially or puzzle game. Also just wondering what are the nodes you use for the menu?

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

      Hey Stevie, thank you for your comment and suggestion. To be honest, I'm not sure if I will, I don't have experience as a designer or programmer with that genre, not sure if I can meet the quality level I want to reach with such a series.

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

      @@GameDevelopmentCenter your very welcocme and that is completly understandable.

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

      @@CreativeSteve69 Thx for your understanding Stevie, I'm sure I will make elements that could be implemented in such a game, like a dialogue system for example. Just not a whole series :)

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

      @@GameDevelopmentCenter That is compltely understandble. :)

  • @cmds.learning7426
    @cmds.learning7426 4 роки тому +1

    by godot coming!!

  • @Vianyte
    @Vianyte 3 роки тому +1

    For people using C#, the menu code works like this (without the exit button):
    public class UI : CanvasLayer
    {
    public Control gameMenu = null;

    public override void _Ready(){
    gameMenu = (Control)GetNode("GameMenu");
    }

    public override void _Input(InputEvent inputEvent){
    if (inputEvent.IsActionPressed("ui_start")){
    if (gameMenu.Visible){
    gameMenu.Hide();
    } else{
    gameMenu.Show();
    }
    }
    }
    }

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

    I can see this icon but dont work if i deteled optionsmenu
    ua-cam.com/video/p1l0M8u5EVc/v-deo.html this

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

    Hi! Dear good guy! I am a very bad translator! I find it difficult to understand you. Especially rewriting the code. Sorry! Can you show / give codes for this menu?

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

      No I don't provide any code base or scripts, I think it defeats the point of education :)

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

    cmon boyo, options without saving? 😔

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

      Yeah, the title says game menu, not save and load. I understand you want more content, that is great to hear. I won't however make tutorials 3 hours long. I prefer to cut tutorials up into sections so people have an easier time to find and navigate the specific concepts they would like to watch. Or in other words; this is UA-cam, not University

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

      @@GameDevelopmentCenter I mean saving the option you selected so you don't have to do it every time😍
      university is garbo😏

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

      @@ocoro174 That is pretty much exactly the same as a save/load system. Instead of a player, it's settings. I will get into that in another tutorial most likely at some point in the future, but it simply didn't make sense to put that in here. With the options menu, I already went a wee bit out of the main topic of this tutorial; a game menu.

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

    I am working on combat platformer game...is there any beginner game dev who want to join...mail me if u are interested i am not that skilled but i am average in godot and gdsript...it is a pixelated game...i already have a teammate its not any commercial game just for fun