Skip to content

Instantly share code, notes, and snippets.

@GloryFish
Created October 17, 2013 16:42
Show Gist options
  • Save GloryFish/7028213 to your computer and use it in GitHub Desktop.
Save GloryFish/7028213 to your computer and use it in GitHub Desktop.
module(...)
-- This file is for use with Love2d and was generated by Zwoptex (http://zwoptexapp.com/)
--
-- The function getSpriteSheetData() returns a table suitable for importing using sprite.newSpriteSheetFromData()
--
-- Usage example:
-- local zwoptexData = require "ThisFile.lua"
-- local data = zwoptexData.getSpriteSheetData()
-- local spriteSheet = sprite.newSpriteSheetFromData( "Untitled.png", data )
--
-- For more details, see http://developer.anscamobile.com/content/game-edition-sprite-sheets
function getFrames()
local frames = {
{% for sprite in spritesAndAliases %}
{
name = "{{ sprite.name }}",
rect = { x = {{ sprite.textureRectX }}, y = {{ sprite.textureRectY }}, width = {{ sprite.textureRectWidth }}, height = {{ sprite.textureRectHeight }} },
},
{% /for %}
}
return frames
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment