views:

348

answers:

3

Is there a way to speed up animations using something like a blur?

I have a loop which must be travelled through to represent one "increment" in my UI. When the user jumps ahead by several increments at once, I'd like to speed up each of the animation loops.

How can I accomplish this?

+2  A: 

iPhone SDK doesn't have CoreImage filters, (the right way to do it in Mac OS X).

Your other options are to

  • fake it using Core Animation layers.
  • use OpenGL

It's not trivial, but in the case of CoreAnimation, you can try setting up a few copies of the layer with various alpha values and/or colored shadows. Translucent mask layers may work also. Depending on the content and speed of you may have to play around to get the effect you are looking for.

Kailoa Kadano
+1  A: 

If you wanted to stick solely with Quartz, you could also consider counting the number of increments to be moved, and carry out a single animation that encapsulates them all.

Then, set the duration of the single animation to be less than x individual animations would be if "stacked" end-for-end.

Although this would not give you a blur, you could quite simply adjust the duration of the whole to be less than the sum of the individual parts if carried out separately. At this small of a scale, such tricks tend to feel the same to the user.

Carson C.
+1  A: 

You can get "smear streaking" effect by creating a layer, setting its alpha to .25 (or whatever value you think looks good), then copying your image to that in 3-5 positions (choose a value that looks good to you) spaced apart to make it look like motion-blur.

For extra-fancy, have 3 CGLayers, at .25, .5, .75, plus the original image, and have the CGLayers 3, 2 and 1 step behind, to leave a "trail."

Olie