Re: Best way to animate series of images in 10.4
Re: Best way to animate series of images in 10.4
- Subject: Re: Best way to animate series of images in 10.4
- From: Ricky Sharp <email@hidden>
- Date: Thu, 17 Nov 2005 17:26:01 -0600
On Nov 17, 2005, at 5:05 PM, Rhon Fitzwater wrote:
The goal of this is to create in some sense, a custom progress
indicator. When my program is doing something, instead of using the
supplied progress indicators, I want to use the custom animation
from my images.
What's commonly done in this situation is to have a single image
which contains all your 'frames'. Then, whenever your indicator
needs to update itself, just compute the new frame index and use that
to determine the source image bounds.
Here's a small piece of code from a tiled-graphic object:
NSRect theTileRect = NSMakeRect (theColumn * theTileSize.width,
theRow * theTileSize.height,
theTileSize.width, theTileSize.height);
[theImage drawInRect:theDestinationRect fromRect:theTileRect
operation:NSCompositeSourceOver fraction:1.0];
where theTileSize (NSSize) is the dimensions of an individual tile
(frame)
where theColumn and theRow are 0-based indecies
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden