From 5d24aa4e9bafda7f33a8e39ee8d03298138b4334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 27 Apr 2016 23:07:25 +0200 Subject: [PATCH] classref: Sync with 2.0 branch --- classes/class_graphedit.rst | 6 ++++++ classes/class_node2d.rst | 40 ++++++++++++++++++++++++++++++++++--- classes/class_weakref.rst | 9 ++++++++- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/classes/class_graphedit.rst b/classes/class_graphedit.rst index cfe9b1809..10803eaab 100644 --- a/classes/class_graphedit.rst +++ b/classes/class_graphedit.rst @@ -87,14 +87,20 @@ Return an Array containing the list of connections. A connection consists in a s - :ref:`Vector2` **get_scroll_ofs** **(** **)** const +Return the scroll offset. + .. _class_GraphEdit_set_zoom: - void **set_zoom** **(** :ref:`float` p_zoom **)** +Set the zoom value of the GraphEdit. Zoom value is between :ref:`0.01; 1.728`. + .. _class_GraphEdit_get_zoom: - :ref:`float` **get_zoom** **(** **)** const +Return the current zoom value. + .. _class_GraphEdit_set_right_disconnects: - void **set_right_disconnects** **(** :ref:`bool` enable **)** diff --git a/classes/class_node2d.rst b/classes/class_node2d.rst index c9841c65c..09cba6796 100644 --- a/classes/class_node2d.rst +++ b/classes/class_node2d.rst @@ -82,19 +82,19 @@ Member Function Description - void **set_pos** **(** :ref:`Vector2` pos **)** -Set the position of the 2d node. +Set the position of the 2D node. .. _class_Node2D_set_rot: - void **set_rot** **(** :ref:`float` rot **)** -Set the rotation of the 2d node. +Set the rotation of the 2D node. .. _class_Node2D_set_scale: - void **set_scale** **(** :ref:`Vector2` scale **)** -Set the scale of the 2d node. +Set the scale of the 2D node. .. _class_Node2D_get_pos: @@ -118,30 +118,44 @@ Return the scale of the 2D node. - void **rotate** **(** :ref:`float` radians **)** +Apply a 'radians' rotation to the 2D node, starting from its current rotation. + .. _class_Node2D_move_local_x: - void **move_local_x** **(** :ref:`float` delta, :ref:`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: - void **move_local_y** **(** :ref:`float` delta, :ref:`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: - void **translate** **(** :ref:`Vector2` offset **)** +Apply a local translation of 'offset' to the 2D node, starting from its current local position. + .. _class_Node2D_global_translate: - void **global_translate** **(** :ref:`Vector2` offset **)** +Apply a global translation of 'offset' to the 2D node, starting from its current global position. + .. _class_Node2D_scale: - void **scale** **(** :ref:`Vector2` ratio **)** +Apply the 'ratio' scale to the 2D node, according to its current scale value. + .. _class_Node2D_set_global_pos: - void **set_global_pos** **(** :ref:`Vector2` pos **)** +Set the global position of the 2D node to 'pos'. + .. _class_Node2D_get_global_pos: - :ref:`Vector2` **get_global_pos** **(** **)** const @@ -152,40 +166,60 @@ Return the global position of the 2D node. - void **set_transform** **(** :ref:`Matrix32` xform **)** +Set the local transform :ref:`Matrix32` of the 2D node. + .. _class_Node2D_set_global_transform: - void **set_global_transform** **(** :ref:`Matrix32` xform **)** +Set the global transform :ref:`Matrix32` of the 2D node. + .. _class_Node2D_look_at: - void **look_at** **(** :ref:`Vector2` point **)** +Rotate the 2d node so it points at 'point' position. + .. _class_Node2D_get_angle_to: - :ref:`float` **get_angle_to** **(** :ref:`Vector2` point **)** const +Return the rotation angle needed for the 2d node to point at 'point' position. + .. _class_Node2D_set_z: - void **set_z** **(** :ref:`int` z **)** +Set the Z-index value of the 2D node. + .. _class_Node2D_get_z: - :ref:`int` **get_z** **(** **)** const +Return the Z-index of the 2D node. + .. _class_Node2D_set_z_as_relative: - void **set_z_as_relative** **(** :ref:`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: - :ref:`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: - void **edit_set_pivot** **(** :ref:`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: - :ref:`Matrix32` **get_relative_transform_to_parent** **(** :ref:`Object` parent **)** const +Return the transform :ref:`Matrix32` calculated relatively to the parent of this 2D node. + diff --git a/classes/class_weakref.rst b/classes/class_weakref.rst index a9a885df6..2fe5f898a 100644 --- a/classes/class_weakref.rst +++ b/classes/class_weakref.rst @@ -13,7 +13,7 @@ WeakRef Brief Description ----------------- - +Holds an :ref:`Object`, but does not contribute to the reference count if the object is a reference. Member Functions ---------------- @@ -22,6 +22,11 @@ Member Functions | :ref:`Object` | :ref:`get_ref` **(** **)** const | +------------------------------+----------------------------------------------------------+ +Description +----------- + +A weakref can hold a :ref:`Reference`, without contributing to the reference counter. A weakref can be created from an :ref:`Object` using :ref:`@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 --------------------------- @@ -29,4 +34,6 @@ Member Function Description - :ref:`Object` **get_ref** **(** **)** const +Returns the :ref:`Object` this weakref is referring to. +