IFLabel
The IFLabel
object creates a new text label.
Method Summary
IFLabel(String label, int x, int y);
IFLabel(String label, int x, int y, int textSize);;
label
, the text displayed on the label.x
, the X position of the label's upper left hand corner.y
, the Y position of the label's upper left hand corner.textSize
, the font size for the label text.
setLabel(String newLabel)
- Sets the label text.
newLabel
, the new label text.
getLabel()
- Returns the button's name as a String.
setWidth(int width)
- Sets the width of the button.
width
, the new width for the button.
getWidth()
- Returns the width in pixels of the button in integer form.
setHeight(int height)
- Sets the height of the button.
height
, the new height for the button.
getHeight()
- Returns the height in pixels of the button in integer form.
setSize(int width, int height)
- A convenience method to set both dimensions of the button.
width
, the new width for the button.height
, the new height for the button.
setX(int x)
- Sets the X position of the button relative to its GUIController.
x
, the new X position for the button.
getX()
- Returns the X position in pixels of the button relative to its GUIController.
setY(int y)
- Sets the Y position of the button relative to its GUIController.
y
, the new Y position for the button.
getY()
- Returns the Y position in pixels of the button relative to its GUIController.
setPosition(int x, int y)
- A convenience method to set both the X and Y position of the button.
X
, the new X position for the button.Y
, the new Y position for the button.
Example
import interfascia.*;
GUIController c;
IFLabel l;
void setup() {
c = new GUIController (this);
l = new IFLabel ("Descriptive Text", 30, 30);
c.add (l);
}
void draw() {
}