Hello Guest

Author Topic: programmically adjust anchor  (Read 3895 times)

micky

  • Newbie
  • *
  • Posts: 23
    • View Profile
programmically adjust anchor
« on: January 06, 2014, 07:34:42 pm »
Is there a way to adjust the anchor of a sprite, or is that just one value and I should be translating.. I want to sync some SetFrame() types of animations up to some world coordinates, but the X value of the sprite needs to be snapped to certain points along the way, if that makes any sense.

I figure I could call SetFrame() and then just adjust the anchor instead of translating the whole sprite..

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: programmically adjust anchor
« Reply #1 on: January 07, 2014, 11:03:00 am »
There is no actual anchor on the sprites at runtime. The sprite origin is modified when the geometry is generated to take into account the anchor. You will have to manage this yourself, either by moving the whole sprite or creating a hierarchy to and moving placeholders to manage this.