Page 1 of 1
Translations and particle systems: persistent coordinates?
Posted: Sun Apr 28, 2013 3:34 am
by stcredzero
Hi. I'm writing a 2D scroller.
I'm trying to get particle effects to stay below specific features in my map. This is confusing because all of the coordinate transforms are supposed to be over with when love.draw() is done. The locations of particle effects are persistent, however. How does this work?
Re: Translations and particle systems: persistent coordinate
Posted: Mon Apr 29, 2013 3:25 pm
by adnzzzzZ
Couldn't understand your question but I hope this helps:
Code: Select all
...
ps = love.graphics.newParticleSystem(...)
ps_p = love.graphics.newParticleSystem(...)
ps_p:setPosition(100, 100)
...
love.draw()
love.graphics.draw(ps, 400, 300) -- will draw ps at x = 400, y = 300
love.graphics.draw(ps_p, 400, 300) -- will draw ps_p at x = 500, y = 400
Re: Translations and particle systems: persistent coordinate
Posted: Wed May 01, 2013 6:05 am
by stcredzero
It might come down to an inconsistency in the API applied to particle systems. I was not able to get love.graphics.translate() to work with them properly, but using the offset arguments in love.graphics.draw did the trick.
Re: Translations and particle systems: persistent coordinate
Posted: Wed May 01, 2013 1:39 pm
by markgo
I would suggest reporting it in the issues for bitbucket for future reference!
Re: Translations and particle systems: persistent coordinate
Posted: Wed May 01, 2013 1:48 pm
by bartbes
Is it the old emitted particles that move about when you change the translation?
Re: Translations and particle systems: persistent coordinate
Posted: Thu May 09, 2013 3:19 am
by stcredzero
bartbes wrote:Is it the old emitted particles that move about when you change the translation?
From what I recall, it's the old emitted particles that *don't move* when you change the translation using love.graphics.translation() -- but only when you are using Tangential Acceleration. In that case, it worked when I changed to using the offset arguments or using setPosition. I can try to code up a simplified example/testcase to see if it wasn't something goofy in my code or if it is going wrong like I thought.