Module: Metro::HasAnimations::ClassMethods

Defined in:
lib/metro/animation/has_animations.rb

Instance Method Summary collapse

Instance Method Details

#animate(actor_name, options, &block) ⇒ Object Also known as: change

Define an animation to execute when the scene starts.

Examples:

Defining an animation that fades in and moves a logo when it is

done, transition to the title scene.

  animate :logo, to: { y: 80, alpha: 50 }, interval: 120.ticks do
    transition_to :title
  end


52
53
54
55
# File 'lib/metro/animation/has_animations.rb', line 52

def animate(actor_name,options,&block)
  scene_animation = AnimationFactory.new actor_name, options, &block
  animations.push scene_animation
end

#animationsObject

All the animations that are defined for the scene to be run the scene starts.



63
64
65
# File 'lib/metro/animation/has_animations.rb', line 63

def animations
  @animations ||= []
end