Class Limelight::Animation
In: lib/limelight/animation.rb
Parent: Limelight::Background::Animation

An object to manage a seqeunce of changes, assumedly to a prop. The Animation object is constructed with options and a block. Once the Animation is started, the block is invoked repeatedly until the Animation is stopped.

Although, this object does not update the screen, it provides a means to perform sequential updates in evenly spaced time frames.


new   running?  

Public Class methods

A Prop and block are required to construct an Animation. Options may include

  1. :name (string)
  2. :updates_per_second (int defaults to 60)
  animation =, { "do something"}, :updates_per_second => 20)
  # time passes


    # File lib/limelight/animation.rb, line 23
23:     def initialize(prop, block, options={})
24:       @block = block
25:       name = options[:name] || "#{prop.to_s} animation"
26:       updates_per_second = options[:updates_per_second] || 60
27:       super(updates_per_second)
28:     end

Public Instance methods

Lets you know if the animation is currently running or not.


    # File lib/limelight/animation.rb, line 36
36:     def running?
37:       return is_running
38:     end