Author Topic: How to animate position with anchors  (Read 3475 times)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
How to animate position with anchors
« on: January 02, 2014, 03:36:19 PM »
I have a widget container with a few sprites on the left of the screen, placed using relative positioning so it fixes to the left side of the screen regardless of screen aspect. I now want to animate it into/out of view on the press of a button. This works with a position Tween on the container for 16:9, but crops the animation off left side when using 4:3, although the container does snap into place when the animation is complete.

How does one get the animator to use the relative values for positioning?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to animate position with anchors
« Reply #1 on: January 03, 2014, 04:07:47 AM »
Create an invisible widget and anchor the widget, not your sprite. Make your sprite a child of the widget, and animate its local position using TweenPosition.