core-animation

Mixing CAEAGLLayer with other CALayers

I'm trying, unsuccessfully, to combine OpenGL content with other CALayers. In particular, I would like to overlay the OpenGL content above the other layers (with alpha transparency). I run into two problems: My OpenGL rendering is never displayed (even though the OpenGL functions succeeds). The OpenGL rendering is awfully slow (aroun...

Fading out a Cocoa window

Hello I am wondering if there is a way to animate a window in objective-c using core-animation or quartz. I would like to fade out a window when I close it. My OSX operating system is Tiger. Edit: Is it possible to do the same with an applescript application in Xcode by somehow calling a method from objective-c or another way? ...

CAAnimation duration not being applied

I am applying a CAAnimation to move a toolbar on- and off-screen. When I touch the superview, that fires the following method: - (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [UIView beginAnimations:kViewerToggleToolbarAnimation context:nil]; if (self.viewerToolbarView.isVisible) { self.viewerToolbarVi...

Simple Core Animation View Rotation

I'm going to look into Core Animation in more detail soon but at the moment I'm just looking to rotate a view by a specified angle. I was wondering if anyone could point me to some code or provide a simple example as a quick search online hasn't pulled up any thing useful! Basically, I need to set an anchor point and then rotate my view...

Core Data + Core Animation/CALayer together??

I am making an Cocoa app with custom interfaces. So far I have implemented one version of the app using CALayer doing the rendering, which has been great given the hierarchical structure of CALayers, and its [hitTest:] function for handling mouse events. In this early version, the model of the app are my custom classes. However, as the ...

How do I get NSTextFields to fully animation using Core Animation with a layer backs NSView

I have a very basic app I'm using for experimenting with Core Animation. NSWindow -ContentView --CustomView ---NSTextField I set the content view to be layer backed in interface builder and create a transform.rotation animation. When I add this to the content view it rotates properly, but the NSTextField also remains painted at the or...

Pragmatic way of handling mouse in Core Animation layers

Hello, I'm starting working with Core Animation and I started wondering how to handle various kinds of mouse events like mouse entered a CALayer mouse exited a CALayer mouse click on a CALayer For now I'm concentrating just on mouseDown message sent to my custom view. According to the documentation I should use -hitTest:(CGPoint)poin...

Forcing Consecutive Animations with CABasicAnimation

I have a notification that fires in my model when certain properties change. As a result, a selector in a particular view object catches the notifications to change the position of the view accordingly. The notifications causes a view on the window to move in a particular direction (always vertically or horizontally and always by a sta...

How come my Core Animation transformation always returns to it's start-state?

Hello experts! I am trying to perform some kind of animation of a layer in my iPhone application. It does not matter what I do I always get the same results: after the animation is done it jerks back into it's original position. Even though I set removedOnCompletion to false there is no difference. What am I missing here? Thanks in adv...

Residual/trace in Core Animation & CALayers

I am making an Cocoa app, using Core Animation to create custom UI. However, whenever I drag some layers around, they often leave some "residuals/traces" onto the other layers. So far, my guess is that it is related to my usage of [setNeedsDisplay]. To my understanding, as I drag a layer around, I don't need to call this method to that ...

iPhone animation problem SImulator vs Real Device

Hi! This is my first question her so please be gentle: I have followig animation code running smoothly on the simulator as well as on the real device (I am testng on iPhone 3GS 3.1.2). Animation is a simple transition between the 2 views, something like book page flipping. One diffrence betwen simulator an real device (The problem I can...

chopping deadspace out of UIViewAnimationTransitionCurlUp?

I'd like to utilize UIViewAnimationTransitionCurlUp more often in my applications however it has a very annoying trait... namely that the first 20% to 35% of it is non-action... I know this is the case because I set an animation duration to 20 seconds to confirm my suspicions that the culprit wasn't simply setup time internal to [UIView]...

Resize and move a UIView with Core Animation (CAKeyFrameAnimation)

Is this possible? I can change the opacity and position (center) of the layer but whenever I try to change the size or origin, it doesn't work. CAAnimationGroup* anigroup = [CAAnimationGroup new]; CGMutablePathRef thePath = CGPathCreateMutable(); CGPathAddRect(thePath, NULL, CGRectMake(0,0, 320, 480)); CGPathAddRect(the...

Want to have a CALayer to display inside the window

I'm trying to get a CALayer with a black background to display. I've attached the AppDelegate as the delegate to the file's owner. The console reports correctly the "awaking from nib..." log statement. I however, just see a blank grey window (335x390 in size), with no black box drawn in the middle. What concept am I missing? Thanks in a...

Sliding from One View to Another.

How would I change from one view to another with a slide transition? Thanks. ...

Chaining Core Animation animations

Which is the most elegant and modular way to chain animation in a Core Animation context? I mean to do animations that starts just when other finished (for example, changing position and then opacity).. normal approach is to directly change properties: layer.position = new_point; layer.opacity = 0.0f; but this will do them at the sa...

Can Core Animations supports a 20 frames per second enlargement from 32 x 32 px to 120 x 170 px?

my background.jpg has 52 32x32 mini poker cards.png and when user touch on 1 card, it will enlarge to 120x 170 px. At any point in time, there is only 1 card being chosen (i.e, being animated) with at most 19 entire cards overlapped (120x170 / 32x32). Should i use Core Animation or do i have to learn OpenGL or use a library such as coc...

Animating a UIImageView tint

Similar to this previous question, I want to apply an arbitrarly-coloured tint to an arbitrary image (a UIImageView). However, I want the tint to fade away over N seconds of time, to have a "pulse" effect. I'll be triggering the pulse every M seconds. While I think I could rig up a naive solution using an NSTimer to change the tint, I t...

Iphone 3d Animation Problem

Hey guys. I recently posted my problem but neither did I get an answer here or elsewhere, nor can I find my post again... Anyways, I want to try to state my point clearer, hoping you can help me this time maybe. The part of code, this is about, looks like this: CABasicAnimation *animation = nil; CATransform3D transform; animation = ...

How can I accurately time animations on an iPhone inside the normal flow of a program?

I've been using CALayer animations in my program, primarily to move around CALayers with animation on my screen. My problem is that I don't want to exit the layer-moving (card dealing, as it happens) method until all of the cards are done dealing. How can this be done cleanly? Presume that my layer-moving method is called by different m...