Permalink
Browse files

* Changed colors to show up better on a projector screen

 * Modified the transforms example to show direct manipulation of the CATransform3D
  • Loading branch information...
1 parent 120e001 commit aff9b58f499abeff8e295064c98cedbe774e1986 @neror committed Sep 16, 2009
@@ -49,7 +49,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
pulseLayer_ = [[CALayer layer] retain];
[myView.layer addSublayer:pulseLayer_];
@@ -51,7 +51,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
runButton_ = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
runButton_.frame = CGRectMake(10.f, 10.f, 300.f, 44.f);
@@ -49,7 +49,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
pulseLayer_ = [[CALayer layer] retain];
[myView.layer addSublayer:pulseLayer_];
@@ -53,7 +53,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
moveAnchorPointButton_ = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
moveAnchorPointButton_.frame = CGRectMake(10.f, 10.f, 145.f, 44.f);
@@ -97,7 +97,7 @@ - (void)updatePropertiesLabel {
}
- (void)viewWillAppear:(BOOL)animated {
- simpleLayer_.backgroundColor = [UIColorFromRGBA(0xFFFFFF, .85f) CGColor];
+ simpleLayer_.backgroundColor = [UIColorFromRGBA(0x00FF00, .85f) CGColor];
simpleLayer_.bounds = CGRectMake(0.f, 0.f, 200.f, 200.f);
simpleLayer_.position = self.view.center;
simpleLayer_.delegate = self;
@@ -48,7 +48,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
self.view = myView;
}
@@ -51,7 +51,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
magicButton_ = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
magicButton_.frame = CGRectMake(10.f, 10.f, 300.f, 44.f);
@@ -54,7 +54,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
jumpButton_ = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
jumpButton_.frame = CGRectMake(10.f, 10.f, 300.f, 44.f);
@@ -48,7 +48,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
self.view = myView;
}
@@ -49,7 +49,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
drawingLayer_ = [[CALayer layer] retain];
@@ -62,7 +62,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
moveAnchorPointButton_ = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
moveAnchorPointButton_.frame = CGRectMake(10.f, 10.f, 145.f, 44.f);
@@ -137,7 +137,7 @@ - (void)updatePropertiesLabel {
}
- (void)viewWillAppear:(BOOL)animated {
- simpleLayer_.backgroundColor = [UIColorFromRGBA(0xFFFFFF, .85f) CGColor];
+ simpleLayer_.backgroundColor = [UIColorFromRGBA(0x00FF00, .85f) CGColor];
simpleLayer_.bounds = CGRectMake(0.f, 0.f, 200.f, 200.f);
simpleLayer_.position = kSimpleLayerStartPosition;
simpleLayer_.transform = CATransform3DIdentity;
@@ -198,7 +198,11 @@ - (void)translate:(id)sender {
CATransform3D currentTransform = simpleLayer_.transform;
translated = CATransform3DTranslate(currentTransform, 20.f, 20.f, 0.f);
} else {
- translated = CATransform3DMakeTranslation(50.f, 50.f, 0.f);
+ // The following is equvalent to:
+ // translated = CATransform3DMakeTranslation(50.f, 50.f, 0.f);
+ translated = CATransform3DIdentity;
+ translated.m41 = 50.f;
+ translated.m42 = 50.f;
}
simpleLayer_.transform = translated;
[simpleLayer_ setNeedsDisplay];
@@ -54,7 +54,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
NSArray *typeItems = [NSArray arrayWithObjects:@"Push", @"Move In", @"Reveal", @"Fade", nil];
typeSelectControl_ = [[UISegmentedControl alloc] initWithItems:typeItems];
@@ -58,7 +58,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
maskBlueButton_ = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
maskBlueButton_.frame = CGRectMake(10.f, 10.f, 145.f, 44.f);
@@ -113,7 +113,7 @@ - (void)viewDidUnload {
#pragma mark View drawing
- (void)viewWillAppear:(BOOL)animated {
- containerLayer_.backgroundColor = [[UIColor whiteColor] CGColor];
+ containerLayer_.backgroundColor = [[UIColor greenColor] CGColor];
containerLayer_.bounds = CGRectMake(0.f, 0.f, 200.f, 200.f);
containerLayer_.delegate = self;
containerLayer_.position = self.view.center;
@@ -47,7 +47,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
self.view = myView;
}
@@ -55,7 +55,7 @@ - (void)dealloc {
- (void)loadView {
UIView *myView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- myView.backgroundColor = [UIColor grayColor];
+ myView.backgroundColor = [UIColor whiteColor];
roundCornersButton_ = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
roundCornersButton_.frame = CGRectMake(10.f, 10.f, 145.f, 44.f);
@@ -99,7 +99,7 @@ - (void)viewDidUnload {
#pragma mark View drawing
- (void)viewWillAppear:(BOOL)animated {
- simpleLayer_.backgroundColor = [[UIColor whiteColor] CGColor];
+ simpleLayer_.backgroundColor = [[UIColor greenColor] CGColor];
simpleLayer_.bounds = CGRectMake(0.f, 0.f, 200.f, 200.f);
simpleLayer_.position = CGPointMake(160.f, 250.f);
[simpleLayer_ setNeedsDisplay];

0 comments on commit aff9b58

Please sign in to comment.