ParticleSystem and setColor

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
splats
Prole
Posts: 2
Joined: Sun Feb 05, 2017 1:17 am

ParticleSystem and setColor

Post by splats »

Hi, love2d newbie here, I've noticed something peculiar with the ParticleSystem - if I have love.graphics.setColor(color) for say drawing a shape, then draw my particleSystem object afterwards, the particles will always have the color from the previous setColor, ignoring whatever is set by ParticleSystem:setColors initially (I'd expect it to be the interpolated color). Is this a bug or am I missing something..
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: ParticleSystem and setColor

Post by veethree »

Set the color back to white before drawing the particle system.
splats
Prole
Posts: 2
Joined: Sun Feb 05, 2017 1:17 am

Re: ParticleSystem and setColor

Post by splats »

Thanks! :ultrahappy:
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: ParticleSystem and setColor

Post by slime »

Just a clarification, the global constant color and the per-particle colors get multiplied (modulated) together when the particle system is drawn – so neither overwrites the other, but if you don't want a custom constant color then you'll still need to set it to the default white when drawing.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests