• 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: Text over graphics
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text over graphics


  • Subject: Re: Text over graphics
  • From: Angela Brett <email@hidden>
  • Date: Sun, 30 Sep 2001 22:52:51 +1200

3) Before you draw the text the first time, grab a bitmap of the background
behind the text. Draw the text. When the text changes, draw the grabbed
bitmap to erase the old text and then draw the new text. The good news is
that you do not have to do this the hard way: A search on temporary drawing
reveals the following:

<stuff about NSWindow's cacheImageInRect>

Thanks, I used that - it was just what I was hoping to be able to do, and simple as well. I've been able to make other parts of my program look better too using the same technique. I didn't use flushWindowIfNeeded though, as that makes it display the restored image, making the text seem to flicker. Thanks to everyone who responded (on- and off-list) on this topic - I've learnt a few other things that I might need in future. cacheImageInRect is easy to miss but extremely useful - especially for a game, when there are several images changing or moving around the screen and overlapping.


References: 
 >Text over graphics (From: Angela Brett <email@hidden>)
 >Re: Text over graphics (From: "Erik M. Buck" <email@hidden>)

  • Prev by Date: Re: custom object archiving
  • Next by Date: Re: Drag a JPEG from Finder to Cocoa
  • Previous by thread: Re: Text over graphics
  • Next by thread: Security-related APIs
  • Index(es):
    • Date
    • Thread