Solution found, I wasn't setting the bounds properly.
----- Original Message ---- From: Shaun Larkin <[EMAIL PROTECTED]> To: cocoa-dev <[email protected]> Sent: Thursday, August 28, 2008 10:16:03 AM Subject: Semi-transparent offscreen CALayer I'm trying to animate a semi-transparent CALayer (opacity 0.8) by sliding it in from offscreen but it only seems to exist is it's opaque:YES is set, essentially negating any transparent effects. I've look through the documentation but haven't found a solution. I had assumed that when the calayer appears in context it would would be rendered. here is the code :: // the transparent calayer is a subclass called Menu.m -(void)drawInContext:(CGContextRef)ctx { CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); CGFloat col[4] = {0,0,0,0.5}; CGColorRef colr = CGColorCreate(space, col); CGColorSpaceRelease(space); CGContextSetFillColorWithColor(ctx, colr); CGColorRelease(colr); CGContextFillRect(ctx, [self frame]); } //in the layer hosting view , this on work if the menu's opaque property is set to YES CABasicAnimation * b = [CABasicAnimation animationWithKeyPath:@"position.y"]; b.duration = 0.4f; b.fromValue = [NSNumber numberWithFloat:menu.frame.origin.y]; b.toValue = [NSNumber numberWithFloat:360.0]; b.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; b.removedOnCompletion = NO; b.fillMode = kCAFillModeForwards; [menu addAnimation:b forKey:@"slideIn"]; thanks in advance! _________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/shaunlarkincocoa%40yahoo.ca This email sent to [EMAIL PROTECTED] __________________________________________________________________ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at http://ca.toolbar.yahoo.com. _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/shaunlarkincocoa%40yahoo.ca This email sent to [EMAIL PROTECTED] __________________________________________________________________ Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
