Class: Yuki::Animation::ParticleOnSpriteAnimation

Inherits:
TimedAnimation show all
Defined in:
docs/5_Battle_20_MoveAnimation.rb

Overview

Class that performs a particle on sprite animation

Instance Attribute Summary

Attributes inherited from TimedAnimation

#begin_time, #end_time, #time_source

Attributes included from Yuki::AnimationMixin

#player, #resolver

Instance Method Summary collapse

Methods inherited from TimedAnimation

#done?, #duration, #parallel_add, #play_before, #update

Methods included from Yuki::AnimationMixin

#begin_offset_for_next_animation, #done?, #duration, #update

Constructor Details

#initialize(time_to_process, particle, on, proportion_x = 1, proportion_y = 1, distortion: :UNICITY_DISTORTION, time_source: :SCENE_TIME_SOURCE) ⇒ ParticleOnSpriteAnimation

Create a new ParticleOnSpriteAnimation

Parameters:

  • time_to_process (Float) —

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

  • particle (Sprite, Sprite3D) —

    sprite that will be placed

  • on (PokemonSprite, PokemonSprite3D) —

    based on which Sprite dimension it will be placed

  • proportion_x (Float) (defaults to: 1) —

    proportion of the sprite width that will cover (by default 1)

  • proportion_y (Float) (defaults to: 1) —

    proportion of the sprite height that will cover (by default 1)

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

    callable taking one parameter (between 0 & 1) and converting it to another number (between 0 & 1) to distort time

  • time_source (#call, Symbol) (defaults to: :SCENE_TIME_SOURCE) —

    callable taking no parameter and giving the current time



261
262
# File 'docs/5_Battle_20_MoveAnimation.rb', line 261

def initialize(time_to_process, particle, on, proportion_x = 1, proportion_y = 1, distortion: :UNICITY_DISTORTION, time_source: :SCENE_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



265
266
# File 'docs/5_Battle_20_MoveAnimation.rb', line 265

def start(begin_offset = 0)
end

#update_internal(time_factor)

Method you should always overwrite in order to perform the right animation

Parameters:

  • time_factor (Float) —

    number between 0 & 1 indicating the progression of the animation



269
270
# File 'docs/5_Battle_20_MoveAnimation.rb', line 269

def update_internal(time_factor)
end