Changing cloths of a 2d Animation character.

Hi All,

In my game I am giving an option to choose the cloths which can be a applied to the character and same cloth will be used in game by the character.

The animation of the character is being done frame by frame. So how I can change cloth in this case , Obviously I don’t want to create animation of character with every outfit player may choose to have. I was thinking if it can be done :-

To change the shirt of the character : I will read the pixels which represent the shirt ( don’t know how to detect , which pixels represents shirt ) , then set the pixels of selected shirt on this existing shirt . But i don’t know how to get UV coords of the existing shirt and replace with new shirt pixel by pixel.

is it the Right Way to approach it ?

Your prolly gonna want to take your player sprite animations, Copy them, Draw the shirt onto the player sprite in each animation state, Then erase the original player sprite leaving just the clothing in all its animated states. Then have the clothing sprites rendered on a layer above your player sprite layer and switch animation states based on the player sprite animation states. Atleast thats how i would assume to do it.