Skip to content

Commit f674f72

Browse files
authored
Merge pull request #11177 from skyace65/StepByStepUi
Add UI roles to remaining step by step pages
2 parents a5eedd9 + 7338979 commit f674f72

File tree

5 files changed

+46
-44
lines changed

5 files changed

+46
-44
lines changed

getting_started/step_by_step/instancing.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ you to download the ball's sample project we prepared for you:
5252
`instancing_starter.zip <https://github.com/godotengine/godot-docs-project-starters/releases/download/latest-4.x/instancing_starter.zip>`_.
5353

5454
Extract the archive on your computer. To import it, you need the Project Manager.
55-
The Project Manager is accessed by opening Godot, or if you already have Godot opened, click on *Project -> Quit to Project List* (:kbd:`Ctrl + Shift + Q`, :kbd:`Ctrl + Option + Cmd + Q` on macOS)
55+
The Project Manager is accessed by opening Godot, or if you already have Godot
56+
opened, click on :menu:`Project > Quit to Project List` (:kbd:`Ctrl + Shift + Q`, :kbd:`Ctrl + Option + Cmd + Q` on macOS)
5657

57-
In the Project Manager, click the *Import* button to import the project.
58+
In the Project Manager, click the :button:`Import` button to import the project.
5859

5960
.. image:: img/instancing_import_button.webp
6061

@@ -63,12 +64,12 @@ Double-click the ``project.godot`` file to open it.
6364

6465
.. image:: img/instancing_import_project_file.webp
6566

66-
Finally, click the Import & Edit button.
67+
Finally, click the :button:`Import`` button.
6768

6869
.. image:: img/instancing_import_and_edit_button.webp
6970

7071
A window notifying you that the project was last opened in an older Godot version
71-
may appear, that's not an issue. Click *Ok* to open the project.
72+
may appear, that's not an issue. Click :button:`Ok`` to open the project.
7273

7374
The project contains two packed scenes: ``main.tscn``, containing walls against
7475
which the ball collides, and ``ball.tscn``. The Main scene should open
@@ -118,7 +119,7 @@ Editing scenes and instances
118119
There is more to instances. With this feature, you can:
119120

120121
1. Change the properties of one ball without affecting the others using the
121-
Inspector.
122+
:ui:`Inspector`.
122123
2. Change the default properties of every Ball by opening the ``ball.tscn`` scene
123124
and making a change to the Ball node there. Upon saving, all instances of the
124125
Ball in the project will see their values update.
@@ -130,8 +131,8 @@ Let's try this. Double-click ``ball.tscn`` in the FileSystem to open it.
130131

131132
.. image:: img/instancing_ball_scene_open.webp
132133

133-
In the Scene dock on the left, select the Ball node. Then, in the Inspector on the right, click on the PhysicsMaterial
134-
property to expand it.
134+
In the Scene dock on the left, select the Ball node. Then, in the :ui:`Inspector` on the
135+
right, click on the :inspector:`PhysicsMaterial`` property to expand it.
135136

136137
.. image:: img/instancing_physics_material_expand.webp
137138

@@ -149,8 +150,8 @@ on the corresponding tab above the viewport.
149150

150151
.. image:: img/instancing_scene_tabs.webp
151152

152-
Select one of the instanced Ball nodes and, in the Inspector, set its Gravity
153-
Scale value to ``10``.
153+
Select one of the instanced Ball nodes and, in the :ui:`Inspector`, set its
154+
:inspector:`Gravity Scale` value to ``10``.
154155

155156
.. image:: img/instancing_property_gravity_scale.png
156157

@@ -167,11 +168,11 @@ Rerun the game and notice how this ball now falls much faster than the others.
167168

168169
.. note::
169170

170-
You may notice you are unable to change the values of the PhysicsMaterial
171-
of the ball. This is because PhysicsMaterial is a *resource*, and needs
171+
You may notice you are unable to change the values of the :inspector:`PhysicsMaterial`
172+
of the ball. This is because :inspector:`PhysicsMaterial` is a *resource*, and needs
172173
to be made unique before you can edit it in a scene that is linking to its
173174
original scene. To make a resource unique for one instance, right-click on
174-
the **Physics Material** property in the Inspector and click **Make Unique**
175+
the :inspector:`Physics Material` property in the :ui:`Inspector`` and click :button:`Make Unique``
175176
in the context menu.
176177

177178
Resources are another essential building block of Godot games we will cover

getting_started/step_by_step/nodes_and_scenes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ opening the project, you should see an empty editor.
7272

7373
.. image:: img/nodes_and_scenes_01_empty_editor.webp
7474

75-
In an empty scene, the Scene dock on the left shows several options to add a
75+
In an empty scene, the :ui:`Scene`` dock on the left shows several options to add a
7676
root node quickly. :button:`2D Scene` adds a :ref:`Node2D <class_Node2D>` node,
7777
:button:`3D Scene` adds a :ref:`Node3D <class_Node3D>` node,
7878
and :button:`User Interface` adds a :ref:`Control <class_Control>` node.

getting_started/step_by_step/scripting_first_script.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ icon, which we often use for prototyping in the community.
4141

4242
.. image:: img/scripting_first_script_icon.svg
4343

44-
We need to create a Sprite2D node to display it in the game. In the Scene dock,
45-
click the **Other Node** button.
44+
We need to create a Sprite2D node to display it in the game. In the :ui:`Scene` dock,
45+
click the :button:`Other Node` button.
4646

4747
.. image:: img/scripting_first_script_click_other_node.webp
4848

@@ -51,14 +51,14 @@ to create the node.
5151

5252
.. image:: img/scripting_first_script_add_sprite_node.webp
5353

54-
Your Scene tab should now only have a Sprite2D node.
54+
Your :ui:`Scene` tab should now only have a Sprite2D node.
5555

5656
.. image:: img/scripting_first_script_scene_tree.webp
5757

58-
A Sprite2D node needs a texture to display. In the Inspector on the right, you
59-
can see that the **Texture** property says ``<empty>``. To display the Godot icon,
60-
click and drag the file ``icon.svg`` from the FileSystem dock onto the Texture
61-
slot.
58+
A Sprite2D node needs a texture to display. In the :ui:`Inspector` on the right, you
59+
can see that the :inspector:`Texture` property says ``<empty>``. To display the
60+
Godot icon, click and drag the file ``icon.svg`` from the FileSystem dock onto the
61+
Texture slot.
6262

6363
.. image:: img/scripting_first_script_setting_texture.webp
6464

@@ -75,16 +75,16 @@ Creating a new script
7575
---------------------
7676

7777
To create and attach a new script to our node, right-click on Sprite2D in the
78-
Scene dock and select **Attach Script**.
78+
Scene dock and select :button:`Attach Script`.
7979

8080
.. image:: img/scripting_first_script_attach_script.webp
8181

82-
The **Attach Node Script** window appears. It allows you to select the script's
82+
The :ui:`Attach Node Script` window appears. It allows you to select the script's
8383
language and file path, among other options.
8484

85-
Change the **Template** field from ``Node: Default`` to ``Object: Empty`` to
85+
Change the :ui:`Template` field from ``Node: Default`` to ``Object: Empty`` to
8686
start with a clean file. Leave the other options set to their default values and
87-
click the **Create** button to create the script.
87+
click the :button:`Create` button to create the script.
8888

8989
.. image:: img/scripting_first_script_attach_node_script.webp
9090

@@ -93,7 +93,7 @@ click the **Create** button to create the script.
9393
C# script names need to match their class name. In this case, you should name the
9494
file ``MySprite2D.cs``.
9595

96-
The Script workspace should appear with your new ``sprite_2d.gd`` file open and
96+
The :ui:`Script` workspace should appear with your new ``sprite_2d.gd`` file open and
9797
the following line of code:
9898

9999
.. tabs::
@@ -120,16 +120,16 @@ node, including classes it extends, like ``Node2D``, ``CanvasItem``, and
120120
class will implicitly extend :ref:`RefCounted <class_RefCounted>`, which
121121
Godot uses to manage your application's memory.
122122

123-
Inherited properties include the ones you can see in the Inspector dock, like
123+
Inherited properties include the ones you can see in the :ui:`Inspector` dock, like
124124
our node's ``texture``.
125125

126126
.. note::
127127

128-
By default, the Inspector displays a node's properties in "Title Case", with
128+
By default, the :ui:`Inspector` displays a node's properties in "Title Case", with
129129
capitalized words separated by a space. In GDScript code, these properties
130130
are in "snake_case", which is lowercase with words separated by an underscore.
131131

132-
You can hover over any property's name in the Inspector to see a description and
132+
You can hover over any property's name in the :ui:`Inspector` to see a description and
133133
its identifier in code.
134134

135135
Hello, world!
@@ -165,7 +165,7 @@ this function.
165165
red and display the following error message: "Indented block expected".
166166

167167
Save the scene as ``sprite_2d.tscn`` if you haven't already, then press :kbd:`F6` (:kbd:`Cmd + R` on macOS)
168-
to run it. Look at the **Output** bottom panel that expands.
168+
to run it. Look at the :ui:`Output` bottom panel that expands.
169169
It should display "Hello, world!".
170170

171171
.. image:: img/scripting_first_script_print_hello_world.webp
@@ -178,7 +178,7 @@ Turning around
178178

179179
It's time to make our node move and rotate. To do so, we're going to add two
180180
member variables to our script: the movement speed in pixels per second and the
181-
angular speed in radians per second. Add the following after the ``extends Sprite2D`` line.
181+
angular speed in radians per second. Add the following after the ``extends Sprite2D`` line.
182182

183183
.. tabs::
184184
.. code-tab:: gdscript GDScript

getting_started/step_by_step/scripting_player_input.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ The two actions we use above, "ui_left" and "ui_right", are predefined in every
7474
Godot project. They respectively trigger when the player presses the left and
7575
right arrows on the keyboard or left and right on a gamepad's D-pad.
7676

77-
.. note:: You can see and edit input actions in your project by going to Project
78-
-> Project Settings and clicking on the Input Map tab.
77+
.. note:: You can see and edit input actions in your project by going to
78+
:menu:`Project > Project Settings` and clicking on the :ui:`Input Map` tab.
7979

8080
Finally, we use the ``direction`` as a multiplier when we update the node's
8181
``rotation``: ``rotation += angular_speed * direction * delta``.

getting_started/step_by_step/signals.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ To add a button to our game, we will create a new scene which will include
5858
both a :ref:`Button <class_button>` and the ``sprite_2d.tscn`` scene we created in
5959
the :ref:`doc_scripting_first_script` lesson.
6060

61-
Create a new scene by going to the menu Scene -> New Scene.
61+
Create a new scene by going to the menu :menu:`Scene > New Scene`.
6262

6363
.. image:: img/signals_01_new_scene.webp
6464

65-
In the Scene dock, click the 2D Scene button. This will add
65+
In the Scene dock, click the :button:`2D Scene`` button. This will add
6666
a :ref:`Node2D <class_Node2D>` as our root.
6767

6868
.. image:: img/signals_02_2d_scene.webp
@@ -73,7 +73,7 @@ previously onto the Node2D to instantiate it.
7373
.. image:: img/signals_03_dragging_scene.png
7474

7575
We want to add another node as a sibling of the Sprite2D. To do so, right-click
76-
on Node2D and select Add Child Node.
76+
on Node2D and select :button:`Add Child Node`.
7777

7878
.. image:: img/signals_04_add_child_node.webp
7979

@@ -92,8 +92,8 @@ If you don't see the handles, ensure the select tool is active in the toolbar.
9292

9393
Click and drag on the button itself to move it closer to the sprite.
9494

95-
You can also write a label on the Button by editing its Text property in the
96-
Inspector. Enter ``Toggle motion``.
95+
You can also write a label on the Button by editing its :inspector:`Text` property
96+
in the :ui:`Inspector`. Enter ``Toggle motion``.
9797

9898
.. image:: img/signals_08_toggle_motion_text.webp
9999

@@ -114,8 +114,9 @@ want to call a new function that will toggle its motion on and off. We need to
114114
have a script attached to the Sprite2D node, which we do from the previous
115115
lesson.
116116

117-
You can connect signals in the Node dock. Select the Button node and, on the
118-
right side of the editor, click on the tab named "Node" next to the Inspector.
117+
You can connect signals in the :ui:`Node` dock. Select the Button node and, on the
118+
right side of the editor, click on the tab named :ui:`Node` next to the
119+
:ui:`Inspector`.
119120

120121
.. image:: img/signals_10_node_dock.webp
121122

@@ -142,7 +143,7 @@ methods "_on_node_name_signal_name". Here, it'll be "_on_button_pressed".
142143

143144
The advanced view lets you connect to any node and any built-in
144145
function, add arguments to the callback, and set options. You can
145-
toggle the mode in the window's bottom-right by clicking the Advanced
146+
toggle the mode in the window's bottom-right by clicking the :button:`Advanced`
146147
button.
147148

148149
.. note::
@@ -151,8 +152,8 @@ methods "_on_node_name_signal_name". Here, it'll be "_on_button_pressed".
151152
automatic code generation might not work. In this case, you need to connect
152153
the signal via code as explained in the next section.
153154

154-
Click the Connect button to complete the signal connection and jump to the
155-
Script workspace. You should see the new method with a connection icon in the
155+
Click the :button:`Connect` button to complete the signal connection and jump to the
156+
:ui:`Script` workspace. You should see the new method with a connection icon in the
156157
left margin.
157158

158159
.. image:: img/signals_13_signals_connection_icon.webp
@@ -273,7 +274,7 @@ this.
273274

274275
.. image:: img/signals_15_scene_tree.webp
275276

276-
With the Timer node selected, go to the Inspector and enable the **Autostart**
277+
With the Timer node selected, go to the :ui:`Inspector` and enable the :inspector:`Autostart`
277278
property.
278279

279280
.. image:: img/signals_18_timer_autostart.webp
@@ -466,7 +467,7 @@ reaches 0.
466467
.. note:: As signals represent events that just occurred, we generally use an
467468
action verb in the past tense in their names.
468469

469-
Your signals work the same way as built-in ones: they appear in the Node tab and
470+
Your signals work the same way as built-in ones: they appear in the :ui:`Node` tab and
470471
you can connect to them like any other.
471472

472473
.. image:: img/signals_17_custom_signal.webp

0 commit comments

Comments
 (0)