L_Particle Class Reference

#include <L_Particle.h>

List of all members.


Detailed Description

Particle entity for being attached to ParticleEffect.


Public Member Functions

 L_Particle (const L_Particle &par)
 L_Particle (CL_Surface *surface_t, int life_t)
void copy_from (const L_Particle &par)
void set_size (L_REAL size)
void set_life (int life_t)
void set_color (const L_Color &color)
void set_color (const char a, const char r, const char g, const char b)
void set_velocity (const L_Vector &v_t)
void set_position (L_REAL x, L_REAL y)
void set_rotation (L_REAL radian)
void set_rotation2 (L_REAL radian)
void set_motion_controller (L_MotionController *motion_ctr)
void set_blending_mode (int mode)
void set_prerun_callback (L_PRERUN_USERFUNC *user_func, void *user_data)
void remove (void)
void coloring1 (const L_Color &color1_t, L_REAL begin_at=0)
void coloring2 (const L_Color &color1_t, const L_Color &color2_t, L_REAL begin_at=0)
void coloring3 (const L_Color &color1_t, const L_Color &color2_t, unsigned int switch_time_t, L_REAL begin_at=0)
void sizing1 (L_REAL size_r, L_REAL begin_at=0)
void sizing2 (L_REAL size_r1, L_REAL size_r2, L_REAL begin_at=0)
void sizing3 (L_REAL size_r, L_REAL begin_at=0)
void rotating1 (L_REAL radian_t, L_REAL begin_at=0)
void rotating2 (L_REAL radian_t, L_REAL begin_at=0)
void rotating3 (L_REAL begin_at=0)
void rotating4 (L_REAL begin_at=0)
void disable_coloring (void)
void disable_sizing (void)
void disable_rotating (void)
L_REAL get_size (void)
L_REAL get_ref_size (void)
L_REAL get_radian (void)
L_Vector get_velocity (void)
int get_remaininig_life (void)
bool is_alive (void)
void initialize (void)
void run (int time_elapesed_t)
void draw (int x_shift=0, int y_shift=0)

Public Attributes

L_REAL x_pos
L_REAL y_pos


Constructor & Destructor Documentation

L_Particle const L_Particle par  ) 
 

Copy contructor ( it does not copy all variables )

L_Particle CL_Surface *  surface_t,
int  life_t
 

Contructor
life_t : pass L_INFINITE_LIFE to have infinite life particle


Member Function Documentation

void set_size L_REAL  size  ) 
 

Set the current size and reference size of particle, the sizing effect is relative to reference size.

void set_life int  life_t  ) 
 

Set the life in miliseconds, pass L_INFINITE_LIFE for infinite life.

void set_rotation2 L_REAL  radian  ) 
 

Only use this when rotating2() is used. This function would reset the initial rotation
set by rotating2().

void set_motion_controller L_MotionController motion_ctr  ) 
 

Assign a motion controller for complex motion.

void set_blending_mode int  mode  ) 
 

Set blending mode of particle ( particle is in L_ADDITIVE_BLENDING blending mode
by default ). Available blending mode : L_NORMAL_BLENDING, L_ADDITIVE_BLENDING

void set_prerun_callback L_PRERUN_USERFUNC *  user_func,
void *  user_data
 

Set user call back function. The user function is called at least once per frame before calling run(int).
L_PRERUN_USERFUNC :
   void callback_function(L_Particle& particle, const void* user_data)

void remove void   ) 
 

This particle will be removed in run(int) after this function has been called.

void coloring1 const L_Color color1_t,
L_REAL  begin_at = 0
 

Set coloring effect, the particle changes from current color(at "begin_at") to "color1_t"(at the end).

void coloring2 const L_Color color1_t,
const L_Color color2_t,
L_REAL  begin_at = 0
 

Set coloring effect, the color of particle changes from color1(at "begin_at") to "color2"(at the end).

void coloring3 const L_Color color1_t,
const L_Color color2_t,
unsigned int  switch_time_t,
L_REAL  begin_at = 0
 

Set coloring effect, the particle keeps switching colors with duration of "switch_time_t"(in milisecs).

void sizing1 L_REAL  size_r,
L_REAL  begin_at = 0
 

Set sizing effect, the particle changes from current size(at "begin_at") to "size_r"(at the end).

void sizing2 L_REAL  size_r1,
L_REAL  size_r2,
L_REAL  begin_at = 0
 

Set sizing effect, the size of particle changes from "size_r1"(at "begin_at") to "size_r2"(at the end).

void sizing3 L_REAL  size_r,
L_REAL  begin_at = 0
 

Set sizing effect, the size of particle changes in amount of "size_r" value every millisec.

void rotating1 L_REAL  radian_t,
L_REAL  begin_at = 0
 

Set rotating effect, the particle rotates in amount of "radian_t" every millisec.

void rotating2 L_REAL  radian_t,
L_REAL  begin_at = 0
 

Set rotating effect, the particle rotates in total amount of "radian_t" in its life.

void rotating3 L_REAL  begin_at = 0  ) 
 

Set rotating effect, the particle rotates randomly.

void rotating4 L_REAL  begin_at = 0  ) 
 

Set rotating effect, the particle always face to the direction of its velocity.

void disable_coloring void   ) 
 

Disable coloring effect.

void disable_sizing void   ) 
 

Disable sizing effect.

void disable_rotating void   ) 
 

Disable rotating effect.

void run int  time_elapesed_t  ) 
 

Pass the frame time for this function to activate the particle.

void draw int  x_shift = 0,
int  y_shift = 0
 

Draw the particle with screen position shift option.



logo LinearParticle Documentation © 2006-2007 by Wong Chin Foo.
Generated on 8 Jun 2007 by doxygen 1.4.6-NO