Page 1 of 1

Toggling full-camera particles on certain sections

Posted: Fri Dec 15, 2017 10:37 pm
by sheepsaren1ce
Hi. I have installed a full camera Rain particle on Lua, but is there any certain way to enable the particles on certain sections?

Thanks. :D

Re: Toggling full-camera particles on certain sections

Posted: Fri Dec 15, 2017 10:54 pm
by PixelPest
You don't "install" rain particles. What code do you have already?

Re: Toggling full-camera particles on certain sections

Posted: Fri Dec 15, 2017 11:57 pm
by The0x539
In your code there'll be an emitter. Somewhere in the code you'll be calling its draw method. Just stick that method call inside an appropriate if statement.

Re: Toggling full-camera particles on certain sections

Posted: Sat Dec 16, 2017 6:03 am
by sheepsaren1ce
PixelPest wrote:You don't "install" rain particles. What code do you have already?
Code:
local effect = particles.Emitter(0, 0, Misc.resolveFile("particles/p_rain.ini"));
effect:AttachToCamera(Camera.get()[1]);

function onCameraUpdate()
effect:Draw();
end

Re: Toggling full-camera particles on certain sections

Posted: Sat Dec 16, 2017 7:03 am
by Hoeloe
Like The0x539 said, you're calling effect:Draw(). All you need to do is check the section first.

Re: Toggling full-camera particles on certain sections

Posted: Sun Dec 17, 2017 3:55 am
by sheepsaren1ce
Hoeloe wrote:Like The0x539 said, you're calling effect:Draw(). All you need to do is check the section first.
Thanks!