Created
March 3, 2012 17:06
-
-
Save kybernetyk/1967033 to your computer and use it in GitHub Desktop.
lol animierung
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction) buttonOneClick:(id)sender { | |
NSRect frm = [button2 frame]; | |
frm.origin.x += 150; | |
#if 1 | |
[NSAnimationContext beginGrouping]; | |
[[NSAnimationContext currentContext] setDuration: 5.0]; | |
[[NSAnimationContext currentContext] setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut]]; | |
[button2.animator setFrame: frm]; | |
[NSAnimationContext beginGrouping]; | |
[[NSAnimationContext currentContext] setDuration: 4.0]; | |
[button2.animator setAlphaValue: 0.1]; | |
[NSAnimationContext endGrouping]; | |
[NSAnimationContext beginGrouping]; | |
[[NSAnimationContext currentContext] setDuration: 1.0]; | |
[[NSAnimationContext currentContext] setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseIn]]; | |
[button2.animator setFrameRotation: -90.0]; | |
[NSAnimationContext endGrouping]; | |
[NSAnimationContext endGrouping]; | |
#else | |
CABasicAnimation *a = [button2 animationForKey: @"frameOrigin"]; | |
[a setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut]]; | |
[a setDuration: 5.0]; | |
[[button2 animator] setFrame: frm]; | |
a = [button2 animationForKey: @"alphaValue"]; | |
[a setDuration: 0.25]; | |
[[button2 animator] setAlphaValue: 0.1]; | |
a = [button2 animationForKey: @"frameRotation"]; | |
NSLog(@"%@ %f",a, [a duration]); | |
[a setDuration: 4.0]; //warom ghet das net? | |
NSLog(@"%@ %f",a, [a duration]); | |
[button2.animator setFrameRotation: -90]; | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment