Manual control of particle system?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Manual control of particle system?
Quite simply, how do I make Love's particle system emit a particle at a given point? I don't need any of this auto-emission stuff. Just a function like emitParticle(ParticleSystem, x, y). I can't seem to get any regularity out of it by using setPosition, start, update...
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: Manual control of particle system?
I dunno if this is completely correct... but couldn't you instantiate a new ParticleSystem with a buffer of 1 and set the values accordingly?
From there, you could just make an emitParticle function, yeah?
From there, you could just make an emitParticle function, yeah?
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Manual control of particle system?
I don't know if that would work, but it would certainly chew up a horrendous amount of resources...
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: Manual control of particle system?
Well, not exactly.
You instantiate the new ParticleSystem in love.load.
Then, you set the position of the system and start and stop it in the function.
You instantiate the new ParticleSystem in love.load.
Then, you set the position of the system and start and stop it in the function.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: Manual control of particle system?
I thought about that as an answer, but then that brings a particle system management problem. So I didn't suggest it.Raylin wrote:I dunno if this is completely correct... but couldn't you instantiate a new ParticleSystem with a buffer of 1 and set the values accordingly?
From there, you could just make an emitParticle function, yeah?
The idea of starting, updating, and stopping only works if the time passed is long enough to only emit one particle (and not two, or three, or none). The particle system will continue updating the particles if it is stopped I believe. But, you probably already knew that, but were indeed having the emit only one problem.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Manual control of particle system?
So... Are you saying that Love doesn't have a function to just emit a particle? Really?
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Manual control of particle system?
I guess because if you only need one particle there's no need for a ParticleSystem.
Help us help you: attach a .love.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Manual control of particle system?
Yes. If you need to move a single particle around, it's just easier to use love.graphics.draw and move the single image yourself.
When I write def I mean function.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Manual control of particle system?
No, I need to emit one particle at a given point. I'm going to do this several hundred times as I calculate coordinates. I need to use the particle system because love.draw is too slow for me to add another five hundred or so draws.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Who is online
Users browsing this forum: Ahrefs [Bot] and 58 guests