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()
Gets the height of the scrollable content.
|
int |
getContentWidth()
Gets the width of the scrollable content.
|
MalisisFont |
getFont()
Gets the
MalisisFont used for this UILabel. |
FontRenderOptions |
getFontRenderOptions()
Gets the
FontRenderOptions used for this UILabel. |
float |
getFontScale()
Gets the font scale for this
UILabel. |
int |
getHorizontalPadding()
Gets the horizontal padding.
|
int |
getLineHeight() |
float |
getOffsetX()
Gets the offset from 0 to 1 of the scrollable content.
|
float |
getOffsetY()
Gets the offset from 0 to 1 of the scrollable content.
|
java.lang.String |
getPropertyString()
Gets the property string.
|
float |
getScrollStep()
Gets the amount of scrolling from 0 to 1, done by one step of the scroll wheel.
|
int |
getStartLine() |
java.lang.String |
getText()
Gets the text of this
UILabel. |
int |
getVerticalPadding()
Gets the vertical padding.
|
int |
getVisibleLines() |
void |
onSizeChange(SpaceChangeEvent.SizeChangeEvent<UILabel> event) |
UILabel |
setFont(MalisisFont font)
Sets the
MalisisFont. |
UILabel |
setFontRenderOptions(FontRenderOptions fro)
|
void |
setOffsetX(float offsetX,
int delta)
Sets the offset from 0 to 1 of the scrollable content.
|
void |
setOffsetY(float offsetY,
int delta)
Sets the offset from 0 to 1 of the scrollable content.
|
UILabel |
setText(BBString str) |
UILabel |
setText(java.lang.String text)
Sets the text of this
UILabel. |
addControlComponent, attachData, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getData, getGui, getHeight, getIconProvider, 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, self, 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
MalisisFont to use for this UILabel.protected FontRenderOptions fro
FontRenderOptions to use for this UILabel.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 UILabel setFont(MalisisFont font)
IGuiTextMalisisFont.public FontRenderOptions getFontRenderOptions()
FontRenderOptions used for this UILabel.getFontRenderOptions in interface IGuiText<UILabel>public UILabel setFontRenderOptions(FontRenderOptions fro)
setFontRenderOptions in interface IGuiText<UILabel>fro - the froUILabelpublic float getFontScale()
UILabel.getFontScale in interface IBBCodeRenderer<UILabel>public int getContentWidth()
IScrollablegetContentWidth in interface IScrollablepublic int getContentHeight()
IScrollablegetContentHeight in interface IScrollablepublic float getOffsetX()
IScrollableUIScrollBar.Type.HORIZONTAL scrollbars.getOffsetX in interface IScrollablepublic void setOffsetX(float offsetX,
int delta)
IScrollableUIScrollBar.Type.HORIZONTAL scrollbars.UIScrollBar.Type.VERTICAL scrollbar if available.setOffsetX in interface IScrollableoffsetX - the offset xdelta - the deltapublic float getOffsetY()
IScrollableUIScrollBar.Type.VERTICAL scrollbars.getOffsetY in interface IScrollablepublic void setOffsetY(float offsetY,
int delta)
IScrollableUIScrollBar.Type.VERTICAL scrollbars.UIScrollBar.Type.HORIZONTAL scrollbar if available.setOffsetY in interface IScrollableoffsetY - the offset ydelta - the deltapublic float getScrollStep()
IScrollablegetScrollStep in interface IScrollablepublic int getVerticalPadding()
IScrollablegetVerticalPadding in interface IScrollablepublic int getHorizontalPadding()
IScrollablegetHorizontalPadding 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>