mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Fix mixup between translated and translated_local
This commit is contained in:
@@ -222,11 +222,12 @@ to set its ``origin`` vector to (1, 2):
|
|||||||
|
|
||||||
.. image:: img/matrices_and_transforms/translate.png
|
.. image:: img/matrices_and_transforms/translate.png
|
||||||
|
|
||||||
There is also a ``translated()`` method, which performs a different
|
There is also a ``translated_local()`` method, which performs a different
|
||||||
operation to adding or changing ``origin`` directly. The ``translated()``
|
operation to adding or changing ``origin`` directly. The ``translated_local()``
|
||||||
method will translate the object *relative to its own rotation*.
|
method will translate the object *relative to its own rotation*.
|
||||||
For example, an object rotated 90 degrees clockwise will move to
|
For example, an object rotated 90 degrees clockwise will move to
|
||||||
the right when ``translated()`` with ``Vector2.UP``.
|
the right when ``translated_local()`` with ``Vector2.UP``. To translate
|
||||||
|
*relative to the global/parent frame* use ``translated()`` instead.
|
||||||
|
|
||||||
.. note:: Godot's 2D uses coordinates based on pixels, so in actual
|
.. note:: Godot's 2D uses coordinates based on pixels, so in actual
|
||||||
projects you will want to translate by hundreds of units.
|
projects you will want to translate by hundreds of units.
|
||||||
|
|||||||
Reference in New Issue
Block a user