I have an class "Cube" and in there is a method -rotate. The method sets the anchorPoint at the bottom left and then rotates the cube by 90 degrees. After that, another method is called, which makes the cube to rotate back by -90 degrees. That's done specifying the stop selector. Btw: This has no special purpose. Just learning!
-rotate ...
NOTE: I added my new solution at the UPDATE answer below.
I try to recreate the effects we saw in Mobile Safari's tab on iPhone/iPod touch.
Basically, it's a UIScrollView that holds 4 reusable UIView (acting like ring buffer), and scrolls horizontally. When scrolling, the UIView's opacity will fade in/out seamlessly with offset.
Curr...
I'm experimenting with drawing on the iPhone by manually creating parts of the UI for my application (In this case a graph). Essentially, I want to draw a rectangle with rounded corners, a drop-shadow, and a semi-transparent gradient as the fill of the rectangle. Here is a screen shot of my photoshop mockup:
I've gotten has far as crea...
I am applying an rotation transform animation in an animation block with this transform:
CATransform3D rotatedTransform = self.layer.transform;
rotatedTransform = CATransform3DRotate(rotatedTransform, 90 * M_PI / 180.0, 0.0f, 0.0f, 1.0f);
self.layer.transform = rotatedTransform;
The animation begins, and the user kicks in another even...
Dear All,
I'm currently learning Iphone programing and I'm having some trouble wrapping my mind around CAKeyframeAnimation
I'm using CAKeyframeAnimation to animate objects on the screen like so:
CGPathMoveToPoint(thePath, NULL, start.x, start.y);
CGPathAddLineToPoint(thePath, NULL, finish.x, finish.y);
animation.path = thePath;
anima...
I've tried this:
CATransform3D rotationTransform = [[self.layer presentationLayer] transform];
This will not work, since the compiler will throw an warning and an error:
Warning: Multiple methods "-transform"
found. Error: Invalid initializer.
So then I tried this:
CATransform3D rotationTransform = [[self.layer presentationLa...
I am attemting to transition from one UIView to another, when the user rotates the device. This, in of itself, is not difficult. However, since I am displaying completely different content after the rotation, the default animation provided by UIKit (rotating the currently displayed view) is inappropriate conceptually.
Simply disabling t...
The documentation says:
The presentation tree contains the
values that are currently being
presented to the user as an animation
takes place. For example, setting a
new value for the backgroundColor of a
layer immediately changes the value in
the layer tree. However, the
backgroundColor value in the
corresponding laye...
I've tried this, but that doesn't work:
CATransform3D currentTransform = self.layer.transform;
CATransform3D identityTransform = CATransform3DIdentity;
if (currentTransform == identityTransform)
NSLog(@"the same");
I really woulnd like to compare each single field in the matrix ;)
Can I instad compare that somehow as a whole big thin...
There seems to be an delegate that can be set like myView.layer.delegate = anObject
The documentation just says:
delegate
Specifies the receiver’s
delegate object.
@property(assign) id
delegate
I wonder what kind of methods that delegate would implement, and when they would be called. Could solve some big problems ...
My delegate for ended animations looks like this:
(void)animationDidEnd:(NSString *)animationID finished:(BOOL)finished context:(void *)context
for some reason, the finished is always NO in my animation chain. But I need to know if an animation in my chain has finished completely.
Example: Something says: "move to (20,100)". And as ...
There is a function like:
CATransform3DGetAffineTransform
Returns the affine transform
represented by 't'. If 't' can not be
exactly represented as an affine
transform the returned value is
undefined.
I'm not so math-orientated, so a easy to understand description would be very nice. Wikipedia was no big help here.
...
I have some useful methods for physics calculations like acceleration / deceleration, speed, and some more.
Most of them require at least two measurements asunder in terms of time. So every time I want to use them, I have to implement a bunch of instance variables in my object that needs the calculation, for example for calculating an a...
I am trying to figure out how can you drag an image while constraining its movement along a certain path.
I tried several tricks including animation along a path, but couldn't get the animation to play and pause and play backwards - so that seems out of the question.
Any ideas ? anyone ?
...
I have an app that's half way done. The performance is not really good, and I wonder where the bottlenecks are. Although I can go ahead and start commenting out suspected lines of code, I wonder if there are any tools that would tell me which method cool took how long and what happened next. The stack trace isn't really that helpful.
I ...
Instruments tells that there are "misaligned images" which are animated by core animation. What does that mean?
UPDATE: I've seen that in Instruments.app > Core Animation.
...
I have 12 views which I rotate almost similar to the icons in the home screen when going into homescreen-customization-mode by touching an icon for a few seconds.
I use a 3D transformation code to do the rotations. They have each a duration of just 0.02 seconds, and the angle and direction of rotation changes permanently upon accelerati...
For 3D space, I use:
self.layer.transform = CATransform3DIdentity;
what corresponds here if I just need 2d space and want to assign the identity transform? I knew there was something, but I can't find it anymore.
...
I'm working on a Cocoa project using Core Animation and I've got a custom view that is displayed in two windows. It always shows up in one window, but sometimes does not show up in the other window when I start up the application. So far as I can tell, it is completely random. Here is the code I call when the view is initialized. It ...
I have an core animation block where I call a method that will load a view controller. there is an custom transition between two view controllers happening. However, when the view controller builds up the interface, all this stuff is affected by core animation. Although it results in some interesting effects, I don't want that ;)
[UIVie...