Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

This is a specialized command-line tool to create and edit Half-Life sprites. It was the only tool that could make certain types of sprites back when I made it, but now WadMaker and HL-Texture-Tools can do most of the things this tool can.

The only features still unique to this tool:

  • Edit sprites without recompiling.
  • indexalpha image conversion.

Usage

Compiling a sprite

spriteguy compile file.png[x,y] file2.bmp[x,y] file.spr [key=value key=value ...]

A normal parallel sprite is created by default. Use keyvalues to change the sprite type. BMP and PNG files are supported (8-bit, 24-bit, or 32-bit). The [x,y] arguments are offsets applied to each frame in-game.

To make an alphatest sprite, add the alpha keyvalue. The color of the first pixel in the first image is made transparent globally and replaced with your alpha color.

Editing a sprite

spriteguy edit file.spr [key=value key=value ...]

Keyvalues

Here's what you can use for the [key=value key=value ...] parameters when compiling or editing a sprite.

Key Value / Description
format normal, additive, indexalpha, or alphatest. Shorthand values are n, ad, i, and al.
mode oriented, parallel, or upright. Shorthand values are o, p, u.
alpha 3 or 6 digit RGB hex string (00f or 0000ff for blue) to use in alphatest or indexalpha mode.
In alphatest mode, this sets the transparent color.
In indexalpha mode, this sets the overall color.
x X offset to apply to all frames. This shifts the position of the sprite in-game.
y Y offset to apply to all frames.
ialpha Converts the sprite to indexalpha format. Valid values are normal or inverted. This makes the sprite greyscale, and colored in-game with the alpha color you set.

Examples

spriteguy compile file1.bmp output.spr
Makes a simple parallel opaque sprite.

spriteguy compile file1.bmp file2.png[-100,100] output.spr alpha=000 mode=upright
Makes an animated upright alphatest sprite using black as the transparency color. An offset is applied to the 2nd frame.

spriteguy edit file.spr ialpha=normal alpha=0f0
Convert to a green indexalpha sprite.

Building the source

Windows users:

  1. Install CMake, Visual Studio Community, and Git.
    • Visual Studio: Make sure to checkmark "Desktop development with C++" if you're installing for the first time.
  2. Open a command prompt somewhere and run these commands to download and build the source code:
     git clone https://github.com/wootguy/spriteguy
     cd spriteguy
     mkdir build && cd build
     cmake ..
     cmake --build . --config Release
    

To build an x86 version for Windows XP, replace the cmake .. command with cmake -A win32 -T v141_xp ... You will need the v141_xp toolset downloaded. It's available in the Visual Studio Installer for VS 2017.

Linux users:

  1. Install Git, CMake, and a compiler.
    • Debian: sudo apt install build-essential git cmake
  2. Open a terminal somewhere and run these commands:
    git clone https://github.com/wootguy/spriteguy
    cd spriteguy
    mkdir build && cd build
    cmake .. -DCMAKE_BUILD_TYPE=Release
    make
    

About

Create and edit Half-Life sprites

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages