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.
3 Answers
-
curve:Titanium.UI.ANIMATION_CURVE_LINEAR
is the answer to specify an animation that proceeds at a constant rate.
-
I have also noticed this. I would like to control the speed of acceleration and "slowing down" with a parameter.
-
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?