controlP5
Class Textlabel

java.lang.Object
  extended by controlP5.Controller
      extended by controlP5.Textlabel
All Implemented Interfaces:
CDrawable, ControllerInterface, ControlP5Constants

public class Textlabel
extends Controller

a textlabel is an image containing text rendered from a bitfont source image. available bit fonts are: standard56, standard58, synt24, grixel. the font of a textlabel can be changed by using setFont(int theFontIndex) theFontIndex is of type int and available indexes are stored in the constants ControlP5.standard56, ControlP5.standard58, ControlP5.synt24, ControlP5.grixel available characters for each pixelfont range from ascii code 32-126 http://www.asciitable.com/

+Example
/**
 * ControlP5 TextLabel
 * by andreas schlegel, 2009
 */

import controlP5.*;

ControlP5 controlP5;

Textlabel myTextlabelA;
Textlabel myTextlabelB;

void setup() {
  size(400,400);
  frameRate(30);
  controlP5 = new ControlP5(this);
  controlP5.setControlFont(new ControlFont(createFont("Georgia",20), 20));

  myTextlabelA = controlP5.addTextlabel("label","A SINGLE TESTLABEL.",20,134);
  myTextlabelA.setColorValue(0xffcccccc);

  myTextlabelB = new Textlabel(this,"a single textlabel big stuff.",20,20,400,200);
}



void draw() {
  background(0);
  myTextlabelB.draw(this); 
}


Field Summary
 
Fields inherited from interface controlP5.ControlP5Constants
acceptClassList, ACTIVE, ALT, ARC, ARRAY, BACKSPACE, BOOLEAN, BOTTOM, CENTER, CONTROL, controlEventClass, CUSTOM, DECREASE, DEFAULT, DELETE, DOWN, ELLIPSE, ENTER, ESCAPE, EVENT, eventMethod, FIELD, FLOAT, HALF_PI, HIDE, HIGHLIGHT, HORIZONTAL, IMAGE, INCREASE, INTEGER, INVALID, KEYCONTROL, LEFT, LINE, LOAD, MENU, METHOD, MOVE, OVER, PI, PRESSED, PRINT, RELEASE, RESET, RIGHT, SAVE, SHIFT, SPRITE, STRING, SWITCH, SWITCH_BACK, SWITCH_FORE, TAB, TOP, TWO_PI, UP, VERBOSE, VERTICAL
 
Constructor Summary
Textlabel(processing.core.PApplet theComponent, java.lang.String theValue, int theX, int theY)
          ..
Textlabel(processing.core.PApplet theComponent, java.lang.String theValue, int theX, int theY, int theW, int theH)
           
Textlabel(processing.core.PApplet theComponent, java.lang.String theValue, int theX, int theY, int theW, int theH, int theColor, int theFont)
          ..
 
Method Summary
 void addToXMLElement(ControlP5XMLElement theElement)
           
 void draw(processing.core.PApplet theApplet)
          draw the textlabel.
 ControlFont setControlFont(ControlFont theControlFont)
           
 void setFont(int theFont)
          a textlabel is an image containing text rendered from a bitfont source image.
 Controller setHeight(int theValue)
           
 Textlabel setLetterSpacing(int theValue)
          set the letter spacing of the font.
 void setPosition(float theX, float theY)
          set the position of the textlabel.
 void setValue(float theValue)
          set the value of the controller.
 Textlabel setValue(java.lang.String theText)
          set the text of the textlabel.
 Controller setWidth(int theValue)
           
 void update()
          updates the value of the controller without having to set the value explicitly.
 Label valueLabel()
          returns the caption label of the controller.
 
Methods inherited from class controlP5.Controller
absolutePosition, add, addListener, arrayValue, behavior, captionLabel, changeValue, color, continuousUpdateEvents, controlWindow, defaultValue, disableSprite, enableSprite, getAsXML, getColor, getHeight, getPickingColor, getSprite, getTab, getWidth, getWindow, hide, id, init, isBroadcast, isInside, isLock, isMousePressed, isMoveable, isUpdate, isUserInteraction, isVisible, isXMLsavable, keyEvent, label, linebreak, listenerSize, lock, max, min, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, name, parent, plugTo, plugTo, position, remove, remove, removeBehavior, removeListener, setArrayValue, setBehavior, setBroadcast, setCaptionLabel, setColor, setColorActive, setColorBackground, setColorCaptionLabel, setColorForeground, setColorLabel, setColorValue, setColorValueLabel, setDecimalPrecision, setDefaultValue, setDisplay, setDisplay, setGroup, setGroup, setId, setImage, setImage, setImages, setImages, setLabel, setLabelVisible, setLock, setMax, setMin, setMousePressed, setMoveable, setParent, setSize, setSize, setSprite, setTab, setTab, setUpdate, setUserInteraction, setValueLabel, setVisible, setWindow, setWindow, show, stringValue, toString, trigger, unlock, unplugFrom, unplugFrom, updateAbsolutePosition, updateEvents, updateInternalEvents, updateSize, value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Textlabel

public Textlabel(processing.core.PApplet theComponent,
                 java.lang.String theValue,
                 int theX,
                 int theY,
                 int theW,
                 int theH,
                 int theColor,
                 int theFont)
..

Parameters:
theComponent - PApplet
theValue - String
theX - int
theY - int
theW - int
theH - int
theColor - int
theFont - int

Textlabel

public Textlabel(processing.core.PApplet theComponent,
                 java.lang.String theValue,
                 int theX,
                 int theY)
..

Parameters:
theComponent - PApplet
theValue - String
theX - int
theY - int

Textlabel

public Textlabel(processing.core.PApplet theComponent,
                 java.lang.String theValue,
                 int theX,
                 int theY,
                 int theW,
                 int theH)
Parameters:
theComponent -
theValue -
theX -
theY -
theW -
theH -
Method Detail

setWidth

public Controller setWidth(int theValue)
Overrides:
setWidth in class Controller

setHeight

public Controller setHeight(int theValue)
Overrides:
setHeight in class Controller

draw

public void draw(processing.core.PApplet theApplet)
draw the textlabel.

Specified by:
draw in interface CDrawable
Specified by:
draw in interface ControllerInterface
Overrides:
draw in class Controller
Parameters:
theApplet - PApplet
See Also:
ControllerDisplay

setValue

public void setValue(float theValue)
Description copied from class: Controller
set the value of the controller.

Specified by:
setValue in class Controller
Parameters:
theValue - float

update

public void update()
Description copied from class: Controller
updates the value of the controller without having to set the value explicitly. update does not visually update the controller. the updating status can be set with setUpdate(true/false) and checked with isUpdate(). setUpdate ( )

Specified by:
update in interface ControllerInterface
Overrides:
update in class Controller

setValue

public Textlabel setValue(java.lang.String theText)
set the text of the textlabel.

Parameters:
theText - String

setPosition

public void setPosition(float theX,
                        float theY)
set the position of the textlabel.

Specified by:
setPosition in interface ControllerInterface
Overrides:
setPosition in class Controller
Parameters:
theX - float
theY - float

setLetterSpacing

public Textlabel setLetterSpacing(int theValue)
set the letter spacing of the font.

Parameters:
theValue - int
Returns:
Textlabel

setFont

public void setFont(int theFont)
a textlabel is an image containing text rendered from a bitfont source image. available bit fonts are: standard56, standard58, synt24, grixel. the font of a textlabel can be changed by using setFont(int theFontIndex) theFontIndex is of type int and available indexes are stored in the constants ControlP5.standard56, ControlP5.standard58, ControlP5.synt24, ControlP5.grixel available characters for each pixelfont range from ascii code 32-126

Parameters:
theFont - int

setControlFont

public ControlFont setControlFont(ControlFont theControlFont)

valueLabel

public Label valueLabel()
Description copied from class: Controller
returns the caption label of the controller.

Overrides:
valueLabel in class Controller
Returns:
See Also:
Label

addToXMLElement

public void addToXMLElement(ControlP5XMLElement theElement)
Parameters:
theElement - ControlP5XMLElement


processing library controlP5 by Andreas Schlegel. (c) 2010