Tweener does not update values

Issue #3 closed
Serkan Axu
created an issue

Comments (5)

  1. Jake Albano repo owner

    Please show the code that isn't working for you or I'm going to close this issue. I've never heard of anyone having such a fundamental problem, and I support a number of developers who use Glide every day.

  2. Serkan Axu reporter

    Thank you for the quick response,

    var tweener = new Tweener(); tweener.Tween(Parent, new { X = 500 }, 2);

    Parent Object is a simple class

    public class SimpleObject { public SimpleObject() { }

    private float _x; public float X { set { _x = value; Console.WriteLine(value); } get { return _x; } } }

    When I debug the source code allTweens container seems empty.

  3. Jake Albano repo owner

    The Tweener does not update automatically; you'll need to make a call to tweener.Update(time) in your main loop. Time can be anything; I use fractional seconds in a float, but I know of people who pass elapsed frames. As long as you keep it consistent throughout your application you won't have a problem.

    allTweens is modified at the beginning of the Update step. This is necessary to prevent errors when collections are modified during iteration. If you never update the tweener, it will never contain anything and your objects will not be updated.

  4. Log in to comment