@@ -41,8 +41,8 @@ icon, which we often use for prototyping in the community.
41
41
42
42
.. image :: img/scripting_first_script_icon.svg
43
43
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.
46
46
47
47
.. image :: img/scripting_first_script_click_other_node.webp
48
48
@@ -51,14 +51,14 @@ to create the node.
51
51
52
52
.. image :: img/scripting_first_script_add_sprite_node.webp
53
53
54
- Your Scene tab should now only have a Sprite2D node.
54
+ Your :ui: ` Scene ` tab should now only have a Sprite2D node.
55
55
56
56
.. image :: img/scripting_first_script_scene_tree.webp
57
57
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.
62
62
63
63
.. image :: img/scripting_first_script_setting_texture.webp
64
64
@@ -75,16 +75,16 @@ Creating a new script
75
75
---------------------
76
76
77
77
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 ` .
79
79
80
80
.. image :: img/scripting_first_script_attach_script.webp
81
81
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
83
83
language and file path, among other options.
84
84
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
86
86
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.
88
88
89
89
.. image :: img/scripting_first_script_attach_node_script.webp
90
90
@@ -93,7 +93,7 @@ click the **Create** button to create the script.
93
93
C# script names need to match their class name. In this case, you should name the
94
94
file ``MySprite2D.cs ``.
95
95
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
97
97
the following line of code:
98
98
99
99
.. tabs ::
@@ -120,16 +120,16 @@ node, including classes it extends, like ``Node2D``, ``CanvasItem``, and
120
120
class will implicitly extend :ref: `RefCounted <class_RefCounted >`, which
121
121
Godot uses to manage your application's memory.
122
122
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
124
124
our node's ``texture ``.
125
125
126
126
.. note ::
127
127
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
129
129
capitalized words separated by a space. In GDScript code, these properties
130
130
are in "snake_case", which is lowercase with words separated by an underscore.
131
131
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
133
133
its identifier in code.
134
134
135
135
Hello, world!
@@ -165,7 +165,7 @@ this function.
165
165
red and display the following error message: "Indented block expected".
166
166
167
167
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.
169
169
It should display "Hello, world!".
170
170
171
171
.. image :: img/scripting_first_script_print_hello_world.webp
@@ -178,7 +178,7 @@ Turning around
178
178
179
179
It's time to make our node move and rotate. To do so, we're going to add two
180
180
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.
182
182
183
183
.. tabs ::
184
184
.. code-tab :: gdscript GDScript
0 commit comments