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.
A Prop and block are required to construct an Animation. Options may include
animation = Animation.new(prop, Proc.new { "do something"}, :updates_per_second => 20) animation.start # time passes animation.stop
# 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