6. What an emitter do:
1.emit particles.
2.controls how to emit particles.
(birthrate, velocity, direction..etc).
3.holds a zone to generate particles.
(can be a point, textfield or any bitmapdata using
alpha mask..etc)
10. Particle is What is a particle?
1.What you just see(the little blocks).
2.Basic units of a particle system.
3.Usually in (really) large number.
4.Does not necessarily be small.
27. We need one major loop to
• Generate and dispose particles.
• Interacting with mouse position(if
needed).
• Update particles’ attributes(position,
rotation, alpha..etc.).
We can put it in Emitter class
28. ENTER_FRAME
particle = new Particle() n times
n = number per frame
= birthrate / framerate
setInitialAttribute(particle);
foreach particle in particlesArray
particle.update();
37. Value Object ItemRenderer
• Velocity • Position
• Lifetime • Transparency
• Age • Color
• Position • Shape
• Mass • Size
• Update()
38. Value Object BitmapCanvas
ItemRenderer
• Velocity • Position
• Lifetime • Transparency
• Age • Color
• Position • Shape
• Mass • Size
• Update()
39. Value Object BitmapCanvas
ItemRenderer
• Velocity
• Lifetime
• Age
• Transparency
• Color
• Shape
• Position
• Mass
• Update()
40. bitmapdata.lock()
point foreach particle in particleArray
bitmapdata.setpixel32()
bitmapdata.unlock();
bitmap Bitmapdata.copyPixels()
(No rotation and scale)
sprite bitmapdata.draw(source,
matrix, colorTransform
)
41. • More memory usage
(compared to cacheAsBitmap=false)
• Drastic performance boost
Because we manually overrode the process of native displaying,
bypassed the native rasterize engine