devkitPro / tex3ds

3DS Texture Conversion
GNU General Public License v3.0
37 stars 10 forks source link

(Feature request) Spritesheet img support #16

Open Nanquitas opened 6 years ago

Nanquitas commented 6 years ago

Hi :)

It's currently possible to generate a (C2D_) SpriteSheet from multiple sprites images but I didn't see anything to load an image with multiple sprites in it, like this one: image.

I know it could be done "manually" by creating a Tex3DS_Texture and filling the Tex3DS_SubTexture part but I thought that it was better if it could be used with the existing C2D_SpriteSheet stuff.

A config file of the sprite would be needed ofc, but it would be consistent with all the gfx stuff (.t3x only, not a mix).

piepie62 commented 5 years ago

Random question: why not use a publicly available image processor (like ImageMagick) to split that sheet into separate sprites, then feed those through tex3ds?

Nanquitas commented 5 years ago

Yeah sure, it's possible. But it would be nice to have tex3ds being able to directly process that kind of sheet. It would keep a project file tree clean, with one file per sheet instead of X files.

Note that I just suggested this for the sake of feature completeness but as you said, there are workarounds.

piepie62 commented 5 years ago

The main problem I see with that from a usability standpoint would be setting the dimensions for the individual sprites; if you were to try to combine a couple of those spritesheets I can't imagine what the arguments would be

Nanquitas commented 5 years ago

The main idea was just to feed the image sprite sheet with a list of internal sprites positions / dimensions and get a .t3x texture file compatible with citro3d/2d directly. Not to merge different sprite sheets.

This can be done manually as I said in my first message but I think that having the Tex3DS_SubTextures embedded in the file is cleaner (and avoid extra code per sprite sheets if multiple usage).

This would not require a lot of work I think as it would merely just convert the passed image + fill the Tex3DS_SubTexture in the file header.

Merging sprite sheets should not be that complexe either, we could imagine a list like Etc

But I don't think that sheet merging is a necessity ?

Anyway, the scene is now focused on the Switch so I'm pretty sure that extra features for this is far from a priority. ;)