net.nexttext.renderer
Class VelocityRenderer

java.lang.Object
  extended by net.nexttext.renderer.TextPageRenderer
      extended by net.nexttext.renderer.VelocityRenderer

public class VelocityRenderer
extends TextPageRenderer

Traverses the TextObject hierarchy and draws every object's velocity as a line starting from the object's position. This callback is useful to debug behaviours that make use of the Velocity property.


Constructor Summary
VelocityRenderer(processing.core.PApplet p, int color, int scale)
          Builds a VelocityRenderer.
VelocityRenderer(processing.core.PApplet p, int r, int g, int b, int scale)
          Builds a VelocityRenderer.
 
Method Summary
 void renderPage(TextPage textPage)
          Traverses the TextObject hierarchy and renders a velocity vector for any TextObject having a Velocity property.
 
Methods inherited from class net.nexttext.renderer.TextPageRenderer
getPApplet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityRenderer

public VelocityRenderer(processing.core.PApplet p,
                        int color,
                        int scale)
Builds a VelocityRenderer.

Parameters:
p - the parent PApplet
color - the color that will be used to render the vector
scale - a scalar that will be used to make the vector proportionally larger. This is useful since (x,y) values for velocity are often in the range 0~5.

VelocityRenderer

public VelocityRenderer(processing.core.PApplet p,
                        int r,
                        int g,
                        int b,
                        int scale)
Builds a VelocityRenderer.

Parameters:
p - the parent PApplet
r - the red value of the color that will be used to render the vector
g - the green value of the color that will be used to render the vector
b - the blue value of the color that will be used to render the vector
scale - a scalar that will be used to make the vector proportionally larger. This is useful since (x,y) values for velocity are often in the range 0~5.
Method Detail

renderPage

public void renderPage(TextPage textPage)
Traverses the TextObject hierarchy and renders a velocity vector for any TextObject having a Velocity property.

Specified by:
renderPage in class TextPageRenderer
Parameters:
textPage - the TextPage to render