Skip to content

Commit ae602ba

Browse files
authored
Merge pull request #7384 from Piralein/ui-stuff
2 parents 3599cfb + 16d1831 commit ae602ba

File tree

1 file changed

+17
-34
lines changed

1 file changed

+17
-34
lines changed

getting_started/first_2d_game/06.heads_up_display.rst

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,12 @@ Inspector. The default font for ``Control`` nodes is small and doesn't scale
3636
well. There is a font file included in the game assets called
3737
"Xolonium-Regular.ttf". To use this font, do the following:
3838

39-
1. Under "Theme Overrides > Fonts", choose "Load" and select the "Xolonium-Regular.ttf" file.
39+
Under "Theme Overrides > Fonts", choose "Load" and select the "Xolonium-Regular.ttf" file.
4040

4141
.. image:: img/custom_font_load_font.webp
4242

43-
Once you've done this on the ``ScoreLabel``, you can click the down arrow next
44-
to the Font property and choose "Copy", then "Paste" it in the same place
45-
on the other two Control nodes.
46-
Set the "Font Size" property of the ``ScoreLabel`` under "Theme Overrides > Font Sizes".
47-
A setting of ``64`` works well.
43+
The font size is still to small, increase it to ``64`` under "Theme Overrides > Font Sizes".
44+
Once you've done this with the ``ScoreLabel``, repeat the changes for the ``Message`` and ``StartButton`` nodes.
4845

4946
.. image:: img/custom_font_size.webp
5047

@@ -54,48 +51,34 @@ A setting of ``64`` works well.
5451

5552
Arrange the nodes as shown below.
5653
You can drag the nodes to place them manually, or for more precise placement,
57-
use "Anchor Presets" with the following settings:
54+
use "Anchor Presets".
5855

5956
.. image:: img/ui_anchor.webp
6057

6158
ScoreLabel
6259
~~~~~~~~~~
6360

64-
Layout :
65-
66-
- Anchor Preset : ``Center Top``
67-
68-
Label settings :
69-
70-
- Text : ``0``
71-
- Horizontal Alignment : ``Center``
72-
- Vertical Alignment : ``Center``
61+
1. Add the text ``0``.
62+
2. Set the "Horizontal Alignment" and "Vertical Alignment" to ``Center``.
63+
3. Choose the "Anchor Preset" ``Center Top``.
7364

7465
Message
7566
~~~~~~~~~~~~
7667

77-
Layout :
78-
79-
- Anchor Preset : ``Center``
80-
81-
Label settings :
82-
83-
- Text : ``Dodge the Creeps!``
84-
- Horizontal Alignment : ``Center``
85-
- Vertical Alignment : ``Center``
86-
- Autowrap Mode : ``Word``
68+
1. Add the text ``Dodge the creeps!``.
69+
2. Set the "Horizontal Alignment" and "Vertical Alignment" to ``Center``.
70+
3. Set the "Autowrap Mode" to ``Word``, otherwise the label will stay on one line.
71+
4. Under "Control - Layout/Transform" set "Size X" to ``480`` to use the entire width of the screen.
72+
5. Choose the "Anchor Preset" ``Center``.
8773

8874
StartButton
8975
~~~~~~~~~~~
9076

91-
Layout :
92-
93-
- Anchor Preset : ``Center Bottom``
94-
95-
Button settings :
96-
97-
- Text : ``Start``
98-
- Position Y : ``580`` (Control - Layout/Transform)
77+
1. Add the text ``Start``.
78+
2. Under "Control - Layout/Transform", set "Size X" to ``200`` and "Size Y" to ``100``
79+
to add a little bit more padding between the border and text.
80+
3. Choose the "Anchor Preset" ``Center Bottom``.
81+
4. Under "Control - Layout/Transform", set "Position Y" to ``580``.
9982

10083
On the ``MessageTimer``, set the ``Wait Time`` to ``2`` and set the ``One Shot``
10184
property to "On".

0 commit comments

Comments
 (0)