Page 1 of 1
Pausing animation in ParticleSystem
Posted: Tue Aug 14, 2018 7:18 pm
by XHH
I'm having trouble figuring out how to make a particle emit a different texture without affecting already created particles. Is this possible to do with just one ParticleSystem? For example, I have a ParticleSystem that has emitted 3 copies of ball.png. If I change the texture to box.png, I don't want it to change previously made ball.png particles, but any new particles use box.png.
Also, is it possible to do the same with Quads. Can I make a particle use a certain quad from a list and not change during its lifetime?
Thanks in advance!
Re: Changing texture and quad in ParticleSystem
Posted: Fri Aug 24, 2018 7:47 pm
by XHH
BUMP: Anyone know if it's possible to pause the animation in a ParticleSystem that uses quads? I just want to draw each particle to be a different frame of a spritesheet and not change to any other part of the animation.
Re: Pausing animation in ParticleSystem
Posted: Sat Aug 25, 2018 7:43 am
by 0x72
Take a look at
ParticleSystem::update (1); it seams that
quadIndex is a function of
t (normalized "age" of a particle) so no way to achieve what you want using vanilla LÖVE. As of using different textures: there is also impossible because
texture is a field of the
ParticleSystem and
Particles know nothing about it.
If you're willing to build your own love version than removing this (2) part and updating (3) to pick a random value from 0 to
quads' length - 1 should do the trick. Some more work is needed if you want this behaviour to be optional.
(1)
https://bitbucket.org/rude/love/src/ccc ... em.cpp-997
(2)
https://bitbucket.org/rude/love/src/ccc ... pp-992:998
(3)
https://bitbucket.org/rude/love/src/ccc ... em.cpp-389