Problem with Sprites using ImageSheets and Zwoptex

I’ve run into a problem with ImageSheets in my latest project. I can use ImageSheets to build my sprites if I stick to the ‘simple’ options format specified here: http://www.coronalabs.com/blog/2012/03/06/image-sheets-image-groups-and-sprites/ . However, I would like to use Zwoptex to make my sprite sheets so that I can have variable sized frames to save space. If I try to load in a zwoptex descriptor file it will run without errors, and the sprites are physical in the game world ( meaning I can collide with them in Box 2D), but they aren’t visible.

Has anyone seen a problem like this before? I’ve pasted some code below but if you feel like you need any more info to help me with this just let me know.

This an example of my code which should load in the spriteSheet and build a sprite to place in the middle of the screen.

 local enemy\_sheetInfo = require("zombieSheet")  
 local enemy\_imageFile = "art/sprites/zombieSheet.png"  
  
 local enemy\_imageSheet = graphics.newImageSheet(enemy\_imageFile, enemy\_sheetInfo.getSpriteSheetData() )  
 local enemy\_sequenceData =   
 {  
 { name="walk-down", start=1, count=1},  
 { name="walk-left", start=2, count=1},  
 { name="walk-up", start=3, count=1},  
 { name="walk-right", start=2, count=1}  
 }  
 local enemy\_test = display.newSprite(enemy\_imageSheet, enemy\_sequenceData)  
 enemy\_test.x = screenWidth/2  
 enemy\_test.y = screenHeight/2  
 localGroup:insert(enemy\_test)  

Here is an example of the spriteSheet description file Zwoptex exports - zombieSheet.lua

module(...)  
  
-- This file is for use with CoronaSDK™ and was generated by Zwoptex (http://zwoptexapp.com/)  
--  
-- For more details, see http://developer.anscamobile.com/reference/sprite-sheets  
  
function getSpriteSheetData()  
  
 local sheet = {  
 frames = {  
  
 {  
 name = "zombie\_down.png",  
 spriteColorRect = { x = 0, y = 0, width = 53, height = 65 },   
 textureRect = { x = 0, y = 0, width = 53, height = 65 },   
 spriteSourceSize = { width = 53, height = 65 },   
 spriteTrimmed = true,  
 textureRotated = false  
 },  
  
 {  
 name = "zombie\_left.png",  
 spriteColorRect = { x = 0, y = 0, width = 48, height = 64 },   
 textureRect = { x = 0, y = 65, width = 48, height = 64 },   
 spriteSourceSize = { width = 48, height = 64 },   
 spriteTrimmed = true,  
 textureRotated = false  
 },  
  
 {  
 name = "zombie\_up.png",  
 spriteColorRect = { x = 0, y = 0, width = 50, height = 65 },   
 textureRect = { x = 53, y = 0, width = 50, height = 65 },   
 spriteSourceSize = { width = 50, height = 65 },   
 spriteTrimmed = true,  
 textureRotated = false  
 },  
  
 }  
 }  
  
 return sheet  
end  

And if I use the following instead of trying to load the Zwoptex file it will display the sprite ( but I have to make all my sprites have the same dimensions and won’t be able to easily retina-ize my assets ).

enemy\_sheetInfo =   
 {  
 width=64,  
 height=64,  
 numFrames=4  
 }  
local enemy\_imageSheet = graphics.newImageSheet(enemy\_imageFile, enemy\_sheetInfo)  

Any help would be appreciated.

Thanks! [import]uid: 11540 topic_id: 30492 reply_id: 330492[/import]