项目作者: spawnfest

项目描述 :
Command-line spritesheet generator in Elixir
高级语言: Elixir
项目地址: git://github.com/spawnfest/SpritePacker.git
创建时间: 2019-09-19T22:49:01Z
项目社区:https://github.com/spawnfest/SpritePacker

开源协议:

下载


SpritePacker

SpritePacker is a command-line spritesheet (a.k.a. Texture Atlas) generator written in Elixir.

Supported spritesheet formats

  • JSON

Usage

Command Line

  1. $ escript .\sprite_packer -s .\test_sprites\

Options:

  1. Note: Atlas and json data will be generated in "<source>/sprite_packer/"
  2. Options:
  3. -s, [--src] # source directory of sprites to be packed into atlas
  4. --algorithm # algorithm to use for packing (default growing binpack algorithm)
  5. --size # atlas size(only if using simple binpack algorithm), default 1024x768
  6. -h #help

Installation

  1. Install ImageMagick
  2. run mix escript.build (for building commandline application) from the project root.

Test

  1. Build the Command-line application.
  2. run escript .\sprite_packer -s .\test_sprites\
  3. A folder will be generated inside test_sprites(source_directory) with spriteatlas.png and spriteatlas.json

Generated spritesheet from the test

Generated spritesheet

Todo

  1. Optimize the Growing binpack algorithm.
  2. Support more formats(cross-game engine support)
  3. Add a dashboard where users can drag the images, select desired format etc..(in phoenix live-view)