Class: Teaas::HorizontalRoller

Inherits:
Object
  • Object
show all
Defined in:
lib/teaas/horizontal_roller.rb

Class Method Summary collapse

Class Method Details

.roll(img, options) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/teaas/horizontal_roller.rb', line 3

def self.roll(img, options)
  if options[:reverse]
    img.roll(options[:img_width] * ((options[:total_frames] - options[:frame].to_f) / options[:total_frames]), 0)
  else
    img.roll(options[:img_width] * (options[:frame].to_f / options[:total_frames]), 0)
  end
end