Pausing animation in ParticleSystem

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
XHH
Citizen
Posts: 85
Joined: Thu Jun 20, 2013 6:43 pm
Location: US
Contact:

Pausing animation in ParticleSystem

Post 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!
Last edited by XHH on Fri Aug 24, 2018 7:48 pm, edited 1 time in total.
I like to draw and program :)
User avatar
XHH
Citizen
Posts: 85
Joined: Thu Jun 20, 2013 6:43 pm
Location: US
Contact:

Re: Changing texture and quad in ParticleSystem

Post 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.
I like to draw and program :)
User avatar
0x72
Citizen
Posts: 55
Joined: Thu Jun 18, 2015 9:02 am

Re: Pausing animation in ParticleSystem

Post 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
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests