Slight card modifications, added background image extension

master
silverwizard 5 years ago
parent 8fe73a8142
commit c1df1f3db9
  1. 0
      Backgrounds/.gitkeep
  2. 9
      CardGen.pl
  3. 4
      shopping.yml

@ -51,10 +51,13 @@ foreach my $card (keys %{$cards->{Deck}->{Cards}}){
$image->Annotate(text => wrap('', '', $card), x => 50, y => 100, font => $mainfont, fill => $txtcolour, pointsize => 60);
my $newlines = () = $text =~ /(\n)/g;
$image->Annotate(text => $text, x => 50, y => (750-(25*$newlines)), font => $mainfont, fill => $txtcolour, pointsize => 25);
my $backgroundfilename = "Backgrounds/" . $card . ".png";
if(-e $backgroundfilename){
my $background = Image::Magick->new;
$background->ReadImage($backgroundfilename);
$image->Composite(compose => 'Atop', image => $background, gravity => 'Center');
}
$image->Write($card . '.png');
}
#my $body = Image::Magick->new;
#$body->ReadImage('mayhemtraining9.png');
#say $image->Composite(compose => 'over', image => $image, x => 100, y => 165);

@ -1,7 +1,7 @@
Deck:
Background: black
Background: white
Font: Courier
TextColour: green
TextColour: black
BorderColour: green
Cards:
Leg Boost:

Loading…
Cancel
Save