The BitmapParticleMaterial
class lets you use a bitmap as particle material. The bitmap can be created in two ways:
The next two sections will show an example for each of them. Let's start with a drawn bitmap.
Again we will use the ParticleTemplate
class as our starting point. In this example named BitmapParticleMaterialShapeExample
, we need to import the BitmapParticleMaterial
class.
import org.papervision3d.materials.special.BitmapParticleMaterial;
Add the following code at the top of the init()
method to instantiate the Particles
class and add it to the scene:
var particles:Particles = new Particles(); scene.addChild(particles);
Add the following inside the for
loop:
var triangle:Shape = new Shape(); triangle.graphics.beginFill(Math.random() * 0xFFFFFF); triangle.graphics.moveTo(0,0); triangle.graphics.lineTo(20,20); triangle.graphics.lineTo(40,0); var bitmapData:BitmapData...