Package noppes.npcs.api.gui
Interface ILabel
-
- All Superinterfaces:
ICustomGuiComponent
public interface ILabel extends ICustomGuiComponent
Represents a text label component in a custom GUI. Provides methods to get or set text, size, scale, and shadow properties.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getHeight()
Returns the label's height.float
getScale()
Returns the scale factor of the label.boolean
getShadow()
Returns whether the label text is rendered with a shadow.java.lang.String
getText()
Returns the text of the label.int
getWidth()
Returns the label's width.ILabel
setScale(float scale)
Sets the scale factor of the label.void
setShadow(boolean shadow)
Sets whether the label text should be rendered with a shadow.ILabel
setSize(int width, int height)
Sets the size of the label.ILabel
setText(java.lang.String text)
Sets the label text.-
Methods inherited from interface noppes.npcs.api.gui.ICustomGuiComponent
fromNBT, getAlpha, getColor, getHoverText, getID, getPosX, getPosY, getRotation, hasHoverText, setAlpha, setColor, setHoverText, setHoverText, setID, setPos, setRotation, toNBT
-
-
-
-
Method Detail
-
getText
java.lang.String getText()
Returns the text of the label.- Returns:
- the label text.
-
setText
ILabel setText(java.lang.String text)
Sets the label text.- Parameters:
text
- the new text.- Returns:
- this label instance.
-
getWidth
int getWidth()
Returns the label's width.- Returns:
- the width in pixels.
-
getHeight
int getHeight()
Returns the label's height.- Returns:
- the height in pixels.
-
setSize
ILabel setSize(int width, int height)
Sets the size of the label.- Parameters:
width
- the new width.height
- the new height.- Returns:
- this label instance.
-
getScale
float getScale()
Returns the scale factor of the label.- Returns:
- the scale.
-
setScale
ILabel setScale(float scale)
Sets the scale factor of the label.- Parameters:
scale
- the new scale.- Returns:
- this label instance.
-
getShadow
boolean getShadow()
Returns whether the label text is rendered with a shadow.- Returns:
- true if shadow is enabled; false otherwise.
-
setShadow
void setShadow(boolean shadow)
Sets whether the label text should be rendered with a shadow.- Parameters:
shadow
- true to enable shadow.
-
-