Class: Shibainu::Image

Inherits:
Pixelart::Image
  • Object
show all
Defined in:
lib/shibainus.rb

Constant Summary collapse

BEFORE_PATCH =

before callback/patch for hats

->(img, meta) {
   ## hack for doge hats - cut off / clean top (ears)
    if ['beanie',
        'cap',
        'capforward',
        'cowboyhat',
        'fedora',
        'bandana',
        'tophat',
        'knittedcap'].include?( meta.name )
         puts "  apply doge headwear (for hats & more) hack before '#{meta.name}' - wipe-out pixel lines 3,4,5 (top e.g. doge ears)..."

         ## "wipe-out" pixel lines 3,4,5 (top)
        [3,4,5].each do |y|
           img.width.times do |x|
              img[ x, y ] = 0  # transparent color
           end
        end
     end
}
NAMES =
['doge', 'doges',
'shiba', 'shibas',
'shibainu', 'shibainus']
DEFAULT_ATTRIBUTES =
['Classic']

Class Method Summary collapse

Class Method Details

.generate(*names) ⇒ Object



67
68
69
# File 'lib/shibainus.rb', line 67

def self.generate( *names )
 generator.generate( *names, before: BEFORE_PATCH )
end

.generatorObject



34
35
36
37
# File 'lib/shibainus.rb', line 34

def self.generator
  @generator ||= Artfactory.use(  Shibainu::Sheet.builtin,
                                  image_class: Image )
end