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?
Translations and particle systems: persistent coordinates?
-
- Prole
- Posts: 11
- Joined: Fri Apr 05, 2013 1:10 am
Re: Translations and particle systems: persistent coordinate
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
-
- Prole
- Posts: 11
- Joined: Fri Apr 05, 2013 1:10 am
Re: Translations and particle systems: persistent coordinate
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
I would suggest reporting it in the issues for bitbucket for future reference!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Translations and particle systems: persistent coordinate
Is it the old emitted particles that move about when you change the translation?
-
- Prole
- Posts: 11
- Joined: Fri Apr 05, 2013 1:10 am
Re: Translations and particle systems: persistent coordinate
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.bartbes wrote:Is it the old emitted particles that move about when you change the translation?
Who is online
Users browsing this forum: Bing [Bot] and 1 guest