class_propertytweener.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the PropertyTweener.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_PropertyTweener:
  6. PropertyTweener
  7. ===============
  8. **Inherits:** :ref:`Tweener<class_Tweener>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Interpolates an :ref:`Object<class_Object>`'s property over time.
  10. Description
  11. -----------
  12. ``PropertyTweener`` is used to interpolate a property in an object. See :ref:`Tween.tween_property<class_Tween_method_tween_property>` for more usage information.
  13. \ **Note:** :ref:`Tween.tween_property<class_Tween_method_tween_property>` is the only correct way to create ``PropertyTweener``. Any ``PropertyTweener`` created manually will not function correctly.
  14. Methods
  15. -------
  16. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`as_relative<class_PropertyTweener_method_as_relative>` **(** **)** |
  18. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`from<class_PropertyTweener_method_from>` **(** :ref:`Variant<class_Variant>` value **)** |
  20. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`from_current<class_PropertyTweener_method_from_current>` **(** **)** |
  22. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`set_delay<class_PropertyTweener_method_set_delay>` **(** :ref:`float<class_float>` delay **)** |
  24. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`set_ease<class_PropertyTweener_method_set_ease>` **(** :ref:`EaseType<enum_Tween_EaseType>` ease **)** |
  26. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`PropertyTweener<class_PropertyTweener>` | :ref:`set_trans<class_PropertyTweener_method_set_trans>` **(** :ref:`TransitionType<enum_Tween_TransitionType>` trans **)** |
  28. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  29. Method Descriptions
  30. -------------------
  31. .. _class_PropertyTweener_method_as_relative:
  32. - :ref:`PropertyTweener<class_PropertyTweener>` **as_relative** **(** **)**
  33. When called, the final value will be used as a relative value instead. Example:
  34. ::
  35. var tween = get_tree().create_tween()
  36. tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() #the node will move by 100 pixels to the right
  37. ----
  38. .. _class_PropertyTweener_method_from:
  39. - :ref:`PropertyTweener<class_PropertyTweener>` **from** **(** :ref:`Variant<class_Variant>` value **)**
  40. Sets a custom initial value to the ``PropertyTweener``. Example:
  41. ::
  42. var tween = get_tree().create_tween()
  43. 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)
  44. ----
  45. .. _class_PropertyTweener_method_from_current:
  46. - :ref:`PropertyTweener<class_PropertyTweener>` **from_current** **(** **)**
  47. 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:
  48. ::
  49. tween.tween_property(self, "position", Vector2(200, 100), 1).from(position)
  50. tween.tween_property(self, "position", Vector2(200, 100), 1).from_current()
  51. ----
  52. .. _class_PropertyTweener_method_set_delay:
  53. - :ref:`PropertyTweener<class_PropertyTweener>` **set_delay** **(** :ref:`float<class_float>` delay **)**
  54. Sets the time in seconds after which the ``PropertyTweener`` will start interpolating. By default there's no delay.
  55. ----
  56. .. _class_PropertyTweener_method_set_ease:
  57. - :ref:`PropertyTweener<class_PropertyTweener>` **set_ease** **(** :ref:`EaseType<enum_Tween_EaseType>` ease **)**
  58. Sets the type of used easing from :ref:`EaseType<enum_Tween_EaseType>`. If not set, the default easing is used from the :ref:`Tween<class_Tween>` that contains this Tweener.
  59. ----
  60. .. _class_PropertyTweener_method_set_trans:
  61. - :ref:`PropertyTweener<class_PropertyTweener>` **set_trans** **(** :ref:`TransitionType<enum_Tween_TransitionType>` trans **)**
  62. Sets the type of used transition from :ref:`TransitionType<enum_Tween_TransitionType>`. If not set, the default transition is used from the :ref:`Tween<class_Tween>` that contains this Tweener.
  63. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  64. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  65. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  66. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  67. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  68. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`