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.

Animating in Core Grapics Help.

I've been building a small game in Core Grapics and I can move around UIviews easy with a gameLoop and everything, but I don't know how to do scripted animations, besides block animations. How would I move a UIButton up 5 points and the bring it down 300 points when I click on it? And are there any good tutorials for core graphic animations.
Tagged:

Replies

  • tetrisleetetrislee Posts: 21New Users
    Hello,
    You should use the Core Animation framework to animate properties on the layer. You can either subclass CALayer or use a delegate to do the actual drawing. In the drawing code, you can access the property that is being interpolated and use it to move points, change the thickness of lines, or anything else that Core Graphics lets you control. Look at this example code from Apple and see how it uses the lineWidth value that is being animated.

    This little tutorial by John Blackburn is one of my favorite introductions to Core Animation. There are a few different concepts to grasp, but in general it's pretty simple to create quite complex animations.

    Your problem with things running slower and slower most probably has nothing to do with Core Graphics. It could be that you are accidentally creating more and more timers for example.
    Thanks :)
Sign In or Register to comment.