Hello Guest

Author Topic: XML question  (Read 4296 times)

kai_dante

  • Newbie
  • *
  • Posts: 2
    • View Profile
XML question
« on: June 24, 2013, 03:57:02 pm »
Hi,
I'm fairly new to both Unity and 2D tk and have been given a sprite sheet and XML file of an animation cycle. Is there anyway I can use these together with 2D tk? I've made animations through sprite sheets before but the frames on the sprite sheets were all spaced the same so I could use the 2D tk collection editor to slice them up equally but in the sprite sheet I have been given is already optimized so I can't slice it up equally all I have is the XML file.

Sorry if this question has been asked before I had a quick search and couldn't find anything in relation to this.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: XML question
« Reply #1 on: June 24, 2013, 06:24:53 pm »
Since you already have an atlas, I'm guessing you don't want tk2d to re-atlas it?
If so - check out the runtime sprite collection sample, which creates a sprite collection at runtime from rectangles within a texture.
After you've got a collection, you can create a tk2dSpriteAnimationClip and play that directly.


If you want to do this in code, but then set up animations, etc. in the interface, its still doable. Let me know if thats what you want.

kai_dante

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: XML question
« Reply #2 on: June 25, 2013, 04:28:06 pm »
Yea this should work, thanks for the reply!