Particle class

This is a very simple particle class. The technique is not hard to understand but still powerfull. A particle will be created using a BitmapData object. You have to use a greyscale image for the texture because after creating the particle you are able to assign a color. This class is used in the BitmapFire and BitmapParticles experiments.

Simple example:
[as]import de.je2050.effect.Particle;

var particle: Particle = new Particle(this.createEmptyMovieClip(‘__p’, 1), BitmapData.loadBitmap(‘texture’));
particle.setColor(1 , 0, 1);
particle.timeline._x = particle.timeline._y = 200;[/as]

One Comment

  1. luluberlututu
    Posted Aug 23, 2007 at 10:58 am | Permalink

    Hello,

    I have download your example “BitmapParticule”.
    Very good job !

    But if I import the file Main.as, I have this message of error :

    TypeError: Error #1007: Tentative d’instanciation sur un élément non constructeur.
    at Main$iinit()

    You already have meet this problem ?
    Thanks
    Ludo

One Trackback

  1. [...] h, experiments — joa @ 3:50 am

    This example shows what can be done using the Particle class. I am also making use of the new garbage collection here. 100 particles will be created when the movie [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*