Core Animation Tween?

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

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    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

    Joined:
    Oct 13, 2008
    Location:
    Achewood, CA
    #2
    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

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #3
    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

    Joined:
    Feb 18, 2007
    Location:
    Canada
    #4
    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