diff options
Diffstat (limited to 'doc/classes/Animation.xml')
-rw-r--r-- | doc/classes/Animation.xml | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index c6b868c058..169fbcd5a8 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -5,10 +5,19 @@ </brief_description> <description> An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track. - Animations are just data containers, and must be added to odes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back. + [codeblock] + # This creates an animation that makes the node "Enemy" move to the right by + # 100 pixels in 1 second. + var animation = Animation.new() + var track_index = animation.add_track(Animation.TYPE_VALUE) + animation.track_set_path(track_index, "Enemy:position.x") + animation.track_insert_key(track_index, 0.0, 0) + animation.track_insert_key(track_index, 0.5, 100) + [/codeblock] + Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/animation/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link> </tutorials> <demos> </demos> @@ -552,7 +561,8 @@ <argument index="1" name="path" type="NodePath"> </argument> <description> - Set the path of a track. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ":". Example: "character/skeleton:ankle" or "character/mesh:transform/local" + Set the path of a track. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ":". + [b]Example:[/b] "character/skeleton:ankle" or "character/mesh:transform/local". </description> </method> <method name="track_swap"> |