I have a particle, and an image that is moving on the screen what I would like is that the emitter of the particle is the center of my image thus the particle always follow the image. How can I do this?
Asked
Active
Viewed 346 times
-1
-
What code do you have so far? – Alex Reynolds May 15 '11 at 09:50
-
2Why was this tagged Xcode? I don't see how this is related to Xcode. :/ – May 15 '11 at 10:05
-
why do you add a comment? I don't see how this is important. :/ – arvin Arabi May 15 '11 at 14:06
2 Answers
0
If your using only the basic UIImageView for your animation then you might have to do it yourself (unless the is a magic function somewhere that I missed).
To do so I would suggest getting a few bitmaps representing a trail of stars and while you move your image you display these bitmaps in succession rotated in the right direction to give the illusion of particules falling of the image end
The other solution that would look wy cooler is if you use a library such as cocos2 that would allow you to display your images and create particules easily (but that will involve changing to an opengl environment ...
Hope it helps
Jason

Jason Rogers
- 19,194
- 27
- 79
- 112
-
and can I use cocos2D just for my particles and then put my particles in a real (non cocos2D) project ? – arvin Arabi May 15 '11 at 10:26
0
set the particle location to UIImageView location..
like
emitter.position = imgView.position;
If you are going to use cocos2d,the same thing...
emitter.position = sprite.position;

Anish
- 2,889
- 1
- 20
- 45