public class TextComponent extends AbstractGuiComponent implements ColoredComponent
Constructor and Description |
---|
TextComponent(java.lang.String text,
com.jme3.font.BitmapFont font) |
Modifier and Type | Method and Description |
---|---|
void |
attach(GuiControl parent) |
void |
calculatePreferredSize(com.jme3.math.Vector3f size) |
TextComponent |
clone() |
TextComponent |
color(com.jme3.math.ColorRGBA color) |
void |
detach(GuiControl parent) |
float |
getAlpha()
Returns the current alpha multiplier that is applied
to the color when set to the actual visuals.
|
com.jme3.math.ColorRGBA |
getColor()
Returns the current color of this component.
|
com.jme3.font.BitmapFont |
getFont() |
float |
getFontSize() |
HAlignment |
getHAlignment() |
int |
getLayer() |
float |
getMaxWidth() |
com.jme3.math.Vector3f |
getOffset() |
java.lang.String |
getText() |
float |
getTextSize() |
VAlignment |
getVAlignment() |
TextComponent |
offset(float x,
float y,
float z) |
protected void |
resetAlignment() |
protected void |
resetLayer() |
void |
reshape(com.jme3.math.Vector3f pos,
com.jme3.math.Vector3f size) |
void |
setAlpha(float f)
Sets an alpha multiplier that will be applied to the
color when set to the actual visuals.
|
void |
setColor(com.jme3.math.ColorRGBA color)
Sets the color for this component.
|
void |
setFont(com.jme3.font.BitmapFont font) |
void |
setFontSize(float size) |
void |
setHAlignment(HAlignment a) |
void |
setLayer(int layer) |
void |
setMaxWidth(float f)
For values greater than 0, this will constrain the maximum
width of the text box.
|
void |
setOffset(float x,
float y,
float z) |
void |
setOffset(com.jme3.math.Vector3f offset) |
void |
setText(java.lang.String text) |
void |
setTextSize(float f) |
void |
setVAlignment(VAlignment a) |
getGuiControl, getNode, invalidate, isAttached
public TextComponent(java.lang.String text, com.jme3.font.BitmapFont font)
public TextComponent clone()
clone
in interface GuiComponent
clone
in class AbstractGuiComponent
public void attach(GuiControl parent)
attach
in interface GuiComponent
attach
in class AbstractGuiComponent
public void detach(GuiControl parent)
detach
in interface GuiComponent
detach
in class AbstractGuiComponent
public void setText(java.lang.String text)
public java.lang.String getText()
public void setLayer(int layer)
public int getLayer()
public void setHAlignment(HAlignment a)
public HAlignment getHAlignment()
public void setVAlignment(VAlignment a)
public VAlignment getVAlignment()
public void setMaxWidth(float f)
public float getMaxWidth()
public void setFont(com.jme3.font.BitmapFont font)
public com.jme3.font.BitmapFont getFont()
public void setFontSize(float size)
public float getFontSize()
public void setColor(com.jme3.math.ColorRGBA color)
ColoredComponent
setColor
in interface ColoredComponent
public com.jme3.math.ColorRGBA getColor()
ColoredComponent
getColor
in interface ColoredComponent
public void setAlpha(float f)
ColoredComponent
setAlpha
in interface ColoredComponent
public float getAlpha()
ColoredComponent
getAlpha
in interface ColoredComponent
public TextComponent color(com.jme3.math.ColorRGBA color)
public TextComponent offset(float x, float y, float z)
public void setOffset(float x, float y, float z)
public void setOffset(com.jme3.math.Vector3f offset)
public com.jme3.math.Vector3f getOffset()
public void setTextSize(float f)
public float getTextSize()
public void reshape(com.jme3.math.Vector3f pos, com.jme3.math.Vector3f size)
reshape
in interface GuiComponent
public void calculatePreferredSize(com.jme3.math.Vector3f size)
calculatePreferredSize
in interface GuiComponent
protected void resetAlignment()
protected void resetLayer()