Core Animation Tween?

Discussion in 'Mac Programming' started by Darkroom, May 20, 2009.

  1. Darkroom Guest


    Dec 15, 2006
    Montréal, Canada
    i'm very new to core animation. i'd like to know if you can do simple motion/shape tweening like in Flash, or is it all only a frame by frame array of static images?

    for example: can i produce an animation by only having an array of 2 images: a circle and a square. using start coordinates for the circle, end coordinates for the square and a timer, create a animation of the circle moving across the screen while morphing (or blending) into the square?

    if so, that would be amazing.
  2. autorelease macrumors regular

    Oct 13, 2008
    Achewood, CA
    Core Animation only lets you work with rectangular layers. You can't "morph" from one NSBezierPath shape to another, but I'm pretty sure you can fade a layer's content from one image to another. (i.e. draw a circle into a layer and fade it into a square).

    Core Animation isn't Flash. It serves an entirely different purpose.
  3. Chirone macrumors 6502

    Mar 2, 2009
    as far as i can tell core animation can only tween transformations and filters (although the filter animation never worked for me even though it was copy pasted code from the documentation :confused:)

    if you want to do some morphing of shapes i think you have to just do it on the core graphics level...
  4. Spike099 macrumors regular

    Feb 18, 2007
    Sample App

    Hey, i've attached a sample app for you that demonstrates a image that fades from one to the other while it is moving. Press the button a couple times and it changes the image back and forth... Hope it helps.

    Attached Files:

Share This Page