Class cocos.particle.ParticleSystem

         object --+    
                  |    
cocosnode.CocosNode --+
                      |
                     ParticleSystem

Methods

  __init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  on_enter(self)
Called every time just before the node enters the stage.
  draw(self)
This is the function you will have to override if you want your subclassed to draw something on screen.
  step(self, delta)
  add_particle(self)
  stop_system(self)
  reset_system(self)
  update_particles(self, delta)
  init_particle(self)
Inherited from cocosnode.CocosNode: __contains__, add, are_actions_running, do, get, get_ancestor, get_children, on_exit, pause, pause_scheduler, remove, remove_action, resume, resume_scheduler, schedule, schedule_interval, stop, transform, unschedule, visit, walk Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

  emit_counter
How many particles can be emitted per second
  particle_count
Count of particles
Inherited from cocosnode.CocosNode: actions, camera, children, children_anchor_x, children_anchor_y, children_names, grid, is_running, rotation, scale, scheduled_calls, scheduled_interval_calls, skip_frame, to_remove, transform_anchor_x, transform_anchor_y, visible, x, y

Class Variables

  active = True
is the particle system active ?
  duration = 0
duration in seconds of the system.
  elapsed = 0
time elapsed since the start of the system (in seconds)
  gravity = Point2(0.0, 0.0)
Gravity of the particles
  pos_var = Point2(0.0, 0.0)
position is from "superclass" CocosNode Position variance
  angle = 0.0
The angle (direction) of the particles measured in degrees
  angle_var = 0.0
Angle variance measured in degrees;
  speed = 0.0
The speed the particles will have.
  speed_var = 0.0
The speed variance
  tangential_accel = 0.0
Tangential acceleration
  tangential_accel_var = 0.0
Tangential acceleration variance
  radial_accel = 0.0
Radial acceleration
  radial_accel_var = 0.0
Radial acceleration variance
  size = 0.0
Size of the particles
  size_var = 0.0
Size variance
  life = 0
How many seconds will the particle live
  life_var = 0
Life variance
  start_color = Color(0.0, 0.0, 0.0, 0.0)
Start color of the particles
  start_color_var = Color(0.0, 0.0, 0.0, 0.0)
Start color variance
  end_color = Color(0.0, 0.0, 0.0, 0.0)
End color of the particles
  end_color_var = Color(0.0, 0.0, 0.0, 0.0)
End color variance
  total_particles = 0
Maximum particles
  texture = pyglet.resource.image('fire.png').texture
texture of the particles
  blend_additive = False
blend additive
  color_modulate = True
color modulate
Inherited from cocosnode.CocosNode: anchor, anchor_x, anchor_y, children_anchor, parent, position, transform_anchor

Method Details

__init__

(Constructor) __init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides:
cocosnode.CocosNode.__init__

on_enter

on_enter(self)
Called every time just before the node enters the stage.
Overrides:
cocosnode.CocosNode.on_enter

draw

draw(self)

This is the function you will have to override if you want your subclassed to draw something on screen.

You must respect the position, scale, rotation and anchor attributes. If you want OpenGL to do the scaling for you, you can:

def draw(self):
    glPushMatrix()
    self.transform()
    # ... draw ..
    glPopMatrix()
Overrides:
cocosnode.CocosNode.draw

Class Variable Details

duration

duration in seconds of the system. -1 is infinity
Value:
0