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