Browse Source

classref: Sync with 2.0 branch

Rémi Verschelde 9 years ago
parent
commit
5d24aa4e9b
3 changed files with 51 additions and 4 deletions
  1. 6 0
      classes/class_graphedit.rst
  2. 37 3
      classes/class_node2d.rst
  3. 8 1
      classes/class_weakref.rst

+ 6 - 0
classes/class_graphedit.rst

@@ -87,14 +87,20 @@ Return an Array containing the list of connections. A connection consists in a s
 
 
 - :ref:`Vector2<class_vector2>`  **get_scroll_ofs**  **(** **)** const
 - :ref:`Vector2<class_vector2>`  **get_scroll_ofs**  **(** **)** const
 
 
+Return the scroll offset.
+
 .. _class_GraphEdit_set_zoom:
 .. _class_GraphEdit_set_zoom:
 
 
 - void  **set_zoom**  **(** :ref:`float<class_float>` p_zoom  **)**
 - void  **set_zoom**  **(** :ref:`float<class_float>` p_zoom  **)**
 
 
+Set the zoom value of the GraphEdit. Zoom value is between :ref:`0.01; 1.728<class_0.01; 1.728>`.
+
 .. _class_GraphEdit_get_zoom:
 .. _class_GraphEdit_get_zoom:
 
 
 - :ref:`float<class_float>`  **get_zoom**  **(** **)** const
 - :ref:`float<class_float>`  **get_zoom**  **(** **)** const
 
 
+Return the current zoom value.
+
 .. _class_GraphEdit_set_right_disconnects:
 .. _class_GraphEdit_set_right_disconnects:
 
 
 - void  **set_right_disconnects**  **(** :ref:`bool<class_bool>` enable  **)**
 - void  **set_right_disconnects**  **(** :ref:`bool<class_bool>` enable  **)**

+ 37 - 3
classes/class_node2d.rst

@@ -82,19 +82,19 @@ Member Function Description
 
 
 - void  **set_pos**  **(** :ref:`Vector2<class_vector2>` pos  **)**
 - void  **set_pos**  **(** :ref:`Vector2<class_vector2>` pos  **)**
 
 
-Set the position of the 2d node.
+Set the position of the 2D node.
 
 
 .. _class_Node2D_set_rot:
 .. _class_Node2D_set_rot:
 
 
 - void  **set_rot**  **(** :ref:`float<class_float>` rot  **)**
 - void  **set_rot**  **(** :ref:`float<class_float>` rot  **)**
 
 
-Set the rotation of the 2d node.
+Set the rotation of the 2D node.
 
 
 .. _class_Node2D_set_scale:
 .. _class_Node2D_set_scale:
 
 
 - void  **set_scale**  **(** :ref:`Vector2<class_vector2>` scale  **)**
 - void  **set_scale**  **(** :ref:`Vector2<class_vector2>` scale  **)**
 
 
-Set the scale of the 2d node.
+Set the scale of the 2D node.
 
 
 .. _class_Node2D_get_pos:
 .. _class_Node2D_get_pos:
 
 
@@ -118,30 +118,44 @@ Return the scale of the 2D node.
 
 
 - void  **rotate**  **(** :ref:`float<class_float>` radians  **)**
 - void  **rotate**  **(** :ref:`float<class_float>` radians  **)**
 
 
+Apply a 'radians' rotation to the 2D node, starting from its current rotation.
+
 .. _class_Node2D_move_local_x:
 .. _class_Node2D_move_local_x:
 
 
 - void  **move_local_x**  **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false  **)**
 - 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.
+
 .. _class_Node2D_move_local_y:
 .. _class_Node2D_move_local_y:
 
 
 - void  **move_local_y**  **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false  **)**
 - 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.
+
 .. _class_Node2D_translate:
 .. _class_Node2D_translate:
 
 
 - void  **translate**  **(** :ref:`Vector2<class_vector2>` offset  **)**
 - void  **translate**  **(** :ref:`Vector2<class_vector2>` offset  **)**
 
 
+Apply a local translation of 'offset' to the 2D node, starting from its current local position.
+
 .. _class_Node2D_global_translate:
 .. _class_Node2D_global_translate:
 
 
 - void  **global_translate**  **(** :ref:`Vector2<class_vector2>` offset  **)**
 - void  **global_translate**  **(** :ref:`Vector2<class_vector2>` offset  **)**
 
 
+Apply a global translation of 'offset' to the 2D node, starting from its current global position.
+
 .. _class_Node2D_scale:
 .. _class_Node2D_scale:
 
 
 - void  **scale**  **(** :ref:`Vector2<class_vector2>` ratio  **)**
 - void  **scale**  **(** :ref:`Vector2<class_vector2>` ratio  **)**
 
 
+Apply the 'ratio' scale to the 2D node, according to its current scale value.
+
 .. _class_Node2D_set_global_pos:
 .. _class_Node2D_set_global_pos:
 
 
 - void  **set_global_pos**  **(** :ref:`Vector2<class_vector2>` pos  **)**
 - void  **set_global_pos**  **(** :ref:`Vector2<class_vector2>` pos  **)**
 
 
+Set the global position of the 2D node to 'pos'.
+
 .. _class_Node2D_get_global_pos:
 .. _class_Node2D_get_global_pos:
 
 
 - :ref:`Vector2<class_vector2>`  **get_global_pos**  **(** **)** const
 - :ref:`Vector2<class_vector2>`  **get_global_pos**  **(** **)** const
@@ -152,40 +166,60 @@ Return the global position of the 2D node.
 
 
 - void  **set_transform**  **(** :ref:`Matrix32<class_matrix32>` xform  **)**
 - void  **set_transform**  **(** :ref:`Matrix32<class_matrix32>` xform  **)**
 
 
+Set the local transform :ref:`Matrix32<class_matrix32>` of the 2D node.
+
 .. _class_Node2D_set_global_transform:
 .. _class_Node2D_set_global_transform:
 
 
 - void  **set_global_transform**  **(** :ref:`Matrix32<class_matrix32>` xform  **)**
 - void  **set_global_transform**  **(** :ref:`Matrix32<class_matrix32>` xform  **)**
 
 
+Set the global transform :ref:`Matrix32<class_matrix32>` of the 2D node.
+
 .. _class_Node2D_look_at:
 .. _class_Node2D_look_at:
 
 
 - void  **look_at**  **(** :ref:`Vector2<class_vector2>` point  **)**
 - void  **look_at**  **(** :ref:`Vector2<class_vector2>` point  **)**
 
 
+Rotate the 2d node so it points at 'point' position.
+
 .. _class_Node2D_get_angle_to:
 .. _class_Node2D_get_angle_to:
 
 
 - :ref:`float<class_float>`  **get_angle_to**  **(** :ref:`Vector2<class_vector2>` point  **)** const
 - :ref:`float<class_float>`  **get_angle_to**  **(** :ref:`Vector2<class_vector2>` point  **)** const
 
 
+Return the rotation angle needed for the 2d node to point at 'point' position.
+
 .. _class_Node2D_set_z:
 .. _class_Node2D_set_z:
 
 
 - void  **set_z**  **(** :ref:`int<class_int>` z  **)**
 - void  **set_z**  **(** :ref:`int<class_int>` z  **)**
 
 
+Set the Z-index value of the 2D node.
+
 .. _class_Node2D_get_z:
 .. _class_Node2D_get_z:
 
 
 - :ref:`int<class_int>`  **get_z**  **(** **)** const
 - :ref:`int<class_int>`  **get_z**  **(** **)** const
 
 
+Return the Z-index of the 2D node.
+
 .. _class_Node2D_set_z_as_relative:
 .. _class_Node2D_set_z_as_relative:
 
 
 - void  **set_z_as_relative**  **(** :ref:`bool<class_bool>` enable  **)**
 - 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.
+
 .. _class_Node2D_is_z_relative:
 .. _class_Node2D_is_z_relative:
 
 
 - :ref:`bool<class_bool>`  **is_z_relative**  **(** **)** const
 - :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.
+
 .. _class_Node2D_edit_set_pivot:
 .. _class_Node2D_edit_set_pivot:
 
 
 - void  **edit_set_pivot**  **(** :ref:`Vector2<class_vector2>` 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.
+
 .. _class_Node2D_get_relative_transform_to_parent:
 .. _class_Node2D_get_relative_transform_to_parent:
 
 
 - :ref:`Matrix32<class_matrix32>`  **get_relative_transform_to_parent**  **(** :ref:`Object<class_object>` parent  **)** const
 - :ref:`Matrix32<class_matrix32>`  **get_relative_transform_to_parent**  **(** :ref:`Object<class_object>` parent  **)** const
 
 
+Return the transform :ref:`Matrix32<class_matrix32>` calculated relatively to the parent of this 2D node.
+
 
 

+ 8 - 1
classes/class_weakref.rst

@@ -13,7 +13,7 @@ WeakRef
 Brief Description
 Brief Description
 -----------------
 -----------------
 
 
-
+Holds an :ref:`Object<class_object>`, but does not contribute to the reference count if the object is a reference.
 
 
 Member Functions
 Member Functions
 ----------------
 ----------------
@@ -22,6 +22,11 @@ Member Functions
 | :ref:`Object<class_object>`  | :ref:`get_ref<class_WeakRef_get_ref>`  **(** **)** const |
 | :ref:`Object<class_object>`  | :ref:`get_ref<class_WeakRef_get_ref>`  **(** **)** const |
 +------------------------------+----------------------------------------------------------+
 +------------------------------+----------------------------------------------------------+
 
 
+Description
+-----------
+
+A weakref can hold a :ref:`Reference<class_reference>`, without contributing to the reference counter. A weakref can be created from an :ref:`Object<class_object>` using :ref:`@GDScript.weakref<class_@GDScript_weakref>`. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to eachother. Without weakrefs, using these classes could lead to memory leaks, since both references keep eachother from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released.
+
 Member Function Description
 Member Function Description
 ---------------------------
 ---------------------------
 
 
@@ -29,4 +34,6 @@ Member Function Description
 
 
 - :ref:`Object<class_object>`  **get_ref**  **(** **)** const
 - :ref:`Object<class_object>`  **get_ref**  **(** **)** const
 
 
+Returns the :ref:`Object<class_object>` this weakref is referring to.
+