ios - Swing animation with depth -
in app, have pop banner jumps every time user gets notification server, pop looks sign attached strings top of screen (not code strings lol).
i'm trying achieve swing animation, not side side! , forth, acutely bottom yz point should change, looks popup sign coming towards user, , back, , on....
i hope clear question, matter bugging me long time now.. thanks! !
edit
so i've added image (really badly draws, sorry that), descrices effect im trying achieve :
http://s1.postimg.org/hox4ly3sv/draw_sign.png
and again, sorry bad drawing.
this code did far:
// container calayer *container = [calayer layer]; container.frame = cgrectmake(50, 50, 100, 100); [self.view.layer addsublayer:container]; //create plane calayer *purpleplane = [self addplanetolayer:container size:cgsizemake(100, 100) position:cgpointmake(250, 150) color:[uicolor purplecolor]]; [container addsublayer:imageview.layer]; //apply transform plane catransform3d t = catransform3didentity; //add perspective!!! t.m34 = 1.0/ -100; //t.m34 = 1.0/ -500; t = catransform3drotate(t, degtorad(45.0), 0, 1, 0); purpleplane.transform = t; catransform3d transform = catransform3didentity; // transform.m34 = 1.0 / -50; container.transform = transform; cakeyframeanimation *animation = [cakeyframeanimation animationwithkeypath:@"transform"]; animation.values = [nsarray arraywithobjects: [nsvalue valuewithcatransform3d:catransform3drotate(transform, 0.8 * m_pi / 2, 100, 100, 0.2)], [nsvalue valuewithcatransform3d:catransform3drotate(transform, 0 * m_pi / 2, 100, 100, 0.2)], [nsvalue valuewithcatransform3d:catransform3drotate(transform, -0.6 * m_pi / 2, 100, 1, 0.2)], [nsvalue valuewithcatransform3d:catransform3drotate(transform, 0 * m_pi / 2, 100, 1, 0.2)], [nsvalue valuewithcatransform3d:catransform3drotate(transform, 0.3 * m_pi / 2, 100, 1, 0.2)], [nsvalue valuewithcatransform3d:catransform3drotate(transform, 0 * m_pi / 2, 100, 1, 0.2)], [nsvalue valuewithcatransform3d:catransform3drotate(transform, -0.1 * m_pi / 2, 100, 1, 0.2)], [nsvalue valuewithcatransform3d:catransform3drotate(transform, 0 * m_pi / 2, 100, 1, 0.2)], // [nsvalue valuewithcatransform3d:catransform3drotate(transform, 2 * m_pi / 2, 100, 1, 5)], // [nsvalue valuewithcatransform3d:catransform3drotate(transform, 3 * m_pi / 2, 100, 1, 100)], // [nsvalue valuewithcatransform3d:catransform3drotate(transform, 4 * m_pi / 2, 100, 1, 100)], nil]; animation.duration = 5; [container addanimation:animation forkey:animation.keypath];
as notice, in code, there no effect of view swinging towards you, , that's i'm looking for.
thanks, cheers
sound looking zoom in / out animation, like:
uiview *thestrigviewthing = ... [uiview animatewithduration: 0.2 delay: 0.0 options: uiviewanimationoptioncurveeasein animations:^{ [thestrigviewthing settransform: cgaffinetransformmakescale(2.0f, 2.0f)]; } completion:^(bool finished) { [uiview animatewithduration: 0.2 delay: 0.0 options: uiviewanimationoptioncurveeaseout animations:^{ [thestrigviewthing settransform: cgaffinetransformidentity]; } completion:nil]; }];
Comments
Post a Comment