Free texture packer also released as gulp module

Installation:

$ npm install gulp-free-tex-packer

Basic usage (gulpfile.js):

const gulp = require('gulp');
const texturePacker = require('gulp-free-tex-packer');

gulp.task('pack', function() {
    return gulp.src('src/**/*.*')
        .pipe(texturePacker())
        .pipe(gulp.dest('dest/'));
});

Advanced usage (gulpfile.js):

const gulp = require('gulp');
const texturePacker = require('gulp-free-tex-packer');
 
gulp.task('pack', function() {
    return gulp.src('src/**/*.*')
        .pipe(texturePacker({
            textureName: "my-texture",
            width: 1024,
            height: 1024,
            fixedSize: false,
            padding: 2,
            allowRotation: true,
            detectIdentical: true,
            allowTrim: true,
            exporter: "Pixi",
            removeFileExtension: true,
            prependFolderName: true
        }))
    .pipe(gulp.dest('dest/'));
});

Full options description

Custom exporters

Sources


Demo

  • Install node.js
  • Dowload demo
  • Unpack
  • Execute in console:
  • npm install -g gulp
  • npm install
  • gulp
  • Look at dest folder!