mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Standardize RST header syntax
This commit is contained in:
@@ -200,7 +200,7 @@ LightOccluder2D nodes have 2 properties:
|
||||
There are two ways to create light occluders:
|
||||
|
||||
Automatically generating a light occluder
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Occluders can be created automatically from Sprite2D nodes by selecting the
|
||||
node, clicking the **Sprite2D** menu at the top of the 2D editor then choosing
|
||||
@@ -213,7 +213,7 @@ edges), adjust **Grow (pixels)** and **Shrink (pixels)**, then click **Update
|
||||
Preview**. Repeat this operation until you get satisfactory results.
|
||||
|
||||
Manually drawing a light occluder
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Create a LightOccluder2D node, then select the node and click the "+" button at
|
||||
the top of the 2D editor. When asked to create a polygon resource, answer
|
||||
@@ -256,7 +256,7 @@ The following properties can be adjusted on 2D lights that have shadows enabled:
|
||||
Soft shadows with streaking artifacts due to Filter Smooth being too high (PCF5, Filter Smooth 4)
|
||||
|
||||
Occluder draw order
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**LightOccluder2Ds follows the usual 2D drawing order.** This is important for 2D
|
||||
lighting, as this is how you control whether the occluder should occlude the
|
||||
|
||||
@@ -259,7 +259,7 @@ You will have to code a function to perform this and draw it yourself.
|
||||
to adjust the project to a higher resolution (a 2 or 4 scale tends to work well).
|
||||
|
||||
Drawing a custom polygon shape
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
While there is a dedicated node to draw custom polygons (
|
||||
:ref:`Polygon2D <class_Polygon2D>`), we will use in this case exclusively lower
|
||||
@@ -394,7 +394,7 @@ Polygons will always **connect its last defined point to its first
|
||||
one** in order to have a closed shape.
|
||||
|
||||
Drawing connected lines
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Drawing a sequence of connected lines that don't close down to form a polygon
|
||||
is very similar to the previous method. We will use a connected set of lines to
|
||||
@@ -499,7 +499,7 @@ code or a predefined color name. Check the class :ref:`Color <class_Color>` for
|
||||
constants and ways to define Colors.
|
||||
|
||||
Drawing circles
|
||||
^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
To create the eyes, we are going to add 4 additional calls to draw the eye
|
||||
shapes, in different sizes, colors and positions.
|
||||
@@ -555,7 +555,7 @@ arbitrary angles), you can use the method
|
||||
:ref:`draw_arc <class_CanvasItem_method_draw_arc>`.
|
||||
|
||||
Drawing lines
|
||||
^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
To draw the final shape (the nose) we will use a line to approximate it.
|
||||
|
||||
@@ -610,7 +610,7 @@ you may get additional performance by drawing all of them in a single call, usin
|
||||
the :ref:`draw_multiline <class_CanvasItem_method_draw_multiline>` method.
|
||||
|
||||
Drawing text
|
||||
^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~
|
||||
|
||||
While using the :ref:`Label <class_Label>` Node is the most common way to add
|
||||
text to your application, the low-level `_draw` function includes functionality
|
||||
@@ -680,7 +680,7 @@ can be found on the :ref:`CanvasItem <class_CanvasItem>` class reference.
|
||||
.. _doc_draw_show_drawing_while_editing_example:
|
||||
|
||||
Show the drawing while editing
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
While the code so far is able to draw the logo on a running window, it will
|
||||
not show up on the ``2D view`` on the editor. In certain cases you would
|
||||
@@ -710,7 +710,7 @@ to refresh the current node in the ``2D`` view the first time you add or remove
|
||||
the ``@tool`` annotation.
|
||||
|
||||
Animation
|
||||
^^^^^^^^^
|
||||
~~~~~~~~~
|
||||
|
||||
If we wanted to make the custom shape change at runtime, we could modify the
|
||||
methods called or its arguments at execution time, or apply a transform.
|
||||
@@ -870,7 +870,7 @@ will see how to draw a dynamic line whose coordinates are not known beforehand,
|
||||
and are affected by the user's input.
|
||||
|
||||
Drawing a straight line between 2 points
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Let's assume we want to draw a straight line between 2 points, the first one
|
||||
will be fixed on the upper left corner ``(0, 0)`` and the second will be defined
|
||||
@@ -943,7 +943,7 @@ It should look like this when run:
|
||||
.. image:: img/draw_line_between_2_points.webp
|
||||
|
||||
Drawing an arc between 2 points
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The above example works, but we may want to join those 2 points with a
|
||||
different shape or function, other than a straight line.
|
||||
|
||||
@@ -20,7 +20,7 @@ This page will show you the 2D workspace and how you can get to know it.
|
||||
.. tip:: If you would like to get an introduction to 3D, see :ref:`doc_introduction_to_3d`.
|
||||
|
||||
2D workspace
|
||||
~~~~~~~~~~~~
|
||||
------------
|
||||
|
||||
You will use the 2D workspace to work with 2D scenes, design levels, or create user
|
||||
interfaces.
|
||||
@@ -47,7 +47,7 @@ applicable.
|
||||
|
||||
|
||||
Main toolbar
|
||||
------------
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Some buttons in the main toolbar are the same as those in the 3D workspace. A brief explanation
|
||||
is given with the shortcut if the mouse cursor is hovered over a button for one second.
|
||||
@@ -182,7 +182,7 @@ provides buttons to add, modify, or remove points.
|
||||
|
||||
|
||||
Coordinate system
|
||||
-----------------
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
In the 2D editor, unlike 3D, there are only two axes: ``x`` and ``y``. Also, the viewing
|
||||
angle is fixed.
|
||||
@@ -206,7 +206,7 @@ Dragging in a negative direction flips the node horizontally or vertically.
|
||||
.. _doc_introduction_to_2d_the_viewport:
|
||||
|
||||
2D Viewport
|
||||
-----------
|
||||
~~~~~~~~~~~
|
||||
|
||||
The viewport will be the area you spend the most time if you plan to design levels or user
|
||||
interfaces visually:
|
||||
@@ -298,7 +298,7 @@ Viewport has a **View** menu which provides several options to change the look o
|
||||
|
||||
|
||||
Node2D and Control node
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
-----------------------
|
||||
|
||||
:ref:`CanvasItem <class_CanvasItem>` is the base node for 2D. :ref:`Node2D <class_Node2D>` is the base node
|
||||
for 2D game objects, and :ref:`Control <class_Control>` is the base node
|
||||
|
||||
@@ -55,7 +55,7 @@ Each TileMapLayer node has several properties you can adjust:
|
||||
- **TileSet** The tileset used by the TileMapLayer node.
|
||||
|
||||
Rendering
|
||||
^^^^^^^^^
|
||||
~~~~~~~~~
|
||||
|
||||
- **Y Sort Origin:** The vertical offset to use for Y-sorting on each tile (in pixels).
|
||||
Only effective if **Y Sort Enabled** under CanvasItem settings is ``true``.
|
||||
@@ -67,7 +67,7 @@ Rendering
|
||||
TileMapLayer since tiles are grouped by Y position in that case.
|
||||
|
||||
Physics
|
||||
^^^^^^^
|
||||
~~~~~~~
|
||||
- **Collision Enabled** Enables or disables collision.
|
||||
- **Use Kinematic Bodies** When true TileMapLayer collision shapes will be instantiated
|
||||
as kinematic bodies.
|
||||
@@ -75,7 +75,7 @@ Physics
|
||||
visible. If set to default, then it depends on the show collision debug settings.
|
||||
|
||||
Navigation
|
||||
^^^^^^^^^^
|
||||
~~~~~~~~~~
|
||||
|
||||
- **Navigation Enabled** Whether or not navigation regions are enabled.
|
||||
- **Navigation Visible** Whether or not the TileMapLayer's navigation meshes are
|
||||
@@ -91,7 +91,7 @@ Navigation
|
||||
2D navigation meshes can not be "layered" or stacked on top of each other like visuals or physic shapes. Attempting to stack navigation meshes on the same navigation map will result in merge and logical errors that break the pathfinding.
|
||||
|
||||
Reordering layers
|
||||
^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can reorder layers by drag-and-dropping their node in the Scene tab. You can
|
||||
also switch between which TileMapLayer node you're working on by using the buttons
|
||||
@@ -195,7 +195,7 @@ the 2D editor, **not** the TileMap panel itself.
|
||||
From left to right, the painting modes and tools you can choose are:
|
||||
|
||||
Selection
|
||||
^^^^^^^^^
|
||||
~~~~~~~~~
|
||||
|
||||
Select tiles by clicking a single tile, or by holding down the left mouse button to
|
||||
select multiple with a rectangle in the 2D editor. Note that empty space cannot be
|
||||
@@ -221,7 +221,7 @@ then performing a selection.
|
||||
Right-click or press :kbd:`Escape` to cancel pasting.
|
||||
|
||||
Paint
|
||||
^^^^^
|
||||
~~~~~
|
||||
|
||||
The standard Paint mode allows you to place tiles by clicking or holding
|
||||
down the left mouse button.
|
||||
@@ -250,7 +250,7 @@ the left mouse button.
|
||||
This is identical to using the Picker tool described below.
|
||||
|
||||
Line
|
||||
^^^^
|
||||
~~~~
|
||||
|
||||
After selecting Line Paint mode, you can draw in a line that is
|
||||
always 1 tile thick (no matter its orientation).
|
||||
@@ -270,7 +270,7 @@ You can toggle this mode temporarily while in Paint or Eraser mode by holding
|
||||
Using the line tool after selecting two tiles to draw platforms diagonally
|
||||
|
||||
Rectangle
|
||||
^^^^^^^^^
|
||||
~~~~~~~~~
|
||||
|
||||
After selecting Rectangle Paint mode, you can draw in an axis-aligned
|
||||
rectangle.
|
||||
@@ -285,7 +285,7 @@ You can toggle this mode temporarily while in Paint or Eraser mode by holding
|
||||
:kbd:`Ctrl` and :kbd:`Shift` then drawing.
|
||||
|
||||
Bucket Fill
|
||||
^^^^^^^^^^^
|
||||
~~~~~~~~~~~
|
||||
|
||||
After selecting Bucket Fill mode, you can choose whether painting should be
|
||||
limited to contiguous areas only by toggling the **Contiguous** checkbox that
|
||||
@@ -313,7 +313,7 @@ you can place them in a repeating pattern within the filled area.
|
||||
Using the Bucket Fill tool
|
||||
|
||||
Picker
|
||||
^^^^^^
|
||||
~~~~~~
|
||||
|
||||
After selecting Picker mode, you can pick existing tiles in the 2D editor by
|
||||
holding :kbd:`Ctrl` then clicking on a tile. This will switch the currently
|
||||
@@ -325,7 +325,7 @@ You can toggle this mode temporarily while in Paint mode by holding :kbd:`Ctrl`
|
||||
then clicking or dragging the mouse.
|
||||
|
||||
Eraser
|
||||
^^^^^^
|
||||
~~~~~~
|
||||
|
||||
This mode is combined with any other painting mode (Paint, Line, Rectangle,
|
||||
Bucket Fill). When eraser mode is enabled, tiles will be replaced by empty tiles
|
||||
|
||||
@@ -31,7 +31,7 @@ Creating a new TileSet
|
||||
.. _doc_creating_tilesets_using_tilesheet:
|
||||
|
||||
Using a tilesheet
|
||||
^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
This demonstration will use the following tiles taken from
|
||||
`Kenney's "Abstract Platformer" pack <https://kenney.nl/assets/abstract-platformer>`__.
|
||||
@@ -155,7 +155,7 @@ three vertical dots menu button at the top of the TileSet editor and choose
|
||||
Recreating tiles automatically after changing atlas properties
|
||||
|
||||
Using a collection of scenes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Since Godot 4.0, you can place actual *scenes* as tiles. This allows you to use
|
||||
any collection of nodes as a tile. For example, you could use scene tiles to
|
||||
@@ -522,7 +522,7 @@ There are two ways to assign properties to multiple tiles at once.
|
||||
Depending on your use cases, one method may be faster than the other:
|
||||
|
||||
Using multiple tile selection
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you wish to configure various properties on several tiles at once,
|
||||
choose the **Select** mode at the top of the TileSet editor:
|
||||
@@ -550,7 +550,7 @@ property's value on all tiles in the atlas after editing a property:
|
||||
.. _doc_using_tilemaps_using_tile_property_painting:
|
||||
|
||||
Using tile property painting
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you wish to apply a single property to several tiles at once,
|
||||
you can use the *property painting* mode for this purpose.
|
||||
|
||||
Reference in New Issue
Block a user