Class: Yuki::Animation::Player

Inherits:
Object
  • Object
show all
Includes:
Yuki::AnimationMixin
Defined in:
docs/4_Systems_005_Animation.rb

Overview

Class responsive of playing several animations in order

Instance Attribute Summary

Attributes included from Yuki::AnimationMixin

#player, #resolver

Instance Method Summary collapse

Methods included from Yuki::AnimationMixin

#begin_offset_for_next_animation

Constructor Details

#initialize(animations = nil, parallel = nil) ⇒ Player

Create a new Animation Player

Parameters:

  • animations (Array<AnimationMixin>) (defaults to: nil) —

    all the animations to play one after each other

  • parallel (Array<Array<AnimationMixin>, nil>, nil) (defaults to: nil) —

    all the animations to play in parallel



88
89
# File 'docs/4_Systems_005_Animation.rb', line 88

def initialize(animations = nil, parallel = nil)
end

Instance Method Details

#animation_index(animation) ⇒ Integer?

Get the index of an animation

Parameters:

Returns:

  • (Integer, nil)


129
130
# File 'docs/4_Systems_005_Animation.rb', line 129

def animation_index(animation)
end

#done? ⇒ Boolean

Check if the animation is done

Returns:

  • (Boolean)


101
102
# File 'docs/4_Systems_005_Animation.rb', line 101

def done?
end

#duration ⇒ Float

Get the animation duration in seconds

Returns:

  • (Float)


108
109
# File 'docs/4_Systems_005_Animation.rb', line 108

def duration
end

#first_start_time ⇒ Time?

Get the first start_time in the animation player

Returns:

  • (Time, nil)


137
138
# File 'docs/4_Systems_005_Animation.rb', line 137

def first_start_time
end

#last_end_time ⇒ Time?

Get the last end_time in the animation player

Returns:

  • (Time, nil)


141
142
# File 'docs/4_Systems_005_Animation.rb', line 141

def last_end_time
end

#parallel_add(other, index = nil) ⇒ self Also known as: <<, |, parallel_play

Add a parallel animation

Parameters:

  • other (AnimationMixin) —

    the parallel animation to add

  • index (Integer) (defaults to: nil) —

    index of the animation other will be played in parallel of

Returns:

  • (self)


114
115
# File 'docs/4_Systems_005_Animation.rb', line 114

def parallel_add(other, index = nil)
end

#play(other) ⇒ self Also known as: play_before, >

Add an animation that will be played after self

Parameters:

Returns:

  • (self)


122
123
# File 'docs/4_Systems_005_Animation.rb', line 122

def play(other)
end

#resolver=(value)

Set the resolver

Parameters:

  • value (Hash) —

    new resolver



92
93
# File 'docs/4_Systems_005_Animation.rb', line 92

def resolver=(value)
end

#root ⇒ self

Retro compatibility with legacy animation

Returns:

  • (self)


133
134
# File 'docs/4_Systems_005_Animation.rb', line 133

def root
end

#start(begin_offset = 0) ⇒ self

Start the animation

Parameters:

  • begin_offset (Float) (defaults to: 0) —

    offset for starting the animation (added to animation's clock)

Returns:

  • (self)


97
98
# File 'docs/4_Systems_005_Animation.rb', line 97

def start(begin_offset = 0)
end

#update

Update the animation



104
105
# File 'docs/4_Systems_005_Animation.rb', line 104

def update
end