Easier way to define x, y, width, height for a lot of sprites

I have 110 sprites, and the sprites are in “groups”. For instance, 9 consecutive sprites are 60 by 75, 10 consecutive sprites are 64, 80, etc…

Is there a better way of creating all of these tables by using a for loop or something similar? Creating 110 tables is unproductive, and making different sprite sheets for all of the character frames is also unproductive. 

Any help would be greatly appreciated.

Apparently, this does not work: :frowning:

local options = { { width = 43, height = 67, numFrames = 10 }, { width = 65, height = 83, numFrames = 10 } }

That would have been an easy way out…

just define multiple sequences

I am going to use multiple sequences but the problem comes with creating the imageSheet. The frames are not all the same size and width, and there are 110 of them.

Their sizes are clumped into groups, 9 consecutive have one same size, 10 consecutive have one same size, etc.

I’m confused.  Are you hand rolling the image sheets and the lua file or using a tool like texturepacker?

If you’re doing this manually…well this is why folks use tools.  Doing this by hand is labor intensive and super error prone.  Also, having to adjust the sheet/lua file later is super painful.  

All this pain goes away w/ a tool.

If you don’t have or cannot afford texture packer, shoebox is a viable option but it will require more effort.

I am using TexturePacker. I could never imagine doing it by hand.

The problem I am having is that the frames are not all the same size. The massive 110 sprite sheet contains walking, dying, shooting, jumping, throwing, etc. animations. The problem is that the size of the walk frames is different from the size of the dying frames, or the shooting frames…

Here is the image so you can see what I am saying:

Notice some of the different frame sizes.

I still don’t get it.

You take discrete images, drop them on texture packer, export a sprite sheet and definition file.  Done.

How is this not working?

Maybe you can zip up a small demo projects with the original art and your spritesheet/lua file and share it with me?

PM if you can.  I’ll try to look later.

Currently still have not internet.  I literally am walking over to a neighbor’s  every once in a while w/ my old laptop to check emails.

So next response may not be till tomorrow unless you respond quickly.

Remember, if you do PM me include original assets in zip file.

Alright. Thank you for your help. You should be receiving a PM soon.

Tip:  You still have to write a custom sequence definition pulling the appropriate frames from your image sheet.

-Ed

**UPDATED TO CORRECT ERROR ON MY PART**  

Tip 2: All of the images for a particular animation sequence MUST be the same dimension.

i.e. If you have 5 images for a ‘run’ sequence, all 5 of the original discrete image MUST be of the same dimension.

If your assets come otherwise they won’t work without a lot of effort.

I have never run across a paid set of assets that don’t conform to these requirements.

Texture packer will take these ‘same sized source images’ and pack them in a sheet with just enough room to later pull them out, while fitting together very tightly.

Are those PZUH assets?  If so, did they come in a single  big sheet or as discrete images?

You can answer all my questions later.  PM me first  I gotta roll soon.

-Ed

I am aware.

PM sent.

Also, the images are discrete, and they are from gameart2d.com

Not sure what PZUH is…

The frames are different sizes because of the different positions of the characters. A person standing is not as wide as a person lying on the floor.

I’ll give these a look, but just some I’m clear…

The GOAL is to be able to:

  1. Use these images to make a sprite

  2. Be able to play any animation sequence.

  3. Be able to swap between sequences without needing to destroy and remake the sprite

Right?