Module: RubySprites::Packer::VerticalStack

Defined in:
lib/lash-sprites/packer/vertical_stack.rb

Class Method Summary collapse

Class Method Details

.pack(images, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lash-sprites/packer/vertical_stack.rb', line 8

def self.pack(images, options = {})
  width = 0
  height = 0
  images.each do |img|
    next unless img.exists?
    img.x = 0
    img.y = height
    width = img.width if img.width > width
    height += img.height
  end
  return {:width => width, :height => height}
end