Textlabel

description
a textlabel is a one-line-text for labeling things or leaving notes.
+Example
import controlP5.*;

ControlP5 controlP5;

Textlabel myBigTextlabel;
Textlabel mySmallTextlabel;
boolean isDrawLabel = true;

void setup() {
  size(400,400);
  frameRate(30);
  controlP5 = new ControlP5(this);

  mySmallTextlabel = controlP5.addTextlabel("label","A SINGLE TESTLABEL.",20,134);
  mySmallTextlabel.setColorValue(0xffcccccc);
  
  myBigTextlabel = new Textlabel(this,"a single textlabel.",20,20,400,200,0xff999999,ControlP5.synt24);
  myBigTextlabel.setLetterSpacing(2);
  myBigTextlabel.setWidth(width);
}



void draw() {
  background(0);
  if(keyPressed && key==' ') {
    // change the display area of a textlabel.
    myBigTextlabel.setWidth(mouseX);
    myBigTextlabel.setHeight(mouseY);
  }
  if(isDrawLabel) {
    myBigTextlabel.draw(this); 
  }
}


void keyPressed() {
  if(key=='t') {
    if(isDrawLabel) {
      println("adding myBigTextlabel to the drawable list of tab 'default'.\n"+
      "myBigTextlabel.draw(this); in draw() is not required anymore.");
      controlP5.tab("default").addDrawable(myBigTextlabel);
      isDrawLabel = false;
    }
  }
}

constructors
Textlabel(theComponent, theValue, theX, theY, theW, theH, theColor, theFont);
Textlabel(theComponent, theValue, theX, theY);
parameters
theComponentPApplet 
theValueString 
theXint 
theYint 
theWint 
theHint 
theColorint 
theFontint 
Methods
draw ( )
draw the textlabel.
setFont ( )
set the Pixel-Fontstyle of the Textlabel. see BitFontRenderer for available pixelfonts.
setLetterSpacing ( )
set the letter spacing of the font.
setPosition ( )
set the position of the textlabel.
setValue ( )
set the text of the textlabel.
usage
Web & Application