Currently my particles appear on screen abruptly in their full shape and form. What I want is for the cells to either start at 0.0 opacity and animate up to full opacity, or start at 0.0 scale and animate up to 1.0 scale. I can't find anything online on how to do this.
You can animate the various properties of a CAEmitterCell, there is a good example at animating the CAEmitterCell Color property that should give you a good idea of what you should do to get the effect you want.
There are lots of great resources on CAEmitters, one good one is Tutorial: Particle Systems in Core Animation with CAEmitterLayer and another is Apple's Fireworks Sample Code
Related
Quick diagrams! I'm trying to implement this:
I have this working almost 100% currently (though this is a slightly different stage of the animation):
Everything looks good minus the fade effects at the end of the stroke. Is that possible using a simple CGPath? I'm animating strokeStart and strokeEnd to get the current effect. I've tried using CAGradientLayer as a mask on the layer, but that adds a gradient over the entire layer, not just the ends. Overriding drawRect isn't possible since I'm doing this dynamically with animations.
Any thoughts about how to achieve this effect? I have no idea which direction to go.
Depending on how important opacity is and how complex the rest of the animation is, one option would be to make two blurred tail objects that follow the ends of the path as it is animating.
Roundabout solution, sorry I can't think of another versatile way!
I want to create a circular slider like below.
But i want two functionalities in addition.
1) I want to start the slider from any point,but in fig. it starts from 0.
2) I want to include multiple sliders in a single circular black plot.
I'm sharing the link of this project:
https://www.cocoacontrols.com/controls/circularsliderdemo
Can anyone help me to do these functionalities.
Thanks in advance.
Take a look at CAShapeLayer. You could create a path that is a full circle, and use the strokeStart and strokeEnd properties to only draw part of the circle. You could use core animation to animate between the beginning and the end.
There is an open source custom gesture recognizer on Github that is a one finger gesture recognizer. That would be a good start for detecting and responding to the twirl gesture that such a control would need. EDIT: It's called KTOneFingerRotationGestureRecognizer (link)
Those are some ideas to help get you started.
I have a project on github called iOS-CAAnimation-group-demo That includes a "clock wipe" animation. The clock wipe works by setting up a shape layer as the mask layer for an image view, installing a full-circle arc that's wide enough to completely fill a rectangular area, and then animate the strokeEnd property of the shape layer to reveal/hide the image view. The clock wipe is much more complex than what you need, but it would give you the seed of what you want. You'd use a shape layer with a much thinner line width, and you would use it as a content layer, not as a mask.
I need to animate in ios a scatterplot to make it as the line was drawing. There is a similar effect in this website http://www.highcharts.com .I tried unsuccessfully with basic animation but impossible to make this effect.
Does anyone has any idea on how to do it ?
Unfortunately I've found CorePlot's animation capabilities in this area limiting.
However I have had success achieving the same effect by animating expanding the expansion of a regular UIView which encapsulates the graph.
I don't have my code in front of my at the moment by here is a diagram to highlight how I did it:
The key thing here is you start the initial Animation with a UIView which contains the Graph and who's frame is a smaller width than the graph. Then you animate the frame width to be the full graph size.
When this animates it progressively reveals your graph in a smooth animation.
I want to build an animated transition between two view controllers in iOS, resembling the "Box" transition in PowerPoint or the "Reflection" transition in Keynote.
You can see it here, at 2:10:
http://youtu.be/1fLQg5hFQQg?t=2m10s
What's the best way to do this?
Thanks!
That would be a complex animation to recreate. You'd need to use a CAAnimationGroup that grouped several different animations running at once. You'd want to animate a rotation around the y axis with the center of rotation lifted off the screen, on both the view controller that is animating away and the view that your are animating into place.
You would have to tweak the transform to make it draw with perspective (you add a small value to the .m34 record in the transform). That's because CA animations are orthographic by default (they don't show perspective.)
The reflections could be created using a special subclass of CALayer that lets you create duplicates of a layer. I'm blanking on the name of that layer subclass at the moment. You'd set up 1 duplicate with a scale of -1 on the y axis to flip it upside down, and a darkening effect. I've never done it myself, but I've seen several examples in books and online.
I am a Core Animation newbie and I want to animate a pulsating blue dot very similar to what the Maps application does with the GPS position.
This is not in a map, and this doesn't use Map Kit. It's inside one of my own views (a UIImageView subclass actually), itself inside a UIScrollView.
I am just starting and I am hopeful for suggestions, best practices, perhaps sample code, to speed up my development.
Note a peculiar twist: the look (size) of the pulsating blue dot should preferably not depend on the zoom factor of the host view in its scroll view. I believe Map Kit behaves similarly.
The intent is to attract the user's attention to a specific tiny portion of a crowded image.
Thanks for any suggestion.
You could use two pre-generated images (one with "low light" and one with "high") and animate the transition between the two images. You'd want to use an ease-in curve similar to the map dot (speeds up as it gets brighter) and have it auto-reverse and repeat.
Alternatively, you could use a view with a blue-tinted shadow whose blur radius property is animated between zero and several pixels. With this latter approach, your custom-drawn dot could easily take the scale factor into account when drawing.