Sha256: d124963cabfb692769885383cede877982928b05c494dc63a01b80befa554ee5
Contents?: true
Size: 780 Bytes
Versions: 23
Compression:
Stored size: 780 Bytes
Contents
require 'chunky_png' module SpriteFactory module Library module ChunkyPng VALID_EXTENSIONS = :png def self.load(files) files.map do |filename| image = ChunkyPNG::Image.from_file(filename) { :filename => filename, :image => image, :width => image.width, :height => image.height } end end def self.create(filename, images, width, height) target = ChunkyPNG::Image.new(width, height, ChunkyPNG::Color::TRANSPARENT) images.each do |image| target.compose!(image[:image], image[:x], image[:y]) end target.save(filename) end end # module ChunkyPng end # module Library end # module SpriteFactory
Version data entries
23 entries across 23 versions & 2 rubygems