2D Toolkit Forum

2D Toolkit => Support => Topic started by: shaunus84 on August 27, 2014, 11:51:56 am

Title: Access anchor points
Post by: shaunus84 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
Title: Re: Access anchor points
Post by: unikronsoftware 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.
Title: Re: Access anchor points
Post by: shaunus84 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.
Title: Re: Access anchor points
Post by: unikronsoftware 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)