• 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
NSImageViews, Block Animation and Frame by Frame Image Swapping
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImageViews, Block Animation and Frame by Frame Image Swapping


  • Subject: NSImageViews, Block Animation and Frame by Frame Image Swapping
  • From: James Miller <email@hidden>
  • Date: Tue, 14 Sep 2010 22:42:52 -0600

With Apple recommending block-based animation of UIImageViews, I'm not quite grasping how to take older frame-by-frame animation code like this:

NSArray *playerImagesRight = [NSArray arrayWithObjects: [UIImage imageNamed:@"p1.png"], [UIImage imageNamed:@"p2.png"],[UIImage imageNamed:@"p3.png"],[UIImage imageNamed:@"p4.png"],nil];
[playerImage setAnimationImages:playerImagesRight];
[playerImage setAnimationDuration:.5];
[playerImage setAnimationRepeatCount:-1];
[playerImage startAnimating];

and turn it into a block animation with the whole "[UIImageView beginAnimations:nil context:NULL]" routine?

I've been able to get basic transforms to happen (changing the location of the NSImage, for example), but can't figure out how to flip automatically between multiple image frames using this technique. The best I've been able to do so far is to use a counter and my animation timer to keep calling setImage. Surely there is a better way to do this that I'm just not getting?

Thanks.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSImageViews, Block Animation and Frame by Frame Image Swapping
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: NSOutlineView Drag and Drop
  • Next by Date: Re: Make checkbox in table view uneditable
  • Previous by thread: Re: NSOutlineView Drag and Drop
  • Next by thread: Re: NSImageViews, Block Animation and Frame by Frame Image Swapping
  • Index(es):
    • Date
    • Thread