Programs: 2sprite Conversion Utility


The 2sprite conversion utility "2sprite.exe" converts an 8- or 24-bit picture into an animimated AGAST sprite resource. In order to be converted, the picture must be broken down into rectangular regions as in the picture below, with black border space. The first rectangle decides the transparent background color of the rest of the rectangles, plus a single pixel within it of any other color (other than pure black) chooses the sprites handle (a.k.a center, origin) point.

The picture must be in one of the following file formats:

  • 8-bit per pixel (256-color) PCX file
  • 24-bit per pixel (16.7-million-color) PCX file
  • A single RGBA layer from a Photoshop PSD file
  • 24-bit per pixel TGA file
  • 32-bit per pixel TGA file

Note: Some programs produce variations of PCX files which cannot be understood by 2sprite, and some programs give the user little control over palette indexing, making it difficult to create and save images with pure black pixels.

There is no need to run the program directly, although it is possible. The compiler will automatically run 2sprite when it finds that a sprite resource has been modified. All you really have to do is store your image in the game directory or a scene directory, and remember to follow the pattern "Name.sprite.pcx". Then, inside the script file, you may refer to this resource with the identifier Name_sprite.

2sprite is also used to convert fonts, which are just sprites arranged in a special order. So, if you call a file "Name.font.pcx" it will also be converted, but end up eith the identifier Name_font.

See Also...