swfc manual- initial revision.
[swftools.git] / doc / swfc.xml
diff --git a/doc/swfc.xml b/doc/swfc.xml
new file mode 100644 (file)
index 0000000..bd1176e
--- /dev/null
@@ -0,0 +1,187 @@
+<?xml version='1.0'?>
+<guide>
+    
+<title>SWFC Manual</title>
+
+<abstract>
+swfc is a tool for generating flash files. You can write small simple scripts
+and then have them compiled to SWF Flash Animations.
+</abstract>
+
+
+<!--
+
+This comment aims to give a short overview over the tags defined in guide.xslt.
+Most are like html.
+
+Markups and Highlights:
+
+    <i>italic</i>
+    <b>bold</b>
+    <ul>Underline</ul>
+
+    <f>filename or pathname</f>
+    <c>variable name, command</c> ("c" stands for "code")
+
+Paragraphs:
+
+    <p>
+    Paragraph
+    </p>
+
+Line breaking:
+
+    <br/>
+
+Links:
+
+    <uri>http://www.quiss.org</uri> OR
+    <uri link=http://www.quiss.org>Quiss</uri>
+
+Shell scripts, commands to execute:
+
+    <shell>tail /var/log/messages</shell>
+
+Code:
+    
+    <code lang="sc">   (The lang= is optional)
+       .swf
+           .box b1 100 100
+       .end
+    </code>
+
+Tables:
+
+    <table>
+    <tr><td>Apples</td><td>Pears</td></tr>
+    <tr><td>3</td><td>4</td></tr>
+    </table>
+
+Boxes:
+    <note>
+    Something interesting
+    </note>
+
+    <impo>
+    Something important
+    </impo>
+    
+    <warn>
+    Something to be careful about
+    </warn>
+
+-->
+
+<chapter><title>swfc Basics</title>
+
+ <section><title>Calling swfc</title>
+
+ <p>
+
+  swfc is command line based. You call it via
+
+  <shell>$ swfc file.sc</shell>
+
+  The filename of what is generated depends on the filename of the script (<f>file.sc</f>),
+  the filename given inside the script, and the optional <c>-o</c> passed to swfc.
+
+ </p>
+
+ <note>
+  Though swfc is a command-line utility, there also exists a nice graphical
+  frontend for it, called <uri link="http://www.ucolick.de/~de/Snarf/quiss">Swifty</uri>.
+ </note>
+
+ </section>
+
+ <section><title>A simple swfc example</title>
+
+  <p>
+   Let's create simple SWF file, shall we?
+   The following script creates a red box with a yellow border. On the right side you
+   see the script used, on the left side the swf file that is generated.
+  </p>
+
+  <code lang="swfc">
+.swf name="box.swf"
+    .box b1 100 100 color=yellow fill=red
+    .put b1 pin=center scale=0%
+    .frame 100
+    .change b1 pin=center scale=100%
+    .frame 200
+    .change b1 pin=center scale=0%
+.end
+  </code>
+
+  The <c>.box</c> command creates the box. Every object that is created must also be explicitly
+  put into the scene using <c>.put</c> to become visible.
+
+ </section>
+ <section><title>Text generation</title>
+  
+  <code lang="swfc">
+.swf name="text5.swf"
+.font courier "Courier.swf"
+.font helvetica "Helvetica.swf"
+.text hithere text="HELLO" font=courier size=50% color=blue
+.shape scene Scenery50.swf
+
+.frame 0
+    .startclip hithere pin=center x=100 y=75 scale=50% #text clips...
+        .put scene # ...the image "scene"
+    .end
+.frame 100
+     .change hithere rotate+=360 pin=center scale=100%
+
+.end
+  </code>
+  
+  <code lang="swfc">
+.swf name="text6.swf"
+.font courier "Courier.swf"
+.font helvetica "Helvetica.swf"
+.text hello text="HELLO" font=helvetica size=50% color=blue
+.text world text="WORLD" font=helvetica size=50% color=red
+
+.frame 0
+       .put hello pin=center x=50 y=50 
+       .put world pin=center x=50 y=50 alpha=25%
+.frame 200
+     .change hello rotate+=360 pin=center alpha=25% 
+     .change world rotate-=360 pin=center alpha=100% 
+.end
+  </code>
+ </section>
+
+ <section><title>Color transforms</title>
+
+  <code lang="swfc">
+.swf name="cxform.swf" version=5
+    
+    .shape s1 "photo.swf"
+
+    .put s1 x=50 y=50 scalex=110 scaley=110
+    .frame 100
+    .change s1 x=0 y=0 scalex=210 scaley=210 red=-1+255 green=-1+255 blue=-1+255 #invert
+    .frame 200
+    .change s1 x=100 y=50 scalex=110 scaley=110 red=0 green=+0 blue=+0 #remove red
+    .frame 300
+    .change s1 x=0 y=0 scalex=210 scaley=210 red=+0 green=2 blue=-1+255 #amplify green, invert blue
+    .frame 400
+    .change s1 x=50 y=100 scalex=110 scaley=110 red=2-128 green=-2+255 blue=+0.7+40 #alien glow
+    .frame 500
+    .change s1 x=0 y=0 scalex=210 scaley=210 red=8-1024 green=8-1024 blue=8-1024 #palette reduce
+    .frame 600
+    .change s1 x=0 y=0 scalex=210 scaley=210 red=+0 green=+0 blue=+0 #back to normal
+    .frame 700
+    .change s1 x=105 y=105 scalex=0 scaley=0 luminance=0 #fadeout
+.end
+  </code>
+ </section>
+
+</chapter>
+</guide>