The Scripted Animator

About Animator

Animator is a program that allows you to draw simple animated 2D vector graphics without having to know the intricate APIs of more sophisticated vector libs. You don't have to link with anything: animator reads drawing commands from its STDIN.

Optionally, Animator can describe mouse and keyboard events on its STDOUT, so interactive graphics may be made.

Animator is written in C and depends only on SDL.

Command Line

Animator takes no file arguments, input is always read from STDIN.

The following command line arguments are accepted:

Input Syntax

Input is freeform, tokens are separated by whitespace.

Text starting with the ! character is ignored until EOL.

String constants can be given without quotes if they don't collide with keywords (and they're a single word); otherwise, they should be surrounded with double quotes ". Double quotes and backslashes can be escaped with backslash. Special characters \n \t \r \b \f are supported.

General Commands

Frame Management

Transformations

Initial coordinate system is left edge to right edge -1 .. 1, bottom edge to top edge -1 .. 1. Transformation matrices are kept on a stack; the top matrix of the stack is the active one.

Drawing

Macros

Not all commands are allowed inside macro bodies; basically only drawing and matrix commands are allowed. This is the full list:

color dot line arrow rect text lines poly push pop mult rotate scale shift invoke

Empty macro bodies are not allowed.

Executing a macro is equivalent to executing the instructions in it.

Event Output

When event reporting is turned on, a description of each event is written to STDOUT, one per line. Coordinates in events are written in the current coordinate system seen at the time of the last events on command.

Reported Event Types

mod_mask is a bitmask integer, describing which modifier keys are currently pressed. Here's the value table:

NONE  = 0x0000,
LSHIFT= 0x0001,
RSHIFT= 0x0002,
LCTRL = 0x0040,
RCTRL = 0x0080,
LALT  = 0x0100,
RALT  = 0x0200,
LMETA = 0x0400,
RMETA = 0x0800,
NUM   = 0x1000,
CAPS  = 0x2000,
MODE  = 0x4000

unicode is an integer: the unicode character the current keypress represents (might be 0 if no character can be associated)

keyname is the name of the pressed key, as reported by SDL_GetKeyName. A list may be seen here (the Common name column). Note that the names may contain spaces.

Author

Copyright (C) 2009 Máté Nagy <mnagy AT port70.net>

Animator is licensed under the GNU General Public License Version 2 (available in the file COPYING) or any later version.

Home page: http://repo.hu/projects/animator