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
ConstructorDescriptionLabelWidget
(String text, String fontName, int x, int y, int width, int fontSize, NanoColor textColor) Constructs a newLabelWidget
with the specified text, font, position, size, and color. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Gets the name of the font used by theWidget
.int
Gets the font size of the text.final String
getText()
Gets the text displayed by the widget.final NanoColor
Gets the color of the text.void
render()
Renders theWidget
final void
setFontName
(String fontName) Sets the name of the font to be used by theWidget
.void
setFontSize
(int fontSize) Sets the font size of the text.final void
Sets the text to be displayed by theWidget
.final void
setTextColor
(NanoColor textColor) Sets the color of the text.void
update()
Updates theWidget
Methods 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 newLabelWidget
with 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
-