# JParticleEmitter Class Reference

`#include <JParticleEmitter.h>`

Collaboration diagram for JParticleEmitter:

List of all members.

## Public Types

enum | JParticleEmitterMode { MODE_REPEAT, MODE_ONCE, MODE_NTIMES, MODE_CONTINUOUS }
enum | JParticleEmitterType { TYPE_POINT, TYPE_AREA, TYPE_HORIZONTAL, TYPE_VERTICAL, TYPE_CIRCLE }

## Public Member Functions

| JParticleEmitter (JParticleEffect *parent)
void | SetBlending (int srcBlend, int destBlend)
void | SetQuad (JQuad *quad)
void | Start ()
void | ReStart ()
void | Update (float dt)
void | Render ()
bool | Done ()
void | SetActive (bool flag)
void | MoveAllParticles (float x, float y)
void | EmitParticles (int count)
JParticle * | GetIdleParticle ()
void | StartParticle (JParticle *par)
void | SetMaxParticleCount (int count)

## Detailed Description

Particle emitter. This is where the particles actually generated.

## Member Enumeration Documentation

enum JParticleEmitter::JParticleEmitterMode

Enumerator:

  MODE_REPEAT | Emit particles and repeat when done.
  MODE_ONCE | Emit once.
  MODE_NTIMES | Emit N times.
  MODE_CONTINUOUS | Emit particles continuously.

enum JParticleEmitter::JParticleEmitterType

Enumerator:

  TYPE_POINT | Emit from one point.
  TYPE_AREA | Emit from a rectangle area.
  TYPE_HORIZONTAL | Emit from a horizontal line.
  TYPE_VERTICAL | Emit from a vertical line.
  TYPE_CIRCLE | Emit from a circle.

## Constructor & Destructor Documentation

JParticleEmitter::JParticleEmitter | ( | JParticleEffect * | parent | ) |

Constructor.

Parameters:

  | parent | - Particle effect that contains this emitter.

## Member Function Documentation

void JParticleEmitter::SetBlending | ( | int | srcBlend,
|  | int | destBlend |
| ) |  |  |

Set blending mode for rendering.

Parameters:

  | srcBlend | - Blending mode for source.
  | destBlend | - Blending mode for destination.

void JParticleEmitter::SetQuad | ( | JQuad * | quad | ) |

Set image quad for particles.

Parameters:

  | quad | - Image quad.

void JParticleEmitter::Start | ( |  | ) |

Start emitting particles.

void JParticleEmitter::ReStart | ( |  | ) |

Restart the emitter.

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

Update the emitter.

Parameters:

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

void JParticleEmitter::Render | ( |  | ) |

Render particles emitted by this emitter.

bool JParticleEmitter::Done | ( |  | ) |

Check if the emitter is done.

Returns:
  True if the emitter is done.

void JParticleEmitter::SetActive | ( | bool | flag | ) |

Set active flag.

Parameters:

  | flag | - Active flag.

void JParticleEmitter::MoveAllParticles | ( | float | x,
|  | float | y |
| ) |  |  |

Move all particles to a distance.

Parameters:

  | x | - X distance to move.
  | y | - Y distance to move

void JParticleEmitter::EmitParticles | ( | int | count | ) |

Emit certain amount of particles.

Parameters:

  | count | - Number of particles to emit.

JParticle* JParticleEmitter::GetIdleParticle | ( |  | ) |

Get idle particle to reuse.

Returns:
  Idel particle to use.

void JParticleEmitter::StartParticle | ( | JParticle * | par | ) |

Put a particle in action.

Parameters:

  | par | - Particle to start playing.

void JParticleEmitter::SetMaxParticleCount | ( | int | count | ) |

Set the maximum number of particles that this emitter can emit.

Parameters:

  | count | - Maximum number of particles.