animation particle type

Discussion in 'iOS Programming' started by jagatnibas, Nov 6, 2011.

  1. jagatnibas, Nov 6, 2011
    Last edited: Nov 6, 2011

    jagatnibas macrumors regular

    Joined:
    Jul 28, 2008
    #1
    I want an animation effect where the image view will be visible from particles gradually. like it will be particles and will gradually fill up to make the imageview shape. I dont knoe a name for this type of animation, please tell me if this is possible using UIViewAnimation

    I guess the name for it will be the opposite of dissolve
     
  2. nickculbertson macrumors regular

    nickculbertson

    Joined:
    Nov 19, 2010
    Location:
    Nashville, TN
    #2
    There are a number of ways to do this. What I would do is stack two imageviews, fill them with images that revealing more of the picture, and alternately fill and fade the imageviews.

    ex. image1 L image2 L_ image3 L_/

    Code:
    //assume image1, 2, 3... are declared in your .h
    
    -(IBAction)fadein1{
    imageview1.alpha=0
    imageview1.image=image1;
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [UIView setAnimationDelay:.5];
    imageview1.alpha=1;
    [UIView commitAnimations];
    
    [self performSelector:@selector(fadein2) withObject:nil afterDelay:1.0];
    }
    
    -(IBAction)fadein2{
    imageview2.alpha=0
    imageview2.image=image2;
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [UIView setAnimationDelay:.5];
    imageview2.alpha=1;
    [UIView commitAnimations];
    
    [self performSelector:@selector(fadein3) withObject:nil afterDelay:1.0];
    }
    
    -(IBAction)fadein3{
    imageview1.alpha=0
    imageview1.image=image3;
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [UIView setAnimationDelay:.5];
    imageview1.alpha=1;
    [UIView commitAnimations];
    
    }
    
    
    
    Nick
     
  3. IDMah macrumors 6502

    IDMah

    Joined:
    May 13, 2011
    #3
    pixel dissolve

    Sometimes called a pixel Dissolve..
    in your case reversed..
     
  4. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #4
    UIView BeginAnimations -> old
    Animation Blocks are the new thing, and cleans up your code a bit :)
    Look it up, it's the 'new' hip thing for animating ;)
     

Share This Page