PropertyTweener.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PropertyTweener" inherits="Tweener" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Interpolates an [Object]'s property over time.
  5. </brief_description>
  6. <description>
  7. [PropertyTweener] is used to interpolate a property in an object. See [method SceneTreeTween.tween_property] for more usage information.
  8. [b]Note:[/b] [method SceneTreeTween.tween_property] is the only correct way to create [PropertyTweener]. Any [PropertyTweener] created manually will not function correctly.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="as_relative">
  14. <return type="PropertyTweener" />
  15. <description>
  16. When called, the final value will be used as a relative value instead. Example:
  17. [codeblock]
  18. var tween = get_tree().create_tween()
  19. tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() #the node will move by 100 pixels to the right
  20. [/codeblock]
  21. </description>
  22. </method>
  23. <method name="from">
  24. <return type="PropertyTweener" />
  25. <argument index="0" name="value" type="Variant" />
  26. <description>
  27. Sets a custom initial value to the [PropertyTweener]. Example:
  28. [codeblock]
  29. var tween = get_tree().create_tween()
  30. 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)
  31. [/codeblock]
  32. </description>
  33. </method>
  34. <method name="from_current">
  35. <return type="PropertyTweener" />
  36. <description>
  37. 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 [method from] with the current value. These two calls will do the same:
  38. [codeblock]
  39. tween.tween_property(self, "position", Vector2(200, 100), 1).from(position)
  40. tween.tween_property(self, "position", Vector2(200, 100), 1).from_current()
  41. [/codeblock]
  42. </description>
  43. </method>
  44. <method name="set_delay">
  45. <return type="PropertyTweener" />
  46. <argument index="0" name="delay" type="float" />
  47. <description>
  48. Sets the time in seconds after which the [PropertyTweener] will start interpolating. By default there's no delay.
  49. </description>
  50. </method>
  51. <method name="set_ease">
  52. <return type="PropertyTweener" />
  53. <argument index="0" name="ease" type="int" enum="Tween.EaseType" />
  54. <description>
  55. Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used from the [SceneTreeTween] that contains this Tweener.
  56. </description>
  57. </method>
  58. <method name="set_trans">
  59. <return type="PropertyTweener" />
  60. <argument index="0" name="trans" type="int" enum="Tween.TransitionType" />
  61. <description>
  62. Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default transition is used from the [SceneTreeTween] that contains this Tweener.
  63. </description>
  64. </method>
  65. </methods>
  66. <constants>
  67. </constants>
  68. </class>