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 TypeMethodDescriptionvoidattach(GuiControl parent) voidclone()voiddetach(GuiControl parent) floatgetAlpha()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()floatintgetLayer()floatgetText()floatoffset(float x, float y, float z) protected voidprotected voidvoidvoidsetAlpha(float f) Sets an alpha multiplier that will be applied to the color when set to the actual visuals.voidSets the color for this component.voidsetFont(BitmapFont font) voidsetFontName(String fontName) voidsetFontSize(float size) voidvoidsetLayer(int layer) voidsetMaxWidth(float f) For values greater than 0, this will constrain the maximum width of the text box.voidsetOffset(float x, float y, float z) voidvoidvoidsetTextSize(float f) voidMethods inherited from class com.simsilica.lemur.component.AbstractGuiComponent
getGuiControl, getNode, invalidate, isAttachedMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.simsilica.lemur.core.GuiComponent
getGuiControl, isAttached
-
Constructor Details
-
TextComponent
-
-
Method Details
-
clone
- Specified by:
clonein interfaceGuiComponent- Overrides:
clonein classAbstractGuiComponent
-
attach
- Specified by:
attachin interfaceGuiComponent- Overrides:
attachin classAbstractGuiComponent
-
detach
- Specified by:
detachin interfaceGuiComponent- Overrides:
detachin classAbstractGuiComponent
-
setText
-
getText
-
setLayer
public void setLayer(int layer) -
getLayer
public int getLayer() -
setHAlignment
- Specified by:
setHAlignmentin interfaceText2d
-
getHAlignment
- Specified by:
getHAlignmentin interfaceText2d
-
setVAlignment
- Specified by:
setVAlignmentin interfaceText2d
-
getVAlignment
- Specified by:
getVAlignmentin 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:
setMaxWidthin interfaceText2d
-
getMaxWidth
public float getMaxWidth()- Specified by:
getMaxWidthin interfaceText2d
-
setFont
-
getFont
-
setFontName
- Specified by:
setFontNamein interfaceText2d
-
getFontName
- Specified by:
getFontNamein interfaceText2d
-
setFontSize
public void setFontSize(float size) - Specified by:
setFontSizein interfaceText2d
-
getFontSize
public float getFontSize()- Specified by:
getFontSizein interfaceText2d
-
setColor
Description copied from interface:ColoredComponentSets the color for this component.- Specified by:
setColorin interfaceColoredComponent
-
getColor
Description copied from interface:ColoredComponentReturns the current color of this component.- Specified by:
getColorin interfaceColoredComponent
-
setAlpha
public void setAlpha(float f) Description copied from interface:ColoredComponentSets an alpha multiplier that will be applied to the color when set to the actual visuals.- Specified by:
setAlphain interfaceColoredComponent
-
getAlpha
public float getAlpha()Description copied from interface:ColoredComponentReturns the current alpha multiplier that is applied to the color when set to the actual visuals.- Specified by:
getAlphain 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:
reshapein interfaceGuiComponent
-
calculatePreferredSize
- Specified by:
calculatePreferredSizein interfaceGuiComponent
-
resetAlignment
protected void resetAlignment() -
resetLayer
protected void resetLayer()
-