public class UILabel extends UIComponent<UILabel> implements IScrollable, IGuiText<UILabel>, IBBCodeRenderer<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 BBCodeRenderer |
bbRenderer
BBCode renderer
|
protected BBString |
bbText
BBCode for this
UILabel. |
protected MalisisFont |
font
The
MalisisFont to use for this UILabel. |
protected FontRenderOptions |
fro
The
FontRenderOptions to use for this UILabel. |
protected int |
lineOffset
Number of line offset out of this
UILabel when drawn. |
protected java.util.List<java.lang.String> |
lines
List of strings making the text of this
UILabel. |
protected int |
lineSpacing
Space used between each line.
|
protected boolean |
multiLine
Whether this
UITextField handles multiline text. |
protected UISlimScrollbar |
scrollBar
Scrollbar of the textfield
|
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,
BBString text)
Instantiates a new
UILabel. |
UILabel(MalisisGui gui,
boolean multiLine)
Instantiates a new
UILabel. |
UILabel(MalisisGui gui,
java.lang.String text)
Instantiates a new
UILabel. |
UILabel(MalisisGui gui,
java.lang.String text,
boolean multiLine)
Instantiates a new
UILabel. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildLines()
Builds the lines for this
UILabel. |
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.
|
BBString |
getBBText()
Gets the BB text of this
UILabel. |
UIComponent |
getComponentAt(int x,
int y)
Gets the component at.
|
int |
getContentHeight() |
int |
getContentWidth() |
MalisisFont |
getFont()
Gets the
MalisisFont used for this UILabel. |
FontRenderOptions |
getFontRendererOptions()
Gets the
FontRenderOptions used for this UILabel. |
float |
getFontScale()
Gets the font scale for this
UILabel. |
int |
getHorizontalPadding() |
int |
getLineHeight() |
float |
getOffsetX() |
float |
getOffsetY() |
java.lang.String |
getPropertyString()
Gets the property string.
|
float |
getScrollStep() |
int |
getStartLine() |
java.lang.String |
getText()
Gets the text of this
UILabel. |
int |
getVerticalPadding() |
int |
getVisibleLines() |
void |
onSizeChange(SpaceChangeEvent.SizeChangeEvent<UILabel> event) |
UILabel |
setFont(MalisisFont font,
FontRenderOptions fro)
|
void |
setOffsetX(float offsetX,
int delta) |
void |
setOffsetY(float offsetY,
int delta) |
UILabel |
setText(BBString str) |
UILabel |
setText(java.lang.String text)
Sets the text of this
UILabel. |
addControlComponent, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getGui, getHeight, getName, getParent, getRawHeight, getRawWidth, getRenderer, getTooltip, getWidth, getX, getY, getZIndex, isDisabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, onButtonPress, onButtonRelease, onClick, onDoubleClick, onDrag, onKeyTyped, onMouseMove, onRightClick, onScrollWheel, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, setAlpha, setAnchor, setDisabled, setFocused, setHovered, setName, setParent, setPosition, setPosition, setSize, setTooltip, setTooltip, setVisible, setZIndex, toString, unregisterclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHeight, getWidthprotected MalisisFont font
protected FontRenderOptions fro
FontRenderOptions to use for this UILabel. If null, uses GuiRenderer.getDefaultFontRendererOptions().protected java.lang.String text
UILabel.protected BBCodeRenderer bbRenderer
protected java.util.List<java.lang.String> lines
UILabel.protected boolean multiLine
UITextField handles multiline text.protected int lineOffset
protected int lineSpacing
protected UISlimScrollbar scrollBar
protected int textWidth
protected int textHeight
public UILabel(MalisisGui gui, java.lang.String text, boolean multiLine)
UILabel.gui - the guitext - the textmultiLine - the multi linepublic UILabel(MalisisGui gui, BBString text)
UILabel.gui - the guitext - the textpublic UILabel(MalisisGui gui, java.lang.String text)
UILabel.gui - the guitext - the textpublic UILabel(MalisisGui gui, boolean multiLine)
UILabel.gui - the guimultiLine - the multi linepublic UILabel(MalisisGui gui)
UILabel.gui - the guipublic java.lang.String getText()
UILabel.public UILabel setText(java.lang.String text)
UILabel.multiLine is false, the width is recalculated.multiLine is true, the lines will be recreated.text - the textUILabelpublic MalisisFont getFont()
MalisisFont used for this UILabel.public FontRenderOptions getFontRendererOptions()
FontRenderOptions used for this UILabel.getFontRendererOptions in interface IGuiText<UILabel>public UILabel setFont(MalisisFont font, FontRenderOptions fro)
public float getFontScale()
UILabel.getFontScale in interface IBBCodeRenderer<UILabel>public int getContentWidth()
getContentWidth in interface IScrollablepublic int getContentHeight()
getContentHeight in interface IScrollablepublic float getOffsetX()
getOffsetX in interface IScrollablepublic void setOffsetX(float offsetX,
int delta)
setOffsetX in interface IScrollablepublic float getOffsetY()
getOffsetY in interface IScrollablepublic void setOffsetY(float offsetY,
int delta)
setOffsetY in interface IScrollablepublic float getScrollStep()
getScrollStep in interface IScrollablepublic int getVerticalPadding()
getVerticalPadding in interface IScrollablepublic int getHorizontalPadding()
getHorizontalPadding in interface IScrollablepublic BBString getBBText()
UILabel.getBBText in interface IBBCodeRenderer<UILabel>public UILabel setText(BBString str)
setText in interface IBBCodeRenderer<UILabel>public int getStartLine()
getStartLine in interface IBBCodeRenderer<UILabel>public int getVisibleLines()
getVisibleLines in interface IBBCodeRenderer<UILabel>public int getLineHeight()
getLineHeight in interface IBBCodeRenderer<UILabel>public UIComponent getComponentAt(int x, int y)
getComponentAt in class UIComponent<UILabel>x - the xy - the yprotected void buildLines()
protected 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 void onSizeChange(SpaceChangeEvent.SizeChangeEvent<UILabel> event)
public java.lang.String getPropertyString()
UIComponentgetPropertyString in class UIComponent<UILabel>