core-animation

Core Animation with contentsRect jerkiness

Hi, in my (puzzle) game the pieces are drawn on-screen using a CALayer for each piece. There are 48 pieces (in an 8x6 grid) with each piece being 48x48 pixels. I'm not sure if this is just too many layers, but if this isn't the best solution I don't know what is, because redrawing the whole display using Quartz2d every frame doesn't seem...

Is there an way to pause an Core Animation and resume it at some time later?

I have several Core Animation's going on at the same time. They all have an context and an animation id, where the context is the object that's beeing animated (UIImageView objects). I would like to pause them, so that the animation just stops temporarily, and then when some things are done, resume it to complete it. These things happen ...

Rotating a calayer from a start angle

I want to rotate a layer continuously using byValue, but I can't make it work correctly. I want to rotate by 6 degrees every second, to have a full rotation in 60 seconds. If the initial rotation of the layer is 0, everything is OK. The problem is when I try to set an initial fromValue: If I set the fromValue to 90 deg, the animation w...

Possible to copy CALayer from UIView?

Here's my setup: I have a CALAyer to which I want to add sublayers. I create these sublayers by setting upa UILabel and then adding the UILables layer to my main layer. Of course this leaves the heavy UILabel object hovering around in the background. Is it possible to get the layer with all its content from a UIView and get rid of the UI...

Recommended method to create a "table" using core-animation?

What would be the recommended method to create a "table" like display (columns, rows, header and footer) using core-animation, which I can "build" using animations? I've got my data to hand in an NSDictionary and I've started laying things out, but I feel I'm probably not doing it optimally; I'm creating nested sets of CALayers and wor...

EAGLView orientation changes and strange buffering

I'm writing an app that offloads some heavy drawing into an EAGLView, and it does some lightweight stuff in UIKit on top. It seems that the GL render during an orientation change is cached somewhere, and I can't figure out how to get access to it. Specifically: After an orientation change, calling glClear(GL_COLOR_BUFFER_BIT) isn't e...

Best way to implement animation on iPhone SDK?

I know how to implement the basic animation by moving/resizing a UIView. However, the following two animations seems a bit complicated. 1) Imagine a car game, where when you press on the pedal button the speedometer spins. How to do the kind of animation where the bar "fills up" in a circular shape? Imagine the bars in the following pi...

Jerky/juttery (core-)animation in a screensaver?

I've built a screensaver for Leopard which utilises core-animation. It doesn't do anything overly complicated; uses a tree of CALayers and CATextLayers to produce a "table" of data in the following structure: - root › maincontainer › subcontainer › row [multiple] › cell [multiple] › text layer At most the...

How to do a radar animation in the iPhone SDK?

Does anyone know how to animate a radar animation like the image below? With it growing outwards? I have to draw the circle using Quartz or some other way? ...

How to implement slurp effect on iPhone?

The iPhone has a private list of effects that Apple uses, such as "genieEffect" and "slurpEffect". I'm wondering how one would go about implementing the slurp effect (this is when you trash a mail message or a note). I understand how to use Core Animation, but I'm not sure exactly what parts of it they're using to get that animation. ...

Can this type of wiggle image deformation be done on iPhone without using openGL

I have a straight image and I want to deform it in a wave-like manner. Original image: and I want it to look like this (except animated): I haven't tackled the learning curve of openGL yet so if I can do this with Core Animation it would be great. Is this possible? ...

CoreAnimation Game - Adding a video feed as the background?

Greetings Friends, I am trying to overlay the simple 2D game I am developing on top of a quicktime (.mov) movie. I do not have experience with this (or much game programming xp) so I'm wondering if anyone has had to deal with this problem before and, if so, how did you go about solving it? I've been looking into the QuickTime API (QTKi...

Basic keyframe animation (rotation)

Hi there! I'm trying to create a very simple keyframe animation, whereby a graphic Rotates from one angle to another, through a given midpoint. (The purpose is to be able to animate rotation through an OBTUSE angle of arc GREATER THAN 180 DEGREES, rather than having the animation 'cheat' and go the shortest route, i.e., via the oppos...

What's the best way to provide animation grabs, e.g. when asking questions about coreanimation?

This is a little meta, but I'd like to ask a question related to coreanimation on the iphone, and I think it would really benefit from some kind of movie attachment / link to show what the code does. Probably I'm not the only one who'd like to do this. My question is, what's the best way to illustrate an animation, grab it from the devi...

Can UIViewAnimationTransitionCurlDown work on a view containing an image with transparency?

I am trying to animate a piece of text being pasted on to a view as a post-it note. I have a view with a yellow background, which contains a text view and a close button, initially set to be hidden. I animate it onto the main view like this: [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:postitView cache:NO]; p...

How to "flick" a UIImageView?

I've got some UIViews that I'd like the user to be able to "flick" across the screen. They're not scroll views. They simply contain a raster image (png). Can anyone point me to some sample code, etc to help get me started? Something a little more heavyweight than "MoveMe" out there that helps detect a "flick" (vs a "nudge" or a drag and...

Cocoa focus ring color animation

I want to use a focus ring animation as an indicator of incorrect data in field. So I'm sending becomeFirstResponder: to field and want focus ring to fade from red to default color. I'm wrestling with Core Animation but still have not found any way to do it. Is it possible? ...

Displaying PDFs on iPhone - CALayers?

I'm having a huge headache trying to figure this out. I'm trying to display a single page from a pdf file (the only one that is). This pdf page is a map that I need to zoom in and out with pinching, etc... I am doing this with CATileLayers (each tile being 256x256, but can set it to a bigger size). It does the job but REALLY slowly. What...

Can I increase the animation speed of presentModalViewController?

I'm writing a drawing application that shows a tools view controller when the user clicks an item in a toolbar. However, several of my beta testers have reported that the tools palate opens too slowly. I'm using the standard presentModalViewController:animated: call to display the tools, and I've tried wrapping it in a code block like th...

Getting started creating custom view transitions.

I'm looking for tutorials on creating custom view transitions. In particular, transitions that involve elements other than just the UIViews being affected, such as playing an animation over the transition as it is happening or modifying a screenshot of the UIView being transitioned out. I don't mean implementing the basic set of transi...