فهرست منبع

Merge pull request #35790 from Calinou/doc-animationplayer-vs-tween

doc: Add a short AnimationPlayer versus Tween comparison
Rémi Verschelde 5 سال پیش
والد
کامیت
dfcfa7d256
2فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 1 0
      doc/classes/AnimationPlayer.xml
  2. 1 0
      doc/classes/Tween.xml

+ 1 - 0
doc/classes/AnimationPlayer.xml

@@ -5,6 +5,7 @@
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
 		An animation player is used for general-purpose playback of [Animation] resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels.
 		An animation player is used for general-purpose playback of [Animation] resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels.
+		[AnimationPlayer] is more suited than [Tween] for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an [AnimationPlayer] node thanks to the animation tools provided by the editor. That particular example can also be implemented with a [Tween] node, but it requires doing everything by code.
 		Updating the target properties of animations occurs at process time.
 		Updating the target properties of animations occurs at process time.
 	</description>
 	</description>
 	<tutorials>
 	<tutorials>

+ 1 - 0
doc/classes/Tween.xml

@@ -5,6 +5,7 @@
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
 		Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them.
 		Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them.
+		[Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween] node; it would be difficult to do the same thing with an [AnimationPlayer] node.
 		Here is a brief usage example that causes a 2D node to move smoothly between two positions:
 		Here is a brief usage example that causes a 2D node to move smoothly between two positions:
 		[codeblock]
 		[codeblock]
 		var tween = get_node("Tween")
 		var tween = get_node("Tween")