core-animation

webOS style view switching on iPhone app

Hello, I have been working with a iPhone app that I would like to have switch views like the Palm Pre does for multitasking. I know the usual way of switching views by using the black bar at the bottom of the app but the app I am working on does not lend itself to having a big black bar in the way (see attached picture #1). I guess my q...

Core Animation: resizing layer from just one side on iPhone

I want to animate the resize of a CALayer. It needs to expand from the left (the right side needs to stay put). Setting the anchorPoint will make resizes work this way, but once I start animating, it doesn't behave the way I want it to. Does anyone have a suggestion? Thanks, and sorry for the noob-question. ...

CALayer: callback when animation ends?

Hi All, I have been running into some issues with animating multiple CALayers at the same time, and was hoping someone could point me in the right direction. My app contains an array of CALayer. The position of each layer is set to (previousLayer.position.y + previousLayer.bounds.height), which basically lays them out similar to a tabl...

Extending a view to the left side, animated

Hi, I have a view that I want to extend on the left side using an animation. All borders but the left one should remain the same, so the x position and the width of the view are changing. I use this code: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:5.0]; self.frame = CGRectMake(self.frame.origin.x-100, ...

Setting layer.transform flashes the layer at the end location then animates it from current location.

On occasion when setting layer.transform to a new transform I see the layer blink at its finished location, then animate from its current location to its finished location. I don't know if this is related but at the same time I am setting the sublayerTransform on the layer's superlayer. I've really have no clue why this is happening, a...

Is drawRect: called on multiple threads when using a CATiledlayer?

I know that drawLayer: and drawlayer:inContext: are called on multiple threads when using a CATiledlayer, but what about drawRect:? Apple's PhotoScroller example code uses drawRect: to get its images from disk, and it has no special code for handling threads. I am trying to determine whether my model for a CATiledLayer must be thread-s...

Apply CoreAnimation on image (not on screen)

Hi, I was wondering if it's possible to use Core Animation to work on images and not on the display. For instance I want to apply a CATransform3D (on the iPhone) and output the result of the image manipulation in another image and not on the screen. Thanks! ...

Animate CALayer scale without blurring

I have a CALayer that implements drawInContext: and draws a simple circle, like so: - (void)drawInContext:(CGContextRef)ctx { CGContextScaleCTM(ctx, DrawingScale, DrawingScale); CGContextSetRGBFillColor (ctx, 1, 0, 0, 1); CGContextFillEllipseInRect (ctx, LocationRectangle); } I have been experimenting with different way...

UIView displays improperly after its layer has been animated

Hi, I have a problem I don't understand regarding UIViews and Core Animation. Here's what I want to do: A small view is presented above a bigger view by putting it as one of its subviews. When I click a button inside this view, the view should minimize and move to a specified CGRect. Then the view is removed from its superview. ...

CABasicAnimation animates everything when it should only animate one thing

I made a bunch of little individual pictures, each with a separate CALayer, and they're supposed to fade in and out asynchronously at different rates. Each has a background sublayer and a fill sublayer. A timer runs in the background to animate each one individually at specific moments. For the current behavior of the program, rather ...

Dynamically lay out a Window in Cocoa using Core Animation and populate it

What I'm looking for is a way with CA to dynamically lay out a window. Imagine the following SQL query in a window, each name between +PLUSSIGNS+ being a NSPopUpButton, rest is static text. Select * from +BURRITOS/TACOS1+ +AND/OR1+ +BURRITOS/TACOS2+ +AND/OR2+ Where +TOPPING1+ +EQUALS/LT/GT1+ +TOPPINGLIST1+ +AND/OR3+ +TOP...

IPhone rotation functions and handmade math rotations are inconsistent.

I am currently rotating a UIImageView by touching, dragging, and releasing. I am rotating the object by the function: -(void)rotateForTime:(CGFloat)time distance:(CGFloat)distance { CABasicAnimation* rotationAnimation; rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; rotationAnimation.toVa...

Core Animation and Transformation like zoomRectToVisible

Hi ! I'm trying to get an effect like the zoomRectToVisible-method of UIScrollview. But my method should be able to center the particular rect in the layer while zooming and it should be able to re-adjust after the device orientation changed. I'm trying to write a software like the marvel-comic app and need a view that presents each pa...

How to do dynamic mask with Core Animation?

I want to drag an object (say a three image) and and as it's moved it reveals the content of a layer beneath it. How should I approach this? Someone has asked this question at iPhoneDevSDK but no one seems to know how. ...

Can Mac OS X's Core Animation let you change the layout of the screen?

I have been reading up on OS X's Core animation. I would like to know if it is possible to control the OS windows in a similar way to Expose, Time Machine, and or switching user screens. I am aware that it is possible to easily do these effects in your own program. But if one wanted to control Safari's browser windows, let's say, is that...

Scale a CALayer to base unit size

My app relies heavily on Core Animation; the main view contains dozens of CALayers. In order to facilitate zooming in/out, I have a master layer which contains all layers that I wish to be 'zoomable'. When I zoom, simply modify the sublayerTransform of the master layer. This works fine, however I would like the actual content rendered b...

Animation to shrink view to top left corner

I would like to shrink my UIView to the top left corner. I am currently using a scale transform to achieve this, but the view is shrunk to the center. I have tried to change the layer's anchorpoint, but this results in the entire view changing position on screen . How should a transform be set up to achieve a shrink to the top left corne...

CABasicAnimation's call to drawInContext causes instance variables to reset to zero

This might be my lack of understanding of the call stack when using Core Animation, but something confuses me a little about who/what is calling drawInContext. Lets say I have @interface PlayerLayer : CALayer { int Foo; } and I initialize Foo in init to be something like -(void) init { if( self = [super init] ) { Foo =...

Opening a curtain: Animation with Core Animation

Hey, I would like to animate a curtain, which gets opened. I have two images: one for the left and one for the right side of the curtain (depicted in red). I would like to smoothly slide them away with Core Animation. For what animation type should I look for? How do I achieve a realistic sliding style? Regards, Stefan ...

Zombie CADisplayLink?

Hi everyone, Is it possible that a CADisplayLink gets called one or two more times even after being invalidated? It looks that way to me, and this is causing me a problem because the target object is called where it's already gone so it crashes. Thanks! ...