Class: Spritely::Generators::ChunkyPng

Inherits:
Base
  • Object
show all
Defined in:
lib/spritely/generators/chunky_png.rb

Instance Attribute Summary

Attributes inherited from Base

#sprite_map

Instance Method Summary collapse

Instance Method Details

#build!Object



7
8
9
10
11
12
13
14
# File 'lib/spritely/generators/chunky_png.rb', line 7

def build!
  sprite_map.images.each do |image|
    png = ::ChunkyPNG::Image.from_blob(image.data)
    canvas.replace!(png, image.left, image.top)
  end

  canvas.to_blob(:fast_rgba)
end