I have an existing sprite sheet that doesn’t fall neatly into a grid. I do have a binary atlas file that contains all the info I need to slice it, including pivot points and flipbook animation indices. The textures are also very trimmed / whitespace-friendly / ultra packed. It would also take a lot of time to make individual pngs out of them, or even re-place them individually in a grid mold to use as a tilesource. And to be honest, I don’t want to do extra work or change to another sprite workflow just for Defold.
a) Is there a way for me to use such an existing spritesheet? The best way for me is to be able to make a “custom sprite” where I can change the uv, texture dimension, and offset manually at runtime.
b) An alternative is to at least find a way to set a pivot point for an image cell in the atlas but I don’t suppose that’s possible currently. Would it be possible to programmatically add a pivot variable to each atlas image cell, at the beginning of the runtime, and then detect which cell is being in use every frame and add that vector to the render child .go manually?
I’d very much prefer the former. I’d still have to export individual pngs from the original spritesheet for the latter. There’s already a model and a material component. It’d be nice if I can programmatically create a rect model and set their vertex uvs manually. Is it possible?
I don’t think shader is an option, unless I can write a geometry shader to change vertex position, as each cell would have different sizes… but even if I did I’d also need my entire atlas data on the gpu anyway and that may not be feasible. I just want a way to pass a custom vertex position and uv on the cpu manually.