2D Toolkit Forum
2D Toolkit => Support => Topic started by: eklavyaa on December 18, 2014, 05:08:22 am
-
I have a character with 10 frames. I have created a sprite collection for these 10 frames and using 2dtoolkits own animation I am animating it.
I understand that atlas is created for these 10 frames .
Now I want to change the appearance of the character say I want to apply new pant. How I can do it with minimal efforts, I mean do artist really need to develop another character with new pant and its 10 frames ?
-
You can draw clothes on a separate sprite and draw it on top of your character sprite if you want. tk2d doesn't have any special features for this apart from the sprite attach points.
-
You can draw clothes on a separate sprite and draw it on top of your character sprite if you want
How to do it ?
What I was thinking is to change texture of the legs from current to the texture of pants , for all the 10 frames and then create atlas for these 10 frames to create animation and this will be done only when pant is finalized as the selection .
Can this be done programmatically ?
-
You can do it using GetPixel / SetPixel with Unity textures.
-
You can do it using GetPixel / SetPixel with Unity textures.
So using these function if I want to change the shirt of the character: I will read the pixels which represent the shirt , then set the pixels of selected shirt on this existing shirt .
But how to detect , which pixels represents shirt ?
and
how to get UV coords of these pixels ?
-
But how to detect , which pixels represents shirt ?
and
how to get UV coords of these pixels ?
That is outside the scope of tk2d, you'd probably need to store that in a format you can read, and write out the atlas suitable for tk2d.