Hello Guest

Author Topic: How to add new Pant to the existing character.  (Read 5168 times)

eklavyaa

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
How to add new Pant to the existing character.
« 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 ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to add new Pant to the existing character.
« Reply #1 on: December 18, 2014, 09:33:44 am »
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.

eklavyaa

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: How to add new Pant to the existing character.
« Reply #2 on: December 20, 2014, 05:49:42 am »
Quote
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 ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to add new Pant to the existing character.
« Reply #3 on: December 20, 2014, 10:47:50 pm »
You can do it using GetPixel / SetPixel with Unity textures.

eklavyaa

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: How to add new Pant to the existing character.
« Reply #4 on: December 23, 2014, 07:46:49 am »
Quote
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 ?


« Last Edit: December 23, 2014, 09:25:59 am by eklavyaa »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to add new Pant to the existing character.
« Reply #5 on: December 23, 2014, 10:44:08 am »
Quote
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.