Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Is it possible to control the speed of animation

An animated object by default seems to start off slow then get up to speed then slow down. This makes a simple repeating animation not appear smooth.
Am I missing some setting?

For example I want to create a moving background where the image is 100 pixels too wide so set the image at right:0 and I code the animation like this:

var a2= Titanium.UI.createAnimation(); a2.right= -100; a2.duration: 1000; a2.repeat: 500;
It should look like it is streaming past since the image is seamless but since the animation speeds up and slows down it doesn't. It looks like it is jumping.

— asked April 26th 2010 by Stan Thompson
  • animation
  • speed
0 Comments

3 Answers

  • curve:Titanium.UI.ANIMATION_CURVE_LINEAR

    is the answer to specify an animation that proceeds at a constant rate.

    — answered May 13th 2013 by Maxime Charruel
    permalink
    0 Comments
  • I have also noticed this. I would like to control the speed of acceleration and "slowing down" with a parameter.

    — answered February 28th 2011 by Johan Lahti
    permalink
    1 Comment
    • I am still seeing this issue. Anyone have any luck with it?

      — commented May 9th 2011 by Brian Abney
  • It looks like the most obvious way would be to use the animation curve constants as in:

    view.animate({
        transform:tr_end,
        repeat:3,
        autoreverse:true,
        duration:500,
        curve:Titanium.UI.ANIMATION_CURVE_EASE_IN_OUT
    });
    

    as shown in curve example, but it seems that it simply doesn't work :/. Any ideas?

    — answered June 9th 2011 by Gintaras Sakalauskas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.