• 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
Re: Centering text drawn to screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Centering text drawn to screen (From: Ryan McPherson <email@hidden>)

  • Prev by Date: Re: Q: Filter Services
  • Next by Date: Re: Q: Filter Services
  • Previous by thread: Re: Centering text drawn to screen
  • Next by thread: Re: cocoa-dev digest, Vol 2 #775 - 14 msgs
  • Index(es):
    • Date
    • Thread