Skip to content

Commit

Permalink
Description
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoqsh committed Aug 1, 2023
1 parent 4dce4f0 commit 5a0d4a5
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> The staff to conquer the dunge
The CLI-tool for working with graphical objects such as meshes, animations (actions), character skeletons, sprites, etc. I use it to convert models from Blender into a usable way to work with it in my graphics library [dunge](https://github.com/nanoqsh/dunge).
The CLI-tool for working with graphical objects such as meshes, animations (actions), character skeletons, sprites, etc. I use it to convert models from Blender into a usable way to work with it in my graphics library [dunge](https://github.com/nanoqsh/dunge), as well to work with sprites.

At the moment, this tool is exclusively for personal use, it is unlikely that you will need it.

Expand Down Expand Up @@ -39,3 +39,33 @@ It collect all unique colors and save them to a file. Then, you can recolor the
```
staff repaint sprite.png palette.json
```

## Create a sprite atlas
To create the atlas, you need to specify all the sprites that need to be glued together. For example, let's take all images from the `sprites` directory:
```
staff atlas sprites/*.png
```

This will create two files: `atlas.png` for the final image and `atlas.json` for the sprite map. The sprite map describes all entries by four values: x position, y position, width and height. The sprites names are taken from their file names. To set your own names, you can describe a `.json` file for name conversion, it looks like this:
```json
{
"colon": ":",
"dot": ".",
"dquote": "\"",
"squote": "'",
"slash": "/",
"star": "*"
}
```

To use the transformation, specify this file:
```
staff atlas sprites/*.png --names names.json
```

Specifying the file is optional, otherwise it will default to `names.json` file.

A detailed description of all parameters can be obtained from the help:
```
staff atlas --help
```

0 comments on commit 5a0d4a5

Please sign in to comment.