ShiftyAndPulse

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
411 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 14, 2009

This is a demo of two methods

- (void)shifty { NSLog(@"shifty: Method - FIRED");
CGRect rect = self.centerView.frame;

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationRepeatCount:4];
[UIView setAnimationDuration:0.1]; //TODO: I want to store the x/y values
// and set the frame back to the original state
// when finished. Currently i think they are just
// pointers so the values get erased.
//int rectY = rect.origin.y;
//int rectX = rect.origin.x; if (!shiftyBOOL) { shiftyBOOL = TRUE; rect.origin.x -= kShifty_Offset; //rect.origin.y += kShifty_Offset; NSLog(@"%d,%d",rect.origin.x,rect.origin.y);
} else { shiftyBOOL = FALSE; rect.origin.x += kShifty_Offset; //rect.origin.y -= kShifty_Offset; NSLog(@"%d,%d",rect.origin.x,rect.origin.y);
} self.centerView.frame = rect;
[UIView commitAnimations]; //After values are set, this calls the animation

//TODO
//rect.origin.y = rectY;
//rect.origin.x = rectX;
}

- (void)pulse:(UIColor *)color {
NSLog(@"pulse: - FIRED!");
CGRect rect = CGRectMake(0.0, 0.0, 320.0, 480.0);
UIView *aView = [[UIView alloc] initWithFrame:rect];
aView.backgroundColor = color;
[self insertSubview:aView atIndex:0];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.4];
aView.alpha = 0.0;
//aView.frame = CGRectMake(0.0,0.0,320.0,480.0);
[UIView commitAnimations];
[aView release];
}

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more