CATextLayer question
CATextLayer question
- Subject: CATextLayer question
- From: Davide Scheriani <email@hidden>
- Date: Thu, 5 Jun 2008 15:04:37 +0200
I was playing with my NSView and CATextLayer.
I placed this code:
-(void)mouseDown:(NSEvent *)theEvent
{
NSPoint p = [theEvent locationInWindow];
CATextLayer *textLayer=[CATextLayer layer];
textLayer.string=[arr objectAtIndex: (random() % [arr count])];
textLayer.font=@"Georgia";
textLayer.fontSize = 72.0;
int hue = random() % 100;
float hueAfter=hue;
textLayer.foregroundColor=[NSColor colorWithCalibratedHue:hueAfter/
100 saturation:1 brightness:0.9 alpha:1];
[textLayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMinX
relativeTo:@"superlayer"
attribute:kCAConstraintMinX
offset:p.x-15]];
[textLayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMinY
relativeTo:@"superlayer"
attribute:kCAConstraintMinY
offset:p.y-35]];
[rootLayer addSublayer:textLayer];
}
what ive noticed is when I click,the text appear with a fadein.
Any reason of this behaviour?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden