View Full Version : Core Animation Tween?
Darkroom
May 20, 2009, 06:27 AM
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.
autorelease
May 20, 2009, 12:53 PM
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.
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.
Chirone
May 20, 2009, 10:41 PM
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...
Spike099
May 21, 2009, 02:54 PM
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.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.