NAME

SWF::Shape - Shape class

SYNOPSIS

use SWF::Shape;
my $shape = new SWF::Shape();

DESCRIPTION

SWF::Shape is the fundamental object of a flash movie.

METHODS

new SWF::Shape();

Creates a new Shape object.

$shape->moveTo($x, $y); or $shape->movePenTo($x, $y);

Move the Shape's (imaginary) pen location to ($x, $y) in the Shape's coordinate space.

$shape->moveToRelative($dx, $dy); or $shape->movePen($dx, $dy);

Add ($dx, $dy) to the Shape's pen current location.

$x = $shape->getPenX();

Returns Pen's x-coordinates

$y = $shape->getPenY();

Returns Pen's y-coordinates

($x, $y) = $shape->getPen();

Returns Pen's (x,y) coordinates

$shape->drawLineTo($x, $y);

Draw a line (using current line style - see "setLine()" method) from the current position to ($x, $y).

$shape->drawLine($dx, $dy);

Draw a line (using current line style - see "setLine()" method) from the current position to displacement ($dx, $dy).

$shape->drawCurveTo($controlx, $controly, $anchorx, $anchory);

Draw a quadratic curve (using current line style - see "setLine()" method) from current pen position to ($anchorx, $anchory) using control point ($controlx, $controly).

$shape->drawCurve($controldx, $controly, $anchorx, $anchory);

Draw a quadratic curve (using current line style - see "setLine()" method) from current pen position to displacement ($anchordx, $anchordy) using displacement control point ($controldx, $controldy).

$shape->setLine($width, $r, $g, $b [,$a]);

Sets Shape's line width and color (RGB). To remove the Shape's line style call this method without any arguments, i.e. $shape->setLine().

$fill = $shape->addFill($r, $g, $b [,$a]);

Adds a solid fill to $shape list of fill styles and returns an SWF::Fill object. This object is used with the "setLine()" method described below. The default value of $a is 0.

$fill = $shape->addFill($bitmap [,FLAG]);

Adds a bitmap fill to $shape list of fill styles and returns an SWF::Fill object. This object is used with the "setLine()" method described below.

$bitmap is an SWF::Bitmap object while FLAG arguemnt can be SWFFILL_TILED_BITMAP or SWFFILL_CLIPPED_BITMAP. Make sure to import these constants to your package before useing it, i.e. use the following statement:

use SWF::Fill <list of constants>;

The default value of FLAG is SWFFILL_TILED_BITMAP.

$fill = $shape->addFill($gradient [,FLAG]);

Adds a gradient fill to $shape list of fill styles and returns an SWF::Fill object. This object is used with the "setLine()" method described below.

$gradient is an SWF::Gradient object while FLAG arguemnt can be SWFFILL_LINEAR_GRADIENT or SWFFILL_RADIAL_GRADIENT.Make sure to import these constants to your package before useing it, i.e. use the following statement:

use SWF::Fill <list of constants>;

The default value of FLAG is SWFFILL_LINEAR_GRADIENT.

$shape->setLeftFill($fill);

Sets the fill on the left side of the edge. $fill is an SWF::Fill object returned from "addFill" method.

$shape->setLeftFill($r, $g, $b [,$a]);

This is another way of saying:

my $fill = $shape->addSolidFill($r, $g, $b [,$a]);
$shape->setLeftFill($fill);
$shape->setRightFill($fill);

Sets the fill on the right side of the edge. $fill is an SWF::Fill object returned from "addFill" method.

$shape->setRightFill($r, $g, $b [,$a]);

This is another way of saying:

my $fill = $shape->addSolidFill($r, $g, $b [,$a]);
$shape->setRightFill($fill);
$shape->drawCircle($r) - Don't use. Interface may change.

Draws a circle with radious $r.

$shape->drawArc($r, $startAngle, $endAngle) - Don't use. Interface may change.

AUTHOR

Soheil Seyfaie (soheil at users.sourceforge.net).

SEE ALSO

SWF, SWF::Action, SWF::Bitmap, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Fill, SWF::Font, SWF::Gradient, SWF::Morph, SWF::Movie, SWF::MovieClip,SWF::Shape, SWF::Sound, SWF::TextField, SWF::Text