Inspecting the Inspector Dock: A Godot 4 Tutorial: Text, Auto Translate, and Process Modes Explained

 Today, we will take an intimate look at the Inspector Dock. We will strip it down line by line and explore its most secret places. By the time we’re done, you’ll know every inch of its powerful properties—and it will never be the same again.

For this example, we will use a Label node. So, lets set the mood.

  1. Open Godot and create a new 2D Scene.

  2. Click the “+” icon to add a Label node.

  3. With the Label selected, direct your gaze to the Inspector Dock. This is where the magic happens.

Godot Inspector Dock Tutorial

The first text area, labeled Filter Properties, is a search tool. Try typing "font" in it and see what happens.

The biggest text field is used to store the words that our label will display. If you click the icon of four arrows pointing in different directions you will bring up an even larger text field. This makes it easy to type lengthy texts.

Next, we see Label Settings <empty>. The Label Settings is a resource that can be shared across multiple labels. It takes priority over individual label properties. This is useful if you want to maintain consistency through out your game.

The next set of options control how your text will be positioned on your label. You have your Horizontal and Vertical alignments as well as the Autowrap Mode.

I would suggest leaving the Justification Flags on their default settings. However, tampering with these might be useful if you plan to write in a non-alphabetic language, have special typography needs, or a specific visual design.

The Paragraph Separator has a default value of \n. This works well in most cases, but if you intend to include \n as part of your display text, you will need to come up with a different Paragraph Separator.

The Clip Text checkbox is used to trim away any text that exceeds the boundary of the label.

Text Overrun Behavior is also used to trim text that exceeds the label boundary. But this gives you some controls, like trim at a character or trim after a complete word. And you can add an ellipsis to indicate that text was trimmed.

The Ellipsis Character allows you to define a custom ellipsis.

The Uppercase checkbox if checked... I wonder what that does.

The Tab Stops allows you to modify how your label displays a tab indent.

The Displayed Text gives you controls over how much text gets displayed at one time. You can set line limits for example.

The BiDi (short for Bidirectional) option in Godot's Label node deals with the directionality of text. It is specifically used to handle text written in languages that are right-to-left (RTL), such as Arabic, Hebrew, or other languages that use a similar script.

Under the Control Section...




Layout controls how the Label fits inside its parent node, while the Clip Contents check box will clip any child nodes outside of the Label's boundary.

Localization holds the Localize Numeral System checkbox. This option will automatically format numbers in the Label's text to match the numeral system used by the current locale (language/region setting).

Tooltip contains a text field. This is where you can write some popup text for when a player hovers the mouse over the label. (Note: The mouse is not enabled by default.)

Focus refers to whether the label is currently selected to receive input. The Mode options are...
None: This label can never gain focus.
Click: This label will gain focus if clicked on by mouse.
All: This label can gain focus from mouse clicks, keyboard controls, or even game controllers.

The Neighbors allow you to define which node gains focus when a directional input is received.

Mouse allows you to make the label responsive to the mouse. For example... change the Filter to Stop. Now when the mouse stops over the label your Tooltip text will appear.

Input holds Shortcut Context. This allow you to determine when a shortcut for the label might be active. By default, shortcuts only work when the right part of the UI has focus or is the current context.

Theme allows you to assign a theme resource. If left <empty> then the appearance will be inherited by the parent node's theme or ultimately the games default theme.

Theme Overrides lets you define appearance overrides to the default theme. You can adjust color preferences to your label text here.

Under the CanvasItem Section...




Visibility gives you plenty of controls to decide if the label is visible and in what draw order it should be drawn.

Ordering allows you to set the Z Index. Useful if your label is part of a heads up display (HUD).

Texture comes into play if you are making a 3d game. It controls how to render a label at different distances.

Material. This is where you apply custom shader properties. But first you will need to define a custom shader.

And last we come to the Node Section...

The first is Process. The Mode options are Inherit. This means it has the same process as its parent node. Pausable means its process function is paused when the game is paused. When Paused will cause its process function to be called when the game is paused. Always means its process function is always called regardless of pause state. And Disabled.

Physics Interpolation can be turned on if your label is going to be affected by any game physics.

Auto Translate. This setting controls if the Label’s text will automatically be looked up in your project’s translation system, using the current locale (language setting).

Editor Description allows you to have some text popup when you hover the mouse over the Label in the Scene Dock.



And last you have an area for attaching a script.

I hope you have enjoyed this run through of the Inspector as it pertains to a Label Node.
Thanks for reading.



Comments

Popular Posts