Class: Yuki::Animation::DiscreetAnimation

Inherits:
TimedAnimation show all
Defined in:
docs/01500_Yuki.rb

Overview

Class that perform a discreet number animation (set object.property to a upto b using integer values only)

Direct Known Subclasses

Battle::Visual::HPAnimation, TimedCommands

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

#done?, #in_parallel_of, #parallel_add, #play_before, #resolver=, #update

Constructor Details

#initialize(time_to_process, on, property, a, b, factor = 1, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) ⇒ DiscreetAnimation

Create a new ScalarAnimation convert it to another number (between 0 & 1) in order to distord time

Parameters:

  • time_to_process (Float)

    number of seconds (with generic time) to process the animation

  • on (Object)

    object that will receive the property

  • property (Symbol)

    name of the property to affect (add the = sign in the symbol name)

  • a (Integer, Symbol)

    origin position

  • b (Integer, Symbol)

    destination position

  • factor (Integer, Symbol) (defaults to: 1)

    factor applied to a & b to produce stuff like src_rect animation (sx * width)

  • distortion (#call, Symbol) (defaults to: :UNICITY_DISTORTION)

    callable taking one paramater (between 0 & 1) and

  • time_source (#call, Symbol) (defaults to: :GENERIC_TIME_SOURCE)

    callable taking no parameter and giving the current time



1268
1269
# File 'docs/01500_Yuki.rb', line 1268

def initialize(time_to_process, on, property, a, b, factor = 1, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
end

Instance Method Details

#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



1272
1273
# File 'docs/01500_Yuki.rb', line 1272

def start(begin_offset = 0)
end