Discuss controling animation at the iPhone Developer Exchange - Hackint0sh.org; HI, i have a small question
where can I find some help to make a ...
-
controling animation
HI, i have a small question
where can I find some help to make a slide like the picture down here to control the movement of my animation (png secuence)
the animation are 10 small png pictures.....(secuence)
let me explain again (in other words)
if you slide the finger to the right (100%), show the png number 10
if you slide the finger to 75% on the slide, then show the png number 7
or if you slide the finger to the 20% of the slide, then show the png number 2
etc ... etc
is that posible?
some idea or suggestion please....
any are welcome !
-
-
Senior Professional
Array
Hi,
Sure this is possible.
I'm not at my Mac now but i'll try to reply from memory, therefore just use it as a guide.
Firstly, check out the UI Catalog sample code. This will help you build and install the slider. You will see that there is a delegate method which is called when the slider moves.
Note: The slider values goes from 0 to 1. So you're going to need to do something like this
- (void) this_is_the_slider_delegate: (float)value {
// look up this delegate from the UI Catalog
int imageNum = trunc(value*10); // here you times the slider value by 10 and then cut off the remainder. This will give you the image number
NSString *imgName = [NSString stringWithFormat:@"%d.png",imageNum]; // here you specify the name of the image to be used
myImgView.image = [UIImage imageNamed:imgName]; // finally update the image inside the image view
}
Hope this helps.
-
Similar Threads
-
By computerartist in forum iPhone Developer Exchange
Replies: 1
Last Post: 09-09-2010, 02:49 AM
-
By hackint0sh in forum Latest Headlines
Replies: 0
Last Post: 06-05-2008, 07:00 AM
-
By hackint0sh in forum Latest Headlines
Replies: 0
Last Post: 05-29-2008, 06:10 AM
-
By ujustwonacruz in forum General
Replies: 1
Last Post: 04-22-2008, 04:02 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks