Created
May 12, 2012 16:37
-
-
Save C4Code/2667507 to your computer and use it in GitHub Desktop.
daisy chaining animations with timers
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
// | |
// C4WorkSpace.m | |
// daisyChaining | |
// | |
// Created by Travis Kirton on 12-04-04. | |
// Copyright (c) 2012 POSTFL. All rights reserved. | |
// | |
#import "C4WorkSpace.h" | |
C4Image *myImage; | |
@interface C4WorkSpace () | |
-(void)step1; | |
-(void)step2; | |
-(void)step3; | |
-(void)step4; | |
@end | |
@implementation C4WorkSpace | |
-(void)setup { | |
myImage = [C4Image imageNamed:@"C4Sky.png"]; | |
//work your magic here | |
} | |
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
[self step1]; | |
} | |
-(void)step1 { | |
[self.canvas addImage:myImage]; | |
[self performSelector:@selector(step2) | |
withObject:nil | |
afterDelay:1.0f]; | |
} | |
-(void)step2 { | |
myImage.animationDuration = 1.0f; | |
myImage.center = CGPointMake(384, 512); | |
[self performSelector:@selector(step3) | |
withObject:nil | |
afterDelay:2.0f]; | |
} | |
-(void)step3 { | |
[myImage colorControlSaturation:0 brightness:0 contrast:1]; | |
[self performSelector:@selector(step4) | |
withObject:nil | |
afterDelay:2.0f]; | |
} | |
-(void)step4 { | |
myImage.alpha = 0.0f; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment