You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Document link between Node2D.look_at() and Node2D.get_angle_to()
These methods are closely related, as `Node2D.get_angle_to()` can be used to get the rotation value that is being applied to `look_at()` without actually applying it to the node.
This commit is contained in:
@@ -19,11 +19,11 @@
|
|||||||
Multiplies the current scale by the [param ratio] vector.
|
Multiplies the current scale by the [param ratio] vector.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_angle_to" qualifiers="const">
|
<method name="get_angle_to" qualifiers="const" keywords="look_at">
|
||||||
<return type="float" />
|
<return type="float" />
|
||||||
<param index="0" name="point" type="Vector2" />
|
<param index="0" name="point" type="Vector2" />
|
||||||
<description>
|
<description>
|
||||||
Returns the angle between the node and the [param point] in radians.
|
Returns the angle between the node and the [param point] in radians. See also [method look_at].
|
||||||
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/node2d_get_angle_to.png]Illustration of the returned angle.[/url]
|
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/node2d_get_angle_to.png]Illustration of the returned angle.[/url]
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<return type="void" />
|
<return type="void" />
|
||||||
<param index="0" name="point" type="Vector2" />
|
<param index="0" name="point" type="Vector2" />
|
||||||
<description>
|
<description>
|
||||||
Rotates the node so that its local +X axis points towards the [param point], which is expected to use global coordinates.
|
Rotates the node so that its local +X axis points towards the [param point], which is expected to use global coordinates. This method is a combination of both [method rotate] and [method get_angle_to].
|
||||||
[param point] should not be the same as the node's position, otherwise the node always looks to the right.
|
[param point] should not be the same as the node's position, otherwise the node always looks to the right.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
<return type="void" />
|
<return type="void" />
|
||||||
<param index="0" name="radians" type="float" />
|
<param index="0" name="radians" type="float" />
|
||||||
<description>
|
<description>
|
||||||
Applies a rotation to the node, in radians, starting from its current rotation.
|
Applies a rotation to the node, in radians, starting from its current rotation. This is equivalent to [code]rotation += radians[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="to_global" qualifiers="const">
|
<method name="to_global" qualifiers="const">
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<return type="void" />
|
<return type="void" />
|
||||||
<param index="0" name="offset" type="Vector2" />
|
<param index="0" name="offset" type="Vector2" />
|
||||||
<description>
|
<description>
|
||||||
Translates the node by the given [param offset] in local coordinates.
|
Translates the node by the given [param offset] in local coordinates. This is equivalent to [code]position += offset[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
</methods>
|
</methods>
|
||||||
|
|||||||
Reference in New Issue
Block a user