how to develop a customized animation

Discussion in 'iOS Programming' started by sgs1, Jul 14, 2014.

  1. sgs1 macrumors newbie

    Joined:
    Jul 14, 2014
    #1
    Hi everybody!

    My web designer has developed an animation and gave me 15 jpg with the single step of this animation.
    At the end, i have 2 buttons where i could push to go to another view.
    Now: how i can import this animation in the same sequence? And how i can set two buttons?
     
  2. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #2
    You could create a loop that uses imageNamed: to load each image. Name them with sequence numbers to make life easier.

    You may have to pass those through imageWithRenderingMode: UIImageRenderingModeAlwaysOriginal to create a new image for each fetched image.

    Take that list and create another image with
    animatedImageWithImages:duration:.
     
  3. sgs1 thread starter macrumors newbie

    Joined:
    Jul 14, 2014
    #3
    Thanks for the reply. But if in the image i have an icon ...for example, an house ... how i can set a specific action when i press that icon?

    For example: i push in the house and i open Safari...
     
  4. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #4
    For the button image, look at method setImage:forState:

    To use the button, you learn about using targets and actions. The button is a subclass of the UIControl class that has the setup you need, addTarget:action:forControlEvents:
    What I just hinted at is that when the class you're using does not have what you're looking for, consider that a super class of it may have the feature. Look up the inheritance chain before asking online.

    Look at the openURL: method of the UIApplicaiton class to open Safari.
     

Share This Page