Packagecom.boristhebrave.Box2DWith.Flint
Classpublic class BodyRenderer
InheritanceBodyRenderer Inheritance org.flintparticles.common.renderers.RendererBase

Kinematic controller sets b2Body objects according to the motion of Particles. Particles need to have a body defined by an appropriate initializer, and must be 2D particles.



Public Properties
 PropertyDefined by
  BODY_KEY : * = com.boristhebrave.Box2DWith.Flint::body
[static] Use this key to look up the corresponding body of a particle in its dictionary.
BodyRenderer
  defaultScale : Number = 30
[static] Setting this value saves the effort of specifying the scale parameter in a lot of constructors.
BodyRenderer
  OWNSBODY_KEY : * = com.boristhebrave.Box2DWith.Flint::ownsBody
[static] Use this key to look up the owns body value of a particle in its dictionary.
BodyRenderer
Public Methods
 MethodDefined by
  
BodyRenderer(world:b2World, scale:Number)
Constructs a BodyRenderer.
BodyRenderer
Protected Methods
 MethodDefined by
  
removeParticle(particle:Particle):void
The removeParticle method is called when a particle is removed from one of the emitters that is being rendered by this renderer.
BodyRenderer
  
renderParticles(particles:Array):void
The renderParticles method is called during the render phase of every frame if the state of one of the emitters being rendered by this renderer has changed.
BodyRenderer
Property detail
BODY_KEYproperty
public static var BODY_KEY:* = com.boristhebrave.Box2DWith.Flint::body

Use this key to look up the corresponding body of a particle in its dictionary.

defaultScaleproperty 
public static var defaultScale:Number = 30

Setting this value saves the effort of specifying the scale parameter in a lot of constructors.

OWNSBODY_KEYproperty 
public static var OWNSBODY_KEY:* = com.boristhebrave.Box2DWith.Flint::ownsBody

Use this key to look up the owns body value of a particle in its dictionary. The actual value is a boolean determing if the body should be destroyed when the particle is.

Constructor detail
BodyRenderer()constructor
public function BodyRenderer(world:b2World, scale:Number)

Constructs a BodyRenderer.

Parameters
world:b2World — The world to be "rendered" to.
 
scale:Number — A scaling factor between Flint's pixel co-ordinates and Box2D's units, in pixels/unit.
Method detail
removeParticle()method
protected override function removeParticle(particle:Particle):void

The removeParticle method is called when a particle is removed from one of the emitters that is being rendered by this renderer.

Parameters
particle:Particle — The particle.
renderParticles()method 
protected override function renderParticles(particles:Array):void

The renderParticles method is called during the render phase of every frame if the state of one of the emitters being rendered by this renderer has changed.

Parameters
particles:Array — The particles being managed by all the emitters being rendered by this renderer. The particles are in no particular order.