Class: Yuki::Animation::FullyResolvedAnimation

Inherits:
TimedAnimation show all
Defined in:
docs/4_Systems_005_Animation.rb

Overview

Note:

The play command of all animation played before resolved animation will be called after all previous animation were called. It’s a good practice not to put something else than dispose command after a fully resolved animation.

Class that help to handle animations that depends on sprite creation commands

Examples:

Create a fully resolved animation

root_anim = Yuki::Animation.create_sprite(:viewport, :sprite, Sprite)
resolved_animation = Yuki::Animation.resolved
root_anim.play_before(resolved_animation)
resolved_animation.play_before(...)
resolved_animation.play_before(...)
resolved_animation.parallel_play(...)
root_anim.play_before(Yuki::Animation.dispose_sprite(:sprite))

Instance Attribute Summary

Attributes inherited from TimedAnimation

#begin_time, #end_time, #parallel_animations, #root, #sub_animation, #time_source

Instance Method Summary collapse

Methods inherited from TimedAnimation

#in_parallel_of, #parallel_add, #play_before, #resolver=

Constructor Details

#initializeFullyResolvedAnimation

Create a new fully resolved animation



599
600
# File 'docs/4_Systems_005_Animation.rb', line 599

def initialize
end

Instance Method Details

#done?Boolean

Tell if the animation is done

Returns:

  • (Boolean)


608
609
# File 'docs/4_Systems_005_Animation.rb', line 608

def done?
end

#start(begin_offset = 0)

Start the animation (initialize it)

Parameters:

  • begin_offset (Float) (defaults to: 0)

    offset that prevents the animation from starting before now + begin_offset seconds



604
605
# File 'docs/4_Systems_005_Animation.rb', line 604

def start(begin_offset = 0)
end

#timed_animation_start



601
# File 'docs/4_Systems_005_Animation.rb', line 601

alias timed_animation_start start

#update

Note:

should always be called after start

Update the animation internal time and call update_internal with a parameter between 0 & 1 indicating the progression of the animation



613
614
# File 'docs/4_Systems_005_Animation.rb', line 613

def update
end