• 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: Faster drawing sprite and background
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faster drawing sprite and background


  • Subject: Re: Faster drawing sprite and background
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 8 Oct 2001 04:46:12 -0700

On Monday, October 8, 2001, at 04:19 AM, jean-michel daix wrote:

Hi,

I'm using a NSView based Cocoa application basicely drawing a background and
a sprite. My problem is "drawRect". My background is a 640x480 image and so
it can only be drawed about 12 time by second on my G4 400 (12 fps). I don't
want to redraw all my background all the time for sure, I just want to
redraw the sprite and a part of the background. But, tell me if I'm wrong,
"drawRect" is made to redraw all the content of the NSView.

That depends on the particular implementation of -drawRect:. As it happens, a lot of developers don't bother to use the given rect to limit the amount of drawing they have to do.


I have try to add a NSImageVIew under my NSView for my background but when
calling [backgroundView setImage:myBackGroundImage] from my NSView it
doesn't work. (I'm using setImage because my Background is created by a part
of the application at the initialisation and is not always the same image)

Should I stop to use NSView to deal with my sprite and trying to use only
NSImageView or someone knows a better way to do that ?

You might want to look into using the NSCell class.

-jcr

"I fear all we have done is to awaken a sleeping giant and fill him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.


References: 
 >Faster drawing sprite and background (From: jean-michel daix <email@hidden>)

  • Prev by Date: Faster drawing sprite and background
  • Next by Date: Re: Bug in 10.1 IB / Linker with NSMovieView
  • Previous by thread: Faster drawing sprite and background
  • Next by thread: Re: Faster drawing sprite and background
  • Index(es):
    • Date
    • Thread