Module: RubySprites::Packer::HorizontalStack
- Defined in:
- lib/lash-sprites/packer/horizontal_stack.rb
Class Method Summary collapse
Class Method Details
.pack(images, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/lash-sprites/packer/horizontal_stack.rb', line 7 def self.pack(images, = {}) width = 0 height = 0 images.each do |img| next unless img.exists? img.x = width img.y = 0 height = img.height if img.height > height width += img.width end return {:width => width, :height => height} end |