• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CATextLayer question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CATextLayer question
      • From: Brian Christensen <email@hidden>
  • Prev by Date: Re: Problem with cblas_sgemm in 64 bit build
  • Next by Date: Re: App hangs when displaying any sheet in 10.5 [was Re: Where to start looking to fix hang?]
  • Previous by thread: Re: Linking dependancies
  • Next by thread: Re: CATextLayer question
  • Index(es):
    • Date
    • Thread