|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectcontrolP5.Label
public class Label
Label description tbd.
/** * 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 | |
---|---|
ControllerStyle |
_myControllerStyle
|
static BitFontRenderer |
bitFontRenderer
|
boolean |
isToUpperCase
|
static int |
LABEL_WIDTH_OFFSET
|
CVector3f |
position
|
Constructor Summary | |
---|---|
Label(processing.core.PApplet theApplet,
java.lang.String theText,
int theWidth,
int theHeight)
|
|
Label(processing.core.PApplet theApplet,
java.lang.String theText,
int theWidth,
int theHeight,
int theColor)
|
Method Summary | |
---|---|
Label |
adjust()
work around, fix the issue with cutting off a label when setting a new font for a label. |
int |
color()
Deprecated. |
void |
disableColorBackground()
|
void |
draw(processing.core.PApplet theApplet)
draw a textlabel. |
void |
draw(processing.core.PApplet theApplet,
int theX,
int theY)
draw a textlabel at a given location xy. |
void |
enableColorBackground()
|
void |
fixedSize(boolean theFixedSize)
Deprecated. |
int |
getColor()
|
ControlFont |
getControlFont()
|
int |
getFont()
returns the index of the current bitFont. |
int |
getLineHeight()
|
java.lang.String |
getText()
|
int |
height()
|
int |
lineHeight()
Deprecated. |
void |
multiline(boolean theFlag)
|
int |
offset()
|
void |
set(java.lang.String theText)
set the text of the label. |
void |
set(java.lang.String theText,
boolean isFixedSize)
|
void |
set(java.lang.String theText,
int theColor)
|
void |
set(java.lang.String theText,
int theColor,
boolean isFixedSize)
|
void |
setColor(int theColor)
|
void |
setColor(int theColor,
boolean theFixedSizeFlag)
|
void |
setColorBackground(int theColor)
|
ControlFont |
setControlFont(ControlFont theControlFont)
|
void |
setControlFontSize(int theSize)
|
void |
setFixedSize(boolean theFixedSize)
|
Label |
setFont(int theFont)
a textlabel is an image containing text rendered from a bitfont source image. |
void |
setHeight(int theValue)
|
void |
setOffset(float theValue)
|
void |
setVisible(boolean theValue)
|
void |
setWidth(int theValue)
|
void |
setWithCursorPosition(java.lang.String theText,
int theCursorPosition)
|
void |
setWithCursorPosition(java.lang.String theText,
int theCursorPosition,
int theOffsetX)
|
ControllerStyle |
style()
|
int |
textHeight()
|
java.lang.String |
toString()
|
void |
toUpperCase(boolean theFlag)
set the text of the label to upperCase. |
int |
width()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean isToUpperCase
public static BitFontRenderer bitFontRenderer
public CVector3f position
public static int LABEL_WIDTH_OFFSET
public ControllerStyle _myControllerStyle
Constructor Detail |
---|
public Label(processing.core.PApplet theApplet, java.lang.String theText, int theWidth, int theHeight, int theColor)
theApplet
- theText
- theWidth
- theHeight
- theColor
- public Label(processing.core.PApplet theApplet, java.lang.String theText, int theWidth, int theHeight)
Method Detail |
---|
public void toUpperCase(boolean theFlag)
theFlag
- booleanpublic void draw(processing.core.PApplet theApplet, int theX, int theY)
theApplet
- PApplettheX
- inttheY
- intpublic void draw(processing.core.PApplet theApplet)
draw
in interface CDrawable
theApplet
- PAppletpublic void set(java.lang.String theText)
theText
- public void set(java.lang.String theText, int theColor)
public void set(java.lang.String theText, boolean isFixedSize)
public void set(java.lang.String theText, int theColor, boolean isFixedSize)
public void setWithCursorPosition(java.lang.String theText, int theCursorPosition)
public void setWithCursorPosition(java.lang.String theText, int theCursorPosition, int theOffsetX)
public Label setFont(int theFont)
theFont
- intpublic int getFont()
public ControlFont setControlFont(ControlFont theControlFont)
public ControlFont getControlFont()
public void setControlFontSize(int theSize)
public Label adjust()
public void multiline(boolean theFlag)
public void setOffset(float theValue)
public int offset()
public int lineHeight()
public int getLineHeight()
public int textHeight()
public void fixedSize(boolean theFixedSize)
theFixedSize
- public void setFixedSize(boolean theFixedSize)
public int color()
public int getColor()
public void setColor(int theColor)
public void setColor(int theColor, boolean theFixedSizeFlag)
public void setColorBackground(int theColor)
public void disableColorBackground()
public void enableColorBackground()
public int width()
public int height()
public void setWidth(int theValue)
public void setHeight(int theValue)
public void setVisible(boolean theValue)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getText()
public ControllerStyle style()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |