Making 1 frame/single image count as animation

I have a spritesheet in which some cases, mostly “Standing” are only single images.  However I want to uniformly treat these “singlets” the same way that I treat any animations -

    new PIXI.AnimatedSprite( sheet.animations[poseName] );

But it looks like TexturePacker doesn’t automatically turn singlets into animations at the bottom of the JSON file.  Can this be added in the future?   I think this would be handy so you dont get stuck with some sort of edge case code breaking bug.  Or is the problem that renderering engines don’t play well with single frame animations?

Thanks!

Sounds to me like you are working with PixiJS and not Corona. Also, Corona is not affiliated with TexturePacker. You should probably head to https://www.codeandweb.com/texturepacker with your suggestions and questions.

The way I do it is using TexturePacker.

If I want to use an animation sequence, I need to define these myself using a code editor. Still images / single image are just set using the “setFrame” command.

Thanks for the reply thomas - what I did was I just made a copy of the single image, so now with 2 subquentially numbered stills, it can count as an animation! 

Thanks Mod, I dont know why my searches landed me here. Weird.

Hi Dan,

If that works for you, perfect! I think you can do it without duplicating images as well by creating an animation using explicitly specified frames and just specifying the same image twice in the animation frames table. That would make it an animation as well, but using the same single image twice, instead of two copies of that single image. Am I making sense? :slight_smile:

It does for sure, I’m just trying to automate as much as possible, and it’s easier in python I think to dupe a file than to go an mess with the post texture-packed JSON

Sounds to me like you are working with PixiJS and not Corona. Also, Corona is not affiliated with TexturePacker. You should probably head to https://www.codeandweb.com/texturepacker with your suggestions and questions.

The way I do it is using TexturePacker.

If I want to use an animation sequence, I need to define these myself using a code editor. Still images / single image are just set using the “setFrame” command.

Thanks for the reply thomas - what I did was I just made a copy of the single image, so now with 2 subquentially numbered stills, it can count as an animation! 

Thanks Mod, I dont know why my searches landed me here. Weird.

Hi Dan,

If that works for you, perfect! I think you can do it without duplicating images as well by creating an animation using explicitly specified frames and just specifying the same image twice in the animation frames table. That would make it an animation as well, but using the same single image twice, instead of two copies of that single image. Am I making sense? :slight_smile:

It does for sure, I’m just trying to automate as much as possible, and it’s easier in python I think to dupe a file than to go an mess with the post texture-packed JSON