Method: Pixelart::GeneratorEx#generate_image
- Defined in:
- lib/punks/pixelart/generator.rb
#generate_image(*values, style: nil, patch: nil) ⇒ Object Also known as: generate
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/punks/pixelart/generator.rb', line 109 def generate_image( *values, style: nil, patch: nil ) ## check: rename patch to more/extras/foreign or ... - why? why not? recs = to_recs( *values, style: style, patch: patch ) punk = @image_class.new( @sheet.image.tile_width, @sheet.image.tile_height ) recs.each do |rec| ## note: quick hack - allow "inline" raw images for now - why? why not? ## pass through as-is img = if rec.is_a?( Image ) rec else @sheet.image[ rec.id ] end punk.compose!( img ) end punk end |