跟随图像的粒子
我有一个粒子和一个在屏幕上移动的图像,我想要的是粒子的发射器是我的图像的中心,因此粒子总是跟随图像。我该怎么做?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你的动画只使用基本的 UIImageView 那么你可能必须自己做(除非这是我错过的神奇功能)。
为此,我建议获取一些代表星星轨迹的位图,当您移动图像时,您会连续显示这些位图,并以正确的方向旋转,以产生粒子从图像末端掉落的错觉
另一种解决方案看起来是wy更酷的是,如果您使用像 cocos2 这样的库,它可以让您轻松显示图像并创建粒子(但这将涉及更改为 opengl 环境......
希望它对
Jason有帮助
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
将粒子位置设置为 UIImageView 位置..
就像
如果你要使用 cocos2d,同样的事情...
set the particle location to UIImageView location..
like
If you are going to use cocos2d,the same thing...