Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top