Package com.avrix.ui.widgets
Class LabelWidget
java.lang.Object
com.avrix.ui.widgets.Widget
com.avrix.ui.widgets.LabelWidget
A
Widget for displaying text labels with customizable font and color.-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionLabelWidget(String text, String fontName, int x, int y, int width, int fontSize, NanoColor textColor) Constructs a newLabelWidgetwith the specified text, font, position, size, and color. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringGets the name of the font used by theWidget.intGets the font size of the text.final StringgetText()Gets the text displayed by the widget.final NanoColorGets the color of the text.voidrender()Renders theWidgetfinal voidsetFontName(String fontName) Sets the name of the font to be used by theWidget.voidsetFontSize(int fontSize) Sets the font size of the text.final voidSets the text to be displayed by theWidget.final voidsetTextColor(NanoColor textColor) Sets the color of the text.voidupdate()Updates theWidgetMethods inherited from class com.avrix.ui.widgets.Widget
addChild, addToScreen, bringToTop, drawArc, drawArc, drawCircle, drawEllipse, drawImage, drawLine, drawRect, drawRectOutline, drawRoundedRect, drawRoundedRectOutline, drawText, getAbsoluteParent, getChildren, getHeight, getMaxScrollX, getMaxScrollY, getParent, getScrollSpeed, getScrollX, getScrollY, getWidth, getX, getXA, getY, getYA, intersectScissor, isAlwaysOnTop, isHovered, isPointOver, isScrollable, isScrollLock, isVisible, isVisibleWithinParent, isVisibleWithinWindow, onInitialize, onKeyPress, onKeyRelease, onKeyRepeat, onLeftMouseDown, onLeftMouseDownOutside, onLeftMouseUp, onLeftMouseUpOutside, onMouseEnter, onMouseExit, onMouseMove, onMouseMoveOutside, onMouseWheel, onRightMouseDown, onRightMouseDownOutside, onRightMouseUp, onRightMouseUpOutside, postRender, preRender, removeChild, removeFromScreen, renderChildren, setAlwaysOnTop, setHeight, setMaxScrollX, setMaxScrollY, setScrollable, setScrollLock, setScrollSpeed, setScrollX, setScrollY, setVisible, setWidth, setX, setXA, setY, setYA
-
Constructor Details
-
LabelWidget
public LabelWidget(String text, String fontName, int x, int y, int width, int fontSize, NanoColor textColor) Constructs a newLabelWidgetwith the specified text, font, position, size, and color.
-
-
Method Details
-
getFontSize
public int getFontSize()Gets the font size of the text.- Returns:
- the font size
-
setFontSize
public void setFontSize(int fontSize) Sets the font size of the text.- Parameters:
fontSize- the new font size
-
getTextColor
Gets the color of the text.- Returns:
- the text color
-
setTextColor
Sets the color of the text.- Parameters:
textColor- the new text color
-
getText
Gets the text displayed by the widget.- Returns:
- the text
-
setText
Sets the text to be displayed by theWidget.- Parameters:
text- the new text
-
getFontName
Gets the name of the font used by theWidget.- Returns:
- the font name
-
setFontName
Sets the name of the font to be used by theWidget.- Parameters:
fontName- the new font name
-
update
public void update()Updates theWidget -
render
public void render()Renders theWidget
-