# PIXELIX <!-- omit in toc -->
![PIXELIX](./images/LogoBlack.png)

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/)

# Sprite Sheet <!-- omit in toc -->

- [Purpose](#purpose)
- [Tools And Scripts](#tools-and-scripts)
- [Limitations](#limitations)
- [Issues, Ideas And Bugs](#issues-ideas-and-bugs)
- [License](#license)
- [Contribution](#contribution)

# Purpose
Use a sprite sheet for 2d animations.
The sprite sheet parameters are defined in a additional file to the bitmap file in JSON format. The file shall have the file extension ".sprite".

Example of a fire animation (see ./doc/spritesheet/example):
```json
{
    "texture": {
        "width": 40,
        "height": 8,
        "frames": 5,
        "frame": {
            "width": 8,
            "height": 8
        },
        "fps": 5,
        "repeat": true
    }
}
```

![WifiStatusPlugin](./spritesheet/example/fire.jpg)

The *texture* describes the bitmap texture which contains one or usually several sprites. The bounding box of a sprite is called *frame*.

Because a *texture* may not be filled with sprites, the number of frames (*frames*) is given. If the number of frames is not given, it will be assumed that the texture is completely filled.

The order of each frame is from top left to the right and in the next row again from left to right and so on. If not further specified, it will be automatically repeated. If only on animation cycle is required, it will be specified with *repeat* by setting it to "false".

The frames per second (fps) specifiy how fast the animation runs.

# Tools And Scripts

Use the ```./doc/spritesheet/create_sprite_sheet.py``` to create it or manually.

# Limitations

* Only .bmp format is currently supported, uncompressed and without color palette.

# Issues, Ideas And Bugs
If you have further ideas or you found some bugs, great! Create a [issue](https://github.com/BlueAndi/esp-rgb-led-matrix/issues) or if you are able and willing to fix it by yourself, clone the repository and create a pull request.

# License
The whole source code is published under the [MIT license](http://choosealicense.com/licenses/mit/).
Consider the different licenses of the used third party libraries too!

# Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any
additional terms or conditions.
