Add a force_id: true example to load_images
parent
806cae192b
commit
ff3d057d49
|
|
@ -60,5 +60,13 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do
|
|||
png mask: :magenta, file: 'shiny-purse.png',
|
||||
x: 650, y: 950
|
||||
|
||||
# Note that this method does nothing, even though it would normally fill up
|
||||
# the card. force_id: true looks to the id field to be non-empty to render.
|
||||
# This is useful if you have multiple different icons in one SVG file,
|
||||
# but sometimes want to use none.
|
||||
# e.g. id: [:attack, :defend, nil]
|
||||
svg file: 'spanner.svg', width: :deck, height: :deck,
|
||||
force_id: true, id: '' # <-- the important part
|
||||
|
||||
save prefix: 'load_images_', format: :png
|
||||
end
|
||||
|
|
|
|||
|
|
@ -121,7 +121,13 @@ cairo: translate([650, 950])
|
|||
cairo: rotate([0])
|
||||
cairo: translate([-650, -950])
|
||||
cairo: set_source([ImageSurface, 650, 950])
|
||||
cairo: set_source_color([:magenta])
|
||||
cairo: set_source_color(["magenta"])
|
||||
cairo: mask([ImageSurface, 650, 950])
|
||||
cairo: restore([])
|
||||
cairo: save([])
|
||||
cairo: translate([0, 0])
|
||||
cairo: rotate([0])
|
||||
cairo: scale([6.4453125, 8.7890625])
|
||||
cairo: render_rsvg_handle([RSVG::Handle, "#"])
|
||||
cairo: restore([])
|
||||
surface: write_to_png(["_output/load_images_00.png"])
|
||||
|
|
|
|||
Loading…
Reference in New Issue