Reputation: 13
I have a few lines of words (labels) that have been added to a canvas. I am animating a shape so that it moves from outside of canvas to right under one of the labels.
When I run the following code:
-(void)showContent {
shapeonpage1.animationDuration = 10.0f;
shapeonpage1.origin = CGPointMake(0,0);
}
... the animated shape first appears to move slowly, then gradually speeds up, and slows down again when it reaches its destination.
Is there a way for my animated shape not to speed up and slow down, but move at a consistent speed?
Upvotes: 1
Views: 73
Reputation: 4492
The easiest way to do this is to set the animationOptions
for shapeonpage1
to LINEAR
.
Like so:
-(void)showContent {
shapeonpage1.animationDuration = 10.0f;
shapeonpage1.animationOptions = LINEAR;
shapeonpage1.origin = CGPointMake(0,0);
}
Unfortunately, there aren't many examples that show how to fully use animation options. However, you could have a look at the C4Control documentation for more info.
Upvotes: 1