Coder Social home page Coder Social logo

k4st0r / free-tex-packer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from odrick/free-tex-packer

0.0 0.0 0.0 230.78 MB

Free texture packer

Home Page: http://free-tex-packer.com/

License: MIT License

JavaScript 87.17% PHP 4.39% HTML 0.33% CSS 8.10%

free-tex-packer's Introduction

Free texture packer

logo

IMPORTANT: I don't have time to imporove this app anymore. Only critical bugs will be fixed.

Free texture packer creates sprite sheets for you game or site. Rotation, trimming, multipacking, various export formats (json, xml, css, pixi.js, godot, phaser, cocos2d). Zip support. TinyPNG support. Split sheet tool.

screenshot

Homepage: https://free-tex-packer.com

Web version: https://free-tex-packer.com/app

Desktop versions for win, mac, linux: https://github.com/odrick/free-tex-packer/releases

Gulp module: https://github.com/odrick/gulp-free-tex-packer

Grunt plugin: https://github.com/odrick/grunt-free-tex-packer

Webpack plugin: https://github.com/odrick/webpack-free-tex-packer

CLI: https://github.com/odrick/free-tex-packer-cli

Custom templates

Free texture packer uses mustache template engine.

There are 3 objects passed to template:

rects (Array) list of sprites for export

prop type description
name String sprite name
frame Object frame info (x, y, w, h, hw, hh)
rotated Boolean sprite rotation flag
trimmed Boolean sprite trimmed flag
spriteSourceSize Object sprite source size (x, y, w, h)
sourceSize Object original size (w, h)
first Boolean first element in array flag
last Boolean last element in array flag

config (Object) current export config

prop type description
imageWidth Number texture width
imageHeight Number texture height
scale Number texture scale
format String texture format
imageName String texture name
imageFile String texture file (name with extension)
base64Export Boolean base64 export flag
base64Prefix String prefix for base64 string
imageData String base64 image data

appInfo (Object) application info

prop type description
displayName String App name
version String App version
url String App url

Example:

{
  "frames": {
    {{#rects}}
    "{{{name}}}": {
      "frame": {
        "x": {{frame.x}},
        "y": {{frame.y}},
        "w": {{frame.w}},
        "h": {{frame.h}}
      },
      "rotated": {{rotated}},
      "trimmed": {{trimmed}},
      "spriteSourceSize": {
        "x": {{spriteSourceSize.x}},
        "y": {{spriteSourceSize.y}},
        "w": {{spriteSourceSize.w}},
        "h": {{spriteSourceSize.h}}
      },
      "sourceSize": {
        "w": {{sourceSize.w}},
        "h": {{sourceSize.h}}
      },
      "pivot": {
        "x": 0.5,
        "y": 0.5
      }
    }{{^last}},{{/last}}
    {{/rects}}
  },
  "meta": {
    "app": "{{{appInfo.url}}}",
    "version": "{{appInfo.version}}",
    "image": "{{config.imageFile}}",
    "format": "{{config.format}}",
    "size": {
      "w": {{config.imageWidth}},
      "h": {{config.imageHeight}}
    },
    "scale": {{config.scale}}
  }
}

free-tex-packer's People

Contributors

odrick avatar playtomax-team avatar rtalon83 avatar dadekuma avatar piratesephiroth avatar philskat avatar wen- avatar k4st0r avatar blidnight avatar and3md avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.