JsBattle Docs

Spritesheets

To simplify build process and reduce amount of project dependencies, all spritsheets are kept as static images in /resources/spritesheets. They can be always regenerated if needed from source images that are kept in /resources/images.

Texture Packer

To pack textures and generate any tool that support PixiJS format can be used.
Some examples are:

Texture Packer Configuration

Texture packer must be configured properly to be compatible with JsBattle:

Spritesheet file examples

Here is an example of JSON file that describes the spritesheet

{
    "frames": {
        "battlefield": {
            "frame": {
                "h": 600,
                "w": 900,
                "x": 0,
                "y": 0
            },
            "rotated": false,
            "spriteSourceSize": {
                "h": 600,
                "w": 900,
                "x": 0,
                "y": 0
            },
            "sourceSize": {
                "h": 600,
                "w": 900
            },
            "trimmed": false
        },
    ...
  },
  "meta": {
        "image": "jsbattle.png"
    }
}