Phaser 3:允许粒子以翻转/镜像图像发射?
我有一个粒子发射器,它像往常一样发射同一图像的多个副本。然而,我希望一些粒子被翻转,要么完全以随机的量翻转,要么在中间翻转,这样落到左边的粒子会被翻转,而落到右边的粒子不会被翻转。
然而,我找不到任何关于翻转粒子而不翻转所有粒子的信息。我只想翻转一些。这有可能吗?
I have a particle emitter which emits multiple duplicates of the same image, as usual. However I'd like some of the particles to be flipped, either completely at a random amount, or sort of in the middle, so that particles falling to the left would be flipped and particles falling to the right won't be.
However I couldn't find anything regarding flipping particles without flipping ALL of them. I'd only like some to be flipped. Is this possible in any way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种方法,我认为“最快”就是使用发射器的scaleX属性。
示例代码:
但我从之前的问题中假设您的发射器具有“随机比例”属性。在这种情况下,您必须执行以下操作:
示例代码,对于随机缩放的粒子:
更新(SlowerFix):示例代码,对于随机缩放的粒子:
There are serveral way's, I think the "fastest" would be just to use the
scaleX
property of the emiter.Example Code:
But I assume from a earlier question, that you have emitter with a "random scale" property. I that case you woud have to do something like this:
Example Code, for random scaled particles:
UPDATE(SlowerFix): Example Code, for random scaled particles: