Class: Yuki::Animation::RadiusMoveMarginAnimation

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

Overview

Animation responsive of moving a sprite between a 2 point, one from a sprite defined by a distance with margin

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 RadiusMoveAnimation

#update_internal

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, on, a, b, x_margin = 5, y_margin = 5, reversed: false, max_radius: 360, distortion: :UNICITY_DISTORTION, time_source: :SCENE_TIME_SOURCE) ⇒ RadiusMoveMarginAnimation

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

Parameters:

  • time_to_process (Float) —

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

  • on (Object) —

    object that will receive the property

  • a (Symbol) —

    origin sprite position

  • b (Integer) —

    length of the movement

  • x_margin (Integer) (defaults to: 5) —

    x length of the margin origin

  • y_margin (Integer) (defaults to: 5) —

    y length of the margin origin

  • reversed (Boolean) (defaults to: false) —

    if the animation should be reversed

  • max_radius (Integer) (defaults to: 360) —

    max_radius for the angle direction

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

    callable taking one parameter (between 0 & 1) and

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

    callable taking no parameter and giving the current time



1001
1002
# File 'docs/4_Systems_005_Animation.rb', line 1001

def initialize(time_to_process, on, a, b, x_margin = 5, y_margin = 5, reversed: false, max_radius: 360, distortion: :UNICITY_DISTORTION, time_source: :SCENE_TIME_SOURCE)
end

Instance Method Details

#start(begin_offset = 0) ⇒ self

Start the animation (initialize it)

Parameters:

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

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

Returns:

  • (self)


1006
1007
# File 'docs/4_Systems_005_Animation.rb', line 1006

def start(begin_offset = 0)
end