#!/usr/bin/perl -w
use strict;

use SWF qw(:ALL);

SWF::setScale(1.0);

my $s = new SWF::Shape();

# .msk file generated with "gif2mask" utility
my $f = $s->addFill(new SWF::Bitmap("../common/alphafill.jpg", "../common/alphafill.msk"));
$s->setRightFill($f);

$s->drawLine(640, 0);
$s->drawLine(0, 480);
$s->drawLine(-640, 0);
$s->drawLine(0, -480);

my $c = new SWF::Shape();
$c->setRightFill($c->addFill(0x99, 0x99, 0x99));
$c->drawLine(40, 0);
$c->drawLine(0, 40);
$c->drawLine(-40, 0);
$c->drawLine(0, -40);

my $m = new SWF::Movie();
$m->setDimension(640, 480);
$m->setBackground(0xcc, 0xcc, 0xcc);

# draw checkerboard background
for(my $y=0; $y<480; $y+=40)
{
  for(my $x=0; $x<640; $x+=80)
  {
    my $ci = $m->add($c);
    $ci->moveTo($x, $y);
  }
  
  $y+=40;

  for(my $x=40; $x<640; $x+=80)
  {
    my $ci2 = $m->add($c);
    $ci2->moveTo($x, $y);
  }
}

$m->add($s);

$m->save("test.swf");
