Difference between revisions of "Swf.pl"
From Organic Design wiki
(Colours) |
(restructure) |
||
| Line 1: | Line 1: | ||
use SWF::Builder; | use SWF::Builder; | ||
| − | + | # We may use a dedicated child for serving SWF requests | |
| − | + | sub swfd { | |
| − | + | } | |
| − | |||
| − | |||
| − | # Red triangle | + | # Compile a SWF interface for this peer |
| − | my $shape = $swf->new_shape | + | sub swfCompile { |
| − | + | my $output = ''; | |
| − | + | ||
| − | + | my $swf= SWF::Builder->new( | |
| − | + | FrameRate => 50, | |
| − | + | FrameSize => [0, 0, 640, 480], | |
| − | + | BackgroundColor => 'cccccc' | |
| − | my $instance = $shape->place; | + | ); |
| − | for ( my $x = 0; $x < 400; $x++ ) { $instance->rotate(15)->moveto( $x, 200 ) } | + | |
| − | $swf->save( "$::peer.swf" ); | + | # Red triangle |
| + | my $shape = $swf->new_shape | ||
| + | ->fillstyle('ffffff') | ||
| + | ->linestyle(1, '000000') | ||
| + | ->moveto(0,-11) | ||
| + | ->lineto(10,6) | ||
| + | ->lineto(-10,6) | ||
| + | ->lineto(0,-11); | ||
| + | my $instance = $shape->place; | ||
| + | |||
| + | for ( my $x = 0; $x < 400; $x++ ) { $instance->rotate(15)->moveto( $x, 200 ) } | ||
| + | |||
| + | $swf->save( my $file = "$::peer.swf" ); | ||
| + | my @stat = stat( $file ); | ||
| + | $output .= logAdd "SWF Instance compiled: $file ($stat[7] bytes)\n"; | ||
| + | return $output; | ||
| + | } | ||
Revision as of 00:12, 15 February 2006
use SWF::Builder;
- We may use a dedicated child for serving SWF requests
sub swfd { }
- Compile a SWF interface for this peer
sub swfCompile { my $output = ;
my $swf= SWF::Builder->new( FrameRate => 50, FrameSize => [0, 0, 640, 480], BackgroundColor => 'cccccc' );
# Red triangle my $shape = $swf->new_shape ->fillstyle('ffffff') ->linestyle(1, '000000') ->moveto(0,-11) ->lineto(10,6) ->lineto(-10,6) ->lineto(0,-11); my $instance = $shape->place;
for ( my $x = 0; $x < 400; $x++ ) { $instance->rotate(15)->moveto( $x, 200 ) }
$swf->save( my $file = "$::peer.swf" ); my @stat = stat( $file ); $output .= logAdd "SWF Instance compiled: $file ($stat[7] bytes)\n"; return $output; }



