• 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: Need smooth animation suggestions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need smooth animation suggestions


  • Subject: Re: Need smooth animation suggestions
  • From: Ethan John <email@hidden>
  • Date: Tue, 2 Mar 2004 08:51:02 -0800

You can set up Animation and AnimationController classes to encapsulate this behavior and hide it from the end user. Have the AnimationController class check the timer, and only draw its Animations at correct intervals.

This would make it easy to test various timer implementations.

On Mar 1, 2004, at 11:18 PM, Daniel Todd Currie wrote:

One thing that might help would be keying your animation off the clock time. An NSTimer will not give you truly precise timings, since it is dependent on the run loop. Instead, whenever the timer fires and your animation method begins, read the clock time and extrapolate your animation values from from the exact millisecond time.

Other than that, the quality of your animation will be dependent on system performance and refresh rate, which you could also try increasing if system performance is not an issue. Check http://cocoa.mamasam.com/ for a post that Chris Hanson sent to me a few months ago regarding this topic.

-- Daniel Currie


On 2004 Mar 01, at 22:28, Larry Wilson wrote:

What is the recommended way to achieve smooth animation on Cocoa? I've
tried using an NSTimer (set to fire at apx 30 fps) and notifications,
but I'm getting a bit of stutter in the drawing - particularly if I
move another application window (the animation momentarily stops or
slows).

I'm currently performing a [NSView compositeToPoint:aPoint
fromRect:aFrame operation:NSCompositeSourceOver] from an offscreen
buffer, and then setting [self setNeedsDisplay:YES];

Any suggestions?

Thanks.

-Larry
_______________________________________________
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.
_______________________________________________
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.


ethan john
http://students.washington.edu/thaen/
Apple Campus Representative
University of Washington
206.841.4157

I've got a fever and the only cure is more cowbell.
_______________________________________________
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: 
 >Need smooth animation suggestions (From: Larry Wilson <email@hidden>)
 >Re: Need smooth animation suggestions (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: NSButton darkens background when pressed
  • Next by Date: Re: Databasing and Cocoa
  • Previous by thread: Re: Need smooth animation suggestions
  • Next by thread: Re: Need smooth animation suggestions
  • Index(es):
    • Date
    • Thread