Class: Squib::Graphics::SaveSpruePNG

Inherits:
SaveSprue
  • Object
show all
Defined in:
lib/squib/graphics/save_sprue.rb

Overview

Templated sheet renderer in PNG format.

Instance Method Summary collapse

Methods inherited from SaveSprue

#initialize, #render_sheet

Constructor Details

This class inherits a constructor from Squib::Graphics::SaveSprue

Instance Method Details

#draw_page(cc) ⇒ Object


191
192
193
194
195
196
197
# File 'lib/squib/graphics/save_sprue.rb', line 191

def draw_page(cc)
  cc.target.write_to_png(full_filename)
  init_cc
  cc.set_source_color(:white) # white backdrop TODO make option
  cc.paint
  cc
end

#full_filenameObject


199
200
201
# File 'lib/squib/graphics/save_sprue.rb', line 199

def full_filename
  @sheet_args.full_filename @page_number
end

#init_ccObject


186
187
188
189
# File 'lib/squib/graphics/save_sprue.rb', line 186

def init_cc
  surface = Cairo::ImageSurface.new @tmpl.sheet_width, @tmpl.sheet_height
  Cairo::Context.new(surface)
end