[Resolved] Sprite Making 101

I’ve made a sprite sheet from a series of gifs and saved as a png. For some reason the sprite sheet only shows as a white box. I know the issue is not code as every time I use a known working good sprite sheet I get the animation. Is there any special setting one should use when saving a sprite sheet as a png? [import]uid: 149485 topic_id: 26344 reply_id: 326344[/import]

Two things to consider - 1, does your sheet have any white space? and 2, is this on device only or sim as well? If device only then the sheet is too large.

If you put up code + sheet would be happy to take a look. (You can watermark the sheet to protect your artwork, of course.) [import]uid: 52491 topic_id: 26344 reply_id: 106892[/import]

so far I am only viewing in the simulator. I’m taking a look at the white space as an issue because yes there was some. I’ll work on that and if it does not help I will load. Thanks for the suggestion. [import]uid: 149485 topic_id: 26344 reply_id: 107012[/import]

Is it possible to send the images to you directly? The code is pretty generic.

--require "sprite"  
local sprite = require("sprite")  
local spriteSheet = sprite.newSpriteSheet("sp1.png", 160, 210)  
local danceSet = sprite.newSpriteSet(spriteSheet, 1, 10)  
sprite.add(danceSet, "dance", 1, 10, 600, 2)  
local dancer = sprite.newSprite(danceSet)  
x = display.contentWidth/2  
y = display.contentHeight/2  
right = true  
dancer.x = x  
dancer.y = y  
dancer:prepare("dance")  
dancer:play()  

Pretty sure that code is not at issue as it works with other sprite sheets. Just not the one i want to use. I’ll load the sprite sheet once I hear back from you.

I’ve tried the sprite line both ways.
[import]uid: 149485 topic_id: 26344 reply_id: 107020[/import]

I removed even more white space and got it to work. I’ll work on my sprites. thanks for the suggestion. [import]uid: 149485 topic_id: 26344 reply_id: 107053[/import]

Hey Ken,

Glad you got it working - I am afraid you posted over night here so I didn’t get to see the request for email until just now.

Marking as resolved but please bump if you have any other issues with this.

Peach :slight_smile: [import]uid: 52491 topic_id: 26344 reply_id: 107107[/import]

I can’t believe you were not up at 2 AM looking for my post.
:wink:

Thanks for the prompt replies. Outside of just googling do you know of any good resource for sprite sheet making rules for corona. I can’t seem to find anything that states white space is a big no no.

Thanks again for your prompt responses. [import]uid: 149485 topic_id: 26344 reply_id: 107434[/import]

Haha, I often am around the forum at 2am but this week am trying to be a responsible adult about my sleeping habits :wink:

I am not a sprite expert but it’s my understanding that frames should start in the top left and you should only have white space AFTER all your frames, if possible. (No big gaps between sprites etc.)

I have used texture packer to line up my images to make spritesheets and found that very useful - that could be worth a look?

Let me know how you go - if need be I will try to hunt down a sprite master and interrogate them for you :wink:

Peach [import]uid: 52491 topic_id: 26344 reply_id: 107518[/import]