TexturePacker Custom Exporter

A place to post your custom classes and engine extensions to share with the community.

TexturePacker Custom Exporter

Postby Sandstedt » Fri Jan 13, 2017 9:30 am

I recently created a custom exporter for TexturePacker (requires the full license) for the Isogenic Game Engine.
(Guide how to make one here: https://www.codeandweb.com/texturepacker/documentation#custom-exporter-template-file)

Place these files in a folder named isogenic in your custom exporter folder (Set this in TexturePackers's Preferences > Exporter Directory).

Code: Select all
<exporter version="1.0">

    <description>Isogenic Game Engine exporter for TexturePacker</description>
            <description>IGE js custom exporter for TexturePacker</description>



Code: Select all
// Created with TexturePacker (http://www.codeandweb.com/texturepacker)
// Sprite sheet: {{texture.fullName}} ({{texture.size.width}} x {{texture.size.height}})
// {{smartUpdateKey}}

self.gameTextures.{{texture.trimmedName}} = new IgeSpriteSheet('assets/{{texture.fullName}}', [
   {% for sprite in allSprites %}[{{sprite.frameRect.x}}, {{sprite.frameRect.y}}, {{sprite.frameRect.width}}, {{sprite.frameRect.height}}, "{{sprite.trimmedName}}"]{% if not forloop.last %}, {% endif %}{% endfor %}

This is an example of the generated JavaScript file:
Code: Select all
self.gameTextures.sprite = new IgeSpriteSheet('assets/sprite.png', [
   [1, 1, 177, 427, "sprite-01"], [1, 430, 177, 427, "sprite-02"], [1, 859, 177, 427, "sprite-03"], [1, 1288, 177, 427, "sprite-04"]

Restart texture packer and then you can choose IGE from the Framework export settings.
User avatar
Posts: 14
Joined: Fri Oct 21, 2016 4:17 pm

Return to Custom Code

Who is online

Users browsing this forum: No registered users and 1 guest