de.ilu.movingletters
Class MovingLetters

java.lang.Object
  extended by de.ilu.movingletters.MovingLetters

public class MovingLetters
extends java.lang.Object

a typeset for moving letters with given size and agility.

Version:
20071119
Author:
iluvatar

Field Summary
private  int mAgility
          agility of the letters
private  Letter[] mFont
          letter definition
private  int mHeight
          height for the letters
private  int mJitter
          number of pixels to randomly move the letters
private  int mJitterHalf
          number of pixels to randomly move the letters-helper value
private  Letter[] mLetters
          list of letters indexable by character-values 0-255
private  int[] mPointLocX
          list of pixel x-coordinates of the letter coordinates, all relative to letter coordinate 1
private  int[] mPointLocY
          list of pixel y-coordinates of the letter coordinates, all relative to letter coordinate 1
private  processing.core.PApplet mRuntime
          reference to the processing runtime
private static int NUM_LETTER_COORDINATES
          number of letter coordinates
 
Constructor Summary
MovingLetters(processing.core.PApplet pRuntime, int pHeight)
          create moving letters with given height and an agility of 1.
MovingLetters(processing.core.PApplet pRuntime, int pHeight, int pAgility)
          create moving letters with given height and and agility.
MovingLetters(processing.core.PApplet pRuntime, int pHeight, int pAgility, int pJitter)
          create moving letters with given height and and agility.
 
Method Summary
private  void calcPointLoc(int pMovement)
          (re)calculate pixel coordinates for letter coordinates relative to letter coordinate 1.
(package private)  processing.core.PApplet getRuntime()
          get processing runtime.
(package private)  int getX(int pPos)
          get a pixel x-coordinate for a letter coordinate.
(package private)  int getY(int pPos)
          get a pixel y-coordinate for a letter coordinate.
 void text(java.lang.String pData, int pX, int pY)
          draw text at given coordinate.
 void text(java.lang.String pData, int pX, int pY, int pDotSize)
          draw text at given coordinate.
 void text(java.lang.String pData, int pX, int pY, int pDotSize, int pLineWidth)
          draw text at given coordinate.
 void text(java.lang.String pData, int pX, int pY, int pDotSize, int pLineWidth, int[] pColors)
          draw text at given coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_LETTER_COORDINATES

private static final int NUM_LETTER_COORDINATES
number of letter coordinates

See Also:
Constant Field Values

mFont

private Letter[] mFont
letter definition


mRuntime

private processing.core.PApplet mRuntime
reference to the processing runtime


mLetters

private Letter[] mLetters
list of letters indexable by character-values 0-255


mPointLocX

private int[] mPointLocX
list of pixel x-coordinates of the letter coordinates, all relative to letter coordinate 1


mPointLocY

private int[] mPointLocY
list of pixel y-coordinates of the letter coordinates, all relative to letter coordinate 1


mAgility

private int mAgility
agility of the letters


mHeight

private int mHeight
height for the letters


mJitter

private int mJitter
number of pixels to randomly move the letters


mJitterHalf

private int mJitterHalf
number of pixels to randomly move the letters-helper value

Constructor Detail

MovingLetters

public MovingLetters(processing.core.PApplet pRuntime,
                     int pHeight)
create moving letters with given height and an agility of 1.

Parameters:
pRuntime - the reference to the processing runtime.
pHeight - wanted height of the letters.

MovingLetters

public MovingLetters(processing.core.PApplet pRuntime,
                     int pHeight,
                     int pAgility)
create moving letters with given height and and agility.

Parameters:
pAgility - indicates for how many frames the pixel coordinates of the letter coordinates should kept unchanged.
pRuntime - the reference to the processing runtime.
pHeight - wanted height of the letters.

MovingLetters

public MovingLetters(processing.core.PApplet pRuntime,
                     int pHeight,
                     int pAgility,
                     int pJitter)
create moving letters with given height and and agility.

Parameters:
pAgility - indicates for how many frames the pixel coordinates of the letter coordinates should kept unchanged.
pRuntime - the reference to the processing runtime.
pHeight - wanted height of the letters.
pJitter - number of pixels to randomly move the edges of the letters. This must be divideable by 2!
Method Detail

text

public void text(java.lang.String pData,
                 int pX,
                 int pY)
draw text at given coordinate. Use no dots and line width is 1.

Parameters:
pData - text string.
pX - x-xoordinate for upper left corner of first letter.
pY - y-xoordinate for upper left corner of first letter.

text

public void text(java.lang.String pData,
                 int pX,
                 int pY,
                 int pDotSize)
draw text at given coordinate. Line width is 1.

Parameters:
pData - text string.
pX - x-xoordinate for upper left corner of first letter.
pY - y-xoordinate for upper left corner of first letter.
pDotSize - size of dots to draw at start/end of lines. 0 for no dots.

text

public void text(java.lang.String pData,
                 int pX,
                 int pY,
                 int pDotSize,
                 int pLineWidth)
draw text at given coordinate.

Parameters:
pData - text string.
pX - x-xoordinate for upper left corner of first letter.
pY - y-xoordinate for upper left corner of first letter.
pDotSize - size of dots to draw at start/end of lines. 0 for no dots.
pLineWidth - width of the lines for the text.

text

public void text(java.lang.String pData,
                 int pX,
                 int pY,
                 int pDotSize,
                 int pLineWidth,
                 int[] pColors)
draw text at given coordinate.

Parameters:
pData - text string.
pX - x-xoordinate for upper left corner of first letter.
pY - y-xoordinate for upper left corner of first letter.
pDotSize - size of dots to draw at start/end of lines. 0 for no dots.
pLineWidth - width of the lines for the text.
pColors - an array of colors which can be used by the #color; syntax.

getX

int getX(int pPos)
get a pixel x-coordinate for a letter coordinate.

Parameters:
pPos - letter coordinate.
Returns:
pixel coordinate.

getY

int getY(int pPos)
get a pixel y-coordinate for a letter coordinate.

Parameters:
pPos - letter coordinate.
Returns:
pixel coordinate.

calcPointLoc

private void calcPointLoc(int pMovement)
(re)calculate pixel coordinates for letter coordinates relative to letter coordinate 1.

Parameters:
pMovement -

getRuntime

processing.core.PApplet getRuntime()
get processing runtime.

Returns:
processing runtime.