Cards are almost complete now!
This commit is contained in:
19
src/deck.rb
19
src/deck.rb
@@ -10,6 +10,10 @@ def rank_to_banner_svg(rank)
|
||||
rank.nil? ? nil : (rank.start_with?('+') || rank.start_with?('-')) ? "banniere_mod.svg" : "banniere_rang.svg"
|
||||
end
|
||||
|
||||
def embed_custom(embed, id)
|
||||
embed.svg width: '0.8c', height: '0.8c', dx: '0c', dy: '-0.7c', key: ":#{id}:", file: "._graphics/#{id}.svg"
|
||||
end
|
||||
|
||||
DPI = 300
|
||||
CELL_PX = DPI / 8.0
|
||||
BLEED = 0.125 # In inches
|
||||
@@ -26,6 +30,7 @@ Squib::Deck.new(
|
||||
dpi: DPI,
|
||||
) do
|
||||
background color: 'white'
|
||||
svg file: 'bg_numbers.svg', layout: 'background'
|
||||
|
||||
build :debug do
|
||||
rect layout: 'border', stroke_color: 'black'
|
||||
@@ -49,6 +54,20 @@ Squib::Deck.new(
|
||||
svg file: alt_banner_file, layout: 'alt_banner'
|
||||
text str: data['rang_alt'], layout: 'alt_banner_text'
|
||||
|
||||
fill_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#f5f5f5ff' }
|
||||
stroke_color = data['effet'].map { |effet| effet.nil? ? '#0000': '#bb98' }
|
||||
rect layout: 'effect_frame', fill_color: fill_color, stroke_color: stroke_color
|
||||
text(str: data['effet'], layout: 'effect_text') do |embed|
|
||||
embed_custom(embed, 'effet')
|
||||
embed_custom(embed, 'magouille')
|
||||
embed_custom(embed, 'pv')
|
||||
embed_custom(embed, 'icone_ind')
|
||||
embed_custom(embed, 'icone_gau')
|
||||
embed_custom(embed, 'icone_roy')
|
||||
embed_custom(embed, 'icone_ana')
|
||||
embed_custom(embed, 'icone_dro')
|
||||
embed_custom(embed, 'icone_eco')
|
||||
end
|
||||
|
||||
build :debug do
|
||||
save_pdf sprue: 'sprues/debug.yml', file: 'debug.pdf'
|
||||
|
||||
Reference in New Issue
Block a user