How to layer sprites ("dress up a character") in 2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jonkbonker

Hi,
I have a spritesheet of a “naked” character and spritesheets with armor and weapons that matches in animation frames. The goal is to draw these on top of eachother in-game so that the sprites with armor and weapons are on top of the character so that it looks like you have them equipped.
I know two ways to do this in principle:
1: Animate each sprite stacked on top of each other in real-time, switch out individual spritesheets for each piece of equipment as they are equipped/unequipped in-game.
2: Render the stack of currently active spritesheets to a surface that is not visible for the player and “screenshot” them, the screenshot becomes a single spritesheet of the fully equipped character that is used for the animation during gameplay. Render/screenshot again if equipment change.

Both methods have pros/cons (performance, how shader/effects can be applied, etc) and I would very much like to be able to do both. What would be the best way to go about it in godot? Are there any example projects/addons/scripts out there that does this?

:bust_in_silhouette: Reply From: timothybrentwood

This youtube video is an example of how to do what you’re looking for: https://www.youtube.com/watch?v=AkKywZDJNeE

I don’t believe performance should be an issue either way you try to tackle it but it is a LOT of work to get setup. I would suggest creating one sprite sheet for your character, creating the rest of your game and coming back to that feature as part of your finishing touches for the game.

Thank you very much for the link,
In one of his other videos he simply stack sprites with the animation player, which seem to be best solution for my project:
https://www.youtube.com/watch?v=GPYBNdYuSD8

Thanks!

jonkbonker | 2021-04-28 12:27