ESCAnimationPlayer

Extends: Node

Description

An abstraction class to expose the same animation methods for noth AnimatedSprite and AnimationPlayer

Method Descriptions

_init

func _init(node: Node)

Create a new animation player

Parameters

  • node: The actual player node

get_animation

func get_animation() -> String

Return the currently playing animation Returns the currently playing animation name

get_animations

func get_animations() -> PoolStringArray

Returns a list of all animation names Returns A list of all animation names

is_playing

func is_playing() -> bool

Whether the animation is playing Returns: Whether the animation is playing

stop

func stop()

Stop the animation

play

func play(name: String, backwards: bool = false)

Play the animation

Parameters

  • name: The animation name to play

  • backwards: Play backwards

play_backwards

func play_backwards(name: String)

Play the given animation backwards

Parameters

  • name: Animation to play

has_animation

func has_animation(name: String) -> bool

Check if the given animation exists

Parameters

  • name: Name of the animation to check Returns Whether the animation player has the animation

seek_end

func seek_end(name: String)

Play an animation and directly skip to the end

Parameters

  • name: Name of the animation to play

get_length

func get_length(name: String) -> float

Get the length of the specified animation

Parameters

  • name: Name of the animation Returns The length of the animation in seconds

is_valid

func is_valid() -> bool

Return true if the ESCAnimationPlayer node is valid, ie. it has a valid player node. Returns: true if the ESCAnimationPlayer has a valid player node, else false

Signals

  • signal animation_finished(name): Emitted when the animation finsihed playing