class_propertytweener.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/PropertyTweener.xml.
  6. .. _class_PropertyTweener:
  7. PropertyTweener
  8. ===============
  9. **Inherits:** :ref:`Tweener<class_Tweener>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Interpolates an :ref:`Object<class_Object>`'s property over time.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **PropertyTweener** is used to interpolate a property in an object. See :ref:`SceneTreeTween.tween_property<class_SceneTreeTween_method_tween_property>` for more usage information.
  15. \ **Note:** :ref:`SceneTreeTween.tween_property<class_SceneTreeTween_method_tween_property>` is the only correct way to create **PropertyTweener**. Any **PropertyTweener** created manually will not function correctly.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`as_relative<class_PropertyTweener_method_as_relative>` **(** **)** |
  23. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`from<class_PropertyTweener_method_from>` **(** :ref:`Variant<class_Variant>` value **)** |
  25. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`from_current<class_PropertyTweener_method_from_current>` **(** **)** |
  27. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`set_delay<class_PropertyTweener_method_set_delay>` **(** :ref:`float<class_float>` delay **)** |
  29. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`set_ease<class_PropertyTweener_method_set_ease>` **(** :ref:`EaseType<enum_Tween_EaseType>` ease **)** |
  31. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`set_trans<class_PropertyTweener_method_set_trans>` **(** :ref:`TransitionType<enum_Tween_TransitionType>` trans **)** |
  33. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  34. .. rst-class:: classref-section-separator
  35. ----
  36. .. rst-class:: classref-descriptions-group
  37. Method Descriptions
  38. -------------------
  39. .. _class_PropertyTweener_method_as_relative:
  40. .. rst-class:: classref-method
  41. :ref:`PropertyTweener<class_PropertyTweener>` **as_relative** **(** **)**
  42. When called, the final value will be used as a relative value instead. Example:
  43. ::
  44. var tween = get_tree().create_tween()
  45. tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() #the node will move by 100 pixels to the right
  46. .. rst-class:: classref-item-separator
  47. ----
  48. .. _class_PropertyTweener_method_from:
  49. .. rst-class:: classref-method
  50. :ref:`PropertyTweener<class_PropertyTweener>` **from** **(** :ref:`Variant<class_Variant>` value **)**
  51. Sets a custom initial value to the **PropertyTweener**. Example:
  52. ::
  53. var tween = get_tree().create_tween()
  54. tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100) #this will move the node from position (100, 100) to (200, 100)
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_PropertyTweener_method_from_current:
  58. .. rst-class:: classref-method
  59. :ref:`PropertyTweener<class_PropertyTweener>` **from_current** **(** **)**
  60. Makes the **PropertyTweener** use the current property value (i.e. at the time of creating this **PropertyTweener**) as a starting point. This is equivalent of using :ref:`from<class_PropertyTweener_method_from>` with the current value. These two calls will do the same:
  61. ::
  62. tween.tween_property(self, "position", Vector2(200, 100), 1).from(position)
  63. tween.tween_property(self, "position", Vector2(200, 100), 1).from_current()
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_PropertyTweener_method_set_delay:
  67. .. rst-class:: classref-method
  68. :ref:`PropertyTweener<class_PropertyTweener>` **set_delay** **(** :ref:`float<class_float>` delay **)**
  69. Sets the time in seconds after which the **PropertyTweener** will start interpolating. By default there's no delay.
  70. .. rst-class:: classref-item-separator
  71. ----
  72. .. _class_PropertyTweener_method_set_ease:
  73. .. rst-class:: classref-method
  74. :ref:`PropertyTweener<class_PropertyTweener>` **set_ease** **(** :ref:`EaseType<enum_Tween_EaseType>` ease **)**
  75. Sets the type of used easing from :ref:`EaseType<enum_Tween_EaseType>`. If not set, the default easing is used from the :ref:`SceneTreeTween<class_SceneTreeTween>` that contains this Tweener.
  76. .. rst-class:: classref-item-separator
  77. ----
  78. .. _class_PropertyTweener_method_set_trans:
  79. .. rst-class:: classref-method
  80. :ref:`PropertyTweener<class_PropertyTweener>` **set_trans** **(** :ref:`TransitionType<enum_Tween_TransitionType>` trans **)**
  81. Sets the type of used transition from :ref:`TransitionType<enum_Tween_TransitionType>`. If not set, the default transition is used from the :ref:`SceneTreeTween<class_SceneTreeTween>` that contains this Tweener.
  82. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  83. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  84. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  85. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`