Outils pour utilisateurs

Outils du site


issue223:godot

Ceci est une ancienne révision du document !


I just got myself a few books on Godot and found them lacking. I went onto Youtube and looked at a few “basic” tutorials. I copied down Brackey's 2D tutorial and ended up with a mini game. But(!), copypasta is not learning. (I want to know why!) Though I can say that this Brackeys tutorial *did work, unlike another I tried, I still felt “left out”. Things I wanted were not explained and things I did not need were explained. I headed back to my book, but that was a mess, with instructions like this: Open a node3d, look at it, delete it, open a node2d, look at it, delete it. You can understand my frustration. That’s when it hit me. If I’m having issues like these, others may too… This article series is aimed at complete n00bs – no experience required! This is mainly because I am a n00b too! I’m using this series as a way to explain what I understand, so that I can be sure that I know, the bit that I know, you know? So here is a tutorial on the Godot interface. Though I’m going to show you around, initially, we will also tackle some “why’s”. I’ll make a separate article on GDScript, I first want the foundation right. I want to help others that may be stuck like me, so don’t expect expert matter. Fire up Godot and let’s get to grips with it. This article series may be a bit image heavy, but bear with me. When you open Godot for the first time, you are greeted with a window with a header like the one shown above.

Before you do anything, I want you to click on the “settings” button on the right. Here you can set the interface language and change the theme, as well as the scaling – important if you are a bit sight impaired. You also get to change the “Directory naming convention”. By default it is “kebab case”, I prefer to have my directories in “Title Case”, like a normal person, but there are other options for your preference. That was the first thing none of the books or tutorials covered, but I think one should know about. Now we can go and create a new project. At the first field of entry, we can name our project, be it a game or application. The project path gives you a new folder in your home folder, but if you are like me and set up a folder with sub-folders already, you *will get a warning when browsing to said folder, containing say, another folder with your assets. (“The selected path is not empty”) If you are 100% sure your path is correct, you can ignore this warning. The next part, the renderer, does not matter and I’ll show you *why in a bit. For “Version control Metadata” we will be setting ours to “none”, as we are all home users and do not intend on training someone’s AI for free, just to put you out of a job, later. Once you click “Create”, we will be taken to the main Godot interface that we will be spending our time in. We start at the top (shown below). On the left, we have our menu items, followed by our views, which has icons next to the names and are in bold, then comes the controllers, allowing us to play the scenes and lastly the renderer. Remember that I told you “renderer” did not matter on the previous screen? That is because you can come and change it here any time you like. Though Godot is a “game” engine, there is nothing stopping you making applications with it. In fact, there are a few applications made with Godot, and even other game engines! So don’t write off Godot as ‘just’ a game engine. Much like Lazarus or Visual Basic, it excels at making “windows” and buttons and labels for people to interface with. Let’s move on. Going down, we find what's shown above.

Please note, I’m using the default layout for this article and you can change the layout to suit your needs. Let’s concentrate on the centre, as the columns on either side can be moved. You will see that there is a pointer, highlighted, by default. This is our “Select” pointer. If you need it, simply press “Q” or “q”. This allows you to select things. The next icon is the “Move” pointer and you can get to it via the short-cut key, “W” or “w”. This is like moving a sheet of paper that you are drawing on. If you are brand new to Godot, this will trip you up. Everything you see on screen is placed via a vector. To keep it simple, we will stick with 2D for now. (2 vectors) When you create objects on the screen, they are usually overlaid with something else, say, a collision shape, or they don’t interact. The trick is to create scenes with every object and then *link them to your main scene – more on this in the future. Why I mentioned vectors is that everything is relative… to 0,0! This (0,0) is the origin point of your screen, top left, not bottom left! This means that if you drag one layer off by a few pixels and you don’t realise it, things can go horribly wrong in your game, for instance. (I know! Like five years ago, when I first tried Godot, I tried the “Pong” and “Avoid the creeps” tutorials and got bitten.) Don’t worry though, we have ways of fixing those errors. For now, just know that you need to be careful when moving things, first check which icon is highlighted, before you move. The next two icons are “Rotate” and “Scale”, both these will add “handles” to your objects for you to manipulate the objects with. As with all things computer, there is more than one way to do things, and you can also do this in the side panels, or via code.

While we are on the topic of making mistakes, at any time, you can press CTRL+z to undo! As a newbie, this will be your saving grace a lot of times. OK - the next two buttons I have never used, and you are welcome to click them. You will see that nothing changes and no handles appear. We don’t need them as of now, so we leave them be. (for now…) Next, we have “Pan mode” (middle mouse button move or G) that is not to be confused with move mode (second icon). One moves the canvas on the screen, while the other one moves the screen or viewport. You can try it out, but without something to reference it against, you will not “see” it move. (You know, like relativity, if there is nothing to move relative to, are you moving anything?) So drag the Godot icon to the screen before testing! Than brings me to my next point, play, play play. You cannot break anything in an empty project. Even if you manage to do so, you discard it and open a new one, so feel free to try out anything and see what it does! The next icon is the “Ruler” “R” or “r”. Not as in king, but as in measurement. When you are in this mode, you can drag a ruler out of the margins and it will measure, in pixels, as you move it. This can be handy when you need to do some maths, like say, you are making Pong and you don’t want your paddle to go out of the playing area. You have no idea how big your paddle is, so you measure it and then subtract half from the edge of the screen, for your stopping position.

The next two icons are for snapping. When you need to snap things to a grid layout, for instance, when you are painting a level, you will use these. They are “Smart Snap” and “Snap to Grid” and we will see them in action a bit later in this series. On an empty project, you won’t see anything. The upright ellipses are for configuring the snapping behaviour. The next two are for nodes you are working on. The first locks the node, for when you have something just so, and you don’t want it to change and the next one is “Grouping” the node and it’s children, for instance, if you want to move the lot at once. Like before, there are other ways to achieve this too, though, I used to use it often in the beginning when I first used Godot, I now seldom do. I suspect it will be the same for you. The bone icon is just that, options for skeletons, if you use models. For now, we will be sticking to the simple things, getting you to do stuff. If there is interest, we can move on to more in-depth things. The thing I want you to take home is try, plop the Godot icon on the screen by dragging it to the centre pane and try out the buttons on it, (with it selected) to see what they do. I’ll leave “View” to you, as it is just that, viewing options. Join us next issue as we explore further! Complaints? misc@fullcirclemagazine.org

issue223/godot.1764580456.txt.gz · Dernière modification : 2025/12/01 10:14 de d52fr