classref: Sync with current upstream master branch

This commit is contained in:
Rémi Verschelde
2017-09-23 11:01:36 +02:00
parent 5e952ae7d5
commit 0cc4b36524
467 changed files with 5484 additions and 2561 deletions

View File

@@ -1,5 +1,6 @@
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
.. DO NOT EDIT THIS FILE, but the Node2D.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_Node2D:
@@ -8,14 +9,14 @@ Node2D
**Inherits:** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
**Inherited By:** :ref:`RemoteTransform2D<class_remotetransform2d>`, :ref:`Joint2D<class_joint2d>`, :ref:`ParallaxLayer<class_parallaxlayer>`, :ref:`Line2D<class_line2d>`, :ref:`VisibilityNotifier2D<class_visibilitynotifier2d>`, :ref:`Navigation2D<class_navigation2d>`, :ref:`CollisionPolygon2D<class_collisionpolygon2d>`, :ref:`TouchScreenButton<class_touchscreenbutton>`, :ref:`Particles2D<class_particles2d>`, :ref:`AnimatedSprite<class_animatedsprite>`, :ref:`Light2D<class_light2d>`, :ref:`Path2D<class_path2d>`, :ref:`AudioStreamPlayer2D<class_audiostreamplayer2d>`, :ref:`Sprite<class_sprite>`, :ref:`RayCast2D<class_raycast2d>`, :ref:`CollisionShape2D<class_collisionshape2d>`, :ref:`NavigationPolygonInstance<class_navigationpolygoninstance>`, :ref:`PathFollow2D<class_pathfollow2d>`, :ref:`Polygon2D<class_polygon2d>`, :ref:`Position2D<class_position2d>`, :ref:`LightOccluder2D<class_lightoccluder2d>`, :ref:`CollisionObject2D<class_collisionobject2d>`, :ref:`BackBufferCopy<class_backbuffercopy>`, :ref:`CanvasModulate<class_canvasmodulate>`, :ref:`YSort<class_ysort>`, :ref:`TileMap<class_tilemap>`, :ref:`Camera2D<class_camera2d>`
**Inherited By:** :ref:`RemoteTransform2D<class_remotetransform2d>`, :ref:`Joint2D<class_joint2d>`, :ref:`VisibilityNotifier2D<class_visibilitynotifier2d>`, :ref:`Navigation2D<class_navigation2d>`, :ref:`CollisionPolygon2D<class_collisionpolygon2d>`, :ref:`TouchScreenButton<class_touchscreenbutton>`, :ref:`Particles2D<class_particles2d>`, :ref:`AnimatedSprite<class_animatedsprite>`, :ref:`RayCast2D<class_raycast2d>`, :ref:`Light2D<class_light2d>`, :ref:`Path2D<class_path2d>`, :ref:`Line2D<class_line2d>`, :ref:`Position2D<class_position2d>`, :ref:`AudioStreamPlayer2D<class_audiostreamplayer2d>`, :ref:`CanvasModulate<class_canvasmodulate>`, :ref:`Sprite<class_sprite>`, :ref:`CollisionShape2D<class_collisionshape2d>`, :ref:`NavigationPolygonInstance<class_navigationpolygoninstance>`, :ref:`PathFollow2D<class_pathfollow2d>`, :ref:`ParallaxLayer<class_parallaxlayer>`, :ref:`Polygon2D<class_polygon2d>`, :ref:`LightOccluder2D<class_lightoccluder2d>`, :ref:`CollisionObject2D<class_collisionobject2d>`, :ref:`BackBufferCopy<class_backbuffercopy>`, :ref:`YSort<class_ysort>`, :ref:`TileMap<class_tilemap>`, :ref:`Camera2D<class_camera2d>`
**Category:** Core
Brief Description
-----------------
Base node for 2D system.
A 2D game object, parent of all 2D related nodes. Has a position, rotation, scale and Z-index.
Member Functions
----------------
@@ -59,7 +60,7 @@ Member Functions
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rotate<class_Node2D_rotate>` **(** :ref:`float<class_float>` radians **)** |
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_global_position<class_Node2D_set_global_position>` **(** :ref:`Vector2<class_vector2>` pos **)** |
| void | :ref:`set_global_position<class_Node2D_set_global_position>` **(** :ref:`Vector2<class_vector2>` position **)** |
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_global_rotation<class_Node2D_set_global_rotation>` **(** :ref:`float<class_float>` radians **)** |
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
@@ -69,7 +70,7 @@ Member Functions
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_global_transform<class_Node2D_set_global_transform>` **(** :ref:`Transform2D<class_transform2d>` xform **)** |
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_position<class_Node2D_set_position>` **(** :ref:`Vector2<class_vector2>` pos **)** |
| void | :ref:`set_position<class_Node2D_set_position>` **(** :ref:`Vector2<class_vector2>` position **)** |
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_rotation<class_Node2D_set_rotation>` **(** :ref:`float<class_float>` radians **)** |
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
@@ -93,23 +94,23 @@ Member Functions
Member Variables
----------------
- :ref:`Vector2<class_vector2>` **global_position**
- :ref:`float<class_float>` **global_rotation**
- :ref:`float<class_float>` **global_rotation_deg**
- :ref:`Vector2<class_vector2>` **global_scale**
- :ref:`Transform2D<class_transform2d>` **global_transform**
- :ref:`Vector2<class_vector2>` **position**
- :ref:`float<class_float>` **rotation**
- :ref:`float<class_float>` **rotation_deg**
- :ref:`Vector2<class_vector2>` **scale**
- :ref:`Transform2D<class_transform2d>` **transform**
- :ref:`int<class_int>` **z**
- :ref:`bool<class_bool>` **z_as_relative**
- :ref:`Vector2<class_vector2>` **global_position** - Global position.
- :ref:`float<class_float>` **global_rotation** - Global rotation in radians.
- :ref:`float<class_float>` **global_rotation_deg** - Global rotation in degrees.
- :ref:`Vector2<class_vector2>` **global_scale** - Global scale.
- :ref:`Transform2D<class_transform2d>` **global_transform** - Global [Transform2D].
- :ref:`Vector2<class_vector2>` **position** - Position, relative to the node's parent.
- :ref:`float<class_float>` **rotation** - Rotation in radians.
- :ref:`float<class_float>` **rotation_deg** - Rotation in degrees.
- :ref:`Vector2<class_vector2>` **scale** - Rotation in degrees.
- :ref:`Transform2D<class_transform2d>` **transform** - Local [Transform2D].
- :ref:`int<class_int>` **z** - Z-index. Controls the order in which the nodes render. A node with a higher Z-index will display in front of others.
- :ref:`bool<class_bool>` **z_as_relative** - Make the node's Z-index relative to its parent's Z-index. If this node's Z-index is 2 and its parent's effective Z-index is 3, then this node's effective Z-index will be 2 + 3 = 5.
Description
-----------
Base node for 2D system. Node2D contains a position, rotation and scale, which is used to position and animate. It can alternatively be used with a custom 2D transform (:ref:`Transform2D<class_transform2d>`). A tree of Node2Ds allows complex hierarchies for animation and positioning.
A 2D game object, with a position, rotation and scale. All 2D physics nodes and sprites inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control on the node's render order.
Member Function Description
---------------------------
@@ -118,187 +119,187 @@ Member Function Description
- void **apply_scale** **(** :ref:`Vector2<class_vector2>` ratio **)**
Apply the 'ratio' scale to the 2D node, according to its current scale value.
Multiplies the current scale by the 'ratio' vector.
.. _class_Node2D_edit_set_pivot:
- void **edit_set_pivot** **(** :ref:`Vector2<class_vector2>` pivot **)**
Set the pivot position of the 2D node to 'pivot' value. This method is implemented only in some nodes that inherit Node2D.
Set the pivot position of the 2D node to 'pivot' value. Only some Node2Ds implement this method.
.. _class_Node2D_get_angle_to:
- :ref:`float<class_float>` **get_angle_to** **(** :ref:`Vector2<class_vector2>` point **)** const
Return the rotation angle in radians needed for the 2d node to point at 'point' position.
Returns the angle between the node and the 'point' in radians.
.. _class_Node2D_get_global_position:
- :ref:`Vector2<class_vector2>` **get_global_position** **(** **)** const
Return the global position of the 2D node.
Returns the node's global position.
.. _class_Node2D_get_global_rotation:
- :ref:`float<class_float>` **get_global_rotation** **(** **)** const
Return the global rotation in radians of the 2D node.
Returns the node's global rotation in radians.
.. _class_Node2D_get_global_rotation_in_degrees:
- :ref:`float<class_float>` **get_global_rotation_in_degrees** **(** **)** const
Return the global rotation in degrees of the 2D node.
Return the node's global rotation in degrees.
.. _class_Node2D_get_global_scale:
- :ref:`Vector2<class_vector2>` **get_global_scale** **(** **)** const
Return the global scale of the 2D node.
Returns the node's global scale.
.. _class_Node2D_get_position:
- :ref:`Vector2<class_vector2>` **get_position** **(** **)** const
Return the position of the 2D node.
Returns the node's position.
.. _class_Node2D_get_relative_transform_to_parent:
- :ref:`Transform2D<class_transform2d>` **get_relative_transform_to_parent** **(** :ref:`Node<class_node>` parent **)** const
Return the transform :ref:`Transform2D<class_transform2d>` calculated relatively to the parent of this 2D node.
Returns the :ref:`Transform2D<class_transform2d>` relative to this node's parent.
.. _class_Node2D_get_rotation:
- :ref:`float<class_float>` **get_rotation** **(** **)** const
Return the rotation in radians of the 2D node.
Returns the node's rotation in radians.
.. _class_Node2D_get_rotation_in_degrees:
- :ref:`float<class_float>` **get_rotation_in_degrees** **(** **)** const
Return the rotation in degrees of the 2D node.
Returns the node's rotation in degrees.
.. _class_Node2D_get_scale:
- :ref:`Vector2<class_vector2>` **get_scale** **(** **)** const
Return the scale of the 2D node.
Returns the node's scale.
.. _class_Node2D_get_z:
- :ref:`int<class_int>` **get_z** **(** **)** const
Return the Z-index of the 2D node.
Returns the node's Z-index.
.. _class_Node2D_global_translate:
- void **global_translate** **(** :ref:`Vector2<class_vector2>` offset **)**
Apply a global translation of 'offset' to the 2D node, starting from its current global position.
Adds the 'offset' vector to the node's global position.
.. _class_Node2D_is_z_relative:
- :ref:`bool<class_bool>` **is_z_relative** **(** **)** const
Return true if the Z-index value of this 2D node is relative to its parent's. Else, return false.
Returns true if this node's Z-index is relative to its parent's. Else, returns false.
.. _class_Node2D_look_at:
- void **look_at** **(** :ref:`Vector2<class_vector2>` point **)**
Rotate the 2d node so it points at 'point' position.
Rotates the node so it points towards the 'point'.
.. _class_Node2D_move_local_x:
- void **move_local_x** **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false **)**
Apply a local translation on X axis to the 2D node according to the 'delta' of the process. If 'scaled' is false, the movement is normalized.
Apply a local translation on the node's X axis based on the process's 'delta'. If 'scaled' is false, normalizes the movement.
.. _class_Node2D_move_local_y:
- void **move_local_y** **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false **)**
Apply a local translation on Y axis to the 2D node according to the 'delta' of the process. If 'scaled' is false, the movement is normalized.
Apply a local translation on the node's Y axis based on the process's 'delta'. If 'scaled' is false, normalizes the movement.
.. _class_Node2D_rotate:
- void **rotate** **(** :ref:`float<class_float>` radians **)**
Apply a rotation (in radians) to the 2D node, starting from its current rotation.
Apply a rotation to the node, in radians, starting from its current rotation.
.. _class_Node2D_set_global_position:
- void **set_global_position** **(** :ref:`Vector2<class_vector2>` pos **)**
- void **set_global_position** **(** :ref:`Vector2<class_vector2>` position **)**
Set the global position of the 2D node.
Set the node's global position.
.. _class_Node2D_set_global_rotation:
- void **set_global_rotation** **(** :ref:`float<class_float>` radians **)**
Set the global rotation in radians of the 2D node
Set the node's global rotation in radians.
.. _class_Node2D_set_global_rotation_in_degrees:
- void **set_global_rotation_in_degrees** **(** :ref:`float<class_float>` degrees **)**
Set the global rotation in degrees of the 2D node
Set the node's global rotation in degrees.
.. _class_Node2D_set_global_scale:
- void **set_global_scale** **(** :ref:`Vector2<class_vector2>` scale **)**
Set the global scale of the 2D node.
Set the node's global scale.
.. _class_Node2D_set_global_transform:
- void **set_global_transform** **(** :ref:`Transform2D<class_transform2d>` xform **)**
Set the global transform :ref:`Transform2D<class_transform2d>` of the 2D node.
Set the node's global :ref:`Transform2D<class_transform2d>`.
.. _class_Node2D_set_position:
- void **set_position** **(** :ref:`Vector2<class_vector2>` pos **)**
- void **set_position** **(** :ref:`Vector2<class_vector2>` position **)**
Set the position of the 2D node.
Set the node's position.
.. _class_Node2D_set_rotation:
- void **set_rotation** **(** :ref:`float<class_float>` radians **)**
Set the rotation in radians of the 2D node.
Set the node's rotation in radians.
.. _class_Node2D_set_rotation_in_degrees:
- void **set_rotation_in_degrees** **(** :ref:`float<class_float>` degrees **)**
Set the rotation in degrees of the 2D node.
Set the node's rotation in degrees.
.. _class_Node2D_set_scale:
- void **set_scale** **(** :ref:`Vector2<class_vector2>` scale **)**
Set the scale of the 2D node.
Set the node's scale.
.. _class_Node2D_set_transform:
- void **set_transform** **(** :ref:`Transform2D<class_transform2d>` xform **)**
Set the local transform :ref:`Transform2D<class_transform2d>` of the 2D node.
Set the node's local :ref:`Transform2D<class_transform2d>`.
.. _class_Node2D_set_z:
- void **set_z** **(** :ref:`int<class_int>` z **)**
Set the Z-index value of the 2D node.
Set the node's Z-index.
.. _class_Node2D_set_z_as_relative:
- void **set_z_as_relative** **(** :ref:`bool<class_bool>` enable **)**
Set the Z-index value as relative to the parent node of this 2D node. Thus, if this 2D node's Z-index value is 2 and its parent's effective Z-index is 3, then the effective Z-index value of this 2D node would be 3 + 2 = 5.
Make the node's Z-index relative to its parent's Z-index. If this node's Z-index is 2 and its parent's effective Z-index is 3, then this node's effective Z-index will be 2 + 3 = 5.
.. _class_Node2D_to_global:
@@ -312,6 +313,6 @@ Set the Z-index value as relative to the parent node of this 2D node. Thus, if t
- void **translate** **(** :ref:`Vector2<class_vector2>` offset **)**
Apply a local translation of 'offset' to the 2D node, starting from its current local position.
Translate the node locally by the 'offset' vector, starting from its current local position.