Browse Source

Slight card modifications, added background image extension

master
silverwizard 1 year ago
parent
commit
c1df1f3db9
3 changed files with 8 additions and 5 deletions
  1. +0
    -0
      Backgrounds/.gitkeep
  2. +6
    -3
      CardGen.pl
  3. +2
    -2
      shopping.yml

+ 0
- 0
Backgrounds/.gitkeep View File


+ 6
- 3
CardGen.pl View File

@@ -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);

+ 2
- 2
shopping.yml View File

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


Loading…
Cancel
Save