Hello Guest

Author Topic: Using 2DTK with Spine - Need Help  (Read 4640 times)

Krin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Using 2DTK with Spine - Need Help
« on: June 04, 2013, 05:35:26 am »
Hey,

I absolutely love the plug-ins so far, but I need some help with something specific.

  • I have a humanoid character that I exported body parts from.
  • I need to leave quite a large padding around the body parts because I want to have different skins, and I don't want the Spine alignments to be off-center.
  • But when I leave the Atlas/Collection to be trimmed by 2DTK, it cuts out all the transparent bits, and as a result the UV mapping is a bit off.
  • If trimming is turned off, then everything works fine.

However, I do wish to have trimming on, because it saves a great deal of space. My question is - is there a way to reference the Texture's original (frame) width and height before it was trimmed? As well as the offset of the trimmed texture relative to the original? (In order to UV map it properly onto a mesh)

My second question is, is there any way to dynamically generate collections at runtime? Or if there is any similar solution? In that case that I wanted to use the same Spine skeleton for characters, but I want to be able to change their skins?

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Using 2DTK with Spine - Need Help
« Reply #1 on: June 04, 2013, 10:57:29 am »
1. I think the problem is that Spines runtime doesn't work with trimmed tk2d atlases. It could be modified to work though. Sadly I don't have the time to look into this at the moment, especially since I don't know how Spine works and it would take a while to work it out.

2. Yes, use tk2dSpriteCollectionData.CreateFromTexture to manually specify regions and CreateFromTexturePacker to import Texture Packer atlases.

Krin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Using 2DTK with Spine - Need Help
« Reply #2 on: June 06, 2013, 11:01:18 am »
Alright thanks :)