Common Lisp Package: 3B-SWF

README:

FUNCTION

Public

COLOR-TRANSFORM-ALPHA (&KEY ADD MULTIPLY)

add,multiply are either (r g b a) or #xaarrggbb

COLOR-TRANSFORM-ALPHA-FLOAT (&KEY ADD MULTIPLY)

add,multiply are (r.r g.g b.b a.a)

EXTRACT-TAGS (ID-LIST TAG-LIST)

like EXTRACT-TAG, but avoids duplicating tags (for exaple when dependencies are reused) ID-LIST is a list of either tag IDs, or lists of (tag-id rename-id) where the tag matching TAG-ID will be renamed to RENAME-ID

PLACE-OBJECT (ID DEPTH &KEY CLASS-NAME MATRIX MOVE-P COLOR-TRANSFORM RATIO NAME CLIP-LAYERS FILTER-LIST BLEND-MODE CACHE-AS-BITMAP ACTIONS)

create a place-object-* tag (probably -3, but might eventually get smart enough to use -2 or original if possible), with character id ID, at depth DEPTH (0 to use current top depth) class-name : see swf docs name: name a sprite object for action-set-target* etc move-p: modify or replace the sprite at specified depth ratio: specify morph ratio for a define-morph-shape, 0-65535 (todo: use 0.0-1.0) clip-layers: if >0, use this layer as clip mask for next N higher layers filter-list: filter-list instance specifying filters to apply to character actions: clip-actions instance to specify event handlers for a sprite matrix, color-transform, blend-mode, cache-as-bitmap: specify params

SPRITE (NAME TAGS)

create a sprite with character id NAME, using tags in TAGS, which can be either actual swf-tag instances, character IDs of objects to place at increasing depths, or :show-frame, and end tag will be added automatically if the last element of TAGS isn't :end or an swf-end-tag instance (see ensure-tag for other things that will automatically be converted to tags besides :end and :show-frame)

Undocumented

BACKGROUND-COLOR (&REST COLOR)

EXPORT-ASSETS (EXPORTS)

FILE-ATTRIBUTES (&KEY (DIRECT-BLIT T) (USE-GPU T) (AS3 T) HAS-METADATA (USE-NETWORK T))

FRAME-LABEL (NAME &KEY ANCHOR-P)

IDENTITY-MATRIX (&OPTIONAL MATRIX)

MATRIX (&KEY TX TY SX SY RX RY)

MATRIX* (A B)

RECT (X1 Y1 X2 Y2)

RGB (&REST ARGS)

RGBA (&REST ARGS)

RGBA-FLOAT (R G B A)

ROTATE (ANGLE-DEG &OPTIONAL MATRIX)

SCALE (SX SY &OPTIONAL MATRIX)

SCRIPT-LIMITS (TIMEOUT MAX-RECURSION)

SHOW-FRAME

SKEW (SX SY &OPTIONAL MATRIX)

SPRITE* (NAME &REST TAGS)

SYMBOL-CLASS-TAG (EXPORTS)

TRANSFORM-POINT (MATRIX X Y)

TRANSLATE (TX TY &OPTIONAL MATRIX)

WRITE-SWF (STREAM BODY-TAGS &KEY (FLASH-VERSION 9) (X-TWIPS 400.0) (Y-TWIPS 300.0) (FRAME-RATE 30.0) (FRAME-COUNT (LOOP FOR I IN BODY-TAGS WHEN (TYPEP I 'SWF-SHOW-FRAME-TAG) COUNT 1)) (ATTRIBUTES-TAG NIL) (SCRIPT-LIMITS-STACK 1000) (SCRIPT-LIMITS-TIMEOUT 60) COMPRESS)

Private

EXTRACT-TAG (ID TAG-LIST &KEY RENAME)

extract a tag and any tags it depends on, by exported name or by id TAG-LIST is a list of tags as returned by READ-SWF

FILL-STYLE (FILL)

fill = (:solid r g b a) -- solid color (:linear-gradient x0 y0 x1 y1 (stops) transform spread) -- linear gradient from x0,y0 to x1,y1 (:radial-gradient cx cy r (stops) transform spread) -- radial gradient centered at cx,cy, with radius r (:focal-gradient cx cy fx fy r (stops) spread) -- focal gradient centered at cx,cy, with radius r, and focal point at fx,fy gradient stops: list of (offset (r g b a)) where offset is 0.0 to 1.0

SHAPE (ID FILL-STYLES LINE-STYLES SHAPE-DATA X1 Y1 X2 Y2 &KEY INVERT)

id = character-id of shape fill-styles = alist? of fill-style names to fill-style specs line-styles = alist? of line-style names to line-style specs shape-data = list of shape commands: (:line-style name) -- change line style (:fill-style name) -- change-fill style 1 (:fill-style-2 name) -- change-fill style 2 (:move-to x y) -- move without drawing to absolute x,y (:line-to x y) -- draw straight line to absolute x,y (:quadratic-to x y cx cy) -- quadratic spline to x,y, control point cx,cy (:cubic-to x y cx1 cy1 cx2 cy2 -- cubic spline (converted to quadratic internally, probably not very well) --- fixme: ^^^ these are probably wrong...

SHAPE* (ID SHAPE-DATA)

alternate version of SHAPE, with all style data directly in the op stream, so caller doesn't need to worry about reusing previous styles id = character-id of shape shape-data = list of shape commands: (:line-style (line style data)) -- change line style (:fill-style (fill style data)) -- change-fill style 0 (:fill-style-1 (fill style data)) -- change-fill style 1 (:move-to x y) -- move without drawing to absolute x,y (:line-to x y) -- draw straight line to absolute x,y (:quadratic-to x y cx cy) -- quadratic spline to x,y, control point cx,cy (:cubic-to x y cx1 cy1 cx2 cy2 -- cubic spline (converted to quadratic internally, probably not very well) (:ellipse x y rx ry) -- axis aligned ellipse centered at x,y with radii rx,ry (:circle x y r) -- circle at x,y, radius r (:rect x y w h &optional rx ry) -- rectangle from x,y to (x+w),(y+h) optionally with rounded corners with radii rx,ry (:arc x1 y1 rx ry x-rotation large-flag sweep-flag x2 y2 ) -- svg style arc from x1,y1 to x2,y2, params interpreted as in svg (http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands) (:finish-layer) -- start a new fill/line style array, further fills will be drawn above strokes from earlier commands line style data: nil = no stroke (width join cap (fill style data)) -- stroke fill style data: nil = no fill (:solid r g b a) -- solid color (:linear-gradient x0 y0 x1 y1 (stops) transform spread) -- linear gradient from x0,y0 to x1,y1 (:radial-gradient cx cy r (stops) transform spread) -- radial gradient centered at cx,cy, with radius r (:focal-gradient cx cy fx fy r (stops) spread) -- focal gradient centered at cx,cy, with radius r, and focal point at fx,fy gradient stops: list of (offset (r g b a)) where offset is 0.0 to 1.0

Undocumented

END-TAG

ENSURE-TAG (TAG)

FIND-EXPORTED-TAG (NAME TAG-LIST)

FIND-TAG-BY-ID (ID TAG-LIST)

FOCAL-GRADIENT-FILL (X Y FX FY R COLORS TRANSFORM SPREAD)

LINE-STYLE (WIDTH JOIN CAP FILL &KEY OPEN MITER-LIMIT)

LINEAR-GRADIENT-FILL (X1 Y1 X2 Y2 COLORS TRANSFORM SPREAD)

LIST-EXPORTED-TAGS (TAG-LIST)

PLACE-OBJECT-AT (ID DEPTH X Y &KEY (SX 1 HAS-SX) (SY 1 HAS-SY) MOVE-P)

RADIAL-GRADIENT-FILL (X Y R COLORS TRANSFORM SPREAD)

RAW-FOCAL-GRADIENT-FILL (FR COLORS TRANSFORM SPREAD)

RAW-LINEAR-GRADIENT-FILL (COLORS TRANSFORM SPREAD)

RAW-RADIAL-GRADIENT-FILL (COLORS TRANSFORM SPREAD)

SOLID-FILL (R G B A)

SOUND-ENVELOPE (&KEY (POS 0.0) (LEFT 1.0) (RIGHT 1.0) LEVEL)

SOUND-INFO (&KEY STOP NO-MULTIPLE IN-POINT OUT-POINT LOOP-COUNT ENVELOPE)

SPLIT-CURVE (K1 K2 INTERPOLANTS CURVE-FUN LINE-FUN)

START-SOUND (ID &OPTIONAL SOUND-INFO)

SUBDIVIDE-CURVE (C CURVE-FUN LINE-FUN &KEY (Q-COMBINE-RANGE *CURVE-TOLERANCE*) (MAX-DEPTH 3))

VECTO-LINEAR-GRADIENT (X1 Y1 X2 Y2 COLORS)

VECTO-RADIAL-GRADIENT (CX CY RX RY COLORS)

GENERIC-FUNCTION

Private

Undocumented

TAG-DEPENDENCIES (TAG TAG-LIST)

VARIABLE

Private

Undocumented

*COUNT*

*CURVE-TOLERANCE*

*END-TYPES*

*JOIN-TYPES*