SWFShape$s = new SWFShape();
Creates a new shape object.$l = $s->addLineStyle(width, r, g, b);
$l = $s->addLineStyle(width, r, g, b, a);Adds a new entry to the shape's list of line styles. Index of the entry is returned.All linestyles must be specified before any drawing begins.
$s->setLineStyle($l);
Sets the current line style to index #$l, returned by addLineStyle method.$f = $s->addSolidFill(r, g, b);
$f = $s->addSolidFill(r, g, b, a);Adds a new entry to the shape's list of fill styles. Index of the entry is returned.All fillstyles must be specified before any drawing begins.
$f = $s->addJpegFill(filename);
Adds the named jpeg file to the shape's fill styles.note: this is a temporary hack!
This doesn't allow you to change the bitmap's transform matrix, so bitmap will probably be added as a separate object later. This is just to show off the feature, maybe get some input about a good way to deal with bitmaps.
Also, it can only deal with baseline (frame 0) jpegs, no baseline optimized or progressive scan jpegs!
$s->setFillStyle0($f);
$s->setFillStyle1($f);Ugh. I'd love to figure a way around this.. The deal is, every edge segment borders at most two fills. When rasterizing the object, it's pretty handy to know what those fills are ahead of time, so the swf format requires these to be specified. Setting the right fills at the right time seems to be something of a black art. You can get pretty funky effects by changing fill styles when you shouldn't.For simple shapes, just remember: use fill0 if you defined the object in a clockwise direction, fill1 if it's counterclockwise.
$s->movePenTo(x, y);
Move the shape's pen to (x,y) in the shape's coordinate space.$s->movePen(dx, dy);
Add dx to pen's current x position, dy to y.$s->drawLineTo(x, y);
Draw a line (using the current line style) from the current pen position to point (x,y) in the shape's coordinate space.$s->drawCurveTo(controlx, controly, anchorx, anchory);
Draw a quadratic curve (using the current line style) from the current pen position to (anchorx,anchory) using (controlx,controly) as a control point. That is, head towards the control point, then smoothly turn to the anchor point. Wait, maybe a diagram will help:
..see?
SWFMorphAlso called a "shape tween". This thing lets you make those tacky twisting things that make your computer choke. Oh, joy!
$m = new SWFMorph();
Create a new SWFMorph object.$s = $m->getShape1();
Get a handle to the morph's starting shape.$s = $m->getShape2();
Get a handle to the morph's ending shape.The methods here are sort of weird. It would make more sense to just have newSWFMorph(shape1, shape2);, but as things are now, shape2 needs to know that it's the second part of a morph. (This, because it starts writing its output as soon as it gets drawing commands- if it kept its own description of its shapes and wrote on completion this and some other things would be much easier.)
All content Copyright (C) 2000 Opaque Industries except where noted otherwise.