Package com.simsilica.lemur.component
Class TextComponent
java.lang.Object
com.simsilica.lemur.component.AbstractGuiComponent
com.simsilica.lemur.component.TextComponent
- All Implemented Interfaces:
ColoredComponent
,Text2d
,GuiComponent
A component that renders a text string with a particular
alignment and offset.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
attach
(GuiControl parent) void
clone()
void
detach
(GuiControl parent) float
getAlpha()
Returns the current alpha multiplier that is applied to the color when set to the actual visuals.getColor()
Returns the current color of this component.getFont()
float
int
getLayer()
float
getText()
float
offset
(float x, float y, float z) protected void
protected void
void
void
setAlpha
(float f) Sets an alpha multiplier that will be applied to the color when set to the actual visuals.void
Sets the color for this component.void
setFont
(BitmapFont font) void
setFontName
(String fontName) void
setFontSize
(float size) void
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
void
void
setTextSize
(float f) void
Methods inherited from class com.simsilica.lemur.component.AbstractGuiComponent
getGuiControl, getNode, invalidate, isAttached
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.simsilica.lemur.core.GuiComponent
getGuiControl, isAttached
-
Constructor Details
-
Method Details
-
clone
- Specified by:
clone
in interfaceGuiComponent
- Overrides:
clone
in classAbstractGuiComponent
-
attach
- Specified by:
attach
in interfaceGuiComponent
- Overrides:
attach
in classAbstractGuiComponent
-
detach
- Specified by:
detach
in interfaceGuiComponent
- Overrides:
detach
in classAbstractGuiComponent
-
setText
-
getText
-
setLayer
public void setLayer(int layer) -
getLayer
public int getLayer() -
setHAlignment
- Specified by:
setHAlignment
in interfaceText2d
-
getHAlignment
- Specified by:
getHAlignment
in interfaceText2d
-
setVAlignment
- Specified by:
setVAlignment
in interfaceText2d
-
getVAlignment
- Specified by:
getVAlignment
in interfaceText2d
-
setMaxWidth
public void setMaxWidth(float f) For values greater than 0, this will constrain the maximum width of the text box. Wrapping text will cause the text box to grow vertically.- Specified by:
setMaxWidth
in interfaceText2d
-
getMaxWidth
public float getMaxWidth()- Specified by:
getMaxWidth
in interfaceText2d
-
setFont
-
getFont
-
setFontName
- Specified by:
setFontName
in interfaceText2d
-
getFontName
- Specified by:
getFontName
in interfaceText2d
-
setFontSize
public void setFontSize(float size) - Specified by:
setFontSize
in interfaceText2d
-
getFontSize
public float getFontSize()- Specified by:
getFontSize
in interfaceText2d
-
setColor
Description copied from interface:ColoredComponent
Sets the color for this component.- Specified by:
setColor
in interfaceColoredComponent
-
getColor
Description copied from interface:ColoredComponent
Returns the current color of this component.- Specified by:
getColor
in interfaceColoredComponent
-
setAlpha
public void setAlpha(float f) Description copied from interface:ColoredComponent
Sets an alpha multiplier that will be applied to the color when set to the actual visuals.- Specified by:
setAlpha
in interfaceColoredComponent
-
getAlpha
public float getAlpha()Description copied from interface:ColoredComponent
Returns the current alpha multiplier that is applied to the color when set to the actual visuals.- Specified by:
getAlpha
in interfaceColoredComponent
-
color
-
offset
-
setOffset
public void setOffset(float x, float y, float z) -
setOffset
-
getOffset
-
setTextSize
public void setTextSize(float f) -
getTextSize
public float getTextSize() -
reshape
- Specified by:
reshape
in interfaceGuiComponent
-
calculatePreferredSize
- Specified by:
calculatePreferredSize
in interfaceGuiComponent
-
resetAlignment
protected void resetAlignment() -
resetLayer
protected void resetLayer()
-