Hello Guest

Author Topic: Access anchor points  (Read 3454 times)

shaunus84

  • Newbie
  • *
  • Posts: 2
    • View Profile
Access anchor points
« on: August 27, 2014, 11:51:56 am »
Hey all,

I need to access the anchor points of a sprite from a collection, this will allow me to offset my spine attachments dynamically. Seems strange that I can't just access the values I input to the sprite collection.

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Access anchor points
« Reply #1 on: August 27, 2014, 12:08:31 pm »
The sprite anchor is at the local position of 0, 0, 0 on the sprite... tk2d compensates for this in the mesh it generates.

shaunus84

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Access anchor points
« Reply #2 on: August 27, 2014, 12:23:39 pm »
I want to use the custom anchor positions as the region offset of a region attachment in spine. It would be very helpful to be able to access the values that are input into the custom anchor point dialogue.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Access anchor points
« Reply #3 on: August 27, 2014, 01:40:14 pm »
That value isn't available as it is folded into the mesh result. The easiest way to get custom data into the sprite is to use the sprite attach points. Those values come through correctly, but will be transformed into world space (i.e. if 100 pixels per meter, then 30,60 will be 0.3, 0.6)