Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | l-e-webb |
I have a series of sprite sheets, all of the same size and structure, each of which gives walking frames for a different character. The SpriteFrames
editor allows me to slice the sprite sheets and make the animations, which is nice, but as far as I can tell I have to manually select each frame for each sprite sheet. I’d like to be able to swap out the sprite sheet texture alone to get different characters, rather than having to recreate the animations frame-by-frame for each of the identically-structured sprite sheets.
Is there a built-in pattern I can use to do that? Or an add-on?
If not, I thought about writing a script to create the animations. Ideally I want to use an existing SpriteFrames
resource as a template so I can modify all the animations without having to rewrite my script. As far as I can see, I’d have to iterate through all the frames of all the animations on my template SpriteFrames
, cast the Texture
for that frame as an AtlasTexture
to access its region, and construct a similar SpriteFrames
object with animations made from the corresponding regions on different Texture
. I haven’t checked the cast-to-AtlasTexture
thing though, so I’m not sure it works. Does anyone know of a simpler or more reliable approach?.