Package noppes.npcs.api.gui
Interface IScroll
-
- All Superinterfaces:
ICustomGuiComponent
public interface IScroll extends ICustomGuiComponent
Represents a scrollable list component in a custom GUI. Provides methods to control size, selection, and the displayed list.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetDefaultSelection()Returns the default selection index.intgetHeight()Returns the height of the scroll component.java.lang.String[]getList()Returns the list of text entries displayed in the scroll.intgetWidth()Returns the width of the scroll component.booleanisMultiSelect()Checks whether multiple selections are allowed.IScrollsetDefaultSelection(int defaultSelection)Sets the default selection index.IScrollsetList(java.lang.String[] textList)Sets the list of text entries to display.IScrollsetMultiSelect(boolean selectMultiple)Sets whether multiple selections are allowed.IScrollsetSize(int width, int height)Sets the size of the scroll component.-
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
-
getWidth
int getWidth()
Returns the width of the scroll component.- Returns:
- the width in pixels.
-
getHeight
int getHeight()
Returns the height of the scroll component.- Returns:
- the height in pixels.
-
setSize
IScroll setSize(int width, int height)
Sets the size of the scroll component.- Parameters:
width- the new width.height- the new height.- Returns:
- this scroll instance.
-
getList
java.lang.String[] getList()
Returns the list of text entries displayed in the scroll.- Returns:
- an array of strings.
-
setList
IScroll setList(java.lang.String[] textList)
Sets the list of text entries to display.- Parameters:
textList- an array of strings.- Returns:
- this scroll instance.
-
getDefaultSelection
int getDefaultSelection()
Returns the default selection index.- Returns:
- the default selection.
-
setDefaultSelection
IScroll setDefaultSelection(int defaultSelection)
Sets the default selection index.- Parameters:
defaultSelection- the selection index.- Returns:
- this scroll instance.
-
isMultiSelect
boolean isMultiSelect()
Checks whether multiple selections are allowed.- Returns:
- true if multi-select is enabled.
-
setMultiSelect
IScroll setMultiSelect(boolean selectMultiple)
Sets whether multiple selections are allowed.- Parameters:
selectMultiple- true to allow multi-select.- Returns:
- this scroll instance.
-
-