Re: Centering text drawn to screen
Re: Centering text drawn to screen
- Subject: Re: Centering text drawn to screen
- From: Douglas Davidson <email@hidden>
- Date: Thu, 13 Jun 2002 14:31:36 -0700
On Thursday, June 13, 2002, at 12:54 PM, Ryan McPherson wrote:
I am writing a screensaver that flashes text on the screen using
NSString's
drawInRect:withAttributes: method. I have been successful so far, but
the
text is drawn left-adjusted to the rectangle I'm drawing in and I want
it to
be centered. I couldn't find an attribute that handles this in the
documentation.
Alignment (left, right, center, etc.) is not a separate attribute, but
rather part of the NSParagraphStyle that is the value of the
NSParagraphStyleAttributeName. The appropriate constants are defined in
NSText.h, and the appropriate methods in NSParagraphStyle.h.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.