Added a bunch of defaults

master
silverwizard 5 years ago
parent 113c4198ca
commit 198ae5c782
  1. 25
      CardGen.pl
  2. 7
      shopping.yml

@ -5,14 +5,31 @@ use Text::Wrap;
$Text::Wrap::columns = 30; $Text::Wrap::columns = 30;
my $cards = LoadFile('shopping.yml'); my $cards = LoadFile('shopping.yml');
$bgcolour = $cards->{Deck}->{Background}; if($cards->{Deck}->{Background}){
$mainfont = $cards->{Deck}->{Font}; $bgcolour = $cards->{Deck}->{Background};
$txtcolour = $cards->{Deck}->{TextColour}; }else{
$bgcolour='white';
}
if($cards->{Deck}->{Font}){
$mainfont = $cards->{Deck}->{Font};
}else{
$mainfont = 'Courier';
}
if($cards->{Deck}->{TextColour}){
$txtcolour = $cards->{Deck}->{TextColour};
}else{
$txtcolour = 'black';
}
if($cards->{Deck}->{BorderColour}){
$bordercolour = $cards->{Deck}->{BorderColour};
}else{
$bordercolour = 'red';
}
foreach my $card (keys %{$cards->{Deck}->{Cards}}){ foreach my $card (keys %{$cards->{Deck}->{Cards}}){
my $image = Image::Magick->new(size=>'600x825'); my $image = Image::Magick->new(size=>'600x825');
$image->ReadImage('canvas:' . $bgcolour); $image->ReadImage('canvas:' . $bgcolour);
$image->Draw(stroke=>'red', fill => 'none', strokewidth=>1, primitive=>'rectangle', points=>'38,38 562,787'); $image->Draw(stroke=>$bordercolour, fill => 'none', strokewidth=>1, primitive=>'rectangle', points=>'38,38 562,787');
my $surface = Image::Magick->new; my $surface = Image::Magick->new;
$surface->Rotate(90); $surface->Rotate(90);
$surface->Resize('600x825!'); $surface->Resize('600x825!');

@ -1,7 +1,8 @@
Deck: Deck:
Background: black #Background: black
Font: Courier #Font: Courier
TextColour: white #TextColour: DarkGoldenRod3
#BorderColour: green
Cards: Cards:
Leg Boost: Leg Boost:
- Grants +1d6 when jumping - Grants +1d6 when jumping

Loading…
Cancel
Save