ios - Rotate CAEmitterCell content based on Animation Direction -


using caemitterlayer , cell show particles have direction sensitive content image (an arrow).

want content (arrow image) point in direction cell moving.

here code having arrows move outside edge toward center. how rotate image image points in direction of movement:

emitterlayer = [caemitterlayer layer]; emitterlayer.emitterposition = self.view.center; emitterlayer.emittersize = self.view.bounds.size; emitterlayer.emittermode = kcaemitterlayeroutline; emitterlayer.emittershape = kcaemitterlayerrectangle;  caemittercell* arrow = [caemittercell emittercell]; arrow.birthrate     = 10; arrow.velocity      = 100; arrow.emissionlatitude = m_pi; arrow.scale         = 0.5; arrow.lifetime      = 2; arrow.contents = (id) [[uiimage imagenamed:@"arrowoutline.png"] cgimage];   emitterlayer.emittercells = @[arrow]; [self.view.layer addsublayer:emitterlayer]; 

how content image adjust based on direction of cell movement?

ended using 4 different caemitterlayers 1 each direction emitterposition each edge of screen , emittersize length of given edge.

if there better solution please share.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -