Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

how to move an UIImage based on co ordinates given

raptor85raptor85 Posts: 67Registered Users
i wanted to know if there is a way where an UIImage moves based on multiple co ordinates given in the program for ex : one co ordinates will be to move like 10 pixels frm left to right , 2nd co ordinates should continue from where the last co ordinates ended and move 20 pixels frm top to bottom and so on
Post edited by raptor85 on

Replies

  • Duncan CDuncan C Posts: 8,038Tutorial Authors, Registered Users
    raptor85;417168 said:
    i wanted to know if there is a way where an UIImage moves based on multiple co ordinates given in the program for ex : one co ordinates will be to move like 10 pixels frm left to right , 2nd co ordinates should continue from where the last co ordinates ended and move 20 pixels frm top to bottom and so on
    So you want the image to follow a specific path from point to point on the screen? It's called CAKeyframeAnimation. The lets you specify a series of points, and animate an object (a layer, which can contain an image) to each point in turn.

    You can also animate an image along a curved path using a CGPath.

    Take a look at the animation tutorial linked in my signature. It includes example code on keyframe animation.

    Be warned, though, it's fairly complex stuff.
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • raptor85raptor85 Posts: 67Registered Users
    That tutorial is really amazing , i wanted to know can we move the UIImage in z direction (to tilt it to certain degree like leaning tower of pisa)
    Duncan C;418095 said:
    So you want the image to follow a specific path from point to point on the screen? It's called CAKeyframeAnimation. The lets you specify a series of points, and animate an object (a layer, which can contain an image) to each point in turn.

    You can also animate an image along a curved path using a CGPath.

    Take a look at the animation tutorial linked in my signature. It includes example code on keyframe animation.

    Be warned, though, it's fairly complex stuff.
  • Duncan CDuncan C Posts: 8,038Tutorial Authors, Registered Users
    raptor85;421244 said:
    That tutorial is really amazing , i wanted to know can we move the UIImage in z direction (to tilt it to certain degree like leaning tower of pisa)
    Of course. Just rotate the object by adding a rotation transformation. You probably want to rotate along the y axis, not z. Rotating around the z axis is normal, 2-dimensional rotation of a flat object.
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
Sign In or Register to comment.