Skip to content

Instantly share code, notes, and snippets.

@C4Code
Created May 12, 2012 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save C4Code/2667507 to your computer and use it in GitHub Desktop.
Save C4Code/2667507 to your computer and use it in GitHub Desktop.
daisy chaining animations with timers
//
// 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