I'm working on an iPhone app with some simple animation.
I have a view I want to translate, but not along a line. I want to translate it parabolically. Imagine that I am animating a car moving along a curved road.
I know I can set the transform properly to an instance of CGAffineTransform
Problem is, I have no idea how to create the transform. I know how to scale, translate, etc. but how do I translate parabolically? Is it even possible?
However, this method can be costly if you hire a professional translator. On the other hand, Polylang is a free WordPress plugin you can use to translate your site. Not only can you add translations for posts and pages, but you can also create different versions of your menus and categories.
When you land on a page that isn’t in English, click on the Translate this page button in the address bar to open a popup. Then, select the option for English: The translation popup in Google Chrome. If you prefer, you can right-click the text you’d like translated and choose Translate to English:
1 Go to the webpage you want to translate. 2 Click Translate when prompted. 3 If you don't see a Translate option, click the Google Translate logo in the far-right side of the address bar, then click Translate. 4 The Google Translate extension can be found here if you need machine translation.
When you visit a page in a foreign language, you can click on the aA button in the address bar to open a menu. There, you should see the Translate to English option. If this is the first time you’ve performed this action, you may receive a prompt asking you to enable the beta.
To animate along a smooth curve, you'll want to use a CAKeyframeAnimation. In this answer I provide code for a combined animation that moves an image view along a curve, while resizing it and fading it out. The relevant part of that code is as follows:
// Set up path movement
CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
pathAnimation.calculationMode = kCAAnimationPaced;
pathAnimation.fillMode = kCAFillModeForwards;
pathAnimation.removedOnCompletion = NO;
CGPoint endPoint = CGPointMake(480.0f - 30.0f, 40.0f);
CGMutablePathRef curvedPath = CGPathCreateMutable();
CGPathMoveToPoint(curvedPath, NULL, viewOrigin.x, viewOrigin.y);
CGPathAddCurveToPoint(curvedPath, NULL, endPoint.x, viewOrigin.y, endPoint.x, viewOrigin.y, endPoint.x, endPoint.y);
pathAnimation.path = curvedPath;
CGPathRelease(curvedPath);
This creates a curve with two control points, one at the origin of the view and the other at the upper-right corner of the the display (in landscape mode). For more on constructing paths, see the Quartz 2D Programming Guide or the Animation Types and Timing Programming Guide.
To use this animation, you'll need to add it to your view's layer using something like the following:
[imageViewForAnimation.layer addAnimation:pathAnimation forKey:@"curveAnimation"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With