public class UILabel extends UIComponent<UILabel>
ITransformable.Alpha, ITransformable.Brightness, ITransformable.Color, ITransformable.Position<T>, ITransformable.Rotate, ITransformable.Scale, ITransformable.Size<T>, ITransformable.Translate| Modifier and Type | Field and Description |
|---|---|
protected boolean |
canInteract
Whether this
UILabel can be interacted with. |
protected int |
color
Color to use to draw the text of this
UILabel. |
protected boolean |
drawShadow
Determines if the text is drawn with drop shadow.
|
protected float |
fontScale
Scale of the font.
|
protected java.lang.String |
text
Text of this
UILabel. |
protected int |
textHeight
Height of the text.
|
protected int |
textWidth
Width of the text.
|
| Constructor and Description |
|---|
UILabel(MalisisGui gui)
Instantiates a new
UILabel. |
UILabel(MalisisGui gui,
java.lang.String text)
Instantiates a new
UILabel. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateSize()
Calculate the size of this
UILabel. |
void |
drawBackground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Draws the background.
|
void |
drawForeground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Draws the foreground.
|
UIComponent |
getComponentAt(int x,
int y)
Gets the component at.
|
float |
getFontScale()
Gets the font scale.
|
java.lang.String |
getPropertyString()
Gets the property string.
|
java.lang.String |
getText()
Gets the text.
|
UILabel |
setColor(int color)
Sets the color of the text of this
UILabel. |
UILabel |
setDrawShadow(boolean drawShadow)
Set the drop shadow for the text of this
UILabel. |
UILabel |
setFontScale(float scale)
Sets the scale of the font to use for this
UILabel. |
UILabel |
setText(java.lang.String text)
Sets the text of this
UILabel. |
addControlComponent, componentX, componentY, draw, fireEvent, fireKeyboardEvent, fireMouseEvent, getAlpha, getAnchor, getGui, getHeight, getName, getParent, getRawHeight, getRawWidth, getTooltip, getWidth, getX, getY, getZIndex, isDisabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, setAlpha, setAnchor, setDisabled, setFocused, setHovered, setName, setParent, setPosition, setPosition, setSize, setTooltip, setTooltip, setVisible, setZIndex, toString, unregisterprotected java.lang.String text
UILabel.protected int color
UILabel.protected boolean drawShadow
protected int textWidth
protected int textHeight
protected float fontScale
protected boolean canInteract
UILabel can be interacted with.public UILabel(MalisisGui gui, java.lang.String text)
UILabel.gui - the guitext - the textpublic UILabel(MalisisGui gui)
UILabel.gui - the guipublic UILabel setText(java.lang.String text)
UILabel. If no width was previously set, it will be recalculated for this text.text - the textUILabelpublic java.lang.String getText()
UILabelpublic UILabel setColor(int color)
UILabel.color - the colorpublic UIComponent getComponentAt(int x, int y)
getComponentAt in class UIComponent<UILabel>x - the xy - the ypublic UILabel setDrawShadow(boolean drawShadow)
UILabel.drawShadow - the draw shadowpublic UILabel setFontScale(float scale)
UILabel.scale - the scalepublic float getFontScale()
UILabelprotected void calculateSize()
UILabel.public void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
drawBackground in class UIComponent<UILabel>renderer - the renderermouseX - the mouse xmouseY - the mouse ypartialTick - the partial tickpublic void drawForeground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
drawForeground in class UIComponent<UILabel>renderer - the renderermouseX - the mouse xmouseY - the mouse ypartialTick - the partial tickpublic java.lang.String getPropertyString()
UIComponentgetPropertyString in class UIComponent<UILabel>