# JParticleEffect Class Reference

`#include <JParticleEffect.h>`

Collaboration diagram for JParticleEffect:

List of all members.

## Public Member Functions

| JParticleEffect (JResourceManager *mgr)
bool | Load (const char *filename)
void | Update (float dt)
void | Render ()
bool | Done ()
void | Start ()
void | Stop ()
void | SetParticleSystem (JParticleSystem *particleSys)
JParticleSystem * | GetParticleSystem ()
void | SetPosition (float x, float y)
float | GetX ()
float | GetY ()
void | MoveTo (float x, float y)

## Detailed Description

Particle effect. Each particle effect can contain one or more emitters.

## Constructor & Destructor Documentation

JParticleEffect::JParticleEffect | ( | JResourceManager * | mgr | ) |

Constructor.

Parameters:

  | mgr | - Resource manager for retrieving image quads for the particles.

## Member Function Documentation

bool JParticleEffect::Load | ( | const char * | filename | ) |

Load effect from file.

Parameters:

  | filename | - Name of effect file.

void JParticleEffect::Update | ( | float | dt | ) |

Update particle effect.

Parameters:

  | dt | - Time elapsed since last update (in second).

void JParticleEffect::Render | ( |  | ) |

Render particle effect.

bool JParticleEffect::Done | ( |  | ) |

Check if the particle effect is finished.

Returns:
  True if done.

void JParticleEffect::Start | ( |  | ) |

Start playing.

void JParticleEffect::Stop | ( |  | ) |

Stop playing.

void JParticleEffect::SetParticleSystem | ( | JParticleSystem * | particleSys | ) |

Set particle system.

Parameters:

  | particleSys | - Particle system.

JParticleSystem* JParticleEffect::GetParticleSystem | ( |  | ) |

Get particle system.

Returns:
  Particle system.

void JParticleEffect::SetPosition | ( | float | x,
|  | float | y |
| ) |  |  |

Set position of the effect. New particles will be emitted from the new position but the existing active particles will not be affected.

Parameters:

  | x | - X screen position.
  | y | - Y screen position.

float JParticleEffect::GetX | ( |  | ) |

Get X position.

Returns:
  X position.

float JParticleEffect::GetY | ( |  | ) |

Get Y position.

Returns:
  Y position.

void JParticleEffect::MoveTo | ( | float | x,
|  | float | y |
| ) |  |  |

Move the particle effect over to a new position. All the existing particles will be moved relatively.

Parameters:

  | X | - X screen position.
  | y | - Y screen position.