mmortall
Messages : 6 Date d'inscription : 2011-04-11
| Subject: disable/enable/hide particle system Tue Apr 12, 2011 5:38 am | |
| I need to disable/enable/hide/unhide particle system at any time. How can I do that?
| |
|
takezo02
Messages : 10 Date d'inscription : 2010-11-23
| Subject: Re: disable/enable/hide particle system Thu Apr 14, 2011 5:44 am | |
| I think you can to do this with this method in Core/SPK_Renderer.h
void setActive(bool active);
Apply to all renderer that you want enable/disable in any system or group.
Else implement a new bool or mask in order to enable/disable the render of system.
| |
|
Darktib Committer
Messages : 389 Date d'inscription : 2009-07-20 Localisation : A coté de Paris
| Subject: Re: disable/enable/hide particle system Thu Apr 14, 2011 12:14 pm | |
| If you are rendering and updating manually: - Code:
-
// In your app loop: if(systemIsEnabled) system->update(deltaT); if(systemIsVisible) system->render();
If you're using Irrlicht: - Code:
-
SPK::IRRSystem* system;
// ...
// Anywere you want system->setVisible(v); // v = false to hide it, true to show it system->setAutoUpdateEnabled(aue); // aue = false to disable, true to enable the system
@takezo02: Calling setActive on a renderer will only activate/deactivate a specific renderer, and that is useful if you want to disable only some parts of your system. I think mmortall asked for a solution hiding/showing the whole system... | |
|
mmortall
Messages : 6 Date d'inscription : 2011-04-11
| Subject: Re: disable/enable/hide particle system Fri Apr 15, 2011 6:38 am | |
| Thank your very mach for your help. My mistake was in using System class (no IRRSystem). | |
|
Darktib Committer
Messages : 389 Date d'inscription : 2009-07-20 Localisation : A coté de Paris
| Subject: Re: disable/enable/hide particle system Fri Apr 15, 2011 1:18 pm | |
| You're welcome! Btw, the first solution I wrote is only requiring SPK::System | |
|
Sponsored content
| Subject: Re: disable/enable/hide particle system | |
| |
|